首页 > 解决方案 > 是否有 Google 身份验证器 API

问题描述

我正在尝试使用谷歌身份验证器创建一个使用双因素身份验证器的网络应用程序,所以我的问题是,是否有用于谷歌身份验证器的 api?

标签: google-authenticator

解决方案


有很多关于如何为 Google Authenticator 创建自己的客户端的示例,但是,您也可以使用 API,这可能更容易。

首先,您创建一个要配对的二维码,结合您的应用描述和一个密码,如下所示;

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

然后,一旦用户配对,您就可以使用 validate API 调用来验证他们的 PIN;

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

此 API 的源代码可在 GitHub 上作为开源获取; https://github.com/infiniteloopltd/AuthenticatorAPI.com


推荐阅读