[PR #2694] [MERGED] [PM-3462] Handle force password reset on mobile with TDE #9887

Closed
opened 2026-04-11 02:30:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2694
Author: @jlf0dev
Created: 8/16/2023
Status: Merged
Merged: 8/16/2023
Merged by: @andrebispo5

Base: feature/pm-1029-tde-loginHead: pm-3462-handle-force-password-reset


📝 Commits (6)

  • a4acef8 [PM-3462] Handle force password reset on mobile with TDE
  • fc1bad3 [PM-3462] update references to refactored crypto method
  • 24109b5 Merge branch 'feature/pm-1029-tde-login' into pm-3462-handle-force-password-reset
  • 5a408a4 [PM-3462] Update TwoFactorPage login logic
  • 2908ba5 [PM-3462] Added pending admin request check to TwoFactorPage
  • 2c07569 [PM-3462] Added new exception types for null keys

📊 Changes

14 files changed (+129 additions, -56 deletions)

View changed files

📝 src/App/Pages/Accounts/LoginSsoPageViewModel.cs (+27 -23)
📝 src/App/Pages/Accounts/RegisterPageViewModel.cs (+4 -1)
📝 src/App/Pages/Accounts/SetPasswordPageViewModel.cs (+2 -1)
📝 src/App/Pages/Accounts/TwoFactorPageViewModel.cs (+44 -19)
📝 src/Core/Abstractions/IApiService.cs (+1 -1)
📝 src/Core/Abstractions/ICryptoService.cs (+1 -1)
src/Core/Exceptions/MasterKeyNullException.cs (+12 -0)
📝 src/Core/Exceptions/UserAndMasterKeysNullException.cs (+0 -0)
src/Core/Exceptions/UserKeyNullException.cs (+12 -0)
📝 src/Core/Models/Domain/AuthResult.cs (+4 -1)
📝 src/Core/Services/ApiService.cs (+1 -1)
📝 src/Core/Services/AuthService.cs (+7 -1)
📝 src/Core/Services/CryptoService.cs (+8 -3)
📝 src/Core/Services/KeyConnectorService.cs (+6 -4)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

When a TDE user had their password reset by an admin, the UpdateTempPassword page would show between the SSO login and Login Options screen. This meant that if their device wasn't trusted, they didn't have a User Key to create their new password with.

This sets a ForcePasswordResetReason during the SSO login so that it can be picked up later on the tabs page and removes that navigation from the SSO page.

Other changes

  • This bug was hidden by the EncryptUserKeyWithMasterKeyAsync method creating a new User Key. Since this is too dangerous I've made it explicitly have to be created before passing in.
  • Fixed a key connector bug where we were sending the private key instead of the user key to the server
  • Deprecated ResetMasterPassword on AuthResult
  • Added comments to the navigation logic on the SSO page

Code changes

  • file.ext: Description of what was changed and why

Screenshots

https://github.com/bitwarden/mobile/assets/24985544/ed493b0e-81c1-4a7e-a618-14c2c2857b43

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2694 **Author:** [@jlf0dev](https://github.com/jlf0dev) **Created:** 8/16/2023 **Status:** ✅ Merged **Merged:** 8/16/2023 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `feature/pm-1029-tde-login` ← **Head:** `pm-3462-handle-force-password-reset` --- ### 📝 Commits (6) - [`a4acef8`](https://github.com/bitwarden/android/commit/a4acef8586bfff0d1c9ed19b226c3b5eeea04419) [PM-3462] Handle force password reset on mobile with TDE - [`fc1bad3`](https://github.com/bitwarden/android/commit/fc1bad3c436cc91106bc2bc67b848c5256470bfd) [PM-3462] update references to refactored crypto method - [`24109b5`](https://github.com/bitwarden/android/commit/24109b52c216734ad77b01c0eee2aa940d985142) Merge branch 'feature/pm-1029-tde-login' into pm-3462-handle-force-password-reset - [`5a408a4`](https://github.com/bitwarden/android/commit/5a408a44b94d1f7f9aee59c1ba245c2638781944) [PM-3462] Update TwoFactorPage login logic - [`2908ba5`](https://github.com/bitwarden/android/commit/2908ba59477a8f03e54e8187a09fa7b01052cc95) [PM-3462] Added pending admin request check to TwoFactorPage - [`2c07569`](https://github.com/bitwarden/android/commit/2c07569f72ce40777f0fb5fdacab0a3078a90701) [PM-3462] Added new exception types for null keys ### 📊 Changes **14 files changed** (+129 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Accounts/LoginSsoPageViewModel.cs` (+27 -23) 📝 `src/App/Pages/Accounts/RegisterPageViewModel.cs` (+4 -1) 📝 `src/App/Pages/Accounts/SetPasswordPageViewModel.cs` (+2 -1) 📝 `src/App/Pages/Accounts/TwoFactorPageViewModel.cs` (+44 -19) 📝 `src/Core/Abstractions/IApiService.cs` (+1 -1) 📝 `src/Core/Abstractions/ICryptoService.cs` (+1 -1) ➕ `src/Core/Exceptions/MasterKeyNullException.cs` (+12 -0) 📝 `src/Core/Exceptions/UserAndMasterKeysNullException.cs` (+0 -0) ➕ `src/Core/Exceptions/UserKeyNullException.cs` (+12 -0) 📝 `src/Core/Models/Domain/AuthResult.cs` (+4 -1) 📝 `src/Core/Services/ApiService.cs` (+1 -1) 📝 `src/Core/Services/AuthService.cs` (+7 -1) 📝 `src/Core/Services/CryptoService.cs` (+8 -3) 📝 `src/Core/Services/KeyConnectorService.cs` (+6 -4) </details> ### 📄 Description ## Type of change - [x] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> When a TDE user had their password reset by an admin, the `UpdateTempPassword` page would show between the SSO login and Login Options screen. This meant that if their device wasn't trusted, they didn't have a User Key to create their new password with. This sets a `ForcePasswordResetReason` during the SSO login so that it can be picked up later on the tabs page and removes that navigation from the SSO page. Other changes - This bug was hidden by the `EncryptUserKeyWithMasterKeyAsync` method creating a new User Key. Since this is too dangerous I've made it explicitly have to be created before passing in. - Fixed a key connector bug where we were sending the private key instead of the user key to the server - Deprecated `ResetMasterPassword` on `AuthResult` - Added comments to the navigation logic on the SSO page ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **file.ext:** Description of what was changed and why ## Screenshots <!--Required for any UI changes. Delete if not applicable--> https://github.com/bitwarden/mobile/assets/24985544/ed493b0e-81c1-4a7e-a618-14c2c2857b43 ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-11 02:30:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#9887