[GH-ISSUE #1258] Error when registering U2F device #885

Closed
opened 2026-03-03 02:04:22 +03:00 by kerem · 11 comments
Owner

Originally created by @AJEvans3 on GitHub (Dec 6, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1258

I am self hosting Bitwarden_rs in docker on my synology nas. When I try to add my Yubico security key or Solokey, I get a generic error that appears almost immediately after clicking on the "Read key" button. Ive read in the other posted issues that solution could potentially be found by looking at my configuration.

Is it something to do with my configuration or URLS? How do I go about checking my config/URLS to make sure they are correct? And if not, making the change? When typing in https://webvault.com/app-id.json I get the following:

{"trustedFacets":[{"ids":["http://xxxxx","ios:bundle-id:com.8bit.bitwarden","android:apk-key-hash:xxxxxxxxxx"],"version":{"major":1,"minor":0}}]}

Pad Solo

Originally created by @AJEvans3 on GitHub (Dec 6, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1258 I am self hosting Bitwarden_rs in docker on my synology nas. When I try to add my Yubico security key or Solokey, I get a generic error that appears almost immediately after clicking on the "Read key" button. Ive read in the other posted issues that solution could potentially be found by looking at my configuration. Is it something to do with my configuration or URLS? How do I go about checking my config/URLS to make sure they are correct? And if not, making the change? When typing in https://webvault.com/app-id.json I get the following: {"trustedFacets":[{"ids":["http://xxxxx","ios:bundle-id:com.8bit.bitwarden","android:apk-key-hash:xxxxxxxxxx"],"version":{"major":1,"minor":0}}]} ![Pad Solo](https://user-images.githubusercontent.com/56004016/101287399-4ca9d300-37ad-11eb-8c79-f3d173809ecc.png)
kerem 2026-03-03 02:04:22 +03:00
Author
Owner

@ikkuranus commented on GitHub (Dec 11, 2020):

I'm experiencing the same problem with my yubikey 5.

<!-- gh-comment-id:742986363 --> @ikkuranus commented on GitHub (Dec 11, 2020): I'm experiencing the same problem with my yubikey 5.
Author
Owner

@BlackDex commented on GitHub (Dec 15, 2020):

Keep in mind that you need HTTPS, else these functions will not work.

<!-- gh-comment-id:745137190 --> @BlackDex commented on GitHub (Dec 15, 2020): Keep in mind that you need HTTPS, else these functions will not work.
Author
Owner

@BlackDex commented on GitHub (Dec 15, 2020):

Also, does it work here: https://demo.yubico.com/webauthn-technical/registration

<!-- gh-comment-id:745137940 --> @BlackDex commented on GitHub (Dec 15, 2020): Also, does it work here: https://demo.yubico.com/webauthn-technical/registration
Author
Owner

@AJEvans3 commented on GitHub (Dec 15, 2020):

Keep in mind that you need HTTPS, else these functions will not work.
What does that mean? My yubikey work on the site you sent. What about the solokeys?

<!-- gh-comment-id:745404828 --> @AJEvans3 commented on GitHub (Dec 15, 2020): > Keep in mind that you need HTTPS, else these functions will not work. What does that mean? My yubikey work on the site you sent. What about the solokeys?
Author
Owner

@BlackDex commented on GitHub (Dec 15, 2020):

You need to have an encrypted connection to bitwarden_rs so https:// without it, reading the key will not work.

<!-- gh-comment-id:745463030 --> @BlackDex commented on GitHub (Dec 15, 2020): You need to have an encrypted connection to bitwarden_rs so https:// without it, reading the key will not work.
Author
Owner

@AJEvans3 commented on GitHub (Dec 16, 2020):

I guess I thought I had an encrypted connection. How do I verify that I do? And if I dont, fix it?

<!-- gh-comment-id:747064201 --> @AJEvans3 commented on GitHub (Dec 16, 2020): I guess I thought I had an encrypted connection. How do I verify that I do? And if I dont, fix it?
Author
Owner

@ikkuranus commented on GitHub (Dec 19, 2020):

You need to have an encrypted connection to bitwarden_rs so https:// without it, reading the key will not work.

I run this docker container under unraid with the swag (letsencrypt) reverse proxy. I assume even though the swag container is providing https and the actual bitwarden container is only http that it won't be enough to pass that check?

<!-- gh-comment-id:748452132 --> @ikkuranus commented on GitHub (Dec 19, 2020): > You need to have an encrypted connection to bitwarden_rs so https:// without it, reading the key will not work. I run this docker container under unraid with the swag (letsencrypt) reverse proxy. I assume even though the swag container is providing https and the actual bitwarden container is only http that it won't be enough to pass that check?
Author
Owner

@BlackDex commented on GitHub (Dec 19, 2020):

It should be enough. The browser needs an encrypted connection, else it won't work.
If your URL starts with https:// that should be enough.

Also, check that you have your DOMAIN settings correctly.
If that doesn't match what is in your URL, it will also fail.

github.com/dani-garcia/bitwarden_rs@175f2aeace/.env.template (L194)

<!-- gh-comment-id:748461429 --> @BlackDex commented on GitHub (Dec 19, 2020): It should be enough. The browser needs an encrypted connection, else it won't work. If your URL starts with `https://` that should be enough. Also, check that you have your `DOMAIN` settings correctly. If that doesn't match what is in your URL, it will also fail. https://github.com/dani-garcia/bitwarden_rs/blob/175f2aeace6a6099cb3ea47d2de9968e764b5f43/.env.template#L194
Author
Owner

@qx-775 commented on GitHub (Jan 2, 2021):

I have this issue too, I am trying to register a key clearly on the https page using a self signed cert.

  bitwarden:
        restart: always
        image: docker.io/bitwardenrs/server:latest
        container_name: bitwarden
        environment:
            WEBSOCKET_ENABLED: 'true'
            ROCKET_TLS: '{certs = "/certs/cert.pem", key = "/certs/key.pem"}'
            DOMAIN: https://IPADDRESS:PORTNUMBER

Where IPADDRESS and PORTNUMBER are my actual (redacted) numbers.
Opening the console gives me this

listening for key...
u2f.js:702 Extension JS API Version:  1.1
two-factor-u2f.component.ts:138 error: 2

Using the latest version 2.17.1

What can I do to make the yubikey work? I have 2fa TOTP already enabled.

<!-- gh-comment-id:753415984 --> @qx-775 commented on GitHub (Jan 2, 2021): I have this issue too, I am trying to register a key clearly on the https page using a self signed cert. ```yaml bitwarden: restart: always image: docker.io/bitwardenrs/server:latest container_name: bitwarden environment: WEBSOCKET_ENABLED: 'true' ROCKET_TLS: '{certs = "/certs/cert.pem", key = "/certs/key.pem"}' DOMAIN: https://IPADDRESS:PORTNUMBER ``` Where IPADDRESS and PORTNUMBER are my actual (redacted) numbers. Opening the console gives me this ```js listening for key... u2f.js:702 Extension JS API Version: 1.1 two-factor-u2f.component.ts:138 error: 2 ``` Using the latest version 2.17.1 What can I do to make the yubikey work? I have 2fa TOTP already enabled.
Author
Owner

@BlackDex commented on GitHub (Jan 2, 2021):

Your DOMAIN is not configured correctly.
If you have a self signed cert, which common name (domain name) did you use? That is what you need to fill in into the domain.

Also, I'm not sure if u2f will work with self signed certs. It could be that you need to add your self signed CA root into your trusted certificates for your browser.

But that error 2 means something is not matching, it's either domain or certificate or maybe both.

<!-- gh-comment-id:753442989 --> @BlackDex commented on GitHub (Jan 2, 2021): Your DOMAIN is not configured correctly. If you have a self signed cert, which common name (domain name) did you use? That is what you need to fill in into the domain. Also, I'm not sure if u2f will work with self signed certs. It could be that you need to add your self signed CA root into your trusted certificates for your browser. But that `error 2` means something is not matching, it's either domain or certificate or maybe both.
Author
Owner

@BlackDex commented on GitHub (Jan 31, 2021):

Closing this issue due to inactivity.

Please make sure you have a valid certificate and that the DOMAIN variable is configured correctly.
If one of these presents an issue using a U2F Token will not work.

If you use the image: docker.io/bitwardenrs/server:testing tagged image the DOMAIN variable can be validated within the /admin/diagnostics page.

<!-- gh-comment-id:770412071 --> @BlackDex commented on GitHub (Jan 31, 2021): Closing this issue due to inactivity. Please make sure you have a valid certificate and that the `DOMAIN` variable is configured correctly. If one of these presents an issue using a U2F Token will not work. If you use the `image: docker.io/bitwardenrs/server:testing` tagged image the DOMAIN variable can be validated within the `/admin/diagnostics` page.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#885
No description provided.