Add six new opt-in configuration flags that enhance the SSO experience:
SSO_AUTO_REDIRECT (requires SSO_ONLY=true):
Automatically redirect users to the SSO provider login page instead of
showing the Vaultwarden login form. Uses PKCE with S256 challenge.
SSO_IDENTIFIER:
Custom organization identifier for SSO flows.
SSO_LOGOUT_REDIRECT (requires SSO_AUTO_REDIRECT=true):
On logout, redirect to the SSO provider's OIDC end_session endpoint.
Uses localStorage to detect logout vs fresh visit.
SSO_KEY_CONNECTOR (requires SSO_ONLY=true, SSO_KEY_CONNECTOR_SECRET):
Built-in Key Connector — SSO users never need a master password.
All stored keys are encrypted at rest with AES-256-GCM using a key
derived from SSO_KEY_CONNECTOR_SECRET via HKDF-SHA256 with per-key
salts. File format: salt(32) || nonce(12) || ciphertext || tag(16).
The secret only exists as an env var, never on disk.
SSO_KEY_CONNECTOR_SECRET:
Required 256-bit hex secret for encrypting Key Connector keys at rest.
Can be sourced from external KMS (AWS KMS, HashiCorp Vault) via
deployment tooling for stronger security guarantees.
SSO_AUTO_ENROLL:
Auto-create organization and enroll SSO users on first login.
Startup validation ensures SSO_KEY_CONNECTOR_SECRET is set and valid
(64 hex chars) when SSO_KEY_CONNECTOR is enabled.
Addresses: #2583 (Key Connector), #6191 (auto-redirect), #6316 (SSO_ONLY flows)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
/// Log all tokens |> `LOG_LEVEL=debug` or `LOG_LEVEL=info,vaultwarden::sso=debug` is required
sso_debug_tokens: bool,true,def,false;
/// Auto-redirect to SSO |> Automatically redirect users to the SSO provider login page instead of showing the Vaultwarden login form. Requires SSO_ONLY=true.
sso_auto_redirect: bool,true,def,false;
/// SSO organization identifier |> Identifier sent during SSO auto-redirect. Must match the identifier used in organization invitations. Leave empty to use default.
sso_identifier: String,true,def,String::new();
/// SSO logout redirect |> On logout, redirect to the SSO provider's end_session endpoint to terminate the SSO session. Prevents auto-re-login when SSO_AUTO_REDIRECT is enabled.
sso_logout_redirect: bool,true,def,false;
/// SSO Key Connector |> Enable built-in Key Connector support. Allows SSO users to use their vault without ever setting a master password. The server stores user master keys encrypted at rest. Requires SSO_ONLY=true and SSO_KEY_CONNECTOR_SECRET.
sso_key_connector: bool,true,def,false;
/// SSO Key Connector secret |> Required when SSO_KEY_CONNECTOR=true. 64-char hex string (256 bits) used to encrypt user keys at rest via AES-256-GCM. Generate with: openssl rand -hex 32. CRITICAL: back up this secret — losing it means all Key Connector users lose vault access.
sso_key_connector_secret: Pass,true,option;
/// SSO auto-enroll |> Automatically create an organization and enroll SSO users on first login. The organization name matches SSO_IDENTIFIER (or a default).