This paper is devoted to the study of a boundary data identification for an electromagnetic problem by means of the potential field method (the A-φ method). One part of the boundary is over-determined. The other part of the boundary is unreachable and has to be determined as a part of the problem. We design a constructive algorithm by the A-φ formulation to solve this problem. The numerical scheme is based on the steepest descent method (SDM) for the minimization of a regularized cost functional, having its derivative determined via an adjoint method. We analyse the properties of the cost functional and prove the convergence of the minimization process. The method is supported by several numerical experiments.