speakeasyjs / speakeasy

**NOT MAINTAINED** Two-factor authentication for Node.js. One-time passcode generator (HOTP/TOTP) with support for Google Authenticator.
MIT License
2.7k stars 228 forks source link

Does not agree with google authenticator app ! #94

Open wardhanster opened 7 years ago

wardhanster commented 7 years ago

First of all thanks for the amazing work you guys have put in. I am using speakeasy on a production project and it appears that google authenticator does not work with this library if "the OTP is generated via google auth app in a different timezone." the library works just fine with Authy I have my servers in Atlanta US and I was trying to access it from switzerland and I found about this issue. I am using speakeasy version 2.0.0 A quick response is much appreciated :) and thanks in advance

markbao commented 6 years ago

Hi there, thanks for submitting this issue and for your patience. Usually, these issues are caused by your system time, either on your server or your client, not being in sync. Could you check that both of your systems are correct, to the second, to the official time? One site you can use is https://time.is/.

There should be no issues across timezones – the time is automatically corrected to UTC.

TomasHubelbauer commented 6 years ago

I have the same issue in #102 and my system time matches time.is to a second.

adrai commented 6 years ago

If you have to support Android devices, make sure you're using algorithm: sha1

TomasHubelbauer commented 6 years ago

I should mention my issue in #102 got resolved, maybe you were experiencing the same thing, @wardhanster?

rajatrawataku1 commented 6 years ago

@adrai I am new to 2FA. Can you tell me how to we use sha1 in this?

adrai commented 6 years ago

The default is always sha1 (https://github.com/speakeasyjs/speakeasy#totp). As long as you do not set the algorithm to sha256 or sha512 in combination with Android devices, everything is fine.

walnut937 commented 5 months ago

my speakeasy code and Google authenticator code are different and anyone tell me why, Please explain to me as easily as possible