Skip to main content

Integrate with BookStack

Support level: Community

What is BookStack?

BookStack is a simple, self-hosted, easy-to-use platform for organizing and storing information.

-- https://www.bookstackapp.com/

Preparation

The following placeholders are used in this guide:

  • bookstack.company is the FQDN of the BookStack installation.
  • authentik.company is the FQDN of the authentik installation.
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.

BookStack can use either OpenID Connect (OIDC) or SAML 2.0 for authentication. Choose one protocol and follow the matching tab throughout this guide.

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

Redirect URI changes in authentik 2026.5

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.

  1. Log in to authentik as an administrator and open the authentik Admin interface.

  2. 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 Strict Authorization as https://bookstack.company/oidc/callback.
      • Add a Redirect URI of type Strict Post Logout as https://bookstack.company.
      • Add a Redirect URI of type Strict Post Logout as https://bookstack.company/login.
      • Add a Redirect URI of type Strict Post Logout as https://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.
  3. Click Submit to save the new application and provider.

BookStack configuration

Update the BookStack .env file with the OIDC settings, then restart BookStack.

.env
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:

.env
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.

.env
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:

.env
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.

Resources