web icon indicating copy to clipboard operation
web copied to clipboard

Error when registering a U2F device

Open pierre-le opened this issue 7 years ago • 7 comments

Issue When I try to add my Yubico security key (the blue one, that supports U2F, not the original Yubikey 4/5), I get a generic error that appears almost immediately after clicking on the "Read key" button.

capture

I've got a "error: 2" when debugging from the JS console:

capture

I also checked the logs from the Docker container, but nothing stands out.

Steps to reproduce

  1. Go to the Two Factor Authentication section on the Settings page, then click on the button to add a FIDO U2F security key.
  2. Plug in the Yubico U2F Security Key.
  3. Write a random name in the field.
  4. Click on "Read key"

Additional details I'm using an "on-premises" deployment of Bitwarden. The app is served behind a reverse proxy (Nginx), that handles the HTTPS encryption.

pierre-le avatar Jan 04 '19 17:01 pierre-le

Is the U2F appid available?

https://webvault.com/app-id.json

Does it contain the correct information?

kspearrin avatar Jan 04 '19 18:01 kspearrin

@kspearrin It seems to be correct, as far as I can tell :

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

pierre-le avatar Jan 04 '19 18:01 pierre-le

Is "https://xxxxxxx", your web vault's URL?

kspearrin avatar Jan 04 '19 18:01 kspearrin

Yes, I obfuscated it but the actual URL is valid

pierre-le avatar Jan 04 '19 18:01 pierre-le

To determine whether the U2F key could be causing this issue or not, I tried to click on "Read key" without any key inserted, and the very same thing happens. So I guess it's not related to this specific model...

pierre-le avatar Jan 04 '19 18:01 pierre-le

So I double checked my configuration, and it appears some URLs in bwdata/env/global.override.env were using HTTP instead of HTTPS... Updating them and restarting the container allowed U2F registration to work flawlessly.

My bad! And thanks for your help @kspearrin, and for the awesome work in maitaining Bitwarden 😄

pierre-le avatar Jan 04 '19 19:01 pierre-le

Im having the same issue. How do I go about checking my 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}}]}

AJEvans3 avatar Nov 30 '20 02:11 AJEvans3