Bind the Authorization Transaction End to End
Bind browser intent, callback, code exchange, and target resource as one short-lived transaction. • Lab status: conceptual reconstruction. Receipts are expected simulated outputs, not deployed-system measurements.
System map · Day 04
Whole-system design
Five stable layers. Today's work is expanded and linked; the rest stays in context.
Entry and policy
Onboarding and control
Covered — Connector control plane
Authorization services
Authorization server
Design target · not proved
Issues a code and token only for the registered redirect and requested resource.
Compute and execution
Covered — Connector runtime compute · External resource serverAhead — Refresh coordinator compute
Storage and evidence
Covered — Specification draft store · Connector configuration store · Sanitized discovery cacheAhead — Ordered migration log
Traversed today
Overview
Redeem once and store only a credential reference
The callback first compares state in constant time, checks expiry and unused status, then redeems the code with the exact verifier, redirect URI, client ID, and resource. Successful redemption marks the transaction used before the gateway exposes success. The vault owns token material; the evidence plane receives only a credential reference and safe metadata.
{
"credentialRef": "vault://calendar-lab/grants/grant-d04",
"tokenType": "Bearer",
"resource": "https://calendar.example/mcp",
"scopes": ["calendar.read"],
"accessToken": "not-recorded-here"
}
{
"receipt": "SCG-R04",
"normal": "code_redeemed_once",
"denials": ["state_mismatch", "pkce_mismatch", "resource_mismatch"],
"unaffectedControl": "public-status:200"
}
Run three bounded denials by changing exactly one fact: state, verifier, or resource. Recovery abandons the failed transaction and creates a new one; it never reuses a code or verifier. Cleanup revokes the disposable grant where supported, deletes the vault record, expires the callback listener, and preserves only the redacted receipt.
Score one grant decision
Given the client deployment, selected grant, supplied transaction facts, and one candidate verifier result, decide only redeem or deny, with one reason. The scored unknown is the verifier decision; all other facts are supplied. Matching state, unexpired unused transaction, exact redirect, exact resource, and valid S256 proof permits redemption.
The misconception is “the authorization code is the authorization.” Replay the wrong-resource case: the code can be genuine and still be unusable for this protected resource. Decline cryptography implementation, identity inference, or broad scope design because they introduce unsafe or multiple unknowns.
Carry the grant contract forward
SCG-R04 contains the selected security posture, transaction fields, credential reference, single-use proof, three one-variable denials, positive control, and cleanup. Day 05 uses the same discovered registration endpoint and client posture to register without weakening confidentiality.