Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure on add yubikey #2557

Closed
1 task done
Tracked by #2480
amcusack opened this issue Jan 9, 2023 · 2 comments
Closed
1 task done
Tracked by #2480

failure on add yubikey #2557

amcusack opened this issue Jan 9, 2023 · 2 comments
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@amcusack
Copy link

amcusack commented Jan 9, 2023

Steps To Reproduce

  1. got api key from https://upgrade.yubico.com/getapikey/

  2. added following to docker-compose.yaml in environment section
    globalSettings_yubico_clientId: nnnnn [redacted 5 digit numeric value]
    globalSettings_yubico_key: sH____________________Y= [redacted, 28 character, alpha, starting with sH, ending with Y=]

  3. restart bitwarden

  4. log in

  5. go to account settings/security/two-step login/yubico manage

  6. enter master password

  7. put yubikey in usb port

  8. click into yubikey 1 form field

  9. press button on yubikey

Expected Result

yubikey two key login to be added to user account

Actual Result

error pops up as soon as yubikey button pressed
1

log entries as follows :
fail: Bit.Api.Utilities.ExceptionHandlerFilterAttribute[0]
=> SpanId:a8fe6db899cf1bff, TraceId:ee01ac5c107c1e164428a47957cec5bf, ParentId:0000000000000000 => ConnectionId:0HMNIISU2KGP6 => RequestPath:/two-factor/yubikey RequestId:0HMNIISU2KGP6:00000002 => Bit.Api.Controllers.TwoFactorController.PutYubiKey (Api)
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at YubicoDotNetClient.YubicoClient.SetApiKey(String apiKey)
at YubicoDotNetClient.YubicoClient..ctor(String clientId, String apiKey)
at Bit.Core.Identity.YubicoOtpTokenProvider.ValidateAsync(String purpose, String token, UserManager1 manager, User user) in /source/src/Core/Identity/YubicoOtpTokenProvider.cs:line 67 at Microsoft.AspNetCore.Identity.UserManager1.VerifyTwoFactorTokenAsync(TUser user, String tokenProvider, String token)
at Bit.Api.Controllers.TwoFactorController.ValidateYubiKeyAsync(User user, String name, String value) in /source/src/Api/Controllers/TwoFactorController.cs:line 459
at Bit.Api.Controllers.TwoFactorController.PutYubiKey(UpdateTwoFactorYubicoOtpRequestModel model) in /source/src/Api/Controllers/TwoFactorController.cs:line 129
at lambda_method622(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Screenshots or Videos

No response

Additional Context

No response

Githash Version

e795860-dirty

Environment Details

Virtualization: proxmox 7.3
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 5.10.0-20-amd64
Architecture: x86-64
Docker version 20.10.5+dfsg1, build 55c4c88

Database Image

Version: '10.10.2-MariaDB-1:10.10.2+maria~ubu2204' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution

Issue-Link

#2480

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
@amcusack amcusack added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Jan 9, 2023
@kspearrin
Copy link
Member

You are not using the correct env vars. You need two underscores. globalSettings__yubico__key and globalSettings__yubico__clientId

@amcusack
Copy link
Author

thanks, corrected those vars, tested & working as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment
Projects
None yet
Development

No branches or pull requests

2 participants