Skip to main content
The SSO service provides enterprise Single Sign-On authentication using SAML 2.0 and OpenID Connect protocols, enabling organizations to integrate with their existing identity providers.

Overview

SSO is an enterprise feature available in the commercial version of Bitwarden Server.
The SSO service provides:
  • 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

From bitwarden_license/src/Sso/Startup.cs:26:
Service Configuration

SAML 2.0 Implementation

Service Provider Metadata

The SSO service exposes SAML metadata for IdP configuration:
Metadata includes:
  • 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:
Validation steps:
  1. Signature verification
  2. Timestamp validation (NotBefore/NotOnOrAfter)
  3. Audience restriction
  4. Attribute extraction
  5. 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

From bitwarden_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.
JIT workflow:
  1. User authenticates via SSO
  2. SSO service checks if user exists
  3. If new user, create invitation
  4. Auto-confirm invitation
  5. Add to default group (if configured)
  6. 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

SSO implementations must follow security best practices:
  • 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