BookStack SSO with Keycloak (OIDC)

Use BookStack’s built-in OpenID Connect authentication with a dedicated Keycloak realm client; no paid edition is required.

Last updated

On this page (5)

BookStack · Keycloak · OIDC

Before you start

  • HTTPS BookStack and Keycloak realm.
  • BookStack settings access and a recoverable administrator account.

Configure sign-in

  1. Create a Keycloak OpenID Connect client with client authentication and Standard Flow enabled; allow only the BookStack URL ending in /oidc/callback.
  2. Set AUTH_METHOD=oidc, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET, OIDC_ISSUER to the realm issuer, and OIDC_ISSUER_DISCOVER=true.
  3. Link existing accounts by External Authentication ID using the stable OIDC subject before switching; do not assume email matching.
  4. If syncing roles, use a Keycloak mapper to emit the intended group values, then set OIDC_USER_TO_GROUPS and OIDC_GROUPS_CLAIM to match. Map only approved values to local roles.

Verify the result

  • Pilot new and existing accounts, including an administrator.
  • Check group removal at next sign-in if OIDC_REMOVE_FROM_GROUPS is enabled.

Official documentation

Have Pilae connect your identity provider

Pilae can deploy BookStack with your identity provider already connected. We agree the edition, account mapping and access tests with your team before rollout.