1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00
Commit Graph

255 Commits

Author SHA1 Message Date
Justin Baur
07dc8808b2 Use sync option to skip token refresh after login (#14581) 2025-05-14 14:34:34 -04:00
Todd Martin
4c68f61d47 feat(CLI-SSO-Login): [Auth/PM-21116] CLI - SSO Login - Add SSO Org Identifier option (#14605)
* Add --identifier option for SSO on CLI

* Add option for identifier

* Moved auto-submit after the setting of client arguments

* Adjusted comment

* Changed to pass in as SSO option

* Renamed to orgSsoIdentifier for clarity

* Added more changes to orgSsoIdentifier.
2025-05-13 10:58:48 -04:00
Patrick-Pimentel-Bitwarden
0b0397c3f0 fix(enums-eslint): Enum Rule for ESLint (#14650)
* fix(enums-eslint): Enum Rule for ESLint - Added enums in the warnings for eslint.

* fix(enums-eslint): Enum Rule for ESLint - Updated to error in both places for enums.

* fix(enums-eslint): Enum Rule for ESLint - Added new eslint plugin for warning on enums.

* fix(enums-eslint): Enum Rule for ESLint - Changed based on suggestion.

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>

* refactor(browser-platform-utils): Remove Deprecation and Fix Code - Changed usages of firefox to private and moved the usages to the preferred public method and removed the deprecations.

* fix(enums-eslint): Enum Rule for ESLint - Updated to error and added disable rules for all other places.

* fix(enums-eslint): Enum Rule for ESLint - Undid other changes by accident
2025-05-13 10:07:38 -04:00
Todd Martin
b8074a6f73 chore(feature-flag): Remove pm-9112-device-approval-persistence (#14718) 2025-05-12 15:18:02 -04:00
Todd Martin
eed18c9294 chore(view-cache): [PM-21154] Move view-cache its own feature package and adjust imports
* Moved view-cache services to directory

* Fixed DI for browser extension.

* Fixed tests.
2025-05-12 14:26:52 -04:00
Todd Martin
4191bb9533 chore(captcha): [PM-15162] Remove handling of captcha enforcement and bypass token
* Removed captcha references.

* Removed connectors from webpack

* Fixed extra parameter.

* Resolve merge conflicts.

* Fixed extra argument.

* Fixed failing tests.

* Fixed failing test.

* Accessibility cookie cleanup

* Cleaned up accessibility component.

* Deleted old registration endpoint

* Remove unused register request object.

* Fixed merge error that changed font family.

* Fixed formatting from merge.

* Linting
2025-05-09 10:44:11 -04:00
Alec Rippberger
3030eb7552 [PM-19212] Consolidate password set routing to AuthGuard using ForceSetPasswordReason (#14356)
* Consolidates component routing, removing routing to update-temp-password from components. All routing to update-temp-password should happen in the AuthGuard now.

---------

Co-authored-by: Jared Snider <jsnider@bitwarden.com>
Co-authored-by: Todd Martin <tmartin@bitwarden.com>
2025-05-08 11:24:52 -05:00
Bernd Schoolmann
af40ff26a2 [PM-21001] Move auth code to new encrypt service interface (#14542)
* Add new encrypt service functions

* Undo changes

* Cleanup

* Fix build

* Fix comments

* Move auth code to new encrypt service interface
2025-05-05 16:50:06 +02:00
Thomas Avery
d43e4757df [PM-7604] Require target UserID for KdfConfigService (#14380)
* Require userId for KdfConfigService

* Update auth team callers

* Update tools team callers
2025-04-29 17:25:27 -05:00
Todd Martin
29d0e74e23 fix(login): [PM-20587] Fix unawaited calls to set login email
* Await setting login email in state.

* Changed to get email state within the component.

* Added null filter

* PM-20587 - LoginViaAuthRequest component - update initStandardAuthRequestFlow to correctly retrieve data from active account.

---------

Co-authored-by: Jared Snider <jsnider@bitwarden.com>
2025-04-29 12:00:02 -04:00
Bernd Schoolmann
fd0db40f79 [PM-20492] Refactor symmetric keys - remove key buffer representation, migrate consumers to .toEncoded() (#14371)
* Refactor encrypt service to expose key wrapping

* Fix build

* Undo ts strict removal

* Fix wrong method being used to encrypt key material

* Rename parameters and remove todo

* Add summary to encrypt

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/abstractions/encrypt.service.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Add tests for unhappy paths

* Add test coverage

* Add links

* Remove direct buffer access

* Fix build on cli

---------

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
2025-04-25 19:26:39 +02:00
Alec Rippberger
ab7016fd6b feat(auth): implement view data persistence in 2FA flows
Add persistence to two-factor authentication in the extension login flow. Implements caching of form state to improve user experience when navigating between authentication steps. Includes feature flag for controlled rollout.
2025-04-25 10:02:54 -05:00
Alec Rippberger
71e720e945 fix(auth): clarify 2FA security key verification text
Updates user interface text to improve clarity when prompting for security key verification during two-factor authentication.

Ref: PM-20055
2025-04-22 23:09:07 -05:00
Bernd Schoolmann
e231286f37 [PM-19731] Refactor encrypt service to expose key wrapping (#14080)
* Refactor encrypt service to expose key wrapping

* Fix build

* Undo ts strict removal

* Fix wrong method being used to encrypt key material

* Rename parameters and remove todo

* Add summary to encrypt

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/abstractions/encrypt.service.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Add tests for unhappy paths

* Add test coverage

* Add links

---------

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
2025-04-22 13:56:39 +00:00
Bernd Schoolmann
43b1f55360 [PM-18697] Remove old symmetric key representations in symmetriccryptokey (#13598)
* Remove AES128CBC-HMAC encryption

* Increase test coverage

* Refactor symmetric keys and increase test coverage

* Re-add type 0 encryption

* Fix ts strict warning

* Remove old symmetric key representations in symmetriccryptokey

* Fix desktop build

* Fix test

* Fix build

* Update libs/common/src/key-management/crypto/services/web-crypto-function.service.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/node/src/services/node-crypto-function.service.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Undo changes

* Remove cast

* Undo changes to tests

* Fix linting

* Undo removing new Uint8Array in aesDecryptFastParameters

* Fix merge conflicts

* Fix test

* Fix another test

* Fix test

---------

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
2025-04-21 14:57:26 +00:00
Bryan Cunningham
cbab354c0e Hide bit-icon component from screen readers by default (#14295)
* adds aria-hidden to bit-icon when no aria-label provided

* add ariaLabel to logo svg usages

* add ariaLabel documentation

* default ariaLable value to undefined

* add logo label to translations

* adds i18n pipe to component

* Add binding to example docs
2025-04-18 10:38:19 -04:00
Todd Martin
88638c09b3 Fix(login): [PM-20287] Initialize login email state when email is remembered 2025-04-16 19:58:31 -04:00
Bernd Schoolmann
b09305577f [PM-19603] Change asymmetric interface to only allow key encapsulation (#14046)
* Change asymmetric interface to only allow key encapsulation

* Fix naming

* Clean up naming

* Update libs/common/src/key-management/crypto/abstractions/encrypt.service.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/services/encrypt.service.implementation.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Update libs/common/src/key-management/crypto/abstractions/encrypt.service.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Fix test

---------

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
2025-04-15 16:39:02 +02:00
Todd Martin
356a20a4bc fix(login): [PM-20174] Do not show validation errors on email input on LoginComponent
* Do not show validation errors on input

* Removed one-line function.

* Removed awaits
2025-04-14 15:55:01 -04:00
Todd Martin
f7934b98c6 fix(login): [PM-11502] Support Remember Email option consistently
* Moved saving of SSO email outside of browser/desktop code

* Clarified comments.

* Tests

* Refactored login component services to manage state

* Fixed input on login component

* Fixed tests

* Linting

* Moved web setting in state into web override

* updated tests

* Fixed typing.

* Fixed type safety issues.

* Added comments and renamed for clarity.

* Removed method parameters that weren't used

* Added clarifying comments

* Added more comments.

* Removed test that is not necessary on base

* Test cleanup

* More comments.

* Linting

* Fixed test.

* Fixed base URL

* Fixed typechecking.

* Type checking

* Moved setting of email state to default service

* Added comments.

* Consolidated SSO URL formatting

* Updated comment

* Fixed reference.

* Fixed missing parameter.

* Initialized service.

* Added comments

* Added initialization of new service

* Made email optional due to CLI.

* Fixed comment on handleSsoClick.

* Added SSO email persistence to v1 component.

* Updated login email service.

* Updated setting of remember me

* Removed unnecessary input checking and rearranged functions

* Fixed name

* Added handling of Remember Email to old component for passkey click

* Updated v1 component to persist the email on Continue click

* Fix merge conflicts.

* Merge conflicts in login component.

* Persisted login email on v1 browser component.

* Merge conflicts

* fix(snap) [PM-17464][PM-17463][PM-15587] Allow Snap to use custom callback protocol

* Removed Snap from custom protocol workaround

* Fixed tests.

* Updated case numbers on test

* Resolved PR feedback.

* PM-11502 - LoginEmailSvcAbstraction - mark methods as abstract to satisfy strict ts.

* Removed test

* Changed to persist on leaving fields instead of button click.

* Fixed type checking.

---------

Co-authored-by: Bernd Schoolmann <mail@quexten.com>
Co-authored-by: Jared Snider <jsnider@bitwarden.com>
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
2025-04-10 18:58:49 -04:00
Bernd Schoolmann
5a1b0744f0 [PM-17665] Move cryptofunction service to km (#13285)
* Move cryptofunction service to km

* Fix formatting

* Fix import

* Fix build on desktop

* Fix build on browser and tests
2025-04-10 11:09:35 +02:00
rr-bw
a4040b6b6b refactor(set-change-password): [Auth/PM-17649] Move CompareInputs Validator (#14173)
This PR
- Moves the `compareInputs` validator to `libs/auth` (with some minor updates to the validator)
- Adds unit tests for `compareInputs`
- Removes the deprecated input validators from `InputsFieldMatch` along with the `inputs-field-match.validator.ts` file
2025-04-08 12:42:41 -07:00
rr-bw
81350a2ee1 Revert "refactor(set-change-password): [Auth/PM-17649] Move and test compareI…" (#14171)
This reverts commit ecb4b2d0b7.
2025-04-07 18:34:35 -07:00
rr-bw
ecb4b2d0b7 refactor(set-change-password): [Auth/PM-17649] Move and test compareInputs validator (#13553)
- Move the `compareInputs` validator to `libs/auth`
- Add tests for the `compareInputs` validator
- Delete the deprecated `InputsFieldMatch` class (inputs-field-match.validator.ts)
2025-04-07 15:04:24 -07:00
rr-bw
2267876860 refactor(set-change-password): [Auth/PM-18206] Update InputPasswordComponent to handle multiple flows (#13745)
Updates the InputPasswordComponent so that it can eventually be used in multiple set/change password scenarios.

Most importantly, this PR adds an InputPasswordFlow enum and @Input so that parent components can dictate which UI elements to show.
2025-04-07 11:58:50 -07:00
Patrick-Pimentel-Bitwarden
1af8fe2012 feat(device-approval-persistence): [PM-19380] Device Approval Persistence (#13958)
* feat(device-approval-persistence): [PM-19380] Device Approval Persistence - Added lookup on standard auth requests.

* fix(device-approval-persistence): [PM-19380] Device Approval Persistence - Fixed issue with null value trying to be parsed from the fromJSON function.




---------

Co-authored-by: Todd Martin <tmartin@bitwarden.com>
2025-04-04 15:44:48 -04:00
Bernd Schoolmann
1450a033b3 [PM-19469] Add logs for unlock time (#13972)
* Add logs for unlock time

* Undo local flag override

* Update message

* Update messages

* Fix build on chrome
2025-04-02 23:19:53 +02:00
Will Martin
76cb3fd38d [CL-623] export CDK dialog deps from libs/components (#14074)
* add cdk dialog deps to CL dialog barrel file

* find and replace cdk dialog import

* run prettier
2025-04-02 15:08:38 -04:00
Bernd Schoolmann
22039d038d [PM-3475] Remove deprecated keys (#13266)
* Remove deprecated keys

* Fix cli build

* Fix build
2025-03-31 16:58:02 +02:00
Jason Ng
66a914badf [PM-19654] add hideIcon option to extension anon layout (#14045) 2025-03-28 15:50:30 -04:00
Brandon Treston
0fd01ed7ee [PM-18566] Wire up vNextPolicyService for Clients (#13678)
* wire up vNext impl

* wire up vNextPolicyService for browser

* wire up vNextPolicyService for desktop

* wire up vNextPolicyService for cli

* fix test

* fix missed caller

* cleanup

* fix missing property assignment

* fix QA bug for PM-19205

* fix QA bug for PM-19206

* fix QA bug for pm-19228

* cleanup
2025-03-25 11:30:47 -04:00
Patrick-Pimentel-Bitwarden
841e5980d7 fix(device-approval-login): [PM-19379] Approve Device Login - Fix the call so that it works when not in a TDE scenario. (#13934) 2025-03-21 10:22:37 -04:00
Patrick-Pimentel-Bitwarden
2e0c991f83 fix(device-approval-persistence): [PM-9112] Device Approval Persistence (#13680)
* feat(device-approval-persistence): [PM-9112] Device Approval Persistence - Added in view cache data needed to persist the approval process. Clears after 2 minutes.
2025-03-19 19:26:10 +00:00
Thomas Avery
a11536a424 [PM-17668] Move DeviceTrustService to KM ownership (#13194)
* move DeviceTrustService to KM ownership

* update codecov
2025-03-17 12:02:44 -05:00
Thomas Avery
81335978d8 [PM-17669] Move MasterPasswordService to KM (#13148)
* Move MasterPasswordService to KM
2025-03-13 13:29:27 -05:00
Thomas Avery
7e96b7a9a6 [PM-17670] Move KeyConnectorService to KM ownership (#13277)
* Move KeyConnectorService to KM ownership

* Add to codecov

* Move key connector request models
2025-03-13 09:46:01 -05:00
Jared Snider
cff14ffea3 fix(Extension2FAWebAuthn): [Auth/PM-19086] Read webauthn response off correct property (#13796) 2025-03-13 09:39:04 -04:00
rr-bw
e268055dc1 feature(set-change-password): [Auth/PM-17648] Create MasterPasswordApiService (#13552)
Creates a MasterPasswordApiService to house our API calls related to setting and changing a master password.
2025-03-12 11:33:44 -07:00
Patrick-Pimentel-Bitwarden
3b9be21fd7 fix(auth-routing): [PM-19018] SSO TDE Routing Fix - Fixed routing logic. (#13778)
* fix(auth-routing): [PM-19018] SSO TDE Routing Fix - Fixed routing logic.

* PM-19018 - TwoFactorAuthTests - remove tests that are no longer applicable as 2FA comp isn't responsible for setting admin account recovery flag into state.

* PM-19018 - LoginStrategyTests - add test for processing forcePasswordReset response

---------

Co-authored-by: Jared Snider <jsnider@bitwarden.com>
2025-03-10 21:20:11 -04:00
rr-bw
0568a09212 refactor(device-trust-toasts): [Auth/PM-11225] Refactor Toasts from Auth Services (#13665)
Refactor toast calls out of auth services. Toasts are now triggered by an observable emission that gets picked up by an observable pipeline in a new `DeviceTrustToastService` (libs/angular). That observable pipeline is then subscribed by by consuming the `AppComponent` for each client.
2025-03-10 12:17:46 -07:00
rr-bw
d943f53477 refactor(routing): [Auth/PM-18783] Remove Unauth UI route swapping for all components except 2FA (#13645)
Removes `unauthUiRefreshSwap()` from all routing modules for all refreshed components except for 2FA. This does not remove the legacy components themselves, just the routing to them.

---------

Co-authored-by: Todd Martin <tmartin@bitwarden.com>
2025-03-10 11:12:02 -07:00
Thomas Rittson
ef72f513b1 eslint: report unused disable directives (#13463)
Remove any unused disable directives and FIXMEs in our code
2025-03-10 09:33:08 -04:00
Todd Martin
895b36a3d8 [PM-18945] Add CLI as valid SSO client (#13723)
* Added CLI as valid SSO client.

* Updated SsoClientType
2025-03-07 18:30:28 -05:00
Ike
c739a884b4 [PM-15015] Adding Request Country Name to auth requests approval dialog (#13718)
* feat(pm-15015) : 
  - Adding `requestCountryName` to auth requests dialogs, and response models. 
  - Updated i18n messages.json in Web, Browser, and Desktop to include "Location" translation.
2025-03-07 18:03:13 -05:00
Jared Snider
264ceaa82a fix(NewDeviceVerification): [Auth/PM-18641] Show translated invalid code error on enter keypress (#13740) 2025-03-07 12:56:21 -05:00
Jared Snider
5588e1a1a1 fix(auth): Auth/pm 18836 - UI Refresh - Chrome extension - WebAuthn 2FA revert inline iframe for chromium (#13709)
* PM-18836 - (1) Extension Two Factor Webauthn - revert supporting inline webauthn 2fa as it doesn't work outside of local still (2) Extension 2FA Webauthn comp - add log of webauthn errors to help diagnose future issues

* PM-18836 - Extension - Services module - ExtensionTwoFactorAuthWebAuthnComponentService - remove unused dep
2025-03-06 11:49:49 -08:00
Jared Snider
92f027af5e fix(LoginComp + LoginStrategies): [Auth/PM-18654] Refreshed UI - Desktop TDE JIT provisioned user creation errors with missing org SSO id (#13619)
* PM-18654 - State Service & Login Strategy Refactor - move env seeding into login strategy so that new accounts always load w/ the correct environment

* PM-18654 - SSO Comp - just use user id from auth result

* PM-18654 - Config Service - (1) don't allow cascading calls to the renewConfig by using a private promise (2) Replace shareReplay with share configured with manual timer

* PM-18654 - LoginComponents - detail issue and possible fix

* PM-18654 - DesktopLoginV1Comp - use correct destroy hook

* PM-18654 - LoginComp - clean up no longer correct comment

* PM-18654 - New Device Verification Component - Remove unused PasswordLoginStrategy dependency

* PM-18654 - Browser Home Component - fix qParam logic

* PM-18654 - DefaultConfigService - revert changes as they aren't necessary to fix the bug.

* PM-18654 - DefaultConfigService - remove commented code

* PM-18654 - LoginStrategy - add comment

* PM-18654 - Fix login strat tests
2025-03-03 12:09:35 -05:00
Jake Fink
43f5423e78 [PM-12606] Move Vault Timeout and Vault Timeout Settings to KM (#13405)
* move vault timeout and vault timeout settings to km

* move browser vault timeout service to km

* fix cli import

* fix imports

* fix some relative imports

* use relative imports within common

* fix imports

* fix new imports

* Fix new imports

* fix spec imports
2025-02-28 09:55:03 -05:00
Jared Snider
e6aaa65563 fix(New-UI-Login-SSO): [Auth/PM-18693] LoginComp - fix form validation not showing up on SSO click (#13601) 2025-02-27 10:53:24 -05:00
Todd Martin
ec488e4f84 [PM-18664] Prevent display of Auth Request notification on triggering device (#13597)
* Send device identifier in header.

* Added null to apiUrl property for strict typing.

* Added null to apiUrl for strict typing.
2025-02-27 10:00:52 -05:00