Support the "temporary item sharing" flow of the Bitwarden clients
(bitwarden/clients #23060, #23079, #23152), which shares a whole vault
item through a Send link and requires the recipient to verify an email
address with a one-time code.
Since SDK 0.2.0-main.1075 (browser and desktop 2026.10.0) the clients seal
the item in the Send and send its id in clear in metadata.itemId, which is
required (bitwarden/sdk-internal#1539, bitwarden/server#8485).
- SendType::Item (2): store only {encryptionVersion, data} and
metadata.itemId, capped at 500 kB; the item stays encrypted
client-side with the Send key. Item Sends without metadata.itemId are
rejected ("Metadata is required for item sends.").
- When the item is new or changes, the owner of the Send must be able to
share it: own item, or an organization item they can edit with
passwords visible; not deleted, not archived, not an SSH key. Missing
and forbidden items get the same "Item not found.".
- Item Sends in the earlier format, which no current client decrypts, are
left out of sync, list and get and refused at the access token. They
are not deleted; the regular purge removes them.
- Email verification without a schema change: the allowed addresses
live in the existing `sends.data` JSON (`vwAuthEmails`, stripped from
every response) and the one-time code lives in memory
(EMAIL_TOKEN_SIZE digits, valid for EMAIL_EXPIRATION_TIME, single use,
30 s resend cooldown, burned after EMAIL_ATTEMPTS_LIMIT wrong tries;
a burned code keeps the cooldown).
- Unknown addresses get the same response as allowed ones and no mail
is sent. The code is mailed in the background, so neither the timing
nor a mail server failure tells the two apart; failures are logged.
- `authType` and `emails` in the Send JSON; put_send and create_send
accept `emails` and `authType` instead of rejecting them. Keeping the
current recipients doesn't need mail, so a key rotation can't fail
halfway because email was switched off after the Send was created.
- The legacy /sends/access endpoints refuse email-protected Sends, so
older clients cannot skip the code.
- The two client feature flags (pm-34203-temporary-item-sharing,
pm-30110-sdk-sends-api) are only advertised to clients at or above
ITEM_SHARING_MIN_CLIENT_VERSION (default 2026.10.0), and Item Sends
are hidden from sync/list/get for Android and iOS (the Android app
has no fallback for unknown Send types and would fail the whole sync)
and for clients below that version.
- Each successful access logs "Send <id> opened by <email> from <ip>".
- MaybeClientVersion guard for /api/config, so requests without the
Bitwarden-Client-Version header no longer log an error.
* Add SSO functionality using OpenID Connect
Co-authored-by: Pablo Ovelleiro Corral <mail@pablo.tools>
Co-authored-by: Stuart Heap <sheap13@gmail.com>
Co-authored-by: Alex Moore <skiepp@my-dockerfarm.cloud>
Co-authored-by: Brian Munro <brian.alexander.munro@gmail.com>
Co-authored-by: Jacques B. <timshel@github.com>
* Improvements and error handling
* Stop rolling device token
* Add playwright tests
* Activate PKCE by default
* Ensure result order when searching for sso_user
* add SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION
* Toggle SSO button in scss
* Base64 encode state before sending it to providers
* Prevent disabled User from SSO login
* Review fixes
* Remove unused UserOrganization.invited_by_email
* Split SsoUser::find_by_identifier_or_email
* api::Accounts::verify_password add the policy even if it's ignored
* Disable signups if SSO_ONLY is activated
* Add verifiedDate to organizations::get_org_domain_sso_details
* Review fixes
* Remove OrganizationId guard from get_master_password_policy
* Add wrapper type OIDCCode OIDCState OIDCIdentifier
* Membership::confirm_user_invitations fix and tests
* Allow set-password only if account is unitialized
* Review fixes
* Prevent accepting another user invitation
* Log password change event on SSO account creation
* Unify master password policy resolution
* Upgrade openidconnect to 4.0.0
* Revert "Remove unused UserOrganization.invited_by_email"
This reverts commit 548e19995e141314af98a10d170ea7371f02fab4.
* Process org enrollment in accounts::post_set_password
* Improve tests
* Pass the claim invited_by_email in case it was not in db
* Add Slack configuration hints
* Fix playwright tests
* Skip broken tests
* Add sso identifier in admin user panel
* Remove duplicate expiration check, add a log
* Augment mobile refresh_token validity
* Rauthy configuration hints
* Fix playwright tests
* Playwright upgrade and conf improvement
* Playwright tests improvements
* 2FA email and device creation change
* Fix and improve Playwright tests
* Minor improvements
* Fix enforceOnLogin org policies
* Run playwright sso tests against correct db
* PKCE should now work with Zitadel
* Playwright upgrade maildev to use MailBuffer.expect
* Upgrades playwright tests deps
* Check email_verified in id_token and user_info
* Add sso verified endpoint for v2025.6.0
* Fix playwright tests
* Create a separate sso_client
* Upgrade openidconnect to 4.0.1
* Server settings for login fields toggle
* Use only css for login fields
* Fix playwright test
* Review fix
* More review fix
* Perform same checks when setting kdf
---------
Co-authored-by: Felix Eckhofer <felix@eckhofer.com>
Co-authored-by: Pablo Ovelleiro Corral <mail@pablo.tools>
Co-authored-by: Stuart Heap <sheap13@gmail.com>
Co-authored-by: Alex Moore <skiepp@my-dockerfarm.cloud>
Co-authored-by: Brian Munro <brian.alexander.munro@gmail.com>
Co-authored-by: Jacques B. <timshel@github.com>
Co-authored-by: Timshel <timshel@480s>
* Update twofactor_email.hbs subject line to avoid triggering gmail content filter
Previous subject line was triggering Google's spam blocker, breaking the 2FA setup process if a gmail SMTP server is configured. The new subject line does not (currently) run afoul of Google's filter.
* Update twofactor_email.html.hbs subject line to avoid triggering gmail content filter
Previous subject line was triggering Google's spam blocker, breaking the 2FA setup process if a gmail SMTP server is configured. The new subject line does not (currently) run afoul of Google's filter.
* Update twofactor_email.hbs
Changed "Confirmation" to "Verification" for the sake of internal consistency
* Update twofactor_email.hbs
* Update twofactor_email.html.hbs
- Updated branding for admin and emails
- Updated crates and some deprications
- Removed newline-converter because this is built-in into lettre
- Updated email templates to use a shared header and footer template
- Also trigger SMTP SSL When TLS is selected without SSL
Resolves#1641