Repository navigation
Revocation: resource tokens, and what a revoked token gets back - #150
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, thepsas 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 — soinvalid_*andexpired_*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-Keyheader (agent, person, or auth token):401withSignature-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 carryAAuth-Requirement: requirement=auth-tokenwith 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_jwtis new in signature-key (dickhardt/signature-key#37), as a sibling ofexpired_jwtin 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, andrevoked_jwtdoes not reach it. The body carriesrevoked_<token>_token, beside theinvalid_andexpired_codes that parameter already has:revoked_resource_tokenrevoked_person_tokenA pending request already started against a withdrawn resource token terminates with the new polling code
revoked, rather thandenied, 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-Keyheader.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