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

[PM-11502] Support Remember Email option when using SSO authentication #13391

Draft
wants to merge 6 commits into
base: auth/pm-17751/remember-sso-email
Choose a base branch
from

Conversation

trmartin4
Copy link
Member

@trmartin4 trmartin4 commented Feb 13, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-11502

📔 Objective

The Remember Email option was not working correctly when using SSO authentication.

Previously, the Remember Email choice only took effect after authentication was complete. This necessitated a lot of extra code and complexity in the LoginEmailService in order to track the user's email, as well as whether they want to remember it (but don't remember it yet!) through the various authentication flows. The reason SSO didn't work is because that particular flow didn't handle it correctly after login.

Rather than build on that complexity, this PR changes the underlying assumption of when the Remember Email choice takes affect. The Remember Email option now takes effect as soon as you perform some action on the Login screen. This adjustment has been verified as acceptable by Product. The choice to remember email now takes effect when:

  • Login v1
    • Click Continue
    • Click Login with Passkey (web only)
  • New Login
    • Click Continue
    • Click Login with Passkey (web only)
    • Click Login with SSO

This allowed the simplification of the LoginEmailService interface quite a bit. The LoginEmailService now has two pieces of state it manages:

  • loginEmail
    • The email address the user entered, which is always stored in memory state regardless of whether the user chose to remember their email. This is used programmatically, in code, to maintain context of the user's email address through the login process.
    • It is set with setLoginEmail and exposed via the loginEmail$ observable.
  • rememberedEmail
    • The email address that the user has chosen to remember. If the user has chosen not to remember their email, this will be null.
    • It is set with the setRememberEmailChoice method and exposed via the rememberedEmail$ observable.

📸 Screenshots

Web

Demonstrating that the remembered email persists through all operations, including SSO

web_remember_email_persists.mov

Desktop

Demonstrating that adding an account does not remember email, but logging in does

desktop_add_account_not_remembered.mov

Extension

Demonstrating that adding an account does not remember email, but logging in does

extension_not_remembered_account_add.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@trmartin4 trmartin4 changed the base branch from main to auth/pm-17751/remember-sso-email February 13, 2025 18:40
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 7.95455% with 81 lines in your changes missing coverage. Please review.

Project coverage is 35.22%. Comparing base (14f894a) to head (83e66fe).
Report is 2 commits behind head on auth/pm-17751/remember-sso-email.

Files with missing lines Patch % Lines
libs/auth/src/angular/login/login.component.ts 0.00% 55 Missing ⚠️
.../angular/src/auth/components/login-v1.component.ts 0.00% 10 Missing ⚠️
apps/web/src/app/auth/login/login-v1.component.ts 0.00% 5 Missing ⚠️
apps/browser/src/auth/popup/home.component.ts 0.00% 4 Missing ⚠️
...-verification/new-device-verification.component.ts 0.00% 3 Missing ⚠️
...s-handler/default-login-success-handler.service.ts 0.00% 2 Missing ⚠️
apps/web/src/app/auth/two-factor.component.ts 0.00% 1 Missing ⚠️
...nents/two-factor-auth/two-factor-auth.component.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##           auth/pm-17751/remember-sso-email   #13391   +/-   ##
=================================================================
  Coverage                             35.21%   35.22%           
=================================================================
  Files                                  3126     3126           
  Lines                                 92540    92507   -33     
  Branches                              16854    16845    -9     
=================================================================
- Hits                                  32586    32581    -5     
+ Misses                                57496    57469   -27     
+ Partials                               2458     2457    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Feb 13, 2025

Logo
Checkmarx One – Scan Summary & Details253d0d68-b43e-46da-94d8-babf1bc4d3c7

New Issues (4)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
HIGH CVE-2025-0995 Npm-electron-34.0.0 Vulnerable Package
HIGH CVE-2025-0996 Npm-electron-34.0.0 Vulnerable Package
HIGH CVE-2025-0997 Npm-electron-34.0.0 Vulnerable Package
HIGH CVE-2025-0998 Npm-electron-34.0.0 Vulnerable Package
Fixed Issues (536)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM Angular_Improper_Type_Pipe_Usage /apps/web/src/app/layouts/product-switcher/product-switcher.component.html: 1
MEDIUM Angular_Improper_Type_Pipe_Usage /apps/browser/src/autofill/popup/fido2/fido2-use-browser-link.component.html: 1
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 38
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 130
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1189
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1189
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1281
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 86
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 453
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 432
MEDIUM Client_Privacy_Violation /libs/vault/src/components/decryption-failure-dialog/decryption-failure-dialog.component.html: 17
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.html: 40
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.html: 50
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 705
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 695
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 704
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1281
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 698
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 500
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 696
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1264
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1264
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1194
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 518
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1097
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1283
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1265
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 590
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 718
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 606
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1068
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1097
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1097
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 506
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1282
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1282
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1265
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 690
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 689
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 688
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 687
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/background/overlay.background.ts: 686
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1263
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health-members.component.html: 55

More results are available on the CxOne platform

@trmartin4 trmartin4 marked this pull request as ready for review February 13, 2025 21:36
@trmartin4 trmartin4 requested a review from a team as a code owner February 13, 2025 21:36
@trmartin4 trmartin4 marked this pull request as draft February 14, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant