Skip to main content

Token Revocation

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Token Revocation (RFC 7009) lets a client tell Choreo Identity & Access Management that a token should stop working before it expires. Choreo Identity & Access Management extends this with broader scopes, so an operational event such as a sign-out, a user deletion, an account suspension, or an application deletion can invalidate many tokens at once.

Access tokens are self-contained JWTs, so a resource server that validates them locally has no way to know a token was revoked. Choreo Identity & Access Management solves this with a denylist that both the authorization server and resource servers consult. The scopes below differ only in what goes on that list.

Revocation Scopes​

ScopeWhat it invalidatesTypical trigger
Single tokenOne token, by its jtiA client calls /oauth2/revoke; a refresh token is rotated
GrantEvery token of one authorization grant, by its tfidSign-out, refresh-token replay, authorization-code replay
SubjectEvery token issued to one user, agent, or application, by its subA user is deleted; a user, agent, or application is suspended
ClientEvery token issued through one OAuth client, by its client IDAn application, or an agent with an OAuth client, is suspended; an application is deleted or its client secret is replaced

A token is rejected if any of these matches.

Revoke a Single Token​

How Choreo Identity & Access Management Implements It
AspectBehavior
EndpointPOST /oauth2/revoke
AuthenticationRequired, same client authentication method as the token endpoint (see Client Authentication Methods)
token parameterRequired. The access token or refresh token to revoke
token_type_hint parameterAccepted but not used internally: the server determines the token type itself
Success responseHTTP 200 with an empty body, as RFC 7009 §2.2 requires
Unknown or already-expired tokenHTTP 200. The endpoint never reveals whether a token existed
Token issued to another clientHTTP 400 with invalid_grant
Tokens supportedAccess tokens and refresh tokens
SignatureVerified before anything is recorded, so a token Choreo Identity & Access Management did not issue cannot be added to the denylist
Expired tokensStill revocable. Expiry is ignored on this endpoint, so an expired token can be presented to revoke the rest of its grant
curl -X POST https://<DATA_PLANE_URL>/oauth2/revoke \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d "token=$ACCESS_TOKEN"

A successful revocation returns 200 OK with no body.

Ownership​

RFC 7009 §2.1 requires the server to verify that the token was issued to the authenticated client. Choreo Identity & Access Management enforces this for both token types: access tokens are matched on their client_id claim, and refresh tokens on their sub claim, which carries the owning client. A client attempting to revoke another client's token receives invalid_grant.

Grant-Scoped Revocation​

Revoking one token of a grant usually should not leave its siblings working. Five refreshes produce a chain of access and refresh tokens that all descend from the same authorization, and revoking the newest refresh token alone would leave live access tokens behind.

Choreo Identity & Access Management groups these into a token family, identified by a tfid claim carried on every token of the grant. By default, revoking any token of a family revokes the family in both directions: revoking a refresh token invalidates the access tokens issued alongside it, and revoking an access token invalidates the refresh token that would mint replacements. What Revokes a Family below lists the setting that controls this, along with the other triggers.

Where tfid Comes From​

FlowBehavior
Authorization code with SSOMinted when the session is established and stored against the session participant, which is what makes sign-out revocation possible
Authorization code without SSOMinted when the authorization code is created, so the grant is still revocable
RefreshCopied to the new tokens, so a family survives rotation
Token exchangeControlled by oauth.token_exchange.token_family. none (the default) issues an independent token; inherit copies the subject token's family
Client credentials, CIBANo tfid. There is no user grant to group, so family-scoped revocation does not apply

What Revokes a Family​

TriggerSettingDefault
A client revokes a token that carries a tfidoauth.revocation.token_family.on_explicit_revoketrue
A rotated-out refresh token is presented again (replay)oauth.revocation.token_family.on_refresh_replaytrue
An authorization code is redeemed twice (replay)oauth.revocation.token_family.on_code_replaytrue
The user signs out through RP-Initiated LogoutAlways onNot configurable
note

Refresh-token replay detection depends on rotation, since a token can only be replayed once it has been rotated out. Enable oauth.refresh_token.renew_on_grant to use it.

Session sign-out revokes the family. Session expiry does not: a session that simply times out leaves its tokens valid until they expire on their own.

Subject-Scoped Revocation​

Some events invalidate tokens that no single client is holding, and that span more than one grant. Deleting a user is the clearest case: their tokens may be spread across several applications and devices, and nobody presents them to be revoked.

For these, Choreo Identity & Access Management revokes by subject: every token issued to that user, agent, or application is rejected, across every application and device, without anyone having to present or enumerate them. Tokens already carry sub, so no additional claim is needed.

User Deletion​

