Token Lifetime
Token lifetime is the length of time during which an issued token remains valid before it expires. Once a token expires, the client typically must obtain a new one, which may require reauthentication or use of a refresh token depending on the deployment. Shorter lifetimes reduce the risk if a token is stolen, while longer lifetimes reduce how often clients must renew.
Token lifetime is the configurable or default validity period assigned to an issued token, commonly an access token, but also ID tokens or SAML assertions depending on the platform, after which the token is considered expired and should be rejected during validation. In the Microsoft identity platform, for example, an access token's default lifetime is assigned a randomized value between 60 and 90 minutes (averaging roughly 75 minutes), while long-lived token configurations range from approximately 20 to 28 hours; exact behavior varies by vendor, token type, and configured policy. Shorter lifetimes limit the exposure window if a token is compromised, which is often favored for machine-to-machine and API access, at the cost of more frequent token renewal. When an access token expires, the client typically must acquire a new token, often via a refresh token or by reauthenticating, rather than continuing to present the expired credential. Token lifetime governs the runtime validity window and is distinct from, though related to, revocation and refresh-token rotation; the specific policies configurable (for access, ID, and SAML tokens) depend on the identity platform in use.
Why it matters
Token lifetime directly governs the window of opportunity available to an attacker who obtains a valid token. Because bearer tokens such as OAuth 2.0 access tokens are typically honored by resource servers on presentation, without re-checking the original authentication, a stolen token remains usable until it expires (or, where supported, is revoked). Shorter lifetimes shrink this exposure window, which is why they are often favored for machine-to-machine and API access where reauthentication is cheap or automated. Longer lifetimes reduce renewal overhead but leave a compromised token valid for longer.
The tradeoff is a balancing act rather than a universally correct setting. Setting lifetimes too short can increase load on token endpoints and degrade user or client experience through frequent renewal; setting them too long weakens the security benefit of expiration. In most deployments the choice depends on token type, the sensitivity of the protected resource, and whether refresh tokens or revocation mechanisms are available as compensating controls. It is worth noting that lifetime alone does not provide immediate containment: a self-contained token, once issued, generally remains valid for its full lifetime regardless of later events unless the platform supports revocation or short-lived issuance, so lifetime settings should be evaluated alongside those mechanisms rather than in isolation.
Who it's relevant to
Inside Token Lifetime
Common questions
Answers to the questions practitioners most commonly ask about Token Lifetime.
