Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including aerogear-cordova-otp with all npm packages installed. Try it out:

aerogear-cordova-otp lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("aerogear-cordova-otp/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

aerogear-cordova-otp v0.0.3

Generates a one time password

AeroGear OTP Cordova

Cordova plugin for OTP depends on BarcodeScanner to be able to easly obtain the secret

Project Info
License:Apache License, Version 2.0
Build:Cordova Plugin
Documentation:https://aerogear.org/docs/specs/aerogear-cordova/
Issue tracker:https://issues.jboss.org/browse/AGCORDOVA
Mailing lists:aerogear-users (subscribe)
aerogear-dev (subscribe)

To install

cordova create <project-name>
cd <project-name>
cordova platform add android
cordova plugin add <location-of-this-plugin>
cordova build

Example

Copy example/* into the www folder of your project and press the OTP button. Initially it will fire up the BarcodeScanner to scan a QR code with an url like otpauth://totp/username?secret=7SPQJZ7CDF7NTKJ2 this secret will be stored and then later used to generate One Time Passwords have a look at the guide

Try it on this demo page username is john and password 123

Plugin API

var totp = new AeroGear.Totp();
totp.generate(function(result) { /* result is the otp */ );

or seperate methods

 String secret = "B2374TNIQ3HKC446";
 // initialize OTP
 var generator = new AeroGear.Totp(secret);
 // generate token
 generator.generateOTP(function(result) { /* result is the otp */ });

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.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free