Project 03
Authentication platform
Identity and access control
Brief
A central identity service for multiple applications. Staged on purpose:
- Basic (after Part 6): sessions, tokens, API keys, and resource-level checks (→ 39) — Parts 5–6 provide the storage and the caching that fast token verification needs.
- Full (after Part 10): the complete identity lifecycle, OAuth 2.0/OIDC provider, and RBAC. Method steps are completed in the basic stage and deepened, not restarted.
Targets
1M users · login p99 < 500 ms · token verification p99 < 20 ms · 99.99% availability (everything depends on it) · compliance-grade audit logging.
Must cover
- Basic: sessions, tokens and resource checks (→ 39).
- Full: password storage, MFA, account recovery, lockout (→ 160); SSO (→ 161); token revocation and refresh rotation (→ 162); roles and resource-level authorization (→ 163).
Design challenges
- The full identity lifecycle (→ 160): registration, argon2/bcrypt storage, MFA enrollment and recovery, brute-force lockout, device and session management.
- Sessions vs. JWT per use case; refresh-token rotation; a real revocation story for stateless tokens (→ 162).
- The authorization code + PKCE flow implemented as the provider — every redirect hop understood (→ 161).
- RBAC with resource scoping and privilege-escalation prevention (→ 163).
- Token verification that stays available when the user database is degraded (→ 87; → 192 — ahead, Part 12).
- An immutable audit log of every security event (→ 171).
Out of scope
SAML, SCIM provisioning, passwordless — recorded as extension points in step 21.