Sign-in and roles¶
kataba has no passwords of its own: users sign in with Authentik over OpenID Connect, and their role in kataba follows from their groups in Authentik. Reading public content needs no sign-in at all.
Setting up Authentik¶
In Authentik, create an OAuth2/OpenID provider and an application for kataba that uses it:
- Client type: confidential.
- Redirect URI:
https://<your kataba address>/api/auth/callback/authentik, with the address thatAUTH_URLnames. - Scopes:
openid,emailandprofile. The token must carry the user's groups in agroupsclaim, which Authentik's defaultprofilescope mapping does.
Then copy from Authentik into kataba's configuration:
| From Authentik | Into |
|---|---|
| the provider's client ID | AUTH_AUTHENTIK_ID |
| the provider's client secret | AUTH_AUTHENTIK_SECRET |
the provider's issuer URL, e.g. https://authentik.example.com/application/o/kataba/ |
AUTH_AUTHENTIK_ISSUER |
kataba remembers every user who signed in once, with the name and email address Authentik reports. Authentik decides who may sign in at all, for example with a policy bound to the application.
Groups and roles¶
| Role | May… |
|---|---|
| Guest (not signed in) | read published, public content |
| Viewer | also read internal content |
| Author | also create guides and edit their own guides and those in wiki mode |
| Admin | edit everything, and manage categories, child order, ownership, pages, the menu, settings, imports, deleted guides and backups |
Two groups in Authentik grant the roles, named in the configuration:
- members of
KATABA_ADMIN_GROUP(kataba-adminsin.env.example) become admins, - members of
KATABA_AUTHOR_GROUP(kataba-authors) become authors, - everyone else who signs in is a viewer.
A member of both groups is an admin. A variable that is empty or not set grants its role to nobody; the settings show it as "Not configured". Create the groups in Authentik and add the first admin to the admin group before they sign in for the first time.
kataba derives the role at every sign-in. A change of groups in Authentik takes effect the next time the user signs in to kataba, not while they stay signed in. A user who loses the author role keeps their guides; admins can transfer them.