📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

How would you revoke a JWT access token before it expires, for example after an account is compromised?

Intermediate Theory Intermediate

🎯 Key points

  • A JWT can't be changed; manage state outside it
  • Short access token lifetime bounds exposure
  • Revoke refresh tokens or sessions at the IdP
  • Redis deny-list: jti with TTL, or issued-before timestamp vs iat, in OnTokenValidated
  • Continuous Access Evaluation for critical events in Entra ID
  • Reference tokens and introspection (RFC 7662) for immediate revocation

⏱ 30-second answer

You can't change or recall a JWT once issued, so revocation means managing state outside the token. Keep access tokens short (5–15 minutes) and revoke the refresh token or session at the IdP, so no new access tokens are issued and access ends within one token lifetime. For immediate effect on high-risk APIs, keep a deny-list in Redis: revoked jti values with a TTL equal to the token's remaining lifetime, or a per-user 'tokens issued before' timestamp compared with iat, checked in JwtBearerEvents.OnTokenValidated (a sub-millisecond lookup; fail closed for admin and payment APIs). Microsoft Entra ID's Continuous Access Evaluation lets supported resources (for example Exchange Online, SharePoint and Graph, or your API if it implements claims challenges) reject tokens soon after events such as account disable or password reset. For the strictest cases, use reference tokens checked by introspection (RFC 7662).

🔍 What the interviewer is checking

Checks they know the practical revocation options and their costs

↩ Usually asked after

More in Authentication

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me