stratumauth / app

📱 Two-Factor Authentication (2FA) client for Android + Wear OS
https://stratumauth.com
GNU General Public License v3.0
3.14k stars 201 forks source link

How does Authenticator Pro handle timezones? #1121

Closed s22-tech closed 7 months ago

s22-tech commented 7 months ago

I downloaded Authenticator Pro the other day and it works fantastically! Thank you. Another alternative to Google's offerings.

Your FAQ says "A difference of more than a few seconds may cause invalid codes to be generated."

Since Authenticator is time based, how does it deal with the time being an hour or more different? Especially if we're overseas using a local SIM?

Thanks again.

kwilcz commented 7 months ago

It always uses UTC time:

https://github.com/jamie-mh/AuthenticatorPro/blob/b7d64024081c79f311bb3e91665a18a9f83cd193/AuthenticatorPro.Core/src/Entity/Authenticator.cs#L107-L129

Simply said, as long as your device has proper time set up, you don't have to worry about time zones.

s22-tech commented 7 months ago

That's good news! Thank you.

Oh, and thanks for the explanation and code snippet.