Design Signing Key Caching for Microsoft Entra ID Token Validation

Last updated: November 29, 2026

Quick Overview

Design how thousands of services validate Microsoft Entra ID (Azure AD) access tokens locally by caching the identity provider's public signing keys, including what happens during key rotation.

Microsoft
System Design
Software Engineer
Microsoft
November 29, 2026
Software Engineer
Technical Screen
System Design
Easy

0

0

0 solved


Design how thousands of services validate Microsoft Entra ID (Azure AD) access tokens locally by caching the identity provider's public signing keys, including what happens during key rotation.

A compact caching question that Microsoft identity and platform teams like because it has a real correctness edge: key rotation. The interviewer checks local validation of signed JWTs, cache refresh policy, and safe behavior when a token is signed with an unknown key.

What the Interviewer Expects
  • Validates JWT signatures locally instead of calling the identity service per request
  • Caches the JWKS (signing keys) keyed by key id with a TTL
  • Refreshes on unknown key id, with rate limiting to avoid stampedes
  • Explains overlap during key rotation
  • Checks issuer, audience, expiry and clock skew
Key Topics to Cover
JWT validation
JWKS caching
Key rotation
Negative caching
Clock skew
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • What happens if an attacker sends tokens with random key ids?
  • How long should the cache live, and why?
  • How would you handle revocation of a user's tokens before expiry?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Services receive bearer tokens on every request (tens of thousands per second per service). Validation must take microseconds, work even if the identity endpoint is briefly unreachable, and pick up ne...

High-Level Design

Each service uses a shared auth middleware library. At startup it fetches the OpenID configuration and the JWKS document (list of public keys with kid) and stores it in an in-process cache. ...


Submit Your Answer
Markdown supported