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
- Create a Keycloak OpenID Connect client with client authentication and Standard Flow enabled; allow only the BookStack URL ending in /oidc/callback.
- Set AUTH_METHOD=oidc, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET, OIDC_ISSUER to the realm issuer, and OIDC_ISSUER_DISCOVER=true.
- Link existing accounts by External Authentication ID using the stable OIDC subject before switching; do not assume email matching.
- 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.
