Revocation feed
Every live revocation in the realm, in one feed your own enforcement point polls, so a decision made without the realm still refuses what the realm has revoked.
AvailableAPIRFC 9110
An enforcement point that decides locally (Decide locally) never asks the realm about a token, so it needs another way to learn what the realm has revoked. The revocation feed is that way: one answer listing every revoked token, session and principal that could still verify. The gateway polls it every ten seconds; your own enforcement point can do the same. The feed is available today, with or without the gateway.
Before you begin
Section titled “Before you begin”- A client for your enforcement point with the scope
revocations:read: registering it takes a realm administrator in a group holdingRealmOwner, with the API. - An enforcement point of your own that verifies tokens and can hold the feed between polls.
How it works
Section titled “How it works”GET /policies/v1/revocations, with a token carrying the scope revocations:read for the resource
https://foobar.cvyuh.com/policies/v1, answers every list, each present whether empty or not:
| List | Refuse a token when |
|---|---|
tokens | Its jti, or the jti of any token it was exchanged from, is listed |
families | Its refresh family is listed |
sessions | The session it names (sid) is listed |
subjects | Its sub, or any actor in its act, is listed: a stopped agent, every agent beneath it, or a user no longer active |
subjectsBefore | Its sub or an actor is listed and the token was issued at or before notBeforeMs |
grants | Its sub and client_id are a listed pair, and it was issued at or before notBeforeMs: the user took back that app |
delegations | Its sub is listed, its act names the listed agent at any depth, and it was issued at or before notBeforeMs: the user took back that agent |
Each entry is an object: { "jti": … }, { "family": … }, { "sid": … }, { "sub": … }, and for the timed lists
{ "sub": …, "notBeforeMs": … }, with clientId or agent beside them. notBeforeMs is in milliseconds since the
epoch.
Every entry stays listed for as long as a token it covers could still verify, then drops off. So every poll returns
the whole feed, and a missed poll loses nothing. The answer carries an entity tag: send If-None-Match, and an
unchanged feed is a 304.
Set it up
Section titled “Set it up”-
Register your enforcement point as a client with the
client_credentialsgrant and the scoperevocations:read, withhttps://foobar.cvyuh.com/policies/v1in itsallowedResources: the call is on Decide locally. -
Poll the feed with its token, more often than you poll policies, and check every token against every list:
Terminal window curl -i https://foobar.cvyuh.com/policies/v1/revocations \-H "Authorization: Bearer $TOKEN" \-H 'If-None-Match: "<the last ETag>"'{ "tokens": [], "families": [], "sessions": [], "subjects": [{ "sub": "<agent id>" }],"subjectsBefore": [], "grants": [], "delegations": [] } -
Keep the last good copy when a poll fails, and refuse everything once polls have failed for long enough, as the gateway does: see Fails closed.
Good to know
Section titled “Good to know”- Check the whole chain. Check the token’s
suband every actor in itsact, and every token it was exchanged from, not just the outermost. - Clients aren’t listed: see A client you set inactive.
Limits and defaults
Section titled “Limits and defaults”| What | Value |
|---|---|
| How long an entry stays listed | While a token it covers could still verify |
| A changed feed | A new ETag; an unchanged one is 304 |
| The token to read it | Audience https://foobar.cvyuh.com/policies/v1, scope revocations:read |
What your enforcement point sees when it fails
Section titled “What your enforcement point sees when it fails”| Status | Why | What to do |
|---|---|---|
401 | The token is missing, expired or for another audience | Get a new token for https://foobar.cvyuh.com/policies/v1 |
403 | The token lacks revocations:read | Add the scope to the client |
5xx, or no answer | The realm couldn’t answer | Keep the last good copy, and refuse once it’s too old |
Audit record
Section titled “Audit record”Reading the feed writes no record. Each revocation it lists was recorded when it was made: see Audit record.
Related
Section titled “Related”- Decide locally: the rest of what a local enforcement point does.
- What can be revoked: what puts each entry in the feed.
- How fast revocation takes effect: the feed beside the other ways to check.