Choreo Identity & Access Management ships an administration flow that runs when a user is deleted from the Console. It checks the caller's permission, revokes the user's tokens by subject, terminates their sessions, and then removes the record. flow.userDeletionFlow.defaultHandle names the flow to run. Pointing it at a different administration flow replaces the shipped one.

Account Suspension​

The suspend flow revokes tokens for the target subject and ends its sessions before placing the suspension. For an application or an agent with an OAuth client, it also revokes tokens issued through that client ID, including user tokens.

The revocation cutoff is the time Validate and Plan Suspension runs, plus jwt.leeway. Matching tokens issued at or before that cutoff are rejected. Unsuspending does not remove these revocation records. See Suspend an Account for the administration steps.

An automatic account lock revokes nothing: it refuses new sign-ins only.

Application Deletion and Secret Regeneration​

Deleting an application revokes every token issued to it and detaches it from the sessions it took part in, and then removes the record. This happens whichever way the application is deleted: from the Console, through Dynamic Client Registration, or when a configuration version that no longer has the application is applied to a gateway.

Replacing an application's client secret, with Regenerate client secret in the Console, revokes the tokens issued before the change in the same way, so a secret that leaked takes what it issued with it. An apply of a configuration version that carries the application's current secret changes nothing and revokes nothing. An apply that carries a different secret is a rotation, and revokes as one.

The revocation runs before the change is written, and if it fails nothing is written. Once the change is written, the revocation's cutoff moves to that moment, so a token issued while the change was being written is revoked too:

ChangeRevokes tokens issued up toEffect after the change
Application deletedThe deletionAn application registered later under the same client ID (for example, by rolling back to a configuration version that still has it) is a new application. The tokens it issues are valid.
Client secret replacedThe new secret being writtenEvery token the new secret issues is valid.

The Console's secret regeneration flow revokes until the new secret is written.

The revocation runs as two system flows: flows built into the Choreo Identity & Access Management binary, one that a service runs before it writes the change and one it runs after. They are not resources: they are never stored, they cannot be edited or started through any API, and they never ask for input. A failure before the write leaves the application as it was. A failure after it is reported as an error: a deletion keeps the application's record, so deleting it again revokes and removes it, and a secret replacement keeps the new secret, which the refresh grant already enforces by refusing the refresh tokens issued before it.

Where Revocation Is Enforced​

Revocation is checked at two independent points, and they do not become consistent at the same speed.

Enforcement pointWhat it coversFreshness
Authorization serverIntrospection, the refresh grant, token exchange, and internal validationImmediate. Reads the denylist directly
Resource serverRequests to Choreo Identity & Access Management's own protected APIsEventually consistent. Serves an in-memory snapshot refreshed on an interval
note

A revoked token normally stops being accepted by a resource server within server.security.token_revocation.sync_interval_seconds (60 seconds by default). For an immediate answer, call Token Introspection, which reads current state. Lower the sync interval to shorten the delay, at the cost of more frequent database reads.

Authorization-server enforcement fails closed. If the denylist cannot be read, token validation fails rather than assuming the token is good. Resource-server enforcement keeps serving its last good snapshot across a transient refresh failure.

Resource-server enforcement covers services that share this deployment's database. An external resource server with no access to it should use Token Introspection instead.

Configuration​

Revocation behavior on the authorization server, part of OAuth Configuration:

SettingDefaultDescription
oauth.token_revocation.enabledtrueEnables revocation on the authorization server: the /oauth2/revoke endpoint, the implicit triggers below, and the check that rejects revoked tokens during introspection, the refresh grant, and token exchange. Setting it to false turns off all of them, not just the endpoint
oauth.revocation.token_family.on_explicit_revoketrueRevoking a token also revokes its token family
oauth.revocation.token_family.on_refresh_replaytrueA replayed refresh token revokes its token family. Requires oauth.refresh_token.renew_on_grant
oauth.revocation.token_family.on_code_replaytrueA replayed authorization code revokes the token family issued from it
oauth.token_exchange.token_familynonenone issues an independent token; inherit keeps the subject token's family
oauth.refresh_token.renew_on_grantfalseIssues a new refresh token on each grant. Required for rotation and replay detection
oauth.refresh_token.revoke_previous_on_renewtrueRevokes the consumed refresh token after rotation, making refresh tokens single-use

Revocation enforcement on resource-server requests, part of Security Configuration:

SettingDefaultDescription
server.security.token_revocation.enabledtrueEnforces revocation on requests to protected APIs
server.security.token_revocation.sourcedbWhere the revocation snapshot is read from. db is the only supported value
server.security.token_revocation.sync_interval_seconds60How often the snapshot refreshes, which sets the normal propagation delay before a revoked token stops being accepted

Was this page helpful?