Reputation: 25
I want to create my app with 2FA and I see the google have authenticator that allow other app or website to get authenticate code so I want to know how can I authenticate user in my website with Google Authenticator App?
Upvotes: 0
Views: 2748
Reputation: 21
firstly you need to know that Google Authenticator works with the 2 standard OTP mechanisms, TOTP (Time-based) and HOTP (Counter based).
TOTP or HOTP? In order to implement 2FA for your app, you should first decide if you want to go with TOTP or HOTP. The common choice is usually TOTP, used by Google, Dropbox, Facebook and other popular services.
Find a suitable OTP library for your app. There are many open-source libraries available for almost every popular programming language, e.g python, java, .NET, PHP. For Python https://github.com/pyotp/pyotp For PHP https://github.com/lelag/otphp
OTP Apps: Other than Google Authenticator, there are also many other Authenticator apps you or your users could use: Authy, CyAuth, FreeOTP.
Upvotes: 2