Skip to content

Add the account parameter for resources holding several accounts - #67

Merged
dickhardt merged 1 commit into
mainfrom
account-parameter
Aug 6, 2026
Merged

dickhardt merged 1 commit into
mainfrom
account-parameter

Conversation

@dickhardt

Copy link
Copy Markdown
Owner

Stack 7 of 7. Base: approved-tools-offline (#66). Fixes #52.

A resource may hold more than one account for the same person — an AAuth-to-OAuth proxy where a user has connected several upstream accounts, a SaaS product with several workspaces. Scope says what the agent may do, not which account it may do it to, so consent never named the account, the auth token spanned all of them, and the audit trail could not show which one an authorization covered.

The mechanism

An OPTIONAL account parameter on the authorization endpoint request, echoed as an OPTIONAL claim in the resource token, copied into the auth token. The value is an opaque string in the resource's own namespace — an email address, a workspace id, a tenant key. Different accounts yield different auth tokens, so enforcement and audit are per-account.

It selects rather than hints, which is why it is not login_hint: nobody is being authenticated, the account is already connected at the resource, and the value must survive into the tokens as a claim.

R3 gains a matching OPTIONAL account field, with a recommendation that display name the account in terms the person recognises.

Two things this deliberately does not do

No account listing. The original proposal had the resource reject with an error listing the connected accounts. That is dropped. At the authorization endpoint the resource has an agent identity and no verified identity for the person — so it has nothing to gate a disclosure on and nothing to key the list to, and returning one would disclose the accounts behind an agent to anyone presenting an agent token. Even where the resource does know the person, which of their accounts an agent may act on is a decision that belongs to the person. Unknown account now resolves via requirement=interaction, where the person selects in their own session at the resource.

No structure on the value. The implementation report in #52 proposed {id, kind, label}. Both extra members are dropped:

  • kind existed solely to make the PS verified-email cross-check safe — and that check is removed here, since it produced a warning that fired constantly for legitimate reasons.
  • label addressed consent-card legibility, but the human-readable name belongs in the R3 document's display text, which the resource controls and the PS already renders. The identifier stays an identifier.

Dropping the listing is what removes the last place a label would have been needed on the wire.

Cost

First-time account selection takes an interaction round trip; afterwards the agent holds the value and sends it with no interaction. An agent under a mission that already names the account never pays it.

🤖 Generated with Claude Code

https://claude.ai/code/session_011H2BBgoKc7DqXeme5yT9Ls

@dickhardt
dickhardt changed the base branch from approved-tools-offline to main August 6, 2026 07:31
A resource may hold more than one account for the same person -- an
AAuth-to-OAuth proxy where a user has connected several upstream
accounts, a SaaS product with several workspaces. Scope says what the
agent may do, not which account it may do it to, so consent never named
the account, the auth token spanned all of them, and the audit trail
could not show which one an authorization covered.

The value is an opaque string in the resource's own namespace, flowing
request -> resource token -> auth token, so per-account auth tokens give
per-account enforcement and audit. It selects rather than hints, which
is why it is not login_hint: nobody is being authenticated, and the
value must survive into the tokens as a claim.

Two things this deliberately does not do:

- No account listing. Where the agent does not know which account to
  name, the resource returns requirement=interaction and the person
  selects in their own session. At the authorization endpoint the
  resource has an agent identity and no verified person, so it has
  nothing to gate a disclosure on and nothing to key the list to;
  returning one would disclose the accounts behind an agent to anyone
  presenting an agent token. And which account an agent may act on is a
  decision that belongs to the person.
- No structure on the value. The human-readable name a consent screen
  needs lives in the R3 document's display text, which the resource
  controls and the PS already renders, so the identifier stays an
  identifier.

Fixes #52

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011H2BBgoKc7DqXeme5yT9Ls
@dickhardt
dickhardt merged commit 68fcfa7 into main Aug 6, 2026
2 checks passed
@dickhardt
dickhardt deleted the account-parameter branch August 6, 2026 08:07
dickhardt added a commit that referenced this pull request Aug 6, 2026
All three are artifacts of #62/#67 landing while #53 was open, and none
of them broke the build -- which is what makes the first one worth
calling out.

- The account field added in #67 cited the pre-rename
  I-D.hardt-aauth-protocol anchor, copying the surrounding style at a
  point when that anchor was still correct. Once #53 renamed the
  reference block, the citation matched no local <reference> and mmark
  silently resolved it from the datatracker to
  draft-hardt-aauth-protocol-02 of April 2026 -- the abandoned
  pre-rename draft. R3 cited two different documents, one of them dead,
  with a green build.

- The resource token and auth token prose named typ: resource+jwt and
  typ: auth+jwt. #62 corrected the JSON examples to the registered
  aa-resource+jwt and aa-auth+jwt media types but missed the prose, so
  the document contradicted its own examples one line away.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011H2BBgoKc7DqXeme5yT9Ls
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.

R3/Protocol: optional account parameter to bind an authorization to one of multiple accounts at a resource

1 participant