  The Janis-Newman algorithm is an old but very powerful tool to generate
rotating solutions from static ones through a set of complex coordinate
transformations. Several solutions have been derived in this way, including
solutions with gauge fields. However, the transformation of the latter was so
far always postulated as an ad hoc result. In this paper we propose a
generalization of the procedure, extending it to the transformation of the
gauge field. We also present a simplification of the algorithm due to G.
Giampieri. We illustrate our prescription on the Kerr-Newman solution.
