Repository navigation
[PM-46627] fix: Don't force Key Connector users promoted to admin to set a master password - #7594
Merged
david-livefront merged 1 commit intoNov 11, 2026
Conversation
Collaborator
|
Thank you for your contribution! We've added this to our internal tracking system for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
acul021
force-pushed
the
fix/key-connector-admin-master-password
branch
from
November 10, 2026 15:54
b28e9f0 to
a810bb3
Compare
…r password A Key Connector user who is promoted to owner or admin after migrating gets stuck on the set password screen. The vault is still locked at that point and the user has no master password, so there is no way forward. The admin rule comes from Trusted Device Encryption. Android applied it to Key Connector users too, in two places: - toUserState set needsMasterPassword for Key Connector users with the reset password permission. - getForcePasswordResetReason set the TDE reset reason for any user without a master password, without checking for TDE. Web (default-sync.service.ts, sso-login.strategy.ts) and iOS (SyncService.checkTdeUserNeedsToSetPassword) only apply this rule when trustedDeviceOption is present. Android now does the same.
acul021
force-pushed
the
fix/key-connector-admin-master-password
branch
from
November 11, 2026 14:57
a810bb3 to
9d62a6f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7594 +/- ##
==========================================
+ Coverage 85.73% 86.85% +1.11%
==========================================
Files 1056 898 -158
Lines 69016 65202 -3814
Branches 10279 9378 -901
==========================================
- Hits 59170 56630 -2540
+ Misses 6233 5098 -1135
+ Partials 3613 3474 -139
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
david-livefront
approved these changes
Nov 11, 2026
Collaborator
|
Thanks for your contribution @acul021 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
Reported against a Vaultwarden build with Key Connector support.
Nothing in the client logic is Vaultwarden-specific. A Bitwarden server should hit the same path when a Key Connector user is promoted to owner or admin after migration. I have not reproduced it against a Bitwarden server.
📔 Objective
A Key Connector user who is promoted to owner or admin after migrating to Key Connector cannot log in on Android anymore. The web vault and iOS handle the same account fine.
Steps to reproduce
Expected: The vault unlocks through Key Connector, as it does on web and iOS.
Actual: The app goes to the set password screen. The vault is still locked and the user has no master password, so they can't continue.
Cause
Bitwarden requires TDE users with the "manage account recovery" permission (owners, admins, custom roles with that permission) to set a master password. Android applied this rule to Key Connector users as well, in
UserStateJsonExtensions.kt:toUserStatecomputedneedsMasterPassword = truefor a user without a master password whentrustedDevice != null || keyConnectorOptions != nulland the user had the permission.RootNavViewModelthen routes toRootNavState.SetPassword.getForcePasswordResetReasonsetTDE_USER_WITHOUT_PASSWORD_HAS_PASSWORD_RESET_PERMISSIONon sync for any user without a master password who had the permission, without checking for TDE. The stored reason survives later syncs throughpreviousForcePasswordResetReason.The other clients only apply this rule to TDE:
libs/common/src/platform/sync/default-sync.service.ts: checksuserDecryptionOptions.trustedDeviceOption !== undefined.libs/auth/src/common/login-strategies/sso-login.strategy.ts: readstrustedDeviceOption?.hasManageResetPasswordPermission.SyncService.checkTdeUserNeedsToSetPassword: requirestrustedDeviceOption != nil.GetTokenResponseExtensions.toForcePasswordResetReason) already scopes this totrustedDeviceUserDecryptionOptions. Only the sync and user state paths were missing the check.Changes
needsMasterPassword: a TDE user needs a password only with the reset password permission, a Key Connector user never does, and any other user without a password still does.getForcePasswordResetReason: only sets the TDE reason whentrustedDeviceUserDecryptionOptionsis present.removePassword,shouldShowRemovePassword) is unchanged. It matches web.Tests
New cases in
UserStateJsonExtensionsTest:needsMasterPasswordisfalse.Existing TDE tests are unchanged and pass.
📸 Screenshots
No UI changes.