Skip to content

Revocation: resource tokens, and what a revoked token gets back - #150

Merged
dickhardt merged 2 commits into
mainfrom
resource-token-revocation
Sep 7, 2026
Merged

dickhardt merged 2 commits into
mainfrom
resource-token-revocation

Conversation

@dickhardt

Copy link
Copy Markdown
Owner

Stacked on #148. Depends on dickhardt/signature-key#37 for revoked_jwt.

Resource tokens are revocable

A resource issues resource tokens, so it can withdraw one. It calls the revocation endpoint of the party named in aud — the PS in three-party, the AS in four-party — and, in four-party, the ps as well: the agent hands the resource token to its PS first, so the PS holds it and may be running a consent prompt against it.

The recipient MUST NOT issue an auth token against it and SHOULD terminate a pending request started for it. Five minutes is the whole window (#resource-tokens), but it spans the wait for user interaction, which is exactly when a resource is most likely to want to withdraw a request it already challenged for.

What a revoked token gets back

This was undefined. A revoked token verifies, has not expired, has the right aud, and has intact claims — so invalid_* and expired_* are both false, and a caller told either has no reason not to present the same token again. Where the answer goes follows how the token was carried.

In the Signature-Key header (agent, person, or auth token): 401 with Signature-Error: error=revoked_jwt. Exactly one token rides in that header, so the code needs no token type. A resource refusing a revoked auth token SHOULD also carry AAuth-Requirement: requirement=auth-token with a fresh resource token, so one response says both why it failed and how to recover — the agent's PS then decides afresh and denies terminally if the grant is gone.

revoked_jwt is new in signature-key (dickhardt/signature-key#37), as a sibling of expired_jwt in the Signature Error Code registry.

As a request parameter (resource token; the person token a PS presents to an AS): the signature verified, so this is not a 401, and revoked_jwt does not reach it. The body carries revoked_<token>_token, beside the invalid_ and expired_ codes that parameter already has:

Error Status From
revoked_resource_token 400 the PS or AS the agent presented it to
revoked_person_token 400 the AS, or a PS that would otherwise present it

A pending request already started against a withdrawn resource token terminates with the new polling code revoked, rather than denied, which says the user refused.

An agent token needs no parameter code: it is revoked only at a PS, and a PS always receives it in the Signature-Key header.

Disclosure

Naming revocation to the agent holding the token discloses nothing — the token is its own, and it is the party that most needs to stop using it. That is a different audience from the revocation endpoint's own response to a calling server, which still says only that the revocation was recorded.

Builds clean with mmark + xml2rfc.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vibbcv1TAfcACkkbNTkraE

dickhardt and others added 2 commits September 7, 2026 18:50
A resource issues resource tokens and can withdraw one. It calls the
revocation endpoint of the party named in aud — the PS in three-party,
the AS in four-party — and in four-party the ps as well, which received
the token from the agent and may be holding a pending consent for it.
The recipient MUST NOT issue an auth token against it and SHOULD
terminate a pending request started for it. Five minutes is the whole
window, but it spans the wait for user interaction, which is when a
resource is most likely to withdraw.

Nothing said what a party returns when a revoked token is presented.
It returns what it would return for a token unacceptable for any other
reason: requirement=auth-token with a fresh resource token, an
invalid_person_token or requirement=person-token, a 401 with
Signature-Error invalid_jwt for an agent token at a PS, and
invalid_resource_token at a PS or AS token endpoint. No distinct
"revoked" error — the recovery is identical, and a distinct error would
disclose that a revocation exists, which is what the endpoint's own
200-with-no-404 rule avoids.

Widened invalid_resource_token, invalid_person_token, and denied to
name revocation, and gave Authorization Endpoint Error Responses an
anchor.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vibbcv1TAfcACkkbNTkraE
A revoked token verifies, has not expired, and has intact claims.
Reporting it as malformed or expired is false, and leaves the caller no
reason not to present it again. Where the answer goes follows how the
token was carried.

In the Signature-Key header — agent, person, or auth token — it is a
401 with Signature-Error: error=revoked_jwt, defined in
signature-key#37. One token rides in that header, so the code needs no
token type. A resource refusing a revoked auth token SHOULD carry
requirement=auth-token with a fresh resource token on the same
response, so one message says why and how to recover.

As a request parameter the token is not the credential that signed the
request, so it is not a 401 and revoked_jwt does not reach it. The body
carries revoked_<token>_token, beside the invalid_ and expired_ codes
that parameter already has: revoked_resource_token and
revoked_person_token. A pending request already started against a
withdrawn resource token terminates with the new polling code revoked,
rather than denied, which says the user refused.

An agent token needs no parameter code: it is revoked only at a PS, and
a PS always receives it in the Signature-Key header.

Reverted the widenings of invalid_person_token, invalid_resource_token,
unknown_person_token, and denied, which now have their own codes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vibbcv1TAfcACkkbNTkraE
@dickhardt
dickhardt merged commit 6cfc2e0 into main Sep 7, 2026
2 checks passed
@dickhardt
dickhardt deleted the resource-token-revocation branch September 7, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant