Auth Flow Design
Core Workflow
- Identify actors, clients, trust boundaries, data sensitivity, and existing identity provider or auth stack.
- Separate authentication, authorization, session/token handling, and audit requirements.
- Define flows for login, token issuance, refresh, logout/revocation, service access, permission checks, and failure behavior.
- Specify where checks happen: gateway, middleware, service layer, database, or external provider.
- Document abuse cases, least privilege, tenant isolation, and review gates.
- Include tests and operational checks for auth regressions.
Safety Rules
- Do not invent provider-specific behavior without checking current official docs when details matter.
- Do not recommend storing plaintext secrets, long-lived broad tokens, or client-trusted authorization decisions.
- Escalate auth flows involving payments, admin access, customer data, multi-tenant isolation, or regulated data.
Deliverable Shape
For auth flow plans, provide:
- Actors and trust boundaries
- Authentication flow
- Authorization model
- Token/session lifecycle
- Permission checks and enforcement points
- Error behavior and audit events
- Abuse cases and mitigations
- Test plan and review gates
References
- Read
references/auth-flow-design-checklist.mdwhen designing or reviewing backend auth flows.