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.
Before you begin
Section titled “Before you begin”- 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.
How it works
Section titled “How it works”| Where the token is checked | A revoked token is refused |
|---|---|
| The realm itself: userinfo, token exchange, refresh | At once |
| An API that asks the realm, by introspection or Ask the realm | At once |
| The gateway, or your own enforcement point polling the revocation feed | At its next poll: 10 seconds by default |
| An API that checks signatures and reads status lists | At its next fetch of the list: lists are good for a minute |
| An API that checks signatures only | When 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.
Set it up
Section titled “Set it up”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 than3): see Gateway configuration. - List tokens for offline checkers. Set
statusListed: trueon a client, or name an API in the realm’soauth2Settings.statusListedResources, and its tokens carry a status-list entry. - Shorten access tokens. Lower
oauth2Settings.accessTokenLifetimeSecs: see Set how long tokens live.
Good to know
Section titled “Good to know”- 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.
Limits and defaults
Section titled “Limits and defaults”| What | Default | Can it change? |
|---|---|---|
| The gateway’s revocation poll | Every 10 seconds | Yes, to more than 3 seconds |
| Status lists | Good for a minute | No |
| Access tokens | Five minutes | oauth2Settings.accessTokenLifetimeSecs |
Audit record
Section titled “Audit record”Every revocation is on the audit trail when it’s made, whichever way it’s checked: see Audit record.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| A revoked token works at your API for up to five minutes | Your API checks signatures only | Read status lists, introspect, or put the gateway in front |
| A revoked token works at the gateway for more than 10 seconds | The gateway’s poll interval was raised, or polls are failing | Check the interval; while polls fail, the gateway refuses everything after three |
Coming next
Section titled “Coming next”- Instant revocation: revocations pushed to every gateway the moment they happen. See What’s next for revocation.
Related
Section titled “Related”- What can be revoked: what each revocation stops.
- Revoke a token: the task, start to finish.
- Check a token at your API: checking for yourself or asking.