Integrate with BookStack
Support level: Community
What is BookStack?
BookStack is a simple, self-hosted, easy-to-use platform for organizing and storing information.
Preparation
The following placeholders are used in this guide:
bookstack.companyis the FQDN of the BookStack installation.authentik.companyis the FQDN of the authentik installation.
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.
BookStack can use either OpenID Connect (OIDC) or SAML 2.0 for authentication. Choose one protocol and follow the matching tab throughout this guide.
- OIDC
- SAML
authentik configuration
To support the integration of BookStack with authentik using OIDC, you need to create an application/provider pair in authentik.
Create an application and provider
In authentik versions earlier than 2026.5, all Redirect URIs are automatically treated as Authorization type. If you are using one of these older authentik versions, add only the Authorization URL to your Redirect URIs and do not configure a Post Logout URI.
-
Log in to authentik as an administrator and open the authentik Admin interface.
-
Navigate to Applications > Applications and click New Application to open the application wizard.
- Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Note the Slug value because you will use it when configuring BookStack.
- Choose a Provider type: select OAuth2/OpenID Connect as the provider type.
- Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
- Note the Client ID and Client Secret values because you will use them when configuring BookStack.
- Add a Redirect URI of type
StrictAuthorizationashttps://bookstack.company/oidc/callback. - Add a Redirect URI of type
StrictPost Logoutashttps://bookstack.company. - Add a Redirect URI of type
StrictPost Logoutashttps://bookstack.company/login. - Add a Redirect URI of type
StrictPost Logoutashttps://bookstack.company/login?prevent_auto_init=true. - Select an RSA Signing Key.
- Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's Application Dashboard page.
-
Click Submit to save the new application and provider.
BookStack configuration
Update the BookStack .env file with the OIDC settings, then restart BookStack.
AUTH_METHOD=oidc
OIDC_NAME=authentik
OIDC_DISPLAY_NAME_CLAIMS=name
OIDC_CLIENT_ID=<Client ID from authentik>
OIDC_CLIENT_SECRET=<Client Secret from authentik>
OIDC_ISSUER=https://authentik.company/application/o/<application_slug>/
OIDC_ISSUER_DISCOVER=true
OIDC_END_SESSION_ENDPOINT=true
If BookStack should immediately redirect users to authentik instead of showing the login button, also add the following setting:
AUTH_AUTO_INITIATE=true
Configure role sync (optional)
BookStack can map authentik groups to BookStack roles when the group names match BookStack role display names. If you need a different matching value for a role, edit the role in BookStack and set its External Authentication IDs value.
OIDC_USER_TO_GROUPS=true
OIDC_GROUPS_CLAIM=groups
If BookStack should remove roles that no longer match the user's authentik groups, also add the following setting:
OIDC_REMOVE_FROM_GROUPS=true
If you change an existing BookStack installation from local authentication to OIDC, BookStack does not automatically link users by email address. Before switching the authentication method, log in to BookStack as an administrator and update each local user's External Authentication ID to the identifier that BookStack will receive from authentik.
Configuration verification
To confirm that authentik is properly configured with BookStack, open BookStack and click Login with authentik.
authentik configuration
To support the integration of BookStack with authentik using SAML, you need to create an application/provider pair in authentik.
Create an application and provider
authentik 2026.5 introduces changes to how the SAML provider behaves. Specifically, the provider now automatically sets the Issuer value to: https://authentik.company/application/saml/<application_slug>/metadata/
Older versions of authentik set this value to authentik by default. If you're running an older version, please set Issuer to https://authentik.company/application/saml/<application_slug>/metadata/, where <application_slug> is the slug that you selected for the application.
-
Log in to authentik as an administrator and open the authentik Admin interface.
-
Navigate to Applications > Applications and click New Application to open the application wizard.
- Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Note the Slug value because you will use it when configuring BookStack.
- Choose a Provider type: select SAML Provider as the provider type.
- Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
- ACS URL:
https://bookstack.company/saml2/acs - Audience:
https://bookstack.company/saml2/metadata - SLS URL:
https://bookstack.company/saml2/sls - SLS Binding:
Redirect - Logout Method:
Front-channel (Iframe) - Under Advanced protocol settings:
- Select an available Signing Certificate.
- Set NameID Property Mapping to
authentik default SAML Mapping: Email.
- ACS URL:
- Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's Application Dashboard page.
-
Click Submit to save the new application and provider.
BookStack configuration
Update the BookStack .env file with the SAML settings, then restart BookStack.
AUTH_METHOD=saml2
SAML2_NAME=authentik
SAML2_EMAIL_ATTRIBUTE=http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
SAML2_EXTERNAL_ID_ATTRIBUTE=http://schemas.goauthentik.io/2021/02/saml/uid
SAML2_DISPLAY_NAME_ATTRIBUTES=http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
SAML2_IDP_ENTITYID=https://authentik.company/application/saml/<application_slug>/metadata/
SAML2_AUTOLOAD_METADATA=true
If BookStack should immediately redirect users to authentik instead of showing the login button, also add the following setting:
AUTH_AUTO_INITIATE=true
Configure role sync (optional)
BookStack can map authentik groups to BookStack roles when the group names match BookStack role display names. If you need a different matching value for a role, edit the role in BookStack and set its External Authentication IDs value.
SAML2_USER_TO_GROUPS=true
SAML2_GROUP_ATTRIBUTE=http://schemas.xmlsoap.org/claims/Group
If BookStack should remove roles that no longer match the user's authentik groups, also add the following setting:
SAML2_REMOVE_FROM_GROUPS=true
If you change an existing BookStack installation from local authentication to SAML, BookStack does not automatically link users by email address. Before switching the authentication method, log in to BookStack as an administrator and update each local user's External Authentication ID to the identifier that BookStack will receive from authentik.
Configuration verification
To confirm that authentik is properly configured with BookStack, open BookStack and click Login with authentik.