Skip to content

sauravmndl-zz/aerogear-otp-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aerogear-otp-java - Java One Time Password API

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)

how to create a new project

basic use case

  1. add the maven dependency

     <dependency>
         <groupId>org.jboss.aerogear</groupId>
         <artifactId>aerogear-otp-java</artifactId>
         <version>1.0.0</version>
         <scope>compile</scope>
     </dependency>
    

Getting started

Use

  1. 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
    

Working example

  1. Go to http://controller-aerogear.rhcloud.com/aerogear-controller-demo/login
  2. Login with username: john and password: 123. Click on Give it a try.
  3. Now open google authenticator application at your phone
  4. Go to Add account
  5. Then ask to Scan barcode
  6. After that john account might be added
  7. On your web browser go to Try Google authenticator
  8. Enter username: john and password: 123 and use the current OTP on your mobile

For more details, please refer to our documentation

Are you feeling brave? Try from the snapshot releases!

 <dependency>
     <groupId>org.jboss.aerogear</groupId>
     <artifactId>aerogear-security</artifactId>
     <version>1.0.1-SNAPSHOT</version>
     <scope>compile</scope>
 </dependency>

Documentation

For more details about the current release, please consult our documentation.

Development

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

Questions?

Join our user mailing list for any questions or help! We really hope you enjoy app development with AeroGear!

Found a bug?

If you found a bug please create a ticket for us on Jira with some steps to reproduce it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%