1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-15 23:40:48 -05:00

466 Commits

Author SHA1 Message Date
Jared Snider
a421d334a4
PM-20532 - SendAccessGrantValidator.cs - integrate call to sendAuthenticationQuery 2025-05-29 17:10:51 -04:00
Jared Snider
0f8d11c124
PM-20532 - Update ProfileService.cs to add docs + add send client handling. 2025-05-29 17:10:04 -04:00
Jared Snider
086b2d4e01
Merge remote-tracking branch 'origin/make-client-retrieval-more-extensible' into auth/pm-20532/tech-breakdown-poc-token-based-send-authn-and-authz 2025-05-29 12:38:08 -04:00
Jared Snider
194ca91c16
Merge remote-tracking branch 'origin/make-client-retrieval-more-extensible' into auth/pm-20532/tech-breakdown-poc-token-based-send-authn-and-authz 2025-05-29 12:34:42 -04:00
Jared Snider
3213360760
PM-20532 - ProfileService.cs - add todo to test. 2025-05-29 12:24:56 -04:00
Jared Snider
cd6fd1bac9
Merge branch 'main' into make-client-retrieval-more-extensible 2025-05-29 12:22:07 -04:00
Todd Martin
fe6181f55f
fix(identity): [PM-21975] Add Security Stamp claim to persisted grant
* Added Security Stamp claim to refresh_token

* Linting

* Added better comments.

* Added clarification to naming of new method.

* Updated comments.

* Added more comments.

