I would like to introduce Node One Time Password (notp). This library
brings you the power of counter based one time passwords (HOTP) and
time based one time passwords (TOTP) to NodeJS. It is fully compliant
with RFC 4226 (http://tools.ietf.org/html/rfc4226) and RFC 6238
(http://tools.ietf.org/html/rfc6238), giving you very secure 2 step
authentication for your NodeJS apps.
It is designed to work with Google Authenticator
(http://code.google.com/p/google-authenticator/) that has apps for
iOS, Android and Blackberry.
The library has ZERO dependencies and is very simple to use.
Check out https://github.com/guyht/notp
Installation via
npm install notp
Example usage for TOTP
var notp = require('notp'),
args = {
K : '12345678901234567890'
},
b32 = notp.encBase32(args.K);
console.log('Getting current counter value for K = 12345678901234567890');
console.log('This has a base32 value of ' + b32);
console.log('The base32 value should be entered in the Google
Authenticator App');
console.log('');
notp.getTOTP(args,
function(err) { console.log(err); },
function(code) {
console.log('The current TOTP value is ' + code);
}
);
Now open to questions....
--
Guy Halford-Thompson
Blog - http://www.cach.me/blog
Twitter - https://twitter.com/mrwooster
Google Plus - http://gplus.name/guy
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en