Skip email entry on login when SSO is the only auth method#24
Skip email entry on login when SSO is the only auth method#24IacopoSb wants to merge 1 commit intovaultwarden:v2026.4.1from
Conversation
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).
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). vw_web_builds/libs/auth/src/angular/login/login.component.ts Lines 609 to 615 in 4c96310 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 Besides that those two reservations this change works just fine. |
|
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. |
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_IDENTIFIERserver-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, andclass="vw-remember-email"on the Remember-email<bit-form-control>. These hooks let the vaultwarden SCSS template hide both elements whensso_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
make full. WithSSO_ENABLED=true SSO_ONLY=trueand the companion vaultwarden SCSS change, the login page shows only the "Continue with SSO" button.