Admin ConsoleLogin with SSO

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.

Download Sample

Keycloak setup guide

To get started with Keycloak, there are few required fields to complete that will be covered in this guide. Additional fields can be added to your SSO setup that will be addressed in the subsequent sections.

Open SSO in the web vault

Navigate to your organization's SettingsSingle sign-on screen:

SAML 2.0 configuration
SAML 2.0 configuration

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

There are alternative Member decryption options. Learn how to get started using SSO with trusted devices or Key Connector.

Keycloak setup

Login to Keycloak and select ClientsCreate Client.

Create a Client
Create a Client

On the Create client screen fill in the following fields:

Field

Description

Client type

Select SAML.

Client ID

Set this field to the pre-generated SP Entity ID retrieved from the Bitwarden SSO Configuration screen.

For cloud-hosted customers, this is always https://sso.bitwarden.com/saml2. For self-hosted instances, this is determined by your configured server URL, for example https://your.domain.com/sso/saml2.

Name

Enter a name of your choice for the Keycloak client.

Once you have filled in the required fields on the General Settings page, click Next.

On the Login settings screen, fill in the following field:

Field

Description

Valid redirect URIs

Set this field 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 Save.

Select the Keys tab and toggle the Client signature required option to Off.

Keycloak Keys Config
Keycloak Keys Config

Lastly, on the Keycloak main navigation, select Realm settings and then the Keys tab. Locate the RS256 Certificate and select Certificate.

Keycloak RS256 Certificate
Keycloak RS256 Certificate

The value for the certificate will be required for the following section.

Back to the web vault

At this point, you have configured everything you need within the context of the Keycloak Portal. Return to the Bitwarden web vault and navigate to the SSO settings screen by selecting OrganizationsSettings Single sign-on.

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.

Complete the following fields in the SAML Service Provider Configuration section:

Field

Description

Name ID format

Select Email.

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.

Complete the following fields in the SAML Identity Provider Configuration section:

Field

Description

Entity ID

Enter the URL of the Keycloak realm on which the client was created, for example https://<keycloak_domain>/realms/<realm_name>. This field is case sensitive.

Binding type

Select Redirect.

Single sign-on service URL

Enter your master SAML processing URL, for example https://<keycloak_domain>/realms/<realm_name>/protocol/saml.

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

Enter the RS256 certificate that was copied in the previous step.

The certificate value is case sensitive, extra spaces, carriage returns, and other extraneous characters will cause certificate validation to fail.

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.

Hinweis

When completing the X509 certificate, take note of the expiration date. Certificates will have to be renewed in order to prevent any disruptions in service to SSO end users. If a certificate has expired, Admin and Owner accounts will always be able to log in with email address and master password.

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.

Keycloak additional settings

On the Keycloak Client Settings tab, additional configuration options are available:

Field

Description

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 (sha-256 by default).

Name ID Format

Select the Name ID Format for Keycloak to use in SAML responses.

Once you have completed the forum, select Save.

Test the configuration

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:

Enterprise single sign on and master password
Enterprise single sign on and master password

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

Keycloak Login Screen
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.

Make a Suggestion to this Article...*
Email (optional)

Kontaktieren Sie unser Team vom Kundendienst

Für technische Fragen und bei Fragen zu Rechnungen, Produkten und Familien/Premium-Tarifen.

Name*
E-Mail-Adresse Ihres Bitwarden-Kontos*
Verify account email*
Product*
Are you self-hosting?*
Betreff*
Nachricht...*

Cloud-Status

Check status

© 2023 Bitwarden, Inc.NutzungsbedingungenDatenschutzerklärungSitemap
Diese Website ist auf Deutsch verfügbar.
Go to EnglishStay Here