jamie-mh / AuthenticatorPro

📱 Two-Factor Authentication (2FA) client for Android + Wear OS
https://authenticatorpro.jmh.me
GNU General Public License v3.0
2.71k stars 194 forks source link

How does Authenticator Pro handle timezones? #1121

Closed s22-tech closed 2 months ago

s22-tech commented 2 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 2 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 2 months ago

That's good news! Thank you.

Oh, and thanks for the explanation and code snippet.