* Misspelling
2025-05-28 16:44:18 -04:00
Jared Snider
9976699a4e
PM-20532 - WIP on SendAccessGrantValidator.cs 2025-05-23 16:40:36 -04:00
Jared Snider
e4d5d6d5c4
PM-20532 - WIP 2025-05-22 16:07:52 -04:00
Todd Martin
fad91d8614
fix(captcha): [PM-21707] Add back captchaBypassToken stub value 2025-05-16 15:11:28 -04:00
Patrick-Pimentel-Bitwarden
8d2629fe58
Auth/pm 17111/add browser to list of approving clients (#5825)
* refactor(update-auth-approving-clients): [PM-17111] Add Browser to List of Approving Clients - Refactored how it works to fit different priorities.
2025-05-16 09:50:32 -04:00
bitwarden-charlie
67f745ebc4
chore/SRE-583 Deprecate usage of Auth-Email Header (#5709)
* chore/SRE-583 Deprecate usage of Auth-Email Header

* SRE-583 cleanup function and references

* SRE-583 cleanup tests

---------

Co-authored-by: sneakernuts <671942+sneakernuts@users.noreply.github.com>
2025-05-16 07:45:04 -06:00
Jared Snider
ad5ea39e4b
PM-20532 - Identity - ServiceCollectionExtensions.cs - register Send ExtensionGrantValidator. 2025-05-15 22:40:08 -04:00
Jared Snider
c7603e71a5
PM-20532 - SendAccessGrantValidator - WIP 2025-05-15 22:39:19 -04:00
Jared Snider
e26b29f70e
PM-20532 - (1) Move ApiClient into new StaticClients folder (2) Create SendClientBuilder as don't need to use inheritance w/ client (3) Register new SendClient using builder in StaticClientStore (4) StaticClientStore - update name of clients list to not be ApiClients and instead just be Clients. 2025-05-15 22:27:44 -04:00
Patrick-Pimentel-Bitwarden
dd2ea41b74
Auth/pm 17111/add browser to list of approving clients (#5792)
* feat(update-auth-approving-clients): [PM-17111] Add Browser to List of Approving Clients - Initial changes.

* feat(update-auth-approving-clients): [PM-17111] Add Browser to List of Approving Clients - Updated tests.

* test(update-auth-approving-clients): [PM-17111] Add Browser to List of Approving Clients - Strengthened tests.
2025-05-13 15:43:11 -04:00
Justin Baur
78a9471dac
Use preferred prefix for API keys 2025-05-13 12:47:21 -04:00
Ike
ead5bbdd2a
[PM-21281] Email TOTP sent twice when user only has Email MFA enabled (#5782)
* fix: addressed bug where email token is sent twice,

* test: updating tests to have correct DI and removing test for automatic email of TOTP.
2025-05-09 12:13:01 -04:00
Ike
3f95513d11
[PM-19029][PM-19203] Addressing UserService tech debt around ITwoFactorIsEnabledQuery (#5754)
* fix : split out the interface from the TwoFactorAuthenticationValidator into separate file.
* fix: replacing IUserService.TwoFactorEnabled with ITwoFactorEnabledQuery
* fix: combined logic for both bulk and single user look ups for TwoFactorIsEnabledQuery.
* fix: return two factor provider enabled on CanGenerate() method.

* tech debt: modfifying MFA providers to call the database less to validate if two factor is enabled. 
* tech debt: removed unused service from AuthenticatorTokenProvider

* doc: added documentation to ITwoFactorProviderUsers
* doc: updated comments for TwoFactorIsEnabled impl

* test: fixing tests for ITwoFactorIsEnabledQuery
* test: updating tests to have correct DI and removing test for automatic email of TOTP.
* test: adding better test coverage
2025-05-09 11:39:57 -04:00
Todd Martin
80e7a0afd6
chore(captcha): [PM-15162] Remove captcha enforcement and issuing of bypass token
* Remove captcha enforcement and issuing/verification of bypass token

* Removed more captcha logic.

* Removed logic to enforce failed login attempts

* Linting.

* Fixed order of initialization.

* Fixed merge conflicts

* Renamed registration finish response for clarity

* Remove unnecessary mailService references.
2025-05-09 10:44:38 -04:00
Todd Martin
3989e3b26b
chore(feature-flag): [PM-8671] Remove new-device-verification feature flag
* Completed grouping of feature flags by team.

* Completed grouping feature flags by team.

* Remove email delay feature flag

* Removed feature flag

* Fixed reference.

* Remove flag after merge.

* Removed flag from server.

* Removed feature flag from server

* Remove new device verification feature flag.

* Removed unnecessary using.

* Remove feature flag from Constants
2025-05-09 09:37:16 -04:00
Alex Morask
c9b6e5de86
[PM-20084] [PM-20086] Add TrialLength parameter to trial initiation endpoint and email (#5770)
* Add trial length parameter to trial initiation endpoint and email

* Add feature flag that pegs trial length to 7 when disabled

* Add optionality to Identity

* Move feature service injection to identity accounts controller
2025-05-08 10:43:19 -04:00
Justin Baur
1228fe51c8
Resolve auth warnings (#5784) 2025-05-08 07:49:16 -04:00
Justin Baur
03820b4fba
Add docs and remove TODO comments 2025-05-07 15:11:35 -04:00
Justin Baur
7e5c4b3922
Format 2025-04-29 10:38:15 -04:00
Justin Baur
c699df0b54
Fix namespaces after merge 2025-04-29 10:31:55 -04:00
Justin Baur
f05965529e
Merge remote-tracking branch 'origin/main' into make-client-retrieval-more-extensible 2025-04-29 10:19:41 -04:00
Justin Baur
95a2b80ebb
Make Identity internals visible to its unit tests 2025-04-29 07:04:18 -04:00
Justin Baur
a8083bc008
Fix Debug assertion 2025-04-29 07:03:55 -04:00
Rui Tomé
722fae81b3
[PM-18237] Add RequireSsoPolicyRequirement (#5655)
* Add RequireSsoPolicyRequirement and its factory to enforce SSO policies

* Enhance WebAuthnController to support RequireSsoPolicyRequirement with feature flag integration. Update tests to validate behavior when SSO policies are applicable.

* Integrate IPolicyRequirementQuery into request validators to support RequireSsoPolicyRequirement. Update validation logic to check SSO policies based on feature flag.

* Refactor RequireSsoPolicyRequirementFactoryTests to improve test coverage for SSO policies. Add tests for handling both valid and invalid policies in CanUsePasskeyLogin and SsoRequired methods.

* Remove ExemptStatuses property from RequireSsoPolicyRequirementFactory to use default values from BasePolicyRequirementFactory

* Restore ValidateRequireSsoPolicyDisabledOrNotApplicable

* Refactor RequireSsoPolicyRequirement to update CanUsePasskeyLogin and SsoRequired properties to use init-only setters

* Refactor RequireSsoPolicyRequirementFactoryTests to enhance test clarity

* Refactor BaseRequestValidatorTests to improve test clarity

* Refactor WebAuthnController to replace SSO policy validation with PolicyRequirement check

* Refactor BaseRequestValidator to replace SSO policy validation with PolicyRequirement check

* Refactor WebAuthnControllerTests to update test method names and adjust policy requirement checks

* Add tests for AttestationOptions and Post methods in WebAuthnControllerTests to validate scenario where SSO is not required

* Refactor RequireSsoPolicyRequirement initialization

* Refactor SSO requirement check for improved readability

* Rename test methods in RequireSsoPolicyRequirementFactoryTests for clarity on exempt status conditions

* Update RequireSsoPolicyRequirement to refine user status checks for SSO policy requirements
2025-04-23 15:43:36 +01:00
Todd Martin
465ec08f3a
fix(sso): Revert [deps] Auth: Update Duende.IdentityServer to 7.1.0
This reverts commit 4c5bf495f31f42036d492b088535b28590037aa1.
2025-04-22 10:02:47 -04:00
Justin Baur
1a15e7a51d
Formatting 2025-04-18 13:25:36 -04:00
Justin Baur
7002e6138d
Add DynamicClientStore 2025-04-18 13:12:10 -04:00
Ike
1399b1417e
PM-6675 - Remove old registration endpoint (#5585)
* feat : remove old registration endpoint

* fix: update integration test user registration to match current registration; We need to keep the IRegistrationCommand.RegisterUser method to JIT user.

* fix: updating accounts/profile tests to match current implementations
2025-04-16 15:46:49 -04:00
Todd Martin
8beefbb417
[PM-19685] Remove email delay feature flag (#5622)
* Remove email delay feature flag

* Fixed reference.

* Removed field from old registration method
2025-04-07 21:36:08 -04:00
Todd Martin
d3f8a99fa6
[PM-18175] Remove flag check for 2FA recovery code login (#5513)
* Remove server-side flagging

* Linting

* Linting.
2025-03-17 16:20:51 -04:00
Ike
abfdf6f5cb
Revert "[PM-18944] Update error response from invalid OTP" (#5504)
* Revert "[PM-18944] Update error response from invalid OTP (#5485)"

This reverts commit 1b90bfe2a114e73b583100e955e57ac48b9733b9.
2025-03-17 12:37:34 -04:00
Ike
1b90bfe2a1
[PM-18944] Update error response from invalid OTP (#5485)
* fix(newDeviceVerification): updated error response from invalid OTP
2025-03-11 17:01:50 -04:00
Kyle Spearrin
8354929ff1
[PM-18608] Don't require new device verification on newly created accounts (#5440)
* Limit new device verification to aged accounts

* set user creation date context for test

* formatting
2025-02-27 11:01:40 -05:00
renovate[bot]
4c5bf495f3
[deps] Auth: Update Duende.IdentityServer to 7.1.0 (#5293)
* [deps] Auth: Update Duende.IdentityServer to 7.1.0

* fix(identity): fixing name space for Identity 7.1.0 update

* fix: formatting

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ike Kottlowski <ikottlowski@bitwarden.com>
2025-02-27 09:54:28 -05:00
Ike
b00f11fc43
[PM-17645] : update email for new email multi factor tokens (#5428)
* feat(newDeviceVerification) : Initial update to email

* fix : email copying over extra whitespace when using keyboard short cuts

* test : Fixing tests for new device verificaiton email format
2025-02-21 11:12:31 -05:00
Patrick-Pimentel-Bitwarden
ac6bc40d85
feat(2FA): [PM-17129] Login with 2FA Recovery Code
* feat(2FA): [PM-17129] Login with 2FA Recovery Code - Login with Recovery Code working.

* feat(2FA): [PM-17129] Login with 2FA Recovery Code - Feature flagged implementation.

* style(2FA): [PM-17129] Login with 2FA Recovery Code - Code cleanup.

* test(2FA): [PM-17129] Login with 2FA Recovery Code - Tests.
2025-02-13 15:51:36 -05:00
Maciej Zieniuk
ae9bb427a1
[PM-10600] Push notification creation to affected clients (#4923)
* PM-10600: Notification push notification

* PM-10600: Sending to specific client types for relay push notifications

* PM-10600: Sending to specific client types for other clients

* PM-10600: Send push notification on notification creation

* PM-10600: Explicit group names

* PM-10600: Id typos

* PM-10600: Revert global push notifications

* PM-10600: Added DeviceType claim

* PM-10600: Sent to organization typo

* PM-10600: UT coverage

* PM-10600: Small refactor, UTs coverage

* PM-10600: UTs coverage

* PM-10600: Startup fix

* PM-10600: Test fix

* PM-10600: Required attribute, organization group for push notification fix

* PM-10600: UT coverage

* PM-10600: Fix Mobile devices not registering to organization push notifications

We only register devices for organization push notifications when the organization is being created. This does not work, since we have a use case (Notification Center) of delivering notifications to all users of organization. This fixes it, by adding the organization id tag when device registers for push notifications.

* PM-10600: Unit Test coverage for NotificationHubPushRegistrationService

Fixed IFeatureService substitute mocking for Android tests.
Added user part of organization test with organizationId tags expectation.

* PM-10600: Unit Tests fix to NotificationHubPushRegistrationService after merge conflict

* PM-10600: Organization push notifications not sending to mobile device from self-hosted.

Self-hosted instance uses relay to register the mobile device against Bitwarden Cloud Api. Only the self-hosted server knows client's organization membership, which means it needs to pass in the organization id's information to the relay. Similarly, for Bitwarden Cloud, the organizaton id will come directly from the server.

* PM-10600: Fix self-hosted organization notification not being received by mobile device.

When mobile device registers on self-hosted through the relay, every single id, like user id, device id and now organization id needs to be prefixed with the installation id. This have been missing in the PushController that handles this for organization id.

* PM-10600: Broken NotificationsController integration test

Device type is now part of JWT access token, so the notification center results in the integration test are now scoped to client type web and all.

* PM-10600: Merge conflicts fix

* merge conflict fix
2025-02-12 16:46:30 +01:00
Justin Baur
e01cace189
Turn on TreatWarningsAsError (#5384)
* Turn on TreatWarningsAsError for Release build

- Break Api intentionally

* Fix Api

* Treat warnings as errors no matter the configuration
2025-02-11 08:49:14 -05:00
cyprain-okeke
0337300eac
[PM-15625]Disable trial/send-verification-email endpoint for self-host (#5265)
* endpoint is shut off for self-hosted env

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Fix the reference issues

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2025-02-04 15:27:58 +01:00
Todd Martin
e43a8011f1
[PM-17709] Send New Device Login email for all new devices (#5340)
* Send New Device Login email regardless of New Device Verification

* Adjusted tests

* Linting

* Clarified test names.
2025-01-31 10:46:09 -05:00
Patrick-Pimentel-Bitwarden
ed14f28644
fix(email-feature-flags): [PM-7882] Email Verification - Added back in needed import. (#5268) 2025-01-15 11:04:51 -05:00
Todd Martin
a3e3c7f96c
fix: Added web browser clients to allowed approving device types 2025-01-15 09:45:13 -05:00
Patrick-Pimentel-Bitwarden
34ce480568
fix(email-feature-flags): [PM-7882] Email Verification - Removed the email feature flag from server. (#5232) 2025-01-15 09:31:59 -05:00
Kyle Spearrin
aa0b35a345
[PM-15608] Create more KDF defaults for prelogin (#5122)
* kdf defaults on null map to email hash

* cleanup code. add some randomness as well

* remove null check

* fix test

* move to private method

* remove random options

* tests for random defaults

* SetDefaultKdfHmacKey for old test
2025-01-10 15:54:53 -05:00