Skip to content

Token introspection response viewer

Paste a token introspection response (RFC 7662) to read whether the token is active, its scopes, client, user and times.

Runs in your browser. Nothing you paste is sent to us.

Response

A sample active response for the made-up realm acme is filled in. Keycloak’s endpoint is /realms/<realm>/protocol/openid-connect/token/introspect.

What it says

Active
The authorization server says this token is valid right now.
openidprofileemail
scope
openid profile emailScopes granted to the token
client_id
web-appThe client the token was issued to
username
aliceHuman-readable name of the user
token_type
BearerType of token, such as Bearer
sub
3f6c1a52-sample-0000-0000-000000000001Subject: usually the user id
aud
orders-api, accountWho the token is meant for
iss
https://auth.example.com/realms/acmeWho issued the token
jti
7c1e2a9b-sample-0000-0000-000000000001Token id
exp
2025-11-24T16:05:00Z (11/24/2025, 4:05:00 PM)
iat
2025-11-24T16:00:00Z (11/24/2025, 4:00:00 PM)
Other members (extensions, such as the token’s own claims)
{
  "azp": "web-app",
  "realm_access": {
    "roles": [
      "default-roles-acme",
      "order-manager"
    ]
  }
}

How to use it

  1. Call the introspection endpoint with the token and your client’s credentials.
  2. Paste the JSON response.
  3. Read active first. If it is false, reject the token.
  4. Read scope, client_id, username and the times.

What to know

Introspection asks the authorization server whether a token is still valid. It catches tokens that were revoked or belong to a closed session, which a local signature check cannot see.

Keycloak’s endpoint is /realms/<realm>/protocol/openid-connect/token/introspect, and the caller must authenticate as a client. For an active token, Keycloak includes the token’s claims, such as realm_access, in the response.

An inactive token returns active false. RFC 7662 says the server should not say why, and the client should not rely on any other member.

What token introspection is

Token introspection (RFC 7662) lets a resource server ask the authorization server: is this token valid right now, and what does it say? The server answers with a JSON object whose active member is true or false, plus details about the token when it is active.

Introspection works for any kind of token, including opaque tokens that are just random strings. For JWTs it adds something local validation cannot give: knowledge of revocation and ended sessions. A JWT whose signature and expiry look fine can still be inactive because the user signed out.

How an introspection call works

The resource server sends a POST to the introspection endpoint, form-encoded, with the token in the token parameter. It authenticates as a client, for example with HTTP Basic using its client id and secret.

An introspection request to the sample realm acme
POST /realms/acme/protocol/openid-connect/token/introspect
Host: auth.example.com
Authorization: Basic b3JkZXJzLWFwaTpzYW1wbGUtc2VjcmV0
Content-Type: application/x-www-form-urlencoded

token=eyJhbGciOi…

The introspection request builder writes this request for you as curl or HTTP.

The response members

MemberMeaning
activeRequired. true if the token is valid now, otherwise false
scopeSpace-separated scopes granted to the token
client_idThe client the token was issued to
usernameA human-readable name of the user
token_typeThe type of token, such as Bearer
exp, iat, nbfTimes, in Unix seconds
sub, aud, iss, jtiSubject, audience, issuer and token id

All members except active are optional, and servers may add their own. When active is false, RFC 7662 says the server should not include anything else, and clients must not rely on any other member.

What this viewer does

  • Shows clearly whether the token is active.
  • Lists the granted scopes as badges.
  • Shows the standard members with a note on each, and times as dates with how long ago or from now.
  • Flags a missing or non-boolean active, extra members on an inactive response, and an active token whose exp has passed.
  • Lists all other members separately, such as the token’s own claims.
  • Reads JWT responses (RFC 9701) from their token_introspection claim.

It reads a response you paste. It does not call any server, so you need to make the request yourself.

How to read a response

  1. Call the introspection endpoint with the token and your client’s credentials.
  2. Paste the JSON response.
  3. Read the status first. If it says “Not active”, the token must be rejected, whatever else you see.
  4. For an active token, check scope, client, user and times against what your API expects.

Introspection in Keycloak

A Keycloak realm’s endpoint is https://<host>/realms/<realm>/protocol/openid-connect/token/introspect, listed in the discovery document as introspection_endpoint. The caller must authenticate as a client of the realm, typically a confidential client representing your API.

For an active token, Keycloak returns the token’s claims, such as realm_access, resource_access and preferred_username, together with active and introspection members such as client_id and username. For an expired, revoked or unknown token it returns {"active": false}.

Lightweight access tokens

Recent Keycloak versions can issue lightweight access tokens that leave most claims out, to keep tokens small. Resource servers then call introspection to get the full set of claims. The client setting for this is in its advanced settings.

When tokens become inactive

A Keycloak access token becomes inactive when it expires, when its user session ends (sign-out, session timeout, or an admin ending the session), or when it is revoked. Introspection reflects all of these; local JWT validation sees only expiry.

Use cases

Catching revoked tokens

For sensitive operations, such as payments or admin actions, an API can introspect even JWTs, so a sign-out takes effect at once instead of when the token expires.

Opaque tokens

When tokens are not JWTs, introspection is the only way for an API to learn anything about them.

Debugging “active: false”

Paste the response alongside the JWT decoder output for the same token. If the JWT has not expired but introspection says inactive, the session ended or the token was revoked.

Common problems

SymptomLikely cause
401 from the introspection endpointWrong client credentials, or a public client trying to introspect
active: false for a fresh tokenToken from another realm, or its session already ended
active: false after a sign-outExpected: the session ended, so its tokens are inactive
active is the string "true"A broken server or proxy; it must be a JSON boolean

Introspection compared with local validation

Resource servers have two ways to check an access token. Each has a place.

Local JWT validationIntrospection
Network call per requestNoYes, unless cached
Sees revocation and ended sessionsNo, only expiryYes
Works with opaque tokensNoYes
Needs client credentialsNoYes
Load on the authorization serverOnly fetching keysOne call per check

A common design validates locally for ordinary reads, and introspects before actions that must respect a sign-out at once. Short access token lifetimes narrow the gap for everything else.

Setting up an introspecting client in Keycloak

  1. Create a client for your API, for example orders-api, with Client authentication turned on so it is confidential.
  2. It does not need any login flow; you can turn off the standard flow for it.
  3. Copy its secret from the Credentials tab and store it in the API’s secret store.
  4. Call the introspection endpoint with HTTP Basic using that client id and secret.

The API then sees the same claims a JWT would carry, plus active. Keep the secret on the server; it must never reach a browser.

Caching responses safely

Introspecting every request can put real load on the authorization server. Caching helps, at the cost of noticing revocation later.

  • Key the cache by a hash of the token, not the token itself.
  • Cache active responses for a short time, such as a few seconds to a minute.
  • Never keep a response past the token’s exp.
  • Do not cache inactive responses for long; a retry with the same token should fail quickly anyway.

Log the outcome of introspection calls without logging the token itself. A count of inactive results per client is a useful signal: a sudden rise often means a sign-out wave, a misconfigured client, or someone replaying old tokens.

If your API runs several instances, a shared cache avoids each instance introspecting the same token separately.

Security notes

Only authenticated clients should be able to introspect, otherwise the endpoint becomes a way to test stolen tokens. Use a confidential client for your API and keep its secret on the server.

Caching responses saves round trips but delays revocation. If you cache, keep the cache short and never past the token’s exp.

The sample response on this page is made up. It shows the shape of an active response for the realm acme.

Best practices

  • Check active first, and treat anything other than the boolean true as inactive.
  • Use introspection where revocation must take effect quickly; validate JWTs locally elsewhere.
  • Authenticate the introspecting client and limit which clients may do it.
  • Combine introspection with your own scope and audience checks.
Questions

Frequently asked questions

Why is my token inactive although it has not expired?

The session may have ended, the user may have signed out, or the token may have been revoked. The server may also refuse to describe tokens issued to other clients or realms.

Should I introspect on every request?

It adds a network call per request. Many APIs verify tokens locally and introspect only when they must catch revocation quickly. If you cache responses, never cache them past the token’s `exp`.

Can I paste a JWT response?

Yes. A JWT response (RFC 9701) is read from its `token_introspection` claim. Its signature is not checked here.

What is the Keycloak introspection endpoint?

`https://<host>/realms/<realm>/protocol/openid-connect/token/introspect`. It needs client authentication, such as HTTP Basic with a confidential client’s id and secret.

Why does an inactive response contain only `active: false`?

RFC 7662 asks servers not to explain why a token is inactive, so an attacker learns nothing from probing. Your code should reject the token and not look for reasons.

Can a public client call introspection?

It should not. Introspection is for resource servers that authenticate as confidential clients. Public clients such as browser apps cannot keep a secret.

Is introspection better than validating JWTs locally?

It is more current, because it sees revocation and ended sessions, but slower, because it needs a call. Many systems use local validation by default and introspection for sensitive actions.

Which client should call the introspection endpoint?

A confidential client that represents your API, with its own secret. It does not need to be the client that obtained the token.

Does introspection return the same claims as the JWT?

For Keycloak, an active response includes the token’s claims plus introspection members such as `active`, `client_id` and `username`. Other servers may return fewer claims.

Does introspection work for refresh tokens?

RFC 7662 allows any token type, and the `token_type_hint` parameter can say which kind you send. Resource servers normally introspect access tokens only, since refresh tokens are meant for the client and the authorization server.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.