Closed jimiero closed 4 years ago
The principle of TOTP/Google Authenticator is that both devices generate a code based on time + secret. If one of those two components isn't in sync, they'll generate a different code. So:
The time window for each code is 30 seconds, so if the time difference between server/device is too large codes will be out-of-sync and it will be hard or impossible to hit the right code. You could also increase the window
setting, so accept more codes around the current valid one:
# config/packages/scheb_two_factor.yaml
scheb_two_factor:
google:
window: 1 # How many codes before/after the current one would be accepted as valid
Thanks @scheb that was the issue, server had a wrong un-synced time date, solved that and now worked.
Best regards!
Bundle version: latest version Symfony version: 4.4
Description
I managed to make it work just fine in localhost, but when I try to use on PROD it always fails when I use:
$this->googleAuthenticator->checkCode($user, $code)
Additional Context Any idea what may be the cause of the issue?