I am trying to create a web app that is using a two-factor authenticator using the google authenticator, so my question is, is there an api for google authenticator?
Yes, a quick go-through:
Your users download Google Authenticator app https://apps.apple.com/us/app/google-authenticator/id388497605 or https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en&gl=US
You generate a "secret" code on behalf of your user:
https://google-authenticator.p.rapidapi.com/new/
Server will return you the secret code (e.g. "GXPTBCTI4DX4UFJB"), keep the code, because you'll need it at steps 3 and 4.
You generate QR codes for your users via:
https://google-authenticator.p.rapidapi.com/enroll/?secret=GXPTBCTI4DX4UFJB&account=JohnDoe&issuer=AcmeCorp
Users scan the QR code using Google Authenticator app and temporary codes now get generated.
Now you can validate the codes via:
https://google-authenticator.p.rapidapi.com/validate/?code=266677&secret=GXPTBCTI4DX4UFJB
See full tutorial here https://rapidapi.com/chdan/api/google-authenticator/tutorials/easy-two-factor-authentication-(2fa)-with-google-authenticator.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With