Repository navigation
Description
Problem
A resource that fronts multiple user accounts — e.g. an AAuth→OAuth proxy where one user has connected several Google accounts — has no way for the agent to signal which account an authorization applies to, and no way for the user's consent to be bound to a specific account.
The existing PS token-endpoint hints (login_hint, prompt=select_account, domain_hint, tenant) target the person's identity at the PS, not the selection among upstream accounts held at the resource. A per-call header (e.g. Proxy-Account) works mechanically but is unsatisfying: the consent the user approved never named the account, the auth token spans all accounts, and the audit trail can't show which account an authorization covered.
Proposal
Add an optional account value that flows through the whole authorization chain:
-
Authorization endpoint request — new OPTIONAL parameter
account: an identifier, chosen from the resource's account namespace (e.g. an email address for Google accounts, a portal/hub id for HubSpot), indicating which account at the resource the authorization is for. §Authorization Endpoint Request currently defines onlyscope(+r3_operationsin R3). -
R3 document — when the request carried
account, the resource includes a top-levelaccountfield and names it indisplay(e.g. "…on your Google account [email protected]"), so the user consents to the specific account. -
Resource token — new OPTIONAL claim
account, echoing the requested account. -
Auth token — the PS/AS copies
accountfrom the resource token into the auth token as an OPTIONAL claim. The resource enforces per-account access directly from the token — different accounts yield different auth tokens.
A PS additionally MAY use account at consent time to cross-check against the user's verified identifiers (e.g. "this is one of your verified emails") — a useful signal that the right person is approving.
When multiple accounts are connected and no account was bound, the resource can reject invocations with an error listing the connected accounts, prompting the agent to re-authorize with account set.
Why not reuse login_hint?
login_hint is defined (OpenID.Core §3.1.2.1) as a hint about who to authenticate at the receiving party. Here nobody is being authenticated — the account is already connected at the resource; the parameter selects rather than hints, and it must survive into the issued tokens as a claim. Overloading login_hint would conflate the person logging into the PS with the account being acted on at the resource. (The resource may still internally use OAuth login_hint toward its upstream during a first-connect interaction flow — that's an implementation detail.)
Proving ground
We are implementing this in the Hello AAuth proxy for Google APIs (multi Google-account support, account = email address), including the PS side. Will report back with experience; happy to PR spec text once the shape settles.
Activity
nickgamb commentedon Jul 11, 2026
dickhardt commentedon Jul 11, 2026
@nickgamb -- the scenario is a user has multiple google accounts and wants to access them all -- I think the user having more than one account at a resource is not uncommon -- and this lets the agent pick which account it is wanting authorization at
fetch: openapi-gateway operation ids + --account
dickhardt commentedon Jul 30, 2026
Implementation report-back:
accountneeds a kind and a labelPromised in the "Proving ground" section. We've now implemented
accountend-to-end in the Hellō PS and the AAuth proxy, and run it past Google — QuickBooks, Threads, Slack, HubSpot. The mechanism works: the value flows request → R3 → resource token → auth token, and per-account auth tokens do give clean per-account enforcement and audit.Two things break once the upstream is not email-keyed, and both trace to
accountbeing a bare opaque string.1. The proposed PS cross-check is unsafe to implement as specified
The proposal says:
We built exactly that. It cannot be done correctly with a bare string, because the PS cannot distinguish:
Our check could only ever match subjects of kind
email, so everything in case 2 fell into the negative branch. Connecting a QuickBooks sandbox company rendered:…on every consent, for every id-keyed resource. A non-blocking warning that fires constantly for legitimate reasons is worse than no warning — it trains people to ignore the one case where it means something.
We have removed the negative rendering (kept the positive "one of your verified emails" chip, which has no false-positive mode). Tracked as hellocoop/Wallet#4106.
Suggest the spec say plainly that the cross-check is only defined when the account is an email — which requires the PS to be able to tell, hence:
2. Consent cards can't render an opaque id usefully
9341457618438679is a QuickBooks realmId. The user has no idea whether that is their sandbox company or someone else's. Same for a SlackT…team id or a Threads app-scoped id. The card names the account, per the proposal's intent — but names it in a way the person cannot recognise, which undercuts the point of binding consent to a specific account.The proxy has human labels ("Sandbox Company US 0a7d", "@dickhardt on Threads"); there's simply nowhere on the wire to put them.
Proposed shape
Make
accountstructured (keeping the bare string as the shorthand forkind: "email", or as a deprecated form):id— the wire identifier; what the resource enforces on, unchanged from today.kind—email|id, extensible. Lets a PS run the verified-identifier cross-check only when it is meaningful, and stay silent otherwise.label— OPTIONAL human-readable string for display. Consent cards should render label-first and never show a bare opaque id.For
kind: "email"the label is typically the address itself, so Google-style upstreams are unchanged in appearance.Also affects the account-selection error
The proposal's "reject invocations listing the connected accounts" has the same problem. Ours is currently:
An agent surfacing that list to a user shows a column of opaque ids. Whatever shape
accountsettles on should be reused here, so selection and consent are both label-first with ids on the wire.Summary
The account extension is right; it's just under-specified for non-email namespaces.
kindis the load-bearing addition — without it, a PS cannot safely implement the cross-check the proposal already invites.labelis what makes the consent legible.Happy to PR spec text for the structured form plus the
account_requiredlisting.🤖 Filed via Claude Code
Add the account parameter for resources holding several accounts
Add the account parameter for resources holding several accounts