mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #770] Invalid TOTP code when trying to log in #530
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#530
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @timaschew on GitHub (Dec 18, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/770
Subject of the issue
Invalid TOTP code when logging in via web vault. I'm pretty sure it worked when I've set it up.
I'm running bitwardn inside of dokku (docker). I've restarted the app and run
sudo timedatectl set-ntp trueto sync the time but it didn't help. On my phone I'm using andOTP and I've tested to login to GitHub with the same app and it works. So it seems that the server is the problem.Your environment
Steps to reproduce
Just deployed everything as it is via the Dockerfile. Deployment is handled by dokku
Expected behaviour
Login to web vault and typing in password and afterwards 2FA code without any error.
Actual behaviour
Logging in to to my web vault and typing in my password. After typing in the 2FA code it shows a red notification with the text: An error has occurred. Invalid TOTP code
Here is the server log:
Relevant logs
Here is the dockerfile which is used for deployment:
@BlackDex commented on GitHub (Dec 19, 2019):
Could you verify the date/time on the docker host?
Most of the time this is an issue with timedrifting of the server.
By default there is a timedrift allowed of 30 seconds before and after. But if the server exceeds that, you will get invalid TOTP code messages.
@timaschew commented on GitHub (Dec 20, 2019):
Yes I've checked the time and it is good.
date -uis equal in host, container and my local machine, justdateshows a UTC zone in the container and CET in the host but I don't think this should be a problem.@timaschew commented on GitHub (Dec 20, 2019):
I've deleted the row from the twofactory database and logged in and added again 2FA and now it works again.
BTW: changing the
enabledin the twofactory table do0didn't work.@BlackDex commented on GitHub (Jan 3, 2020):
Well, if you deleted the row, and enabled the 2FA again, it looks like the 2FA key was invalid.
It could mean two things, it was wrongly generated/displayed, or wrongly saved.
But that would also be strange since it will only activate after a verification code.
In any case, in the code the current time used is also printed during the TOTP error just for an extra check.
@dani-garcia commented on GitHub (May 13, 2020):
Closed due to inactivity.
@ghost commented on GitHub (Oct 19, 2022):
Open it because it's a genuine issue :)
@BlackDex commented on GitHub (Oct 19, 2022):
@Jackdrl are you sure? Have you checked the date and time etc..
Also, i would suggest to open a discussion with an output of the support string you can generate from the diagnostics page.