BookStack
Sign in to the BookStack wiki with Pocket ID.
Create the client in Pocket ID
Section titled “Create the client in Pocket ID”- In Pocket ID, open Administration → OIDC Clients and click Add OIDC Client.
- Enter a name such as
BookStackand add the callback URLhttps://bookstack.example.com/oidc/callback. - Click Create and copy the Client ID and the Client secret. The client secret is only shown once.
- On the client’s General tab, turn on PKCE, then click Save.
- On the client’s Access tab, select the groups that may sign in under Allowed User Groups, or choose All Users.
Configure BookStack
Section titled “Configure BookStack”Refer to the BookStack documentation for more information if needed.
Add the following variables to the .env file of your BookStack container and restart it:
AUTH_METHOD=oidcAUTH_AUTO_INITIATE=trueOIDC_NAME="Pocket ID"OIDC_DISPLAY_NAME_CLAIMS=nameOIDC_CLIENT_ID=<client-id>OIDC_CLIENT_SECRET=<client-secret>OIDC_ISSUER=https://id.example.comOIDC_END_SESSION_ENDPOINT=trueOIDC_ISSUER_DISCOVER=trueGroup synchronization
Section titled “Group synchronization”BookStack can sync OIDC user groups with BookStack roles. By default, BookStack matches OIDC groups (Pocket ID groups) with the display names of BookStack roles, ignoring case.
This feature requires the OIDC server to provide a claim in the ID token with an array of group names.
- Set up new Roles (or rename existing ones) in BookStack, for example:
- BookStack_Admin
- BookStack_Editor
- BookStack_Viewer
- In Pocket ID, open Administration → User Groups and create matching groups with Add Group (Friendly Name and Name):
- BookStack Admin (
bookstack_admin) - BookStack Editor (
bookstack_editor) - BookStack Viewer (
bookstack_viewer)
- BookStack Admin (
- Add the following lines to the
.envfile of your BookStack container and restart it:OIDC_USER_TO_GROUPS=trueOIDC_GROUPS_CLAIM=groupsOIDC_ADDITIONAL_SCOPES=groupsOIDC_REMOVE_FROM_GROUPS=true