Can't login after enabling 2FA code #166

Closed
opened 2025-11-07 06:26:31 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @Deanosim on GitHub (Dec 20, 2018).

I enabled 2FA with google authenticator for my account and now I can't login to my account on android or via the web interface, it just spits me back to the main login screen asking for my password after I have entered the 2FA code. I'm using the docker image btw.

Originally created by @Deanosim on GitHub (Dec 20, 2018). I enabled 2FA with google authenticator for my account and now I can't login to my account on android or via the web interface, it just spits me back to the main login screen asking for my password after I have entered the 2FA code. I'm using the docker image btw.
Author
Owner

@Biepa commented on GitHub (Dec 20, 2018):

I had the same problem, when i tested my backup and restore procedure.
Are you sure, the Authenticator is configured the right way? Try to login with the backup code and disable and then enable 2FA again. That worked for me.

@Biepa commented on GitHub (Dec 20, 2018): I had the same problem, when i tested my backup and restore procedure. Are you sure, the Authenticator is configured the right way? Try to login with the backup code and disable and then enable 2FA again. That worked for me.
Author
Owner

@Deanosim commented on GitHub (Dec 20, 2018):

Oh yeah you're right, it would seem the first time you setup 2FA it doesn't work, but after you recover and disable 2FA and then enable it again all of a sudden it starts working.

@Deanosim commented on GitHub (Dec 20, 2018): Oh yeah you're right, it would seem the first time you setup 2FA it doesn't work, but after you recover and disable 2FA and then enable it again all of a sudden it starts working.
Author
Owner

@Biepa commented on GitHub (Dec 20, 2018):

Glad that its working now.
In my case it wasn't the failure of bitwarden, i messed it up myself 🤦‍♂️ 😆

@Biepa commented on GitHub (Dec 20, 2018): Glad that its working now. In my case it wasn't the failure of bitwarden, i messed it up myself :man_facepalming: :laughing:
Author
Owner

@dani-garcia commented on GitHub (Dec 20, 2018):

@Deanosim I can't think of a reason for the 2FA process to only work the second time. Is there any way to reproduce that from a clean database, or was your problem similar to @Biepa's problem?

We've had issues in the past with 2FA, but it's usually a badly configured date or timezone.

@dani-garcia commented on GitHub (Dec 20, 2018): @Deanosim I can't think of a reason for the 2FA process to only work the second time. Is there any way to reproduce that from a clean database, or was your problem similar to @Biepa's problem? We've had issues in the past with 2FA, but it's usually a badly configured date or timezone.
Author
Owner

@Deanosim commented on GitHub (Dec 20, 2018):

I was able to reproduce it a second time by deleting all the database files and letting it regen them, signing up and then enabling 2FA, Still not sure what's causing it but disabling it and enabling it again like I did the first time seems to be a work around.
My timezone and date are correct from what I can tell too, So I have no clue what's causing it.

@Deanosim commented on GitHub (Dec 20, 2018): I was able to reproduce it a second time by deleting all the database files and letting it regen them, signing up and then enabling 2FA, Still not sure what's causing it but disabling it and enabling it again like I did the first time seems to be a work around. My timezone and date are correct from what I can tell too, So I have no clue what's causing it.
Author
Owner

@dani-garcia commented on GitHub (Dec 20, 2018):

I just tried both with a local install and the latest docker hub image and I can't reproduce this.

It's weird, because the 2FA setup asks you to enter a code, so if there is a problem validating the codes it should fail there first.

Do you get any error in the logs? Also, make sure you are running the latest image just in case.

@dani-garcia commented on GitHub (Dec 20, 2018): I just tried both with a local install and the latest docker hub image and I can't reproduce this. It's weird, because the 2FA setup asks you to enter a code, so if there is a problem validating the codes it should fail there first. Do you get any error in the logs? Also, make sure you are running the latest image just in case.
Author
Owner

@Peppershade commented on GitHub (Feb 15, 2021):

I have the same issue, for a long time now.

When i login on a trusted pc where it wont ask for the 2FA everything works. But on new browsers/pcs it will give the error because of the 2FA. It seems like the 2FA works for a few hours after enabling it. It might be caused by a restart.

What I already tried:

  • Remove email settings
  • Readd all 2FA options (all of them give the same error)
  • Update the container
  • Checked the logs
  • Checked the hostname/domain in config and env

ENV screenshot
https://prnt.sc/zlcfx8

This are the logs I get:
Docker log:
[2021-02-15 10:39:09.518][response][INFO] POST /api/accounts/prelogin (prelogin) => 200 OK
[2021-02-15 10:39:09.594][request][INFO] POST /identity/connect/token
[2021-02-15 10:39:09.835][error][ERROR] 2FA token not provided
[2021-02-15 10:39:09.835][response][INFO] POST /identity/connect/token (login) => 400 Bad Request

Chrome:
zone.js:1118 POST https://auth.[REDACTED].nl/identity/connect/token 400

@Peppershade commented on GitHub (Feb 15, 2021): I have the same issue, for a long time now. When i login on a trusted pc where it wont ask for the 2FA everything works. But on new browsers/pcs it will give the error because of the 2FA. It seems like the 2FA works for a few hours after enabling it. It might be caused by a restart. What I already tried: - Remove email settings - Readd all 2FA options (all of them give the same error) - Update the container - Checked the logs - Checked the hostname/domain in config and env **ENV screenshot** https://prnt.sc/zlcfx8 **This are the logs I get:** Docker log: [2021-02-15 10:39:09.518][response][INFO] POST /api/accounts/prelogin (prelogin) => 200 OK [2021-02-15 10:39:09.594][request][INFO] POST /identity/connect/token [2021-02-15 10:39:09.835][error][ERROR] 2FA token not provided [2021-02-15 10:39:09.835][response][INFO] POST /identity/connect/token (login) => 400 Bad Request Chrome: zone.js:1118 POST https://auth.[REDACTED].nl/identity/connect/token 400
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#166