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

CLI login with API key does not work #5251

Closed
1 task done
mu88 opened this issue Jan 11, 2025 · 1 comment
Closed
1 task done

CLI login with API key does not work #5251

mu88 opened this issue Jan 11, 2025 · 1 comment
Labels

Comments

@mu88
Copy link

mu88 commented Jan 11, 2025

Steps To Reproduce

  1. Open cmd.exe
  2. Run set BITWARDENCLI_DEBUG=true
  3. Run bw config server https://myraspi:15443
  4. Run bw login --apikey and pass client_id and client_secret

Expected Result

The login should succeed.

Actual Result

Invalid API Key; Organization API Key currently not supported

Screenshots or Videos

No response

Additional Context

Using bw login --sso works without any issues

Logs of `bw config`
D:\Development\mu88>bw config server https://myraspi:15443
Initializing lowdb storage service.
db file "C:\Users\<myUser>\AppData\Roaming\Bitwarden CLI\data.json already exists"; using existing db
acquiring db file lock
Attempting to create lowdb storage adapter.
Successfully created lowdb storage adapter.
acquiring db file lock
acquiring db file lock
State version: 68
Migrator MinVersionMigrator (to version 3) should migrate: false - up
Migrator RemoveEverBeenUnlockedMigrator (to version 4) should migrate: false - up
Migrator AddKeyTypeToOrgKeysMigrator (to version 5) should migrate: false - up
Migrator RemoveLegacyEtmKeyMigrator (to version 6) should migrate: false - up
Migrator MoveBiometricAutoPromptToAccount (to version 7) should migrate: false - up
Migrator MoveStateVersionMigrator (to version 8) should migrate: false - up
Migrator MoveBrowserSettingsToGlobal (to version 9) should migrate: false - up
Migrator EverHadUserKeyMigrator (to version 10) should migrate: false - up
Migrator OrganizationKeyMigrator (to version 11) should migrate: false - up
Migrator MoveEnvironmentStateToProviders (to version 12) should migrate: false - up
Migrator ProviderKeyMigrator (to version 13) should migrate: false - up
Migrator MoveBiometricClientKeyHalfToStateProviders (to version 14) should migrate: false - up
Migrator FolderMigrator (to version 15) should migrate: false - up
Migrator LastSyncMigrator (to version 16) should migrate: false - up
Migrator EnablePasskeysMigrator (to version 17) should migrate: false - up
Migrator AutofillSettingsKeyMigrator (to version 18) should migrate: false - up
Migrator RequirePasswordOnStartMigrator (to version 19) should migrate: false - up
Migrator PrivateKeyMigrator (to version 20) should migrate: false - up
Migrator CollectionMigrator (to version 21) should migrate: false - up
Migrator CollapsedGroupingsMigrator (to version 22) should migrate: false - up
Migrator MoveBiometricPromptsToStateProviders (to version 23) should migrate: false - up
Migrator SmOnboardingTasksMigrator (to version 24) should migrate: false - up
Migrator ClearClipboardDelayMigrator (to version 25) should migrate: false - up
Migrator RevertLastSyncMigrator (to version 26) should migrate: false - up
Migrator BadgeSettingsMigrator (to version 27) should migrate: false - up
Migrator MoveBiometricUnlockToStateProviders (to version 28) should migrate: false - up
Migrator UserNotificationSettingsKeyMigrator (to version 29) should migrate: false - up
Migrator PolicyMigrator (to version 30) should migrate: false - up
Migrator EnableContextMenuMigrator (to version 31) should migrate: false - up
Migrator PreferredLanguageMigrator (to version 32) should migrate: false - up
Migrator AppIdMigrator (to version 33) should migrate: false - up
Migrator DomainSettingsMigrator (to version 34) should migrate: false - up
Migrator MoveThemeToStateProviderMigrator (to version 35) should migrate: false - up
Migrator VaultSettingsKeyMigrator (to version 36) should migrate: false - up
Migrator AvatarColorMigrator (to version 37) should migrate: false - up
Migrator TokenServiceStateProviderMigrator (to version 38) should migrate: false - up
Migrator MoveBillingAccountProfileMigrator (to version 39) should migrate: false - up
Migrator OrganizationMigrator (to version 40) should migrate: false - up
Migrator EventCollectionMigrator (to version 41) should migrate: false - up
Migrator EnableFaviconMigrator (to version 42) should migrate: false - up
Migrator AutoConfirmFingerPrintsMigrator (to version 43) should migrate: false - up
Migrator UserDecryptionOptionsMigrator (to version 44) should migrate: false - up
Migrator MergeEnvironmentState (to version 45) should migrate: false - up
Migrator DeleteBiometricPromptCancelledData (to version 46) should migrate: false - up
Migrator MoveDesktopSettingsMigrator (to version 47) should migrate: false - up
Migrator MoveDdgToStateProviderMigrator (to version 48) should migrate: false - up
Migrator AccountServerConfigMigrator (to version 49) should migrate: false - up
Migrator KeyConnectorMigrator (to version 50) should migrate: false - up
Migrator RememberedEmailMigrator (to version 51) should migrate: false - up
Migrator DeleteInstalledVersion (to version 52) should migrate: false - up
Migrator DeviceTrustServiceStateProviderMigrator (to version 53) should migrate: false - up
Migrator SendMigrator (to version 54) should migrate: false - up
Migrator MoveMasterKeyStateToProviderMigrator (to version 55) should migrate: false - up
Migrator AuthRequestMigrator (to version 56) should migrate: false - up
Migrator CipherServiceMigrator (to version 57) should migrate: false - up
Migrator RemoveRefreshTokenMigratedFlagMigrator (to version 58) should migrate: false - up
Migrator KdfConfigMigrator (to version 59) should migrate: false - up
Migrator KnownAccountsMigrator (to version 60) should migrate: false - up
Migrator PinStateMigrator (to version 61) should migrate: false - up
Migrator VaultTimeoutSettingsServiceStateProviderMigrator (to version 62) should migrate: false - up
Migrator PasswordOptionsMigrator (to version 63) should migrate: false - up
Migrator GeneratorHistoryMigrator (to version 64) should migrate: false - up
Migrator ForwarderOptionsMigrator (to version 65) should migrate: false - up
Migrator MoveFinalDesktopSettingsMigrator (to version 66) should migrate: false - up
Migrator RemoveUnassignedItemsBannerDismissed (to version 67) should migrate: false - up
Migrator MoveLastSyncDate (to version 68) should migrate: false - up
acquiring db file lock
acquiring db file lock
acquiring db file lock
acquiring db file lock
acquiring db file lock
acquiring db file lock
acquiring db file lock
Saved setting `config`.
Logs of `bw login --apikey`
D:\Development\mu88>bw login --apikey
Initializing lowdb storage service.
db file "C:\Users\<myUser>\AppData\Roaming\Bitwarden CLI\data.json already exists"; using existing db
acquiring db file lock
Attempting to create lowdb storage adapter.
Successfully created lowdb storage adapter.
acquiring db file lock
acquiring db file lock
State version: 68
Migrator MinVersionMigrator (to version 3) should migrate: false - up
Migrator RemoveEverBeenUnlockedMigrator (to version 4) should migrate: false - up
Migrator AddKeyTypeToOrgKeysMigrator (to version 5) should migrate: false - up
Migrator RemoveLegacyEtmKeyMigrator (to version 6) should migrate: false - up
Migrator MoveBiometricAutoPromptToAccount (to version 7) should migrate: false - up
Migrator MoveStateVersionMigrator (to version 8) should migrate: false - up
Migrator MoveBrowserSettingsToGlobal (to version 9) should migrate: false - up
Migrator EverHadUserKeyMigrator (to version 10) should migrate: false - up
Migrator OrganizationKeyMigrator (to version 11) should migrate: false - up
Migrator MoveEnvironmentStateToProviders (to version 12) should migrate: false - up
Migrator ProviderKeyMigrator (to version 13) should migrate: false - up
Migrator MoveBiometricClientKeyHalfToStateProviders (to version 14) should migrate: false - up
Migrator FolderMigrator (to version 15) should migrate: false - up
Migrator LastSyncMigrator (to version 16) should migrate: false - up
Migrator EnablePasskeysMigrator (to version 17) should migrate: false - up
Migrator AutofillSettingsKeyMigrator (to version 18) should migrate: false - up
Migrator RequirePasswordOnStartMigrator (to version 19) should migrate: false - up
Migrator PrivateKeyMigrator (to version 20) should migrate: false - up
Migrator CollectionMigrator (to version 21) should migrate: false - up
Migrator CollapsedGroupingsMigrator (to version 22) should migrate: false - up
Migrator MoveBiometricPromptsToStateProviders (to version 23) should migrate: false - up
Migrator SmOnboardingTasksMigrator (to version 24) should migrate: false - up
Migrator ClearClipboardDelayMigrator (to version 25) should migrate: false - up
Migrator RevertLastSyncMigrator (to version 26) should migrate: false - up
Migrator BadgeSettingsMigrator (to version 27) should migrate: false - up
Migrator MoveBiometricUnlockToStateProviders (to version 28) should migrate: false - up
Migrator UserNotificationSettingsKeyMigrator (to version 29) should migrate: false - up
Migrator PolicyMigrator (to version 30) should migrate: false - up
Migrator EnableContextMenuMigrator (to version 31) should migrate: false - up
Migrator PreferredLanguageMigrator (to version 32) should migrate: false - up
Migrator AppIdMigrator (to version 33) should migrate: false - up
Migrator DomainSettingsMigrator (to version 34) should migrate: false - up
Migrator MoveThemeToStateProviderMigrator (to version 35) should migrate: false - up
Migrator VaultSettingsKeyMigrator (to version 36) should migrate: false - up
Migrator AvatarColorMigrator (to version 37) should migrate: false - up
Migrator TokenServiceStateProviderMigrator (to version 38) should migrate: false - up
Migrator MoveBillingAccountProfileMigrator (to version 39) should migrate: false - up
Migrator OrganizationMigrator (to version 40) should migrate: false - up
Migrator EventCollectionMigrator (to version 41) should migrate: false - up
Migrator EnableFaviconMigrator (to version 42) should migrate: false - up
Migrator AutoConfirmFingerPrintsMigrator (to version 43) should migrate: false - up
Migrator UserDecryptionOptionsMigrator (to version 44) should migrate: false - up
Migrator MergeEnvironmentState (to version 45) should migrate: false - up
Migrator DeleteBiometricPromptCancelledData (to version 46) should migrate: false - up
Migrator MoveDesktopSettingsMigrator (to version 47) should migrate: false - up
Migrator MoveDdgToStateProviderMigrator (to version 48) should migrate: false - up
Migrator AccountServerConfigMigrator (to version 49) should migrate: false - up
Migrator KeyConnectorMigrator (to version 50) should migrate: false - up
Migrator RememberedEmailMigrator (to version 51) should migrate: false - up
Migrator DeleteInstalledVersion (to version 52) should migrate: false - up
Migrator DeviceTrustServiceStateProviderMigrator (to version 53) should migrate: false - up
Migrator SendMigrator (to version 54) should migrate: false - up
Migrator MoveMasterKeyStateToProviderMigrator (to version 55) should migrate: false - up
Migrator AuthRequestMigrator (to version 56) should migrate: false - up
Migrator CipherServiceMigrator (to version 57) should migrate: false - up
Migrator RemoveRefreshTokenMigratedFlagMigrator (to version 58) should migrate: false - up
Migrator KdfConfigMigrator (to version 59) should migrate: false - up
Migrator KnownAccountsMigrator (to version 60) should migrate: false - up
Migrator PinStateMigrator (to version 61) should migrate: false - up
Migrator VaultTimeoutSettingsServiceStateProviderMigrator (to version 62) should migrate: false - up
Migrator PasswordOptionsMigrator (to version 63) should migrate: false - up
Migrator GeneratorHistoryMigrator (to version 64) should migrate: false - up
Migrator ForwarderOptionsMigrator (to version 65) should migrate: false - up
Migrator MoveFinalDesktopSettingsMigrator (to version 66) should migrate: false - up
Migrator RemoveUnassignedItemsBannerDismissed (to version 67) should migrate: false - up
Migrator MoveLastSyncDate (to version 68) should migrate: false - up
acquiring db file lock
acquiring db file lock
acquiring db file lock
acquiring db file lock
? client_id:  <Client ID>
? client_secret:  <Client secret>
Invalid API Key; Organization API Key currently not supported

Build Version

2024.12.1-beta

Environment

Self-Hosted

Environment Details

  • Operation system: Raspberry Pi OS
  • Docker image bitwarden/self-host:2024.12.1-beta
  • Bitwarden works fine both in my Browser, Android and Windows app using the endpoint https://myraspi:15443

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.
@mu88 mu88 added the bug label Jan 11, 2025
@SergeantConfused
Copy link

Hello @mu88,

Thank you for this report. Going by that error message, it seems like you're using the Organizational API key when you should be using the Personal API key; please follow the instructions in the Bitwarden Help Centre to log in via the Bitwarden CLI using the Personal API key.

As a side note, please post future CLI-related reports in the Clients repository; if you're unsure if a particular behaviour is something that should be reported on GitHub, please feel free to get in touch with us and we'll have a look together.

I will now close this GitHub report; if you have any questions or concerns, please feel free to get in touch and please include a link to this GitHub report if you do create a support ticket.

Thank you again,

@SergeantConfused SergeantConfused closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants