In this paper, a new approach to identity authentication is proposed, which takes advantage of the two-beam interference setup and the nonlinear correlation technique. According to the traditional two-beam interference encryption/decryption structure, we design a modified iterative phase retrieval algorithm (MIPRA), which takes the random binary amplitudes as the constraints at the input plane to encode different images (standard reference images) into a set of sparse phase distributions. In the MIPRA, a given random phase distribution serves as a system lock, and it is placed at one of the arms of the two-beam interference setup and keeps unchanged in the whole iterative phase retrieval algorithm but equivalently provides a fixed shifting vector toward the output complex amplitude field. While the peak-to-correlation value (between the output intensity and the original image) reaches a presetting threshold value, or the iterative numer of time reaches a presetting maximum value, the MIPRA stops. Here, the phase lock is assumed to be the same for all the users and thus it is placed and fixed in the system, while the calculated phase distributions vary from the MIPRA to different binary constraints, which are related to different users. Meanwhile, we also study an extension version of the proposed method. By using a superposition multiplexing technique and a nonlinear correlation technique, we can realize a function of hierarchical authentication for various kinds of users through a similar but more smart decision strategy. For example, we adopt the MIPRA four times with different constraints (random binary amplitude distribution) to obtain four phase distributions, the sum of them will be regarded as a final phase key and is designed to the user with the highest privilege. He is then able to pass all the authentication process for each standard reference image with his multiplexed phase key, that is to say, there are obvious peaks in all the nonlinear correlation maps between all the output images and the corresponding standard reference images. In a similar way, the user with the lowest privilege can only pass one authentication process. Compared with the previous identity authentication methods in the optical security area, the phase key for each user, no matter what level he belongs to, is easy to be stored and transmitted because its distinguishing feature of sparsity. It is worthwhile to note that the cross-talk between different output images are very low and will has no effect on the authentication decision since we deliberately assemble all the binary distributions, which act as constraints at the input plane in the MIPRA. Moreover, the output results are all noise-like distributions, which makes it nearly impossible for any potential intruders to find any clues of the original standard reference images. However, on the other hand, with the nonlinear correlation technique, we can easily extract enough information from these noise-like output results to authorize any users, usually we can obtain an obvious peak at the center of the correlation results but there is no peak if we adopt the traditional correlation algorithms. This feature helps reduce the risk of information leakage, thereby providing an additional protection layer. Also, weinvestigate the robustness properties by taking the sparsity ratio, Gaussian noise, and shear/occluded attack into consideration. Some previous tests alsoindicated that our scheme can resist the attack employing incorrect random phase keys. Theoretical analysis and a series simulation results are provided to verify the feasibility and effectiveness of the proposed scheme.