Skip to content
Workforce IdentityMarkdown

Revoke tokens

A client revokes a token it no longer needs, and every other way access ends across the realm reaches the same places.

AvailableAPIRFC 7009

A client posts a token it holds to the realm’s revocation endpoint, for example at sign-out, and the token is revoked. Revoking a refresh token revokes its whole family, with every access token issued under it. Revoking an access token also revokes every token exchanged from it through token exchange.

Revocation is one of several ways access ends, and all of them reach the realm, introspection, status lists and the gateway alike:

WithdrawnByEnds
One tokenThe client, at the revocation endpointThat token, and every token exchanged from it
A refresh familyThe client, or a reused refresh token (with rotation)Every token from one sign-in
A sessionSign-out, or a timeoutEvery online grant from it
A client grantThe user, on Authorized AppsThat app’s tokens for that user
A delegationThe user, on AI AgentsThat agent’s tokens in their name
An agentA quarantine or killIts tokens, and its children’s
A user’s credentialsA partner’s security signalEverything issued to them before that moment
A clientSetting it inactiveAll its tokens
  • Who can do it: a client revokes its own tokens, with its own credentials; no administrator right is involved. To end everything a user holds, a realm administrator ends their sessions instead (Session management).
  • Where: the client calls https://foobar.cvyuh.com/oauth2/revoke. A user takes back an app on their Authorized Apps page in the dashboard.
  • First: nothing to set.

The client authenticates as it does at the token endpoint (a public client sends only its client_id), and posts the token:

Terminal window
curl https://foobar.cvyuh.com/oauth2/revoke \
-d token=8xLOxBtZp8 \
-d token_type_hint=refresh_token \
-d client_id=orders-web

The answer is 200 with an empty body.

token_type_hint only orders the search: refresh_token looks among refresh tokens first, and any other hint, or none, looks among access tokens first. A wrong hint still finds the token.

A held request is canceled here too. An agent’s client whose request waits for its owner (agent guardrails) cancels it by revoking its deferral code, with token_type_hint=urn:ietf:params:oauth:token-type:deferral-code. A token already collected for that code stays valid. While the realm offers the deferred grant, discovery lists this hint in revocation_endpoint_token_type_values_supported.

Nothing to set. The client posts to https://foobar.cvyuh.com/oauth2/revoke, which discovery publishes as revocation_endpoint. A browser app may call it from its own page: see browser apps.

  • The caller authenticates first. A caller that doesn’t is refused before any token is looked at.
  • A client may revoke only its own tokens. Another client’s is refused unauthorized_client, and stays valid.
  • An unknown or expired token is answered 200, and nothing changes.
  • A revoked access token stays revoked until its exp plus the realm’s clock tolerance (clockSkewSecs), so it never reads active again.
Setting or limitDefaultRange
How long a revocation is keptthe token’s exp plus clockSkewSecs (60)clockSkewSecs 0 to 300
How fast it takes effectat once at the realm and in introspection; at the gateway and in status lists within secondsfixed
Who may revoke a tokenthe client it was issued tofixed
SymptomCauseFix
200, but the token still works at your APIYour API checks signatures only, and the token is still within its expIntrospect, read the status list, or put the API behind the gateway
unauthorized_clientThe token was issued to another clientRevoke from the client that holds it, or end the user’s session
invalid_clientThe caller didn’t authenticate as it does at the token endpointSend its credentials, or client_id for a public client

Every revocation is a TOKEN_REVOKED record, whatever the realm’s settings: under the token’s user or agent, naming the client and the kind of token, or under the client for a deferral code. A user taking back an app or an agent is APP_TAKEN_BACK or AGENT_TAKEN_BACK. See them in Audit → Authentication, or on the user’s trail (Read a user’s or agent’s trail).

ErrorWhen
invalid_clientThe caller doesn’t authenticate
invalid_requestNo token is sent, or a parameter is sent twice
unauthorized_clientThe token was issued to another client