In RFC 9396, what can an authorization_details entry express about a requested right that a scope string cannot?
answer
- structure the string cannot hold
- a JSON array of typed rights
- type is the only required member
- locations, actions, datatypes, identifier, privileges
- granted array returns in the token response
basics
~20 sStructure. An authorization_details entry is a JSON object with a required type plus members such as locations, actions, datatypes, identifier and privileges, so one request can name the resource, the operation and the limits — where a scope string is a single opaque label.
solid answer
~40 sA scope value is one opaque string in a space-delimited list: it either appears or it does not, and any parameters have to be smuggled into the string itself by local convention. RFC 9396 replaces that with `authorization_details`, a JSON array sent as an authorization request parameter or as a claim in a request object. Each entry is an object whose only required member is `type`, naming the kind of right and therefore how the rest of the entry is read. The specification also defines common members that types may reuse: `locations` for the resource where the right applies, `actions` for the operations, `datatypes` for the kinds of data, `identifier` for the specific resource, and `privileges`. An unusable array is rejected with `invalid_authorization_details`, and the authorization server advertises which types it understands in `authorization_details_types_supported`.
code
json · 15 lines[
{
"type": "meter-reading-access",
"locations": ["https://api.energy.example.com/readings"],
"actions": ["read"],
"datatypes": ["half-hourly-consumption"],
"identifier": "supply-point-2000012345678"
},
{
"type": "tariff-switch",
"actions": ["initiate"],
"identifier": "supply-point-2000012345678",
"privileges": ["account-holder"]
}
]go deeper
Recall the contrast: a scope is a single word of permission, while an authorization_details entry is a small structured record that can also say which resource, which operation and which data.
Be able to build an entry and defend it: type required and selecting the reading, the common members it may reuse, the error on an unknown type, and the granted array coming back in the token response.
Show where the cost lands — rendering a structured right as consent a person can agree to, and keeping the authorization server's reading and the resource server's enforcement of each type in step.
The question is governance: who defines and versions a type, how many exist before nobody can reason about them, and what an estate does with the resource servers that still decide on strings.
## What a scope value can and cannot say An OAuth 2.0 `scope` is a space-delimited list of strings, and each string is opaque to the protocol. It is a label that the authorization server and the resource server have agreed on out of band. That is enough while a right is a category — read something, write something. It runs out the moment the right has **parameters**: this meter and no other, these dates, up to this amount, this kind of reading. There is nowhere in a scope string to put a parameter except inside the string, and a string with structure in it is a private encoding that every party has to parse the same way, with no protocol support and no error when they disagree. ## The shape RFC 9396 defines `authorization_details` is a JSON array of objects, carried as an authorization request parameter or as a claim inside a request object. Each object describes one right. - **`type`** is the only member the specification requires. It names the kind of right, and it determines how every other member of that entry is interpreted — so it also determines who is entitled to define the rest. - **Common members**, defined once so that types can reuse them rather than reinvent them: - `locations` — where the right applies, typically the resource's URI. - `actions` — the operations being asked for. - `datatypes` — the kinds of data in play. - `identifier` — the specific resource the right is about. - `privileges` — the level or capacity being claimed. - **Type-specific members** may be added beyond these, and their meaning belongs to the type's definition rather than to the protocol. ## What travels back The array does not vanish once consent is given. The token response carries `authorization_details` describing what was actually **granted**, which is not necessarily what was requested: the resource owner may have approved part of it, or the authorization server may have narrowed an entry by policy. A client that assumes the granted array mirrors the requested one will act on rights it does not hold. A resource server, correspondingly, decides on the granted structure rather than on a string being present in a list. ## Discovery and failure | Element | Role | |---|---| | `authorization_details` | The request parameter, and the member echoed in the token response | | `type` | The required member that selects how the entry is read | | `authorization_details_types_supported` | Authorization server metadata listing the types it understands | | `invalid_authorization_details` | The error when the array is unusable — malformed, or naming a type the server does not know | Because an unknown `type` is an error rather than something quietly dropped, a client learns immediately that a right it asked for was not understood, instead of receiving a token that silently lacks it. ## Why the structure is the point Consider an in-flat display unit for a smart electricity meter. "Read my meter" as a scope string cannot distinguish half-hourly consumption for one supply point over one billing period from a complete history of every meter on the account, and it certainly cannot express a tariff switch limited to one supply point. Two entries do express it, and each entry says which resource, which operation and which data. 1. The client composes the array and sends it with the authorization request. 2. The authorization server validates each entry against the types it supports and renders them for consent — which is where the cost shows up, because a structured object has to be turned into a sentence a tenant can actually agree to. 3. What is granted comes back in the token response, and the resource server enforces against that. ## The trade it makes - **Interpretation moves into the servers.** Every type has to be understood by the authorization server that renders it and the resource server that enforces it, and those two readings have to match. - **Consent becomes a rendering problem.** A list of labels is easy to display; a structured right needs a human sentence, per type, in every language a deployment serves. - **The types become a contract** that somebody owns and versions, and an unknown one is a hard error rather than a shrug. - **It composes rather than replaces.** A request may carry `scope` and `authorization_details` together, which is what makes incremental adoption possible at all.
- Can the authorization_details in the token response differ from the one in the request?Yes, and a client must read it rather than assume. The resource owner may approve only part of what was asked, or the authorization server may narrow an entry by policy, so the granted array is the authoritative statement of what the token carries and what a resource server will enforce.
- What happens when an authorization server receives a type it does not recognise?It rejects the request with `invalid_authorization_details` rather than dropping the entry. That is deliberate: a silently discarded right would hand the client a token that appears to work and fails later at a resource server, with nothing in the exchange explaining why.
- Who defines what the members of a given type mean?The definition of that type, not the protocol. RFC 9396 fixes only `type` as required and supplies common members — `locations`, `actions`, `datatypes`, `identifier`, `privileges` — as reusable vocabulary. Everything else is an agreement between whoever issues the right and whoever enforces it.
A scope string is a travel pass stamped only with the word "travel". An authorization_details entry is a ticket that names the route, the date and the class — the structure is printed on the ticket, so nobody has to agree in advance what the single word meant.
saying these in an interview costs you the question
- Thinks authorization_details is just a scope string written in JSON
- Omits type and expects the server to infer the resource
- Assumes every common member is required in every entry
- Expects an unknown type to be ignored rather than rejected
- Believes authorization_details must replace scope in the same request
- Reads only the request array and never the one in the token response