Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting the OTP is invalid #5

Open
thatkookooguy opened this issue Apr 11, 2018 · 0 comments
Open

getting the OTP is invalid #5

thatkookooguy opened this issue Apr 11, 2018 · 0 comments

Comments

@thatkookooguy
Copy link

I changed the code in the test.js a little bit to include client_id and secret_key. Here's the code:

#!/usr/bin/env node

const
stdin = process.stdin,
stdout = process.stdout,
client_id = '<client_id>',
secret_key = '<secret_key>';

var Yubikey = require('./lib/yubikey');

var yubikey = new Yubikey(client_id, secret_key);

function verify(otp) {
  yubikey.verify(otp, function(err) {
    if (err) {
      stdout.write(err + "\n");
    } else {
      stdout.write("Success!  Your token was verified.\n");
    }
    process.exit(0);
  });
}

function readOTP() {
  stdin.resume();
  stdout.write("YubiKey OTP: ");
  stdin.once('data', function(buf) {
    verify(buf.toString().trim());
  });
}

if (!module.parent) {
  readOTP();
}

I keep getting the error

Error: The OTP is invalid.

any idea what I'm doing wrong?

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant