OIDC login (external identity provider, relying-party flow) #19
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?
Context
The first auth phase delivered email/password login with server-side sessions (
tower-sessions) and theAuthorized<Cap>extractor framework. OIDC was deliberately split out to keep that plan small. The session/extractor layer is provider-agnostic, so OIDC slots in on top.What to do (its own plan)
Add an OIDC relying-party flow scoped to the single org:
Config/env.GET /api/admin/oidc/login→ redirect to the provider's authorize endpoint (with state + PKCE).GET /api/admin/oidc/callback→ exchange code, validate the ID token, map the external identity to a localapp_user(provision-on-first-login or match by email — decide), then call the existingauth::establish_session(same session/cookie layer as password login).app_user, or auto-provision with a default role?References
crates/auth/src/lib.rs—establish_session, the session modelcrates/server/src/config.rs— config patternopenidconnect(evaluate vs hand-rolling against discovery).