website/integrations/security/bitwarden/index.mdx
import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs";
Bitwarden is a freemium, open-source password management service that helps users store, manage, and share sensitive information securely online.
The following placeholders are used in this guide:
authentik.company is the FQDN of the authentik installation.bitwarden.company is the FQDN of the Bitwarden installation (if using self-hosted Bitwarden).:::info This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application. :::
:::info To enable Single Sign-On (SSO) with Bitwarden, an enterprise subscription is required. :::
You can configure Bitwarden to use either OIDC or SAML; this guide explains both options.
<Tabs defaultValue="oidc" values={[ { label: "Log in with OIDC", value: "oidc" }, { label: "Log in with SAML", value: "saml" }, ]}> <TabItem value="oidc">
To support the integration of Bitwarden with authentik, you need to create a property mapping and an application/provider pair in authentik.
Bitwarden requires a first and last name for every user. However, authentik, by default, only supplies a full name as a single string. As a result, a property mapping must be created to separate and provide first and last names to Bitwarden.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Customization > Property Mappings and click Create.
Select type: select Scope Mapping.
Configure the Scope Mapping: Provide a descriptive name (e.g. Bitwarden Profile Scope), and an optional description.
profilereturn {
"name": request.user.name,
"preferred_username": request.user.username,
"nickname": request.user.username,
"groups": [group.name for group in request.user.groups.all()],
"surname": request.user.name.rsplit(" ", 1)[-1],
"givenname": request.user.name.rsplit(" ", 1)[0],
}
Click Finish to save the property mapping.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Applications > Applications and click Create with Provider to create an application and provider pair. (Alternatively you can first create a provider separately, then create the application and connect it with the provider.)
Strict redirect URI to:
https://sso.bitwarden.com/oidc-signin for Non-EU based SaaS Bitwarden.https://sso.bitwarden.eu/oidc-signin for EU based SaaS Bitwarden.https://bitwarden.company/oidc-signin for self-hosted Bitwarden.authentik default OAuth Mapping: OpenID 'profile' and add the property mapping that you created.Click Submit to save the new application and provider.
Log in to the Bitwarden dashboard as an administrator (choose Accessing: bitwarden.eu for Bitwarden accounts based in the EU). If you are using a self-hosted Bitwarden, go to https://bitwarden.company/#/login.
In the sidebar, navigate to Admin Console > Settings > Single sign-on, and enter the following settings:
OIDChttps://authentik.company/application/o/<application_slug>/https://authentik.company/application/o/<application_slug>/.well-known/openid-configurationRedirect GETClick Save.
To support the integration of Bitwarden with authentik, you need to create an application/provider pair in authentik.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Applications > Applications and click Create with Provider to create an application and provider pair. (Alternatively you can first create a provider separately, then create the application and connect it with the provider.)
https://temp.tempClick Submit to save the new application and provider.
Provider for Bitwarden).Accessing: bitwarden.eu for EU based Bitwarden accounts). For self-hosted Bitwarden use https://bitwarden.company/#/login.SAML 2.0authentikhttps://authentik.company/application/saml/<application_slug>/sso/binding/redirect/https://authentik.company/application/saml/<application_slug>/slo/binding/redirect/To confirm that authentik is properly configured with Bitwarden, log out and go to the Bitwarden login page (select Accessing: bitwarden.eu for EU based Bitwarden accounts or use https://bitwarden.company/#/login for self-hosted Bitwarden).
Enter the email address of a Bitwarden account and click Use single sign-on. If you haven't claimed the email domain in Bitwarden, enter the unique SSO identifier that you selected, and click Continue. You should be redirected to authentik to login, once successful you should be redirected to the Bitwarden dashboard.
:::info
Depending on your Member decryption options setting, which is set in Bitwarden via Admin Console > Settings > Single sign-on, you may still be required to enter your master password after signing in via SSO.
:::