This article deals with the identification of unknown time- and space-dependent boundary conditions for systems driven by the heat equation. We first consider a one-dimensiona l and single-input problem, dealing with the identification of the time-dependent heat flux on one side of a one-dimensional linear thermal wall, from temperature and heat flux measurements on the other side. We then focus on a quenching process; our interest is to identify the time- and space-dependent heat flux on the boundary of a metal piece from temperature measurements performed inside the material (two-dimensional geometry). Those inverse problems are solved by use of a regularization method, and the solution is obtained by minimization of a quadratic criterion. Because of the linearity of the input-output relationship, the solution of this minimization is derived from the linear quadratic optimal control theory (resolution of a nonstationary Riccati equation). The robustness of the method for very small signal-to-noise ratio is shown. In the two-dimensional multi-input problem, the identification sensitivity to the localization of the measurement points is analyzed. In both cases, we consider input that are discontinuous in time, in order to show the method accuracy in the high-frequency domain.