Skip to content

Skip email entry on login when SSO is the only auth method#24

Open
IacopoSb wants to merge 1 commit intovaultwarden:v2026.4.1from
IacopoSb:feat/sso_login_graphical_fix
Open

Skip email entry on login when SSO is the only auth method#24
IacopoSb wants to merge 1 commit intovaultwarden:v2026.4.1from
IacopoSb:feat/sso_login_graphical_fix

Conversation

@IacopoSb
Copy link
Copy Markdown

@IacopoSb IacopoSb commented May 2, 2026

Why

Today, with SSO_ONLY enabled, the login page still shows the email input field and the "Remember email" checkbox, and clicking the SSO button requires entering an email even though that email is ignored by the backend (single-tenant vaultwarden uses FAKE_SSO_IDENTIFIER server-side).

Two small changes were made in libs/auth/src/angular/login/login.component.{html,ts}:

  • class="vw-email-form-field" on the <bit-form-field> wrapping the email inputs, and class="vw-remember-email" on the Remember-email <bit-form-control>. These hooks let the vaultwarden SCSS template hide both elements when sso_only=true.
  • handleSsoClick() now tolerates an empty email: if the form has no email it skips validation and proceeds. Single-tenant vaultwarden does not require an email to start the SSO flow.

Test done

  • Built locally with make full. With SSO_ENABLED=true SSO_ONLY=true and the companion vaultwarden SCSS change, the login page shows only the "Continue with SSO" button.
Screenshot 2026-05-01 163036

Adds two CSS hooks consumed by vaultwarden's SCSS template:
  - vw-email-form-field on the email <bit-form-field>
  - vw-remember-email on the Remember-email <bit-form-control>
so that vaultwarden can hide both elements when SSO_ONLY=true.

Relaxes handleSsoClick() to tolerate an empty email and proceed to the SSO
redirect anyway, since single-tenant vaultwarden uses FAKE_SSO_IDENTIFIER
server-side and does not require an email to start the flow.

Companion changes on the vaultwarden side add the SCSS rules that consume
these hooks (dani-garcia/vaultwarden#7173).
@stefan0xC
Copy link
Copy Markdown
Collaborator

stefan0xC commented May 6, 2026

that email is ignored by the backend

Last time I checked dani-garcia/vaultwarden#6793 (comment) it was not ignored but it is actually used to determine the 2FA remember token saved on a client. So by not entering a mail address you will always always have to enter your second factor. This would be a client side limitation until upstream changes their behavior (or we make it possible to skip 2FA for SSO, as suggested in dani-garcia/vaultwarden#6833).

// Vaultwarden has a single SSO configuration so the org identifier is always
// FAKE_SSO_IDENTIFIER. Pass it explicitly so the /sso component skips the
// "type your organization SSO identifier" prompt and proceeds to the IdP.
await this.loginComponentService.redirectToSsoLoginWithOrganizationSsoIdentifier(
email,
"00000000-01DC-01DC-01DC-000000000000",
);

I'm not sure how I feel about this change though. I mean I think this currently is a bit messy and I'm not sure if that would further prevent changes to the master password policy on the org level (as discussed in dani-garcia/vaultwarden#7163 (comment)) if we use the FAKE_SSO_IDENTIFIER here. Personally I think this should be fine to streamline the SSO experience as assumed by the comment but maybe @Timshel could chime in and confirm that this is something we actually want? I.e. if we should diverge from upstream by not having SSO related with a single organization at all.

Besides that those two reservations this change works just fine.

@Timshel
Copy link
Copy Markdown

Timshel commented May 6, 2026

I probably would recommend setting the identifier in the logic which try to restore it from storage (cf probably should be in an else branch 🤔 ) this way if a different value is set by an url parameter it won't be overridden (might happen in the invitation flow).

No idea for 2FA would have to do some tests

Edit: for the password policies made more tests and even with latest change the correct org policies can still be used. So it should have no impact.
It has a certain logic since SSO is activated globally no need to check the user email, and we can't really trust the input anyway until the user is authenticated.

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.

3 participants