In this paper we propose a new way of obtaining four dimensional gauge invariant U (n) gauge field from a bulk action. The results are valid for both Randall-Sundrum scenarios and are obtained without the introduction of other fields or new degrees of freedom. The model is based only in nonminimal couplings with the gravity field. We show that two non-minimal couplings are necessary, one with the field strength and the other with a mass term. Despite the loosing of five dimensional gauge invariance by the mass term a massless gauge field is obtained over the brane. To obtain this, we need of a fine tuning of the two parameters introduced through the couplings. The fine tuning is obtained by imposing the boundary conditions and to guarantee non-abelian gauge invariance in four dimensions. With this we are left with no free parameters and the model is completely determined. The model also provides analytical solutions to the linearized equations for the zero mode and for a general warp factor.PACS numbers: 64.60.ah, 64.60.al, 89.75.Da The Randall Sundrum (RS) model appeared in the Physics of higher dimensions as an alternative to compactification that included the possibility of solving the Hierarchy problem [1,2]. To solve the physical problem of dimensional reduction, the RS models should obtain fields with zero mode confined to the brane in order to recoverer the Physical models when the fields are properly integrated over the extra dimension. In the noncompact case, the gravity field localization is attained, however gauge fields as simple as U (1) minimally coupled to gravity are not localized and this was a problem to the theory [2,3]. For the compact case the problem appears when we consider non-abelian gauge fields. After the Fourier decomposition of the zero mode and the normalization dzψ 2 = 1 we have that dzψ 3 m=0 = 1, and the gauge invariance in four dimensions is lost [4]. A number of extensions to RS were proposed in order to provide localized gauge fields for the non-compact case. A smooth warp factor was investigated? [4][5][6][7][8][9][10][11], but also it did not yield localized gauge fields. Some models obtained the localization by the addition of new degrees of freedom such as a scalar or dilaton fields, but a more natural approach would be to obtain an extension of minimal couplings that would localize the gauge field without introducing other fields. A step in this direction was the introduction of a boundary interaction with the field strength [12], but it is known that this produces only a quasi-localized zero mode.Other idea is the breaking of the U (1) gauge invariance in five dimensions by the addition of a mass term. It was found that the only consistent way of getting a localized zero mode is again the introduction of a boundary term, this time with the mass term [13]. Soon it was shown that the boundary mass term was not enough to provide a consistent model in the case of Yang-Mills (YM) fields because non-abelian gauge invariance is lost in the membrane [4]. The work [4] shows th...