用于谷歌身份验证器的 Java API
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30202867/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java API for google Authenticator
提问by user2437940
I wanna add two factor authentication using Google Authenticator and was wondering if google provides with java api's. I tried searching for it but din't find any. Can anyone point me to the java api if there are any. If not how can i go about using Google Authenticator in my web based java application. I am using Spring framework for my existing application
我想使用 Google Authenticator 添加两因素身份验证,并且想知道 google 是否提供了 java api。我试图寻找它,但没有找到。如果有的话,任何人都可以指出我的java api。如果不是,我该如何在基于 Web 的 Java 应用程序中使用 Google 身份验证器。我正在为我现有的应用程序使用 Spring 框架
回答by Emin
回答by ToVine
Sorry if this is too much of a necro-post, but I found this libraryon GitHub - maybe it can help you (and others looking for the same). :)
对不起,如果这是一个死灵帖,但我在 GitHub 上找到了这个库- 也许它可以帮助你(以及其他寻找相同的人)。:)
Note:this is not an official Google library, but it follows the RFC 6238spec for Time-based One-time Password (TOTP), and the author looked at the C code for Google Authenticatorfor reference.
注意:这不是谷歌官方库,但它遵循基于时间的一次性密码 (TOTP)的RFC 6238规范,作者查看了谷歌身份验证器的 C 代码以供参考。
回答by Marufur Rahman
Java library for google authenticator was implemented and can be found here, https://github.com/wstrange/GoogleAuth
谷歌身份验证器的 Java 库已经实现,可以在这里找到, https://github.com/wstrange/GoogleAuth