Skip to content
GatewayMarkdown

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.

  • A client for your enforcement point with the scope revocations:read: registering it takes a realm administrator in a group holding RealmOwner, with the API.
  • An enforcement point of your own that verifies tokens and can hold the feed between polls.

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:

ListRefuse a token when
tokensIts jti, or the jti of any token it was exchanged from, is listed
familiesIts refresh family is listed
sessionsThe session it names (sid) is listed
subjectsIts sub, or any actor in its act, is listed: a stopped agent, every agent beneath it, or a user no longer active
subjectsBeforeIts sub or an actor is listed and the token was issued at or before notBeforeMs
grantsIts sub and client_id are a listed pair, and it was issued at or before notBeforeMs: the user took back that app
delegationsIts 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.

  1. Register your enforcement point as a client with the client_credentials grant and the scope revocations:read, with https://foobar.cvyuh.com/policies/v1 in its allowedResources: the call is on Decide locally.

  2. 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": [] }
  3. 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.

  • Check the whole chain. Check the token’s sub and every actor in its act, and every token it was exchanged from, not just the outermost.
  • Clients aren’t listed: see A client you set inactive.
WhatValue
How long an entry stays listedWhile a token it covers could still verify
A changed feedA new ETag; an unchanged one is 304
The token to read itAudience 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”
StatusWhyWhat to do
401The token is missing, expired or for another audienceGet a new token for https://foobar.cvyuh.com/policies/v1
403The token lacks revocations:readAdd the scope to the client
5xx, or no answerThe realm couldn’t answerKeep the last good copy, and refuse once it’s too old

Reading the feed writes no record. Each revocation it lists was recorded when it was made: see Audit record.