Skip to content

AAuth -11 issue #152: presented_token on the auth token endpoint - #10

Merged
dickhardt merged 1 commit into
mainfrom
presented-token
Sep 8, 2026
Merged

AAuth -11 issue #152: presented_token on the auth token endpoint#10
dickhardt merged 1 commit into
mainfrom
presented-token

Conversation

@dickhardt

Copy link
Copy Markdown
Member

Implements dickhardt/AAuth#152 (spec PR dickhardt/AAuth#153) in the mock PS.

  • The auth token request carries presented_token (REQUIRED): the token the agent presented to the resource — the person token, or on a step-up the auth token — named by the resource token's presented_jti.
  • Step 6 verifies that token under mockin's own key (aud = the resource, cnf.jwk thumbprint = agent_jkt) and matches ps / sub / mission_s256 / tenant against the resource token. No retained record is consulted; the person-token store is retention only.
  • New error codes: invalid_presented_token, expired_presented_token, revoked_presented_token. A missing presented_token is invalid_request.
  • The issued auth token never outlives the presented token.
  • Tests: step-up (auth token presented), reuse of one person token across resource tokens, forged / expired / wrong-aud / wrong-key presented tokens. 225 passing.

Breaking for agents that do not send presented_token (@aauth/agent ≤3.0.2). Release as a major when publishing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEeAq61zr1oVg5FAFf3JTH

The agent's auth token request now carries `presented_token` (REQUIRED):
the token it presented to the resource — the person token, or on a
step-up the auth token — whose jti the resource token's `presented_jti`
names. Step 6 of §Resource Token Verification verifies that token under
the PS's own key (aud = the resource, cnf.jwk = agent_jkt) and matches
ps / sub / mission_s256 / tenant against the resource token, instead of
resolving a retained person-token record. The issued auth token never
outlives the presented token.

- new src/aauth/verify-presented-token.js; verify-resource-token.js keeps
  only the presence checks and returns presented_jti + agent_jkt
- token.js requires presented_token (invalid_request when absent); new
  error codes invalid_presented_token / expired_presented_token /
  revoked_presented_token
- issue-auth-token.js caps exp at presented_exp
- person-token-store.js is retention for revocation only (jti, aud, exp)
- tests: mintResourceToken copies from any presented token (person or
  auth), dual-emits presented_jti by default; step-up, reuse, forged,
  expired, aud and cnf cases added

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEeAq61zr1oVg5FAFf3JTH
@dickhardt
dickhardt merged commit 386b22e into main Sep 8, 2026
2 checks passed
@dickhardt
dickhardt deleted the presented-token branch September 8, 2026 10:32
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