# 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.

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](/gateway/) or have it ask the realm; if your API only checks signatures, a
revoked token keeps working until it expires.

## 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

| 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](/workforce-identity/applications/revoke-access/introspection/) or [Ask the realm](/gateway/decisions/ask-the-realm/) | At once |
| The [gateway](/gateway/), or your own enforcement point polling the [revocation feed](/gateway/revocation/revocation-feed/) | At its next poll: 10 seconds by default |
| An API that checks signatures and reads [status lists](/workforce-identity/applications/revoke-access/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

To make revocations bite sooner:

- **Put the gateway in front**, or have the API introspect: see
  [Get started with Gateway](/gateway/get-started/).
- **Poll more often.** Lower the gateway's revocation poll interval, in seconds (default `10`, more than `3`): see
  [Gateway configuration](/gateway/configuration/#how-current-it-stays).
- **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](/workforce-identity/guides/services/set-token-lifetimes/).

## 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](/gateway/protect-apis/run-the-gateway/#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](/gateway/revocation/what-can-be-revoked/#a-client-you-set-inactive).

## 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

Every revocation is on the audit trail when it's made, whichever way it's checked: see
[Audit record](/gateway/revocation/what-can-be-revoked/#audit-record).

## 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

- **Instant revocation:** revocations pushed to every gateway the moment they happen. See
  [What's next for revocation](/gateway/revocation/whats-next/#instant-revocation).

## Related

- [What can be revoked](/gateway/revocation/what-can-be-revoked/): what each revocation stops.
- [Revoke a token](/gateway/guides/revoke-a-token/): the task, start to finish.
- [Check a token at your API](/gateway/guides/check-a-token-at-your-api/): checking for yourself or asking.
