-
Notifications
You must be signed in to change notification settings - Fork 229
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
speakeasy.time(); not showing matching Google Auth/Console output OTP #25
Comments
Solved my own issue, my computer datetime was not automatically sync'd at the OS level and therefore was out of time vs google's clock and couldn't provide the matching time for recreating OTP. |
Thanks for the update! |
Not a problem, now it seems I'm having an issue with my clocks not staying in perfect sync after the first QR code is generated (within the first 60 seconds). I was given a suggestion by a colleague who mentioned I should add a slight variance to the code by setting the current unix time -30 seconds and running a loop over it (ie. speakeasy.totp({key: 'secret', time: 159183717});) when verifying TOTP Would you advice against this or does this seem like an appropriate solution? |
Hmm, that seems to work but it doesn't seem like a clean solution. So it seems like you get a code at |
Again I solved my own issue, the problem this time was that each time I was verifying the code via speakeasy.time({key: '3jk2h5kj2h63kj2h6kjh23jh6hlkj2h6ljk2h3h', encoding: 'base32'}); it was OUTSIDE my route middleware therefore only loading the variable on initial startup but not each subsequent request... Now that i've moved inside my middleware it's functioning as expected. Thanks for your patients! |
Great to hear, thanks! |
I attempted to use the example in the github readme to verify that the OTP generated from my phone/device matched the speakeasy.time();... Google shows one OTP, and the output to my console shows a different OTP.
Below is the code I used:
Example OTP QR: https://www.google.com/chart?chs=166x166&chld=L|0&cht=qr&chl=otpauth://totp/SecretKey%3Fsecret=KY7TSZRWFZBXCMJGHRED6PDOPBSS4WCK
Result:
Any suggestions?
The text was updated successfully, but these errors were encountered: