Pcornel
Browse topics
Options
Recent
Favorites
Identity · Technical reference

Tokens

Direct answer

Tokens in SSO and federation are signed data structures — SAML assertions, ID tokens, access and refresh tokens — that carry identity and authorization between identity provider, client and APIs.

When to use this

Use this when working with SAML assertions, ID, access or refresh tokens.

First 30 seconds

1. Tokens carry authentication/authorization (JWT, opaque).

2. Always validate signature and claims.

3. Short lifetimes.

4. Protect in storage (no localStorage for sensitive).

5. Revoke on risk.

Operational verification

issuer signs token → client presents → API validates

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Identity, authentication and access control
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformIdentity, authentication and access control
Scope / prerequisiteUse this when working with SAML assertions, ID, access or refresh tokens.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

4 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Checks Verify boundary

Decode a JWT (header.payload.signature, base64url) and check iss, aud, exp, nbf, scp/roles. Validate the signature against the IdP's JWKS (/.well-known/openid-configuration → jwks_uri).

Never paste production tokens into public decoding sites.

Step 2 Verification path Verify boundary
# Inspect a JWT's header and payload (no signature validation)
python3 -c 'import sys,json,base64; [print(json.dumps(json.loads(base64.urlsafe_b64decode(p+"="*(-len(p)%4))),indent=1)) for p in sys.argv[1].split(".")[:2]]' "$TOKEN"

# Human-readable times
date -d @1767225600

# Keys the issuer currently publishes (match the header's kid)
curl -s https://login.example.com/.well-known/openid-configuration | jq -r .jwks_uri | xargs curl -s | jq -r '.keys[].kid'

Check in order: is it the right type of token for this use (ID vs access), the right issuer, the right audience, still valid (nbf ≤ now < exp, allowing small skew), signed with a known key, and carrying the expected scopes/roles.

Step 3 Troubleshooting Narrow the fault
  • 401 from an API: decode the token — usually wrong audience (token for another API), expired, or the API does not trust the issuer/keys.
  • 403 with a valid token: scopes or roles missing — consent or role assignment, not authentication.
  • Works, then fails after some time: refresh flow broken (refresh token revoked, rotated twice, expired).
  • Fails right after the IdP rotated keys: the API cached old JWKS; refresh on unknown kid.
Step 4 Common mistakes Narrow the fault
  • APIs accepting tokens without checking aud.
  • Long-lived access tokens; revoke refresh tokens on account compromise.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • SAML assertions, ID tokens, access tokens and refresh tokens have different purposes.
  • Every token must be validated.
  • Protect tokens in transit and storage.
Key checks
  • python3 -c "import jwt,sys;print(jwt.decode(sys.argv[1],options={'verify_signature':False}))" <token> — decode JWT (inspection only)
  • Token lifetimes — exp policy
  • Revocation capability — sessions/refresh tokens
ReferenceWhat it is1 section · depth on demand

Direct Answer

Tokens carry identity and permissions from an identity provider to applications: SAML assertions and OIDC ID tokens say who the user is; OAuth access tokens let a client call an API; refresh tokens get new access tokens. JWTs are signed, readable JSON — validate issuer, audience, expiry and signature, never trust them unvalidated, and keep access tokens short-lived.

ReferenceWhy it matters1 section · depth on demand

Token types

TokenFormatUsed by
SAML assertionSigned XMLSP login
OIDC ID tokenJWTClient: who the user is
OAuth access tokenJWT or opaqueAPI: what the client may do
Refresh tokenOpaqueObtain new access tokens
ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Tokens carry identity and authorisation from an identity provider to clients and APIs, so that passwords are not passed around.

Kinds of token

TokenFormatAudiencePurpose
SAML assertionSigned XMLService providerBrowser SSO login
ID token (OIDC)Signed JWTClient applicationWho the user is and how they authenticated
Access token (OAuth 2.0)JWT or opaque stringAPI (resource server)Permission to call the API with given scopes
Refresh tokenUsually opaqueAuthorization serverGet new access tokens without a new login
Kerberos ticketBinary, encryptedKerberos serviceWindows/AD service access

JSON Web Tokens (JWT, RFC 7519)

A JWT is header.payload.signature, each part base64url-encoded. The header names the algorithm (alg, e.g. RS256, ES256) and key ID (kid); the payload carries claims (iss, sub, aud, exp, nbf, iat, scp/roles …); the signature (JWS) proves integrity. A JWT is readable by anyone who has it — it is signed, not encrypted, unless JWE is used. Never put secrets in a JWT.

Self-contained vs opaque

  • JWT access tokens are validated locally by the API (signature with the issuer's JWKS, iss, aud, exp, scopes) — fast, but cannot be revoked before expiry, so keep them short-lived.
  • Opaque tokens are random references; the API asks the authorization server through token introspection (RFC 7662), which allows immediate revocation.

Bearer vs sender-constrained

Most access tokens are bearer tokens: whoever holds one can use it. Sender-constrained tokens are bound to a key the client must prove it holds (mutual TLS, RFC 8705, or DPoP, RFC 9449), so a stolen token is useless elsewhere.

Safe handling (RFC 8725 and OAuth security BCP)

Accept only expected algorithms (never none), validate issuer and audience, keep access tokens short-lived, protect refresh tokens (rotation, secure storage), never log full tokens, and send tokens only over TLS.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle and ownership

TokenTypical lifetimeEnded by
Access tokenMinutes to about an hourExpiry (JWT) or revocation via introspection (opaque)
ID tokenMinutes; used once at loginExpiry; the app's own session lasts longer
Refresh tokenHours to months, often slidingRevocation, rotation, password reset, user disabled, inactivity
SAML assertionMinutes (validity window)Expiry; SP session separate

The identity provider owns token lifetimes and signing keys; the application owns its session, token storage and validation. Revoking a user's refresh tokens does not end already-issued access tokens — they live until expiry, which is why access tokens should be short.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docIdentity, authentication and access control current

Authoritative/upstream documentation reviewed for bounded claims in Single Sign-On & Federation → Tokens. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc7522 · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
json web tokenjwtsecurity tokens
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

FieldWhat to look for
alg / kid (header)Expected algorithm; kid present in the issuer's JWKS
issExactly the configured issuer (tenant-specific vs common endpoints differ)
audThe API's identifier (access token) or the client ID (ID token)
exp, nbf, iatUnix seconds; compare with current UTC time
scp / scopeDelegated permissions granted to the client
rolesApplication roles (often for app-only tokens)
azp / appidWhich client obtained the token
sub / oidSubject — stable user or service identifier
typ: at+jwtAccess token per RFC 9068 — must not be accepted as an ID token
Confirmation

Confirm action

Continue?