Code Monkey home page Code Monkey logo

aerogear-otp-java's Introduction

aerogear-otp-java

circle-ci License Maven Central Javadocs

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)

Usage

Android Studio

Add to your application's build.gradle file

dependencies {
  compile 'org.jboss.aerogear:aerogear-otp-java:1.0.0'
}

Maven

Include the following dependencies in your project's pom.xml

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

Demo apps

Take a look in our demo apps

If you wanna test thoses app without need to run you own server you can use the browser-authenticator page

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.

aerogear-otp-java's People

Contributors

camilamacedo86 avatar danbev avatar danielpassos avatar lfryc avatar qmx avatar vibe13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aerogear-otp-java's Issues

Basic code example doesn't work

Hello,
I am kind of surprised that even your main example on your git readme doesn't work. Even though you haven't work in years for this library, I guess it worked at some moment, but someone probably crashed it some time ago and pushed it. It would be nice, if you change it to "deprecated and not working" instead of keeping it up without any comments...

Thanks

Delay window should be configurable

The delay window is set to 1 and it cannot be changed.

I want to change the delay window.

Make it configurable:
totp.setDelayWindow(int delayWindow);

Leading zeros

Hey,

I found out that under specific circumstances the generated token is missing the leading zeros.

You can easily test it with:

  • secret "R5MB5FAQNX5UIPWL"
  • interval "45187109"
  • generated token "2941" but should be "002941"

Totp totp = new Totp("R5MB5FAQNX5UIPWL", new Clock(){
@OverRide
public long getCurrentInterval() {
return 45187109;
}
});

java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1

Hi, I have one question. When I started using your library I tested it on android 5.1.1 and all were ok, but when I start app on the android 4.2 app fall down with this exception.

On this line topt.now()).

Can you please help me?

There are my exception list:
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: FATAL EXCEPTION: main
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: Process: com.grand.capital.app, PID: 13002
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at org.jboss.aerogear.security.otp.Totp.bytesToInt(Totp.java:134)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at org.jboss.aerogear.security.otp.Totp.hash(Totp.java:129)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at org.jboss.aerogear.security.otp.Totp.now(Totp.java:79)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at com.grand.capital.app.ui.OneTimeCodeFragment.onCreateView(OneTimeCodeFragment.java:37)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.support.v4.app.Fragment.performCreateView(Fragment.java:1965)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1078)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:733)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:4998)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
11-21 12:47:32.955 13002-13002/com.grand.capital.app E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.