8

我想使用 Google Authenticator 添加两个因素身份验证,并且想知道 google 是否提供了 java api。我试图搜索它,但没有找到。如果有的话,谁能指出我的java api。如果不是,我该如何在基于 Web 的 Java 应用程序中使用 Google Authenticator。我正在为我现有的应用程序使用 Spring 框架

4

3 回答 3

7

事实上,Google Authenticator 与 Google 服务无关。您需要寻找的是 TOTP。再次使用 TOTP 和 rfc6238 作为关键字进行研究,您会发现很多资源

于 2015-06-04T08:26:02.750 回答
5

谷歌验证器的 Java 库已经实现,可以在这里找到, https://github.com/wstrange/GoogleAuth

于 2017-05-23T18:44:37.067 回答
2

Sorry if this is too much of a necro-post, but I found this library on GitHub - maybe it can help you (and others looking for the same). :)

Note: this is not an official Google library, but it follows the RFC 6238 spec for Time-based One-time Password (TOTP), and the author looked at the C code for Google Authenticator for reference.

于 2016-07-01T09:44:06.657 回答