-
-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid token. Please make sure you have entered it correctly #261
Comments
Without additional information, there's nothing much to look at here. I think the clock skew (drift) is stored somewhere on the OTP device, and I'm guessing here, maybe the clock of your phone and the server have drifted too much? |
hi there. |
you figure out how to resolve this ? |
since my message I had this problem only few times on development server and wasn't able to narrow it down before it disappears, sorry. |
I having this problem in production with large scale users problens... My timezone is in Seoul, maybe is this ?? |
I'm not able to reproduce this anymore. |
With bitten by this too, a warning could be added in the docs that inadvertent redirections might interfere with the process. |
That might be worth doing as it's not the only issue reported that was caused by this sort of misconfiguration: #291 |
I also stumbled on it. It could be caused by django_otp. The TOTPDevice Model has a ThrottlingMixin. After entering a wrong code the ThrottlingMixin could throw the error: VerifyNotAllowed.N_FAILED_ATTEMPTS. django_otp ignores the error message and only returns False as the error status. django-two-factor-auth handles the False by showing the Invalid token message. |
@ronnievdc that's by design and this bug pre-dates that feature by about a year. |
Are there any other URLs that might be loaded that could be causing this issue for you? |
The TOTP generated from the forms.py code (totp(key, self.step, t0, self.digits, self.drift + offset)) is diffrent from code google authenticator is showing me. Any suggestions? |
Some more information would be helpful! |
Hi. Below is my detail on what I have done so far. steps followed.
When I debug I can see that the token generated from the two_factor\forms.py is different from what I see in the google authenticator. |
Are the clocks on your device and your server correct? TOTP is very sensitive to clock drift and it's been my personal experience that this sort of issue is usually a case of "oh, NTP crashed on my server" 😸 |
You can increase the tolerance value, the token will be usable for some more time. It helped me with the same issue. |
Thank you for the reply I am trying only in the localhost now so the clock in my PC and my mobile have the same time. I have even tried to set the TIME_ZONE = 'Asia/Kolkata' which is my local time.
|
After a while token are not accepted anymore even so that I am using the right code generated on Google Auth App. Whenever I enter the code I keep getting the same message : Invalid token. Please make sure you have entered it correctly
The only way to solve it, is to remove the token in the DB and re do the setup.
Your Environment
The text was updated successfully, but these errors were encountered: