GoogleAuth是一个Java服务端开发包,实现了 Time-basedOne-timePassword (TOTP)算法 RFC6238.
该项目参考 GoogleAuthenticator,后者是一个C的开源项目。
Maven:
<dependency><groupId>com.warrenstrange</groupId><artifactId>googleauth</artifactId><version>1.1.2</version></dependency>示例代码:
GoogleAuthenticatorgAuth=newGoogleAuthenticator();finalGoogleAuthenticatorKeykey=gAuth.createCredentials();
评论