Skip to content
GatewayMarkdown

How fast revocation takes effect

How soon a revoked token stops working at the realm, at the gateway, and at an API that checks tokens for itself, and how to make it sooner.

AvailableAPI

A revocation takes effect at the realm the moment it’s saved. Everywhere else, it takes effect when the place that checks the token next learns of it, and that depends on how it checks. If a revoked token must stop within seconds, put your API behind the gateway or have it ask the realm; if your API only checks signatures, a revoked token keeps working until it expires.

  • Nothing to set up to read this page. Changing how soon revocations bite takes a realm administrator in a group holding RealmOwner, with the API, or access to the gateway’s settings.
Where the token is checkedA revoked token is refused
The realm itself: userinfo, token exchange, refreshAt once
An API that asks the realm, by introspection or Ask the realmAt once
The gateway, or your own enforcement point polling the revocation feedAt its next poll: 10 seconds by default
An API that checks signatures and reads status listsAt its next fetch of the list: lists are good for a minute
An API that checks signatures onlyWhen the token expires: five minutes by default

An agent asking for a new token is refused at once in every case, since only the realm issues tokens.

To make revocations bite sooner:

  • Put the gateway in front, or have the API introspect: see Get started with Gateway.
  • Poll more often. Lower the gateway’s revocation poll interval, in seconds (default 10, more than 3): see Gateway configuration.
  • List tokens for offline checkers. Set statusListed: true on a client, or name an API in the realm’s oauth2Settings.statusListedResources, and its tokens carry a status-list entry.
  • Shorten access tokens. Lower oauth2Settings.accessTokenLifetimeSecs: see Set how long tokens live.
  • A gateway that can’t keep up refuses. Rather than let through a token it can’t vouch for, the gateway refuses while its revocation list is stale: see Fails closed.
  • A missed poll loses nothing. Each poll returns every live revocation, so the next good poll catches up.
  • Clients are the exception at the gateway: see A client you set inactive.
WhatDefaultCan it change?
The gateway’s revocation pollEvery 10 secondsYes, to more than 3 seconds
Status listsGood for a minuteNo
Access tokensFive minutesoauth2Settings.accessTokenLifetimeSecs

Every revocation is on the audit trail when it’s made, whichever way it’s checked: see Audit record.

SymptomCauseFix
A revoked token works at your API for up to five minutesYour API checks signatures onlyRead status lists, introspect, or put the gateway in front
A revoked token works at the gateway for more than 10 secondsThe gateway’s poll interval was raised, or polls are failingCheck the interval; while polls fail, the gateway refuses everything after three