Handling Clock Drift with ClockTolerance / Leeway
Different servers can experience microsecond to minute-level clock drift. If an issuing server's clock is 5 seconds ahead of a verifying server, a newly issued token might be rejected as "not yet valid" (nbf failure). Most JWT verification libraries provide a `clockTolerance` (leeway) setting of 30 to 60 seconds to absorb NTP drift gracefully.
Frequently Asked Questions
What is the recommended lifespan for an access token?
Between 5 minutes and 30 minutes for web apps. Stored in memory or an HttpOnly cookie, backed by a refresh token stored securely on the database.