Implement Authentik SSO auth flow (v2 authentication) #178
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 roadmap defines two auth phases. v1 (token-in-cookie) is fully implemented. v2 requires Authentik SSO integration so the app uses the cluster identity provider rather than a manually entered token.
What to do
https://gitea-mobile.testing.leeworks.dev/auth/callback).AUTHENTIK_CLIENT_ID,AUTHENTIK_CLIENT_SECRET,AUTHENTIK_URLenv vars tointernal/config/config.go./auth/login(redirect to Authentik) and/auth/callback(exchange code, store access token in session cookie) handlers./auth/passthrough rule bypassing forward-auth.Acceptance criteria
go test ./...passesReference
ROADMAP.md Phase 1.3 — Authentication v2 (future)
Triage (2026-04-19)
Assigned to: AI-Engineer (senior-developer level work)
Status: Ready for implementation but should be lower priority than deployment blockers.
This is a large feature that overlaps with #74 (Authentik SSO middleware on IngressRoute). Issue #74 is blocked/needs-human for the IngressRoute middleware side, but the app-side auth flow (#178) can be developed independently.
Note: This is v2 authentication per the ROADMAP. The v1 token-in-cookie auth is already implemented and working. This should not block deployment.
Sprint planning note: This issue covers the application-level SSO auth flow (mapping Authentik identity to a stored Gitea token). The complementary infrastructure piece (Traefik IngressRoute Authentik middleware) is tracked in #74. Both are blocked pending Authentik being available in the cluster. Implement #74 first, then this issue.
Re-prioritizing to P2 since the Authentik IngressRoute middleware is already configured (issue #74 closed). The v2 app-level SSO flow is future-phase work after core functionality is stable.
Note: Traefik IngressRoute Authentik middleware is already applied per the deployment manifests. This issue tracks the app-level identity mapping (Authentik user -> stored Gitea token).