AuthVault is building a centralized identity provider (like Auth0 / Okta) that multiple applications use for authentication and authorization. Features:
- OAuth2 / OIDC - implement authorization code flow, client credentials flow, and PKCE. Issue JWTs with configurable claims and expiration.•Single Sign-On (SSO) - users log in once and access all connected applications without re-authenticating. Support SAML 2.0 for enterprise integrations.•Multi-Factor Authentication (MFA) - TOTP (authenticator app), SMS codes, and WebAuthn/passkeys as second factors.•Social login - "Sign in with Google / GitHub / Apple" via OAuth2 federation.•Session management - track active sessions across devices. Users can view and revoke individual sessions.•Role-Based Access Control (RBAC) - define roles and permissions per application. Embed roles in JWT claims.•Brute-force protection - lock accounts after 5 failed login attempts. CAPTCHA challenge after 3 failures.
Targeting 1 million users across 200 connected applications with 50,000 logins per hour at peak.
Design an OAuth2 identity provider with SSO, MFA, social login, session management, and RBAC for 1 M users. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> Load Balancer -> API Gateway -> API Service -> Auth Service -> Primary SQL DB -> Redis Cache