Sign-in with Auth.js and Authentik; roles from groups #4

Closed
opened 2026-11-01 16:19:31 +01:00 by miko · 0 comments
Owner

Part of #1

Blocked by: #2

What

Users sign in via Authentik (OIDC). See ADR-0009 and glossary terms Role, Viewer, Author, Admin, Guest.

Acceptance criteria

  • Auth.js with Authentik provider, JWT sessions
  • Prisma model User (authSubject unique, name, email, role, locale?, createdAt, lastLoginAt); upsert on sign-in
  • Role derived from the groups claim using KATABA_ADMIN_GROUP / KATABA_AUTHOR_GROUP; signed-in without either group → viewer
  • A server-side helper returns the current user with the role read from the database (not the token)
  • Sign-in / sign-out and current user shown in the Titlebar
  • Unit tests for group → role mapping

Human prerequisite

An OIDC application/provider in Authentik with a groups claim; the agent can work against env placeholders until then.

Vocabulary: GLOSSARY.md. Decisions: docs/adr/.

Part of #1 Blocked by: #2 ## What Users sign in via Authentik (OIDC). See ADR-0009 and glossary terms Role, Viewer, Author, Admin, Guest. ## Acceptance criteria - [ ] Auth.js with Authentik provider, JWT sessions - [ ] Prisma model `User` (`authSubject` unique, name, email, role, locale?, createdAt, lastLoginAt); upsert on sign-in - [ ] Role derived from the `groups` claim using `KATABA_ADMIN_GROUP` / `KATABA_AUTHOR_GROUP`; signed-in without either group → `viewer` - [ ] A server-side helper returns the current user with the role read from the database (not the token) - [ ] Sign-in / sign-out and current user shown in the Titlebar - [ ] Unit tests for group → role mapping ## Human prerequisite An OIDC application/provider in Authentik with a `groups` claim; the agent can work against env placeholders until then. Vocabulary: `GLOSSARY.md`. Decisions: `docs/adr/`.
miko closed this issue 2026-11-01 17:44:47 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba#4
No description provided.