Keycloak SAML Implementation
This article contains Keycloak-specific help for configuring login with SSO via SAML 2.0. For help configuring login with SSO for another IdP, refer to SAML 2.0 Configuration.
Configuration involves working simultaneously with the Bitwarden web vault and the Keycloak Portal. As you proceed, we recommend having both readily available and completing steps in the order they are documented.
Tipp
Already an SSO expert? Skip the instructions in this article and download screenshots of sample configurations to compare against your own.
Navigate to your organization's Settings → Single sign-on screen:

If you haven't already, create a unique SSO identifier for your organization. Otherwise, you don't need to edit anything on this screen yet, but keep it open for easy reference.
Tipp
If you are self-hosting Bitwarden, you can use alternative Member decryption options. This feature is disabled by default, so continue with Master password decryption for now and learn how to get started using Key Connector once your configuration is complete and successfully working.
In the Keycloak portal, create a new client:

On the Add Client screen, configure the following settings:
Field | Description |
---|---|
Client ID | Set this field to the pre-generated SP Entity ID retrieved from the Bitwarden SSO Configuration screen. |
Client Protocol | Select |
Client SAML Endpoint | Enter your master SAML processing URL, for example |
When you are finished, select the Save button.
On the Settings tab, configure the following options:
Field | Description |
---|---|
Name | Give the client a unique, Bitwarden-specific name. |
Enabled | Toggle to On. |
Sign Documents | Specify whether SAML documents should be signed by the Keycloak realm. |
Sign Assertions | Specify whether SAML assertions should be signed by the Keycloak realm. |
Signature Algorithm | If Sign Assertions is enabled, select what algorithm to sign with ( |
Name ID Format | Select the Name ID Format for Keycloak to use in SAML responses. |
Valid Redirect URLs | Set this field to the pre-generated Assertion Consumer Service (ACS) URL retreived from the Bitwarden SSO configuration screen. |
Base URL | Set this field to the login URL from which users will access Bitwarden. |
Master SAML Processing URL | If not automatically filled in, set this field to your master SAML processing URL, for example |
Fine grain SAML endpoint configuration
In the Fine Grain SAML Endpoint Configuration section, configure either the Assertion Consumer Service POST Binding URL or Assertion Consumer Service Redirect Binding URL. You will choose in a later step whether to use HTTP POST or Redirect, so configure whichever you would like to use:

For either field, set it to the pre-generated Assertion Consumer Service (ACS) URL retrieved from the Bitwarden SSO configuration screen. For cloud-hosted customers, this is always https://sso.bitwarden.com/saml2/your-org-id/Acs
. For self-hosted instances, this is determined by your configured server URL, for example https://your.domain/sso/your-org-id/Acs
.
Select the Mappers tab and create all of the following Mappers:





From the navigation, select Realm Settings → Keys and get your certificate:

Copy the certificate for use in a later step.
At this point, you have configured everything you need within the context of the Keycloak Portal. Return to the Bitwarden web vault to complete configuration.
The Single Sign-On screen separates configuration into two sections:
SAML Service Provider Configuration will determine the format of SAML requests.
SAML Identity Provider Configuration will determine the format to expect for SAML responses.
Configure the following fields:
Field | Description |
---|---|
Name ID Format | Select the Name ID Format you chose when configuring the Keycloak client. |
Outbound Signing Algorithm | The algorithm Bitwarden will use to sign SAML requests. |
Signing Behavior | Whether/when SAML requests will be signed. |
Minimum Incoming Signing Algorithm | Select the algorithm the Keycloak client is configured to use to sign SAML documents or assertions. |
Want Assertions Signed | Whether Bitwarden expects SAML assertions to be signed. If toggled on, make sure you configure the Keycloak client to sign assertions. |
Validate Certificates | Check this box when using trusted and valid certificates from your IdP through a trusted CA. Self-signed certificates may fail unless proper trust chains are configured with the Bitwarden login with SSO docker image. |
When you are done with the service provider configuration, Save your work.
Identity provider configuration will often require you to refer back to the Keycloak Portal to retrieve client values:
Field | Description |
---|---|
Entity ID | Enter the URL of the Keycloak realm on which the client was created, for example |
Binding Type | Select HTTP POST or Redirect. |
Single Sign On Service URL | Enter your master SAML processing URL, for example |
Single Log Out Service URL | Login with SSO currently does not support SLO. This option is planned for future development, however you may preconfigure it with your Logout URL if you wish. |
X509 Public Certificate | Paste the downloaded certificate, removing
and |
Outbound Signing Algorithm | Select the algorithm the Keycloak client is configured to use to sign SAML documents or assertions. |
Disable Outbound Logout Requests | Login with SSO currently does not support SLO. This option is planned for future development. |
Want Authentication Requests Signed | Whether Keycloak expects SAML requests to be signed. |
When you're done with the identity provider configuration, Save your work.
Tipp
You can require users to log in with SSO by activating the single sign-on authentication policy. Please note, this will require activating the single organization policy as well. Learn more.
Once your configuration is complete, test it by navigating to https://vault.bitwarden.com, entering your email address, selecting Continue, and selecting the Enterprise Single-On button:

Enter the configured organization identifier and select Log In. If your implementation is successfully configured, you will be redirected to the Keycloak login screen:

After you authenticate with your Keycloak credentials, enter your Bitwarden master password to decrypt your vault!
Hinweis
Bitwarden does not support unsolicited responses, so initiating login from your IdP will result in an error. The SSO login flow must be initiated from Bitwarden.