The article describes methods of user identification using authentication based on the second factor. Known algorithms and protocols for two-factor authentication are considered. An algorithm is proposed using mobile devices as identifiers and generating a temporary password based on the hash function of encryption standards. For an automated control system, a two-factor authentication model and a sequential algorithm for generating a temporary password using functions have been developed. The implementation of the system is based on the Node.js software platform using the JavaScript programming language, as well as frameworks and connected system libraries. MongoDB, an open source database management system for information storage and processing was used