Rich Authorization Requests (RAR): fine-grained consent for OAuth
Ask a user to authorize a payment app and the consent screen says "this application wants to: make payments." Make payments to whom? Of how much? Once, or forever? Scopes cannot say. A scope is a flat string — payments:write — and a flat string cannot express "transfer up to 500 EUR from account DE89 to this one payee, once." So integrations either over-request a broad scope the user has no way to reason about, or bolt the real parameters onto the side in custom ways that no standard consent screen can render.
Rich Authorization Requests (RFC 9396) fixes the expressiveness gap. Instead of a space-separated list of scope strings, a client sends an authorization_details parameter: a JSON array of structured objects, each describing exactly what the client wants to do, to what, with what limits. The authorization server can show the user a precise consent screen and mint a token scoped to precisely those details — nothing broader.
From scopes to authorization_details
The authorization_details parameter is a JSON array. Each element has a type that names a schema the authorization server understands, plus whatever fields that schema defines. A payment initiation might look like this.
[
{
"type": "payment_initiation",
"actions": ["initiate"],
"instructedAmount": { "currency": "EUR", "amount": "500.00" },
"creditorAccount": { "iban": "DE02100100109307118603" },
"creditorName": "ACME Supplies GmbH",
"remittanceInformation": "Invoice 2026-0412"
}
]This is not a scope that happens to carry extra data. It is a typed request the server validates field by field: is this creditor allowed, is the amount within policy, is this client permitted to request payment_initiation at all. The consent screen can then say, truthfully, "transfer 500.00 EUR to ACME Supplies GmbH for Invoice 2026-0412" — a statement the user can actually evaluate.
Sending it in the request
Because the parameter is JSON and can be large, it is best sent through a Pushed Authorization Request (PAR) rather than crammed into a front-channel URL. The client POSTs the details to the server first and references them by an opaque handle in the browser redirect.
POST /as/par HTTP/1.1
Host: auth.example.com
Content-Type: application/x-www-form-urlencoded
response_type=code&client_id=app-7f2
&authorization_details=%5B%7B%22type%22%3A%22payment_initiation%22%2C...%7D%5D
&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
&code_challenge_method=S256What comes back
The granted authorization details — which may be narrower than requested, if the user declined parts or policy trimmed them — are returned at the token endpoint and reflected in the token's claims. The resource server reads authorization_details from the token and enforces against the specific object, not a blanket scope.
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 300,
"authorization_details": [
{
"type": "payment_initiation",
"actions": ["initiate"],
"instructedAmount": { "currency": "EUR", "amount": "500.00" },
"creditorAccount": { "iban": "DE02100100109307118603" }
}
]
}The payments API now enforces the exact constraint: a request to move 600 EUR, or to a different creditor, is rejected because the token authorizes 500.00 EUR to that one IBAN. The limit lives in the grant, not in application code that might forget to check it.
Enforcement on the resource server
The resource server's job shifts from "does this token have scope X" to "does this token's authorization_details permit this specific operation." That is more code, but it is the code that actually prevents over-privilege.
type PaymentDetail = {
type: 'payment_initiation';
actions: string[];
instructedAmount: { currency: string; amount: string };
creditorAccount: { iban: string };
};
function authorizePayment(token: TokenClaims, req: PaymentRequest): void {
const detail = (token.authorization_details ?? [])
.find((d): d is PaymentDetail => d.type === 'payment_initiation');
if (!detail || !detail.actions.includes('initiate'))
throw new Error('not authorized for payment initiation');
if (detail.creditorAccount.iban !== req.creditorIban)
throw new Error('creditor not covered by this grant');
if (Number(req.amount) > Number(detail.instructedAmount.amount))
throw new Error('amount exceeds authorized limit');
// currency, actions, and any other constrained field checked the same way
}type and verify every constrained field — do not stop at finding a detail of the right type. A frequent mistake is confirming the token has a payment_initiation detail and then trusting the request's own amount and creditor. The whole value of RAR evaporates if the resource server reads the request parameters instead of the authorized limits. The grant is the source of truth; the request is a claim to be checked against it.Designing authorization_details types
RAR gives you a schema language, and like any schema language it rewards restraint:
- Keep each
typefocused on one kind of resource and action set. A sprawling type that covers everything is just a scope with extra steps. - Make fields enforceable. Every field you put in a detail is a promise the resource server must check. Do not include descriptive fields you will not enforce — they create a false sense of constraint.
- Reuse registered types where they exist (open banking and FAPI define several) so clients and servers already agree on semantics, and define your own only for genuinely domain-specific operations.
- Plan for partial grants. The returned details can be a subset of what was requested; clients must handle getting less than they asked for rather than assuming all-or-nothing.
Scopes are not dead
RAR does not replace scopes; it complements them. Coarse, stable permissions — "read the user's profile," "access the calendar" — are perfectly served by a scope string, and forcing them into authorization_details adds ceremony for nothing. RAR earns its complexity when the authorization is parameterized: a specific amount, a specific resource, a specific one-time action, where the user deserves to see and consent to the actual values.
The deeper win is honest consent. A user cannot meaningfully agree to "make payments"; they can meaningfully agree to "send 500 EUR to ACME, once." RAR makes the request as specific as the action, which is the only way a consent screen tells the truth. Defining those detail types, validating them at the authorization endpoint, and reflecting them into tokens your resource servers enforce is control over the whole consent-to-enforcement path — the kind of end-to-end control you have when you own the authorization server rather than mapping your product onto someone else's fixed scope catalog.
Run it yourself
Bastionary is free, open-source software. Follow the quick start to have it running on your own server, or browse the releases on Git.