Why ASP.NET Core Accepts Recently Expired JWTs and How to Disable It
ASP.NET Core accepts JSON Web Tokens for up to five minutes after their expiration timestamp by default, which can surprise developers who expect strict cutoffs. The behavior is an intentional clock skew allowance permitted by the JWT specification (RFC 7519) to tolerate small time differences between servers. Other frameworks such as Node.js, Go, and Python default to zero leeway, while Spring Security allows a 60-second buffer. This mismatch can cause inconsistent token validation across polyglot microservice setups. Developers can enforce strict expiration by setting ClockSkew to TimeSpan.Zero in the JWT bearer configuration.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in