Authentik self-registration enrollment flow for clients #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Allow photography clients to create their own accounts via Authentik, so every booking is tied to a verified identity. Extends #10 with a two-group role model.
Authentik setup (manual, one-time)
Groups
lisilou-photographers— add the photographer account manuallylisilou-clients— clients auto-join on registrationEnrollment flow
lisilou-clients)OIDC provider scope
groupsto the lisilou-portfolio provider scopesAPI changes (extends #10)
Group claim parsing (
api/auth.js)groupsarray from ID token claimsreq.session.user = { name, email, groups }Middleware
/api/admin/*usesrequireAdmin/api/client/*usesrequireAuthAcceptance
lisilou-clientsgroup and cannot access /dashboardlisilou-photographers) can access /dashboardCompleted and verified end-to-end tonight (2026-07-20).
Ran
scripts/authentik-setup.shagainst auth.jerodrigged.com for real - it had never actually been executed before. Found and fixed two bugs in the script along the way (commits2f5607d,1e1eab3):/stages/prompt/stages/, not/stages/prompt/.A third bug was more serious: the scope-mapping lookup filtered on
managed__iexact, which this Authentik version silently ignores (returns the unfiltered list instead of erroring). That meant the OAuth2 provider only ever got the first scope mapping attached (ak_proxy, an unrelated proxy-outpost scope) instead of openid/profile/email - so every real login would have failed at the userinfo step with a 403 scope mismatch, regardless of anything else being correctly configured. Fixed by filtering onscope_nameinstead, and PATCHed the live provider directly so dev did not need to wait for a fresh run.Verified for real (not just checking the redirect shape) via a disposable Authentik test user driven through the full authorization-code+PKCE flow: signup through the enrollment flow works, creates a real account, auto-logs in; that account then completes our OIDC callback and gets a correctly-scoped non-admin session (
admin:false). Confirmed on both dev-lisilou.jerodrigged.com and lisilou.jerodrigged.com.