# 2FA OTP Error with Yubikey 5C NFC

**URL:** <https://vaultwarden.discourse.group/t/2fa-otp-error-with-yubikey-5c-nfc/919>\
**Category:** Help\
**Created:** [May 25, 2021, 3:52pm UTC](https://vaultwarden.discourse.group/t/2fa-otp-error-with-yubikey-5c-nfc/919 "2021-05-25T15:52:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emb3dded](https://avatars.discourse-cdn.com/v4/letter/e/cc9497/32.png) [@emb3dded](https://vaultwarden.discourse.group/u/emb3dded)\
**Post date:** [May 25, 2021, 3:52pm UTC](https://vaultwarden.discourse.group/t/2fa-otp-error-with-yubikey-5c-nfc/919/1 "2021-05-25T15:52:38Z")

</div>

Hello

I am running vaultwarden with docker compose on gcp.  
I have already a FIDO U2F Security Key and a authenticator app set up with no Problem. Now if i want to add YubiKey OTP Security Key i get the following error:  
 ![image](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/8977dfb8961fb5b020859c9f52f597bafbec7c28.png)  
and in the logs:  
`
[2021-05-25 15:08:37.049][request][INFO] PUT /api/two-factor/yubikey
[2021-05-25 15:08:37.113][error][ERROR] Invalid Yubikey OTP provided.
[CAUSE] Network(
reqwest::Error {
kind: Builder,
source: RelativeUrlWithoutBase,
},
)
[2021-05-25 15:08:37.115][response][INFO] PUT /api/two-factor/yubikey (activate_yubikey_put) => 400 Bad Request
`  
The Yubikey OTP validates on [Yubico demo website](https://demo.yubico.com/otp/verify)  
`
{
“otp”: “xxxx”,
“nonce”: “xxxxx”,
“sl”: “100”,
“status”: “OK”,
“t”: “2021-05-25T15:07:41Z0214”
}
`  
and i set the infos in my .env:  
`
YUBICO_CLIENT_ID=“12345”
YUBICO_SECRET_KEY=“xxxxxxxxxxxxxxxx”
YUBICO_SERVER=
`  
Any ideas how i could get i working? Should i open a bug?  
When i remove the empty YUBICO\_SERVER i get the following in the logs:  
`
[2021-05-25 16:21:18.993][error][ERROR] Invalid Yubikey OTP provided.
[CAUSE] Network(
reqwest::Error {
kind: Request,
url: Url {
scheme: “https”,
username: “”,
password: None,
host: Some(
Domain(
“api5.yubico.com”,
),
),
port: None,
path: “/wsapi/2.0/verify”,
query: Some(
“id=XXXXX&nonce=XXXXXX&otp=XXXXX&sl=XXXXXXXX”,
),
fragment: None,
},
source: TimedOut,
},
)
[2021-05-25 16:21:18.995][response][INFO] PUT /api/two-factor/yubikey (activate_yubikey_put) => 400 Bad Request
`

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [June 24, 2021, 9:06pm UTC](https://vaultwarden.discourse.group/t/2fa-otp-error-with-yubikey-5c-nfc/919/2 "2021-06-24T21:06:37Z")

</div>

These type of auth request need a valid cert and also the domain needs to be configured correctly. Try and verify if that is correct.

---

<div class="post-metadata">

**Author:** ![sailhobie](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/sailhobie/32/783_2.png) [@sailhobie](https://vaultwarden.discourse.group/u/sailhobie)\
**Post date:** [October 11, 2022, 10:47pm UTC](https://vaultwarden.discourse.group/t/2fa-otp-error-with-yubikey-5c-nfc/919/3 "2022-10-11T22:47:16Z")

</div>

Did you have any luck fixing this? I am having the same issue
