Skip to content

triauth for BookStackOIDC

Let your team open BookStack with one approval on their own device, and no BookStack passwords.

  • Wiki and docs
  • Open source
Sign-in through
OpenID Connect bridge
Available in
BookStack v21.10 and newer
Set up in
The .env file

About BookStack

BookStack is a self-hosted wiki for documentation. Content is organized like a library, with shelves that hold books, books that hold chapters and pages, a simple editor, and search. Teams use it for procedures, manuals, and internal knowledge bases.

Connect BookStack to triauth

BookStack signs people in through the triauth OpenID Connect bridge. Once connected, BookStack's sign-in page shows a button with your domain's name. People on your team click it, type their username, and approve on their own device. Nobody keeps a BookStack password, and when someone leaves, removing their identity records at your domain ends their access to BookStack as well.

How it works

  1. Open oidc.triauth.org and enter your domain. Paste BookStack's redirect address, https://docs.example.com/oidc/callback with your own BookStack address in place of docs.example.com, and click Connect app. The bridge gives you a client ID and a client secret.

  2. On your server, add the settings below to BookStack's .env file. Replace example.com with your domain and the two placeholders with the client ID and the client secret from the bridge.

    ini
    AUTH_METHOD=oidc
    OIDC_NAME=example.com
    OIDC_DISPLAY_NAME_CLAIMS=name
    OIDC_CLIENT_ID=<client ID from the bridge>
    OIDC_CLIENT_SECRET=<client secret from the bridge>
    OIDC_ISSUER=https://oidc.triauth.org/example.com
    OIDC_ISSUER_DISCOVER=true
  3. Open BookStack's sign-in page and click the button with your domain's name.

Checkpoint

BookStack's sign-in page shows a button with your domain's name. Choosing it opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve.

Good to know

  • Everyone with an identity at your domain gets a BookStack account the first time they sign in, with the default role. To let only one team in, limit the app to a group when you connect it.
  • People who already have a BookStack account keep it when an administrator enters their identifier as the External Authentication ID on their profile before the switch. Otherwise they get a new account.
  • BookStack can give roles by the groups published at your domain, with three more lines in the settings.

For the person who connects the app

SettingValue
Redirect addresshttps://<your-bookstack>/oidc/callback
Where in BookStackthe .env file in the BookStack folder
IssuerOIDC_ISSUER must equal https://oidc.triauth.org/<your domain> exactly, with no trailing slash, and OIDC_ISSUER_DISCOVER=true reads the rest
GroupsOIDC_ADDITIONAL_SCOPES=groups, OIDC_USER_TO_GROUPS=true, and OIDC_GROUPS_CLAIM=groups. A BookStack role named exactly like the group, domain included, such as editors@example.com, receives its members
Sign-outOIDC_END_SESSION_ENDPOINT stays false, since the bridge has no logout endpoint

BookStack keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge. BookStack's OpenID Connect guide explains every setting, including how to move existing accounts over.

Next steps

All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.