Design: OAuth 2.0 Authorization for Microservices
Design covers OAuth 2.0 authorization server, token issuance, validation, and integration with microservices. Out of scope: user interface design, detailed user management, and third-party identity providers.
Functional Requirements
FR1: Allow users to authenticate and authorize access to multiple microservices securely.
FR2: Support token-based authentication using OAuth 2.0 standard.
FR3: Enable microservices to validate access tokens efficiently without contacting the authorization server on every request.
FR4: Support scopes and roles to restrict access to specific microservice APIs.
FR5: Allow token refresh without requiring user re-login.
FR6: Ensure secure communication between microservices and the authorization server.
FR7: Handle token revocation and expiration properly.
Non-Functional Requirements
NFR1: System must handle 10,000 concurrent users with low latency (p99 < 150ms for token validation).
NFR2: Authorization server availability must be 99.9% uptime.
NFR3: Microservices should not become bottlenecks due to authentication overhead.
NFR4: Tokens should have a limited lifetime (e.g., 1 hour) with refresh tokens valid for 7 days.
NFR5: Use industry-standard OAuth 2.0 flows suitable for microservices architecture.