A Java library for generating one time passwords according to RFC 4226..
This API is compatible with Google Authenticator apps available for Android and iPhone. You can follow the instructions here to install Google Authenticator.
Project Info | |
---|---|
License: | Apache License, Version 2.0 |
Build: | Maven |
Documentation: | https://aerogear.org/docs/ |
Issue tracker: | https://issues.jboss.org/browse/AGSEC |
Mailing lists: | aerogear-users (subscribe) |
aerogear-dev (subscribe) |
-
add the maven dependency
<dependency> <groupId>org.jboss.aerogear</groupId> <artifactId>aerogear-otp-java</artifactId> <version>1.0.0</version> <scope>compile</scope> </dependency>
-
Time based OTP's
String secret = Base32.random(); Totp totp = new Totp(secret); totp.now(); //427773 totp.verify("427773"); //true Thread.sleep(40); totp.verify("427773"); //false
- Go to http://controller-aerogear.rhcloud.com/aerogear-controller-demo/login
- Login with username: john and password: 123. Click on Give it a try.
- Now open google authenticator application at your phone
- Go to Add account
- Then ask to Scan barcode
- After that john account might be added
- On your web browser go to Try Google authenticator
- Enter username: john and password: 123 and use the current OTP on your mobile
For more details, please refer to our documentation
<dependency>
<groupId>org.jboss.aerogear</groupId>
<artifactId>aerogear-security</artifactId>
<version>1.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
For more details about the current release, please consult our documentation.
If you would like to help develop AeroGear you can join our developer's mailing list, join #aerogear on Freenode, or shout at us on Twitter @aerogears.
Also takes some time and skim the contributor guide
Join our user mailing list for any questions or help! We really hope you enjoy app development with AeroGear!
If you found a bug please create a ticket for us on Jira with some steps to reproduce it.