A Node.js client library for verifying OTPs with the Yubikey api servers.
npm install yubikeyify
Or fork this repo and help improve it.
var Yubikey = require('yubikeyify');
var yubikey = new Yubkey(client_id, secret_key, callbackparameter);
// client_id and secret_key can also be discovered from env
function onVerify(err, auth, callbackparameter) {
// if err is null, you're good
// auth is true if everything is fine
// callbackparameter is something you can use for what you see fit
}
yubikey.verify('vvvvvvcurikvhjcvnlnbecbkubjvuittbifhndhn', onVerify);
Plug your YubiKey in, and run ./test.js
. Try entering the same token twice.