google2fa
google2fa copied to clipboard
Code timing incorrect
I have generated the secret, and in my authenticator both entered the key and used the qr code, both return the same codes.
However, when running the Google2FA::verifyGoogle2FA($result, $code, $timeWindow);
method, it always returns false until the code changes between 2-4 times. So why is the code in the verify so delayed to what the authenticator is giving me? This also means after the code keeps changing, older codes still work. My window has been changed varying between 0 and 4, still having the same issue
Hey,
Have you checked the time on the machine hosting your code?
Can you try again on a different machine?
Can you also manually pass a timestamp to the methods of a fixed time where you know what the correct outcomes are so it doesn't rely on your the hosts time?
Hey,
Have you checked the time on the machine hosting your code?
Can you try again on a different machine?
Can you also manually pass a timestamp to the methods of a fixed time where you know what the correct outcomes are so it doesn't rely on your the hosts time?
@Fludem Ah I forgot to update the ticket. Yeah, so I found out my machine was 2 minutes out of sync with the current time (Not sure how that ended up happening as it should have been set to automatic) But I correct that and its back working