Is there a Google authenticator API

Jama Mohamed picture Jama Mohamed · Nov 21, 2018 · Viewed 18.3k times · Source

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?

Answer

Fiach Reid picture Fiach Reid · Nov 13, 2019

There are plenty of examples of how to create your own client for Google Authenticator, however, you can also use an API, which may be easier.

Firstly, you create a QR code to pair with, combined with your app description, and a secret code as follows;

https://www.authenticatorApi.com/pair.aspx?AppName=MyApp&AppInfo=John&SecretCode=12345678BXYT

Then, once the user has paired, you can validate their PIN using the validate API call;

https://www.authenticatorApi.com/Validate.aspx?Pin=123456&SecretCode=12345678BXYT

The source code for this API is available as open source on GitHub here; https://github.com/infiniteloopltd/AuthenticatorAPI.com