Overview
SSO is an enterprise feature available in the commercial version of Bitwarden Server.
- SAML 2.0: Service Provider implementation for SAML-based SSO
- OpenID Connect: Relying Party for OIDC authentication
- Multi-Tenancy: Organization-specific SSO configurations
- Just-In-Time Provisioning: Automatic user account creation
- Domain Verification: Trusted domain-based login routing
- Member Decryption Options: Support for Key Connector and Account Recovery
Architecture
Authentication Flows
SAML 2.0 Flow
1
SSO Initiation
User enters email or clicks SSO login button
2
Organization Lookup
SSO service identifies organization by domain or identifier
3
SAML Request
SSO service generates SAML AuthnRequest and redirects to IdP
4
IdP Authentication
User authenticates with organization’s identity provider
5
SAML Response
IdP sends SAML assertion back to SSO service
6
Validation
SSO service validates SAML signature and assertions
7
Token Exchange
SSO service redirects to Identity service with authorization code
8
Access Token
Identity service issues OAuth tokens for client application
OpenID Connect Flow
1
SSO Initiation
User initiates login via organization SSO
2
OIDC Authorization
SSO service redirects to OIDC provider with authorization request
3
User Authentication
User authenticates with OIDC provider
4
Authorization Code
OIDC provider returns authorization code
5
Token Exchange
SSO service exchanges code for ID token and access token
6
User Info
SSO service retrieves user information from OIDC UserInfo endpoint
7
Bitwarden Login
SSO service creates/updates user and redirects to Identity service
Configuration
Frombitwarden_license/src/Sso/Startup.cs:26:
Service Configuration
SAML 2.0 Implementation
Service Provider Metadata
The SSO service exposes SAML metadata for IdP configuration:- Entity ID
- Assertion Consumer Service URL
- Single Logout Service URL
- Signing certificates
- Supported bindings (HTTP-POST, HTTP-Redirect)
Assertion Consumer Service
Receives and validates SAML assertions:- Signature verification
- Timestamp validation (NotBefore/NotOnOrAfter)
- Audience restriction
- Attribute extraction
- User provisioning/update
Required SAML Attributes
OpenID Connect Implementation
Configuration Discovery
The SSO service discovers OIDC provider configuration via:Required OIDC Claims
Token Validation
ID tokens are validated for:- Signature (using IdP’s public keys)
- Issuer matches configuration
- Audience matches client ID
- Expiration timestamp
- Nonce validation
SSO Configuration Models
Organizations configure SSO via the web vault:SAML 2.0 Settings
OIDC Settings
Middleware Pipeline
Frombitwarden_license/src/Sso/Startup.cs:91:
Request Pipeline
Controllers
The SSO service includes several controllers:Account Controller
Handles SSO login flows:Metadata Controller
SAML metadata endpoints:Home Controller
Error pages and information:Domain Verification
Organizations can verify domains to enable automatic SSO routing:1
Add Domain
Navigate to Organization Settings → Verified Domains
2
Generate DNS Record
System generates TXT record for verification
3
Add DNS Record
Add TXT record to domain’s DNS configuration
4
Verify Domain
Click “Verify” to validate DNS record
5
Enable SSO
Users with verified domain email can use SSO automatically
Member Decryption Options
SSO supports different vault decryption methods:Master Password
Traditional approach - users decrypt vault with master password after SSO login.Key Connector
Stores encryption keys on customer’s infrastructure:Trusted Devices
Device-based encryption key approval:Just-In-Time Provisioning
When enabled, SSO automatically creates user accounts:JIT provisioning creates organization members but does not grant collection access automatically.
- User authenticates via SSO
- SSO service checks if user exists
- If new user, create invitation
- Auto-confirm invitation
- Add to default group (if configured)
- Redirect to vault
Deployment
Environment Variables
Docker
Self-Hosted Configuration
In self-hosted deployments, the SSO service runs at
/sso path.Nginx Configuration
Supported Identity Providers
Azure AD
Microsoft Entra ID via OIDC or SAML
Okta
Okta Identity Cloud (OIDC/SAML)
OneLogin
OneLogin SAML integration
ADFS
Active Directory Federation Services
Google Workspace
Google SAML integration
Duo
Duo SSO with SAML
PingFederate
Ping Identity solutions
Auth0
Auth0 OIDC integration
Troubleshooting
SAML Common Issues
OIDC Common Issues
Debug Logging
Security Considerations
- Certificate Validation: Always validate IdP certificates
- Timestamp Checks: Enforce NotBefore/NotOnOrAfter
- Signature Verification: Require signed assertions
- HTTPS Only: Never use SSO over HTTP
- Domain Verification: Verify email domains before JIT provisioning
- Audit Logging: Monitor SSO authentication events
Related Services
- Identity Service - OAuth token issuance
- SCIM Service - User provisioning
- API Service - Organization management