Invalid TOTP codes #181

Closed
opened 2025-11-07 08:30:05 -06:00 by GiteaMirror · 20 comments
Owner

Originally created by @vbtrek on GitHub (Jan 24, 2018).

Bitwarden sems to be generating invalid TOTP codes. My data was imported from 1password. The codes from 1password work correctly, I have also added the same codes to Authy and when I put Authy / 1password and bitwarden side by side Authy and 1passwords TOTP codes match and bitwarden is wrong.

Any ideas why?

Originally created by @vbtrek on GitHub (Jan 24, 2018). Bitwarden sems to be generating invalid TOTP codes. My data was imported from 1password. The codes from 1password work correctly, I have also added the same codes to Authy and when I put Authy / 1password and bitwarden side by side Authy and 1passwords TOTP codes match and bitwarden is wrong. Any ideas why?
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

That's weird. Are you comparing on the same device?

@kspearrin commented on GitHub (Jan 24, 2018): That's weird. Are you comparing on the same device?
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

Authy is on my iPhone, bitwarden Vault in opera on my laptop, and 1password desktop also on my laptop. Example of the same login in 1password in the foreground and the same login in bitwarden in the background.
totp

It's exactly the same otpauth url in both bitwarden and 1password.

@vbtrek commented on GitHub (Jan 24, 2018): Authy is on my iPhone, bitwarden Vault in opera on my laptop, and 1password desktop also on my laptop. Example of the same login in 1password in the foreground and the same login in bitwarden in the background. ![totp](https://user-images.githubusercontent.com/26403480/35357502-acb084ba-014b-11e8-807f-3f771ddfc174.png) It's exactly the same otpauth url in both bitwarden and 1password.
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

If you are comparing on different devices it could be a time sync issue. Ensure your system time is correct on each. Else it could be that the keys are being parsed differently. For example, does your key have any spaces in it? Are you sure the keys are exactly the same in both systems?

@kspearrin commented on GitHub (Jan 24, 2018): If you are comparing on different devices it could be a time sync issue. Ensure your system time is correct on each. Else it could be that the keys are being parsed differently. For example, does your key have any spaces in it? Are you sure the keys are exactly the same in both systems?
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

I thought that, but both Authy and 1password on the iphone and 1password on the windows laptop all show the same TOTP at the same time, however bitwarden doesn't. bitwarden on the iphone matches the bitwarden web vault on my windows laptop. I can't see any time sync issues. I'll try rescanning the QR code using bitwarden and see if that give me a valid TOTP.

@vbtrek commented on GitHub (Jan 24, 2018): I thought that, but both Authy and 1password on the iphone and 1password on the windows laptop all show the same TOTP at the same time, however bitwarden doesn't. bitwarden on the iphone matches the bitwarden web vault on my windows laptop. I can't see any time sync issues. I'll try rescanning the QR code using bitwarden and see if that give me a valid TOTP.
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

Well, if you are re-scanning QR codes you most likely will get a different TOTP key. If the keys are different you will get different codes. You need to compare the keys in both programs and see what is different.

@kspearrin commented on GitHub (Jan 24, 2018): Well, if you are re-scanning QR codes you most likely will get a different TOTP key. If the keys are different you will get different codes. You need to compare the keys in both programs and see what is different.
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

The keys are currently identical, they were imported. I have also tried cutting and pasting from 1password into bitwarden and saving, but still the TOTP code is different.

@vbtrek commented on GitHub (Jan 24, 2018): The keys are currently identical, they were imported. I have also tried cutting and pasting from 1password into bitwarden and saving, but still the TOTP code is different.
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

Do the keys have spaces? Are all characters valid base 32 characters?

@kspearrin commented on GitHub (Jan 24, 2018): Do the keys have spaces? Are all characters valid base 32 characters?
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

No spaces here's an example: "otpauth://totp/Microsoft:email@server.com?secret=1234567890ABCDEF&issuer=Microsoft" (i've changed the email address and secret!). I've got TOTP setup for a number of services: Microsoft / Google / email / Facebook and they are all wrong in bitwarden.

@vbtrek commented on GitHub (Jan 24, 2018): No spaces here's an example: "otpauth://totp/Microsoft:email@server.com?secret=1234567890ABCDEF&issuer=Microsoft" (i've changed the email address and secret!). I've got TOTP setup for a number of services: Microsoft / Google / email / Facebook and they are all wrong in bitwarden.
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

That's not a valid TOTP key. They key in this case would just be "1234567890ABCDEF"

@kspearrin commented on GitHub (Jan 24, 2018): That's not a valid TOTP key. They key in this case would just be "1234567890ABCDEF"
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

Right, that's what was imported from 1password. Let me change it and try again.

@vbtrek commented on GitHub (Jan 24, 2018): Right, that's what was imported from 1password. Let me change it and try again.
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

Awesome, that's done it, i'll go through an update them all. Maybe something to note for the 1password importer. Thanks for all your help.

@vbtrek commented on GitHub (Jan 24, 2018): Awesome, that's done it, i'll go through an update them all. Maybe something to note for the 1password importer. Thanks for all your help.
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

How are the values actually stored in 1Password? Are they 1234567890ABCDEF or otpauth://totp/Microsoft:email@server.com?secret=1234567890ABCDEF&issuer=Microsoft?

@kspearrin commented on GitHub (Jan 24, 2018): How are the values actually stored in 1Password? Are they `1234567890ABCDEF` or `otpauth://totp/Microsoft:email@server.com?secret=1234567890ABCDEF&issuer=Microsoft`?
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

The full URL, example in screenshot from 1password editor:
totp2

@vbtrek commented on GitHub (Jan 24, 2018): The full URL, example in screenshot from 1password editor: ![totp2](https://user-images.githubusercontent.com/26403480/35359698-05747154-0153-11e8-897d-6fcf934c0e32.png)
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

In my experiencing that's not how most people have them stored in there. If you were to make it just 1234567890ABCDEF in 1Password does it work the same?

@kspearrin commented on GitHub (Jan 24, 2018): In my experiencing that's not how most people have them stored in there. If you were to make it just `1234567890ABCDEF` in 1Password does it work the same?
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

Yes it does work, so both the otpauth url and just the 123456789ABCDEF work the same and produce the same TOTP code. Interestingly the 1password one time password generator (the grey circle icon at the end of the texbox) generates an otpauth url for you. Also, all the TOTP's I have stored were captured using the iphone and the QR code scanner which must also store the full otpauth URL.
totp2

@vbtrek commented on GitHub (Jan 24, 2018): Yes it does work, so both the otpauth url and just the 123456789ABCDEF work the same and produce the same TOTP code. Interestingly the 1password one time password generator (the grey circle icon at the end of the texbox) generates an otpauth url for you. Also, all the TOTP's I have stored were captured using the iphone and the QR code scanner which must also store the full otpauth URL. ![totp2](https://user-images.githubusercontent.com/26403480/35360025-30f486a6-0154-11e8-912b-96df294d126b.png)
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

Hmm. When I tested the importer for 1Password I don't recall seeing otpauth URLS for them. Is this 1Password 4 or 6?

@kspearrin commented on GitHub (Jan 24, 2018): Hmm. When I tested the importer for 1Password I don't recall seeing otpauth URLS for them. Is this 1Password 4 or 6?
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

1password 4.

@vbtrek commented on GitHub (Jan 24, 2018): 1password 4.
Author
Owner

@kspearrin commented on GitHub (Jan 24, 2018):

Ok, that must be different than 1Password 6, which is what I used to test. Thanks.

@kspearrin commented on GitHub (Jan 24, 2018): Ok, that must be different than 1Password 6, which is what I used to test. Thanks.
Author
Owner

@vbtrek commented on GitHub (Jan 24, 2018):

Thank you too.

@vbtrek commented on GitHub (Jan 24, 2018): Thank you too.
Author
Owner

@917huB commented on GitHub (Apr 8, 2018):

Ive just imported into 1.25.1 from a 1Password 6.8.8 export and found the OTP code was as reported above, i.e "otpauth://totp/Coinbase:coinbase@xyz.uk?secret=xxxxyyyyyzzzz1111&issuer=Coinbase" and not just the xxxyyyzzz1111 bit. Correcting the OTP code to just the secret resolves any issues.

@917huB commented on GitHub (Apr 8, 2018): Ive just imported into 1.25.1 from a 1Password 6.8.8 export and found the OTP code was as reported above, i.e "otpauth://totp/Coinbase:coinbase@xyz.uk?secret=xxxxyyyyyzzzz1111&issuer=Coinbase" and not just the xxxyyyzzz1111 bit. Correcting the OTP code to just the secret resolves any issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#181