Token Lifecycle

Understanding how tokens are created, used, and retired in Authority.

Token Types Overview

spinner

Token States

spinner

Authorization Code

Purpose

Short-lived code exchanged for tokens. Separates user authentication from token issuance.

Lifecycle

Creation:  User approves consent
Lifetime:  10 minutes (configurable)
Exchange:  POST /token (one-time use)
Deletion:  After exchange or expiration

Security Properties

  • One-time use - Cannot be reused

  • Short-lived - Minimizes interception window

  • Client-bound - Tied to specific client

  • PKCE-protected - Proof of possession (public clients)

Access Token

Purpose

Authorizes API requests. Presented to resource servers.

Lifecycle

Format

Authority issues JWTs:

Validation

Resource servers validate by:

  1. Verifying JWT signature (JWKS)

  2. Checking expiration

  3. Verifying issuer and audience

  4. Checking required scopes

Refresh Token

Purpose

Obtains new access tokens without user interaction.

Lifecycle

Rotation

With rotation enabled:

Grace Period

Optional reuse window for concurrent requests:

ID Token

Purpose

Proves user authentication. Contains identity claims.

Lifecycle

Validation

Must validate:

  1. Signature (JWKS)

  2. Issuer matches expected

  3. Audience contains client ID

  4. Expiration not passed

  5. Nonce matches (if sent)

Token Revocation

Triggers

Tokens are revoked when:

  • User logs out

  • User changes password

  • Admin revokes manually

  • Security incident detected

  • Session ends

Cascade

Revocation Check

For real-time validation:

Token Storage

Server-Side

Client-Side

Token
Storage
Notes

Access

Memory

Clear on logout

Refresh

Secure cookie

httpOnly, secure

ID

Memory

User info display

Best Practices

Token Lifetimes

Environment
Access Token
Refresh Token

High Security

15 minutes

1 day

Standard

1 hour

30 days

User-Friendly

1 day

90 days

Refresh Strategy

Proactive:

Reactive:

Handling Expiration

Next Steps

Last updated

Was this helpful?