Skip to content

Guide

Why JWT Expiry Checks Break: exp, nbf, Clock Skew, and Timezones

A troubleshooting guide for JWT expiry failures involving exp, nbf, issued-at times, clock skew, and UTC versus local-time mistakes.

Published

Updated

Why time-based JWT bugs feel random

JWT time bugs often look inconsistent because they depend on multiple clocks and multiple assumptions. A token may appear fine when decoded, but still fail because the verifier, the issuer, and your local debugging environment do not agree about the current time.

The claims to compare first

Start with exp, nbf, and iat. Convert them to real dates before reasoning about them. The JWT Decoder helps surface the claims quickly, and the Timestamp Converter makes the actual times obvious.

Where clock skew causes damage

If the issuer and verifier clocks are not aligned, the same token can be rejected as expired or not-yet-valid even though the payload looks right. This is especially common in distributed systems, local development, and preview environments.

Helpful local workflow

Generate a test token with controlled timestamps in the JWT Generator, inspect the claims, and compare the converted values before changing application logic.

Keep Reading In This Topic

Adjacent guides that support the same workflow or query family.

Related Tools

Adjacent utilities for the same workflow.