Rich Authorization Requests
Rich Authorization Requests (RAR), specified in RFC 9396: OAuth 2.0 Rich Authorization Requests, lets clients request fine-grained permissions that scopes alone can’t express.
Scopes and authorization details
In a standard OAuth 2.0 flow, the client requests access with the scope parameter.
Scopes are static, coarse strings, such as read or write, that describe broad categories of access.
The authorization server grants the token with the scopes, and the resource server decides what those scopes permit.
RAR extends this model with the authorization_details parameter.
Instead of, or in addition to, coarse scope strings, the client sends a JSON array of structured objects, each describing the specific access the client needs.
Unlike scopes, authorization details are structured data that the authorization server and resource server can interpret, and that the remote consent service can enrich during consent.
Example authorization_details array
[
{
"type": "account_information",
"actions": [
"list_accounts",
"read_balances",
"read_transactions"
],
"locations": [
"https://example.com/accounts"
]
}
]
Each object requires a type string that names a kind of permission the authorization server recognizes, such as account_information or payment_initiation.
The remaining fields are specific to the type.
In the previous example, actions and locations narrow the request to specific operations on a specific resource.
Use authorization_details when coarse scopes aren’t precise enough:
-
Open Banking and similar ecosystems, where the authorization request must name the exact accounts, transactions, or operations involved.
-
Applications that need the resource owner to approve specific actions, rather than a broad category of access.
-
Flows where the resource server needs the permission details in a machine-readable form.
The resource server receives the granted authorization_details with the access token, so it can enforce the exact permissions the resource owner approved.
How Advanced Identity Cloud supports RAR
Advanced Identity Cloud supports RAR through the remote consent feature.
When a client includes authorization_details in an authorization request, Advanced Identity Cloud sends them to the remote consent service, which presents them to the resource owner for approval.
Advanced Identity Cloud then issues the consented authorization_details in the access token, and in any refresh token issued alongside it.
Advanced Identity Cloud doesn’t validate the content of authorization_details objects beyond their type values.
The consent service is responsible for interpreting, enriching, and validating the details of each type.
Supported flows and endpoints
Clients can request authorization_details on the following endpoints, for the authorization code and implicit grant flows:
-
/oauth2/par, as part of an authorization code grant with PAR
Advanced Identity Cloud ignores authorization_details in requests to other grant flow endpoints, including the /oauth2/device/code endpoint for the device flow.
Don’t include authorization_details in requests to the /oauth2/access_token endpoint.
If RAR is enabled on the provider, Advanced Identity Cloud rejects such requests for the authorization_code and refresh_token grant types with an invalid_request error.
If RAR isn’t enabled, Advanced Identity Cloud ignores the parameter.
Requirements for RAR
To use RAR in Advanced Identity Cloud, configure the following:
-
Enable Remote Consent on the OAuth 2.0 provider. Without remote consent, Advanced Identity Cloud rejects authorization requests that include
authorization_detailswith aninvalid_requesterror. -
Enable Rich Authorization Requests with RCS on the OAuth 2.0 provider. If this setting isn’t enabled, Advanced Identity Cloud ignores
authorization_detailsin authorization requests. When it is enabled, Advanced Identity Cloud also:-
Advertises the
authorization_details_types_supportedmetadata parameter in the OIDC discovery response. -
Processes the
authorization_details_typesparameter in dynamic client registration requests.
-
-
A remote consent service, configured as described in Remote consent. The consent service must support the authorization detail types your clients request.
If the client can skip consent, Advanced Identity Cloud rejects requests that include
authorization_detailswith aninvalid_requesterror because RAR requires the resource owner to approve each detail explicitly.
|
Tokens with authorization details
When the resource owner approves the requested authorization_details during remote consent, Advanced Identity Cloud issues them in the access token, and in any refresh token issued alongside it.
|
The token response includes an authorization_details field containing the granted objects.
The following example shows the token response for an access token issued with authorization_details:
{
"access_token": "access-token",
"refresh_token": "refresh-token",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "read write",
"authorization_details": [{
"type": "account_information",
"actions": [
"list_accounts",
"read_balances",
"read_transactions"
],
"locations": [
"https://example.com/accounts"
]
}]
}
When a client exchanges a refresh token for a new access token, the new access token carries the same authorization_details as the original.
You can’t request different authorization_details when exchanging a refresh token.
Resource servers can retrieve the granted authorization_details from an access token by calling the /oauth2/introspect endpoint.
|
If RAR is enabled on the provider and the client requests |
How authorization details flow through RAR
The following sequence describes the RAR flow in Advanced Identity Cloud:
-
The client sends an authorization request to the /oauth2/authorize or /oauth2/par endpoint, including
authorization_details. -
Advanced Identity Cloud validates the
typeof each object, and that the client is configured with each requested type. -
Advanced Identity Cloud sends the
authorization_detailsto the remote consent service in the consent request JWT. -
The remote consent service presents the details to the resource owner, who approves or denies them.
-
The consent service can enrich the details by adding values.
Example
authorization_detailsenrichmentThe client requests the following
authorization_details:{ "type": "account_information", "accounts": [], "locations": [ "https://example.com/accounts" ] }The consent service populates the
accountsfield with the accounts the end user has selected:{ "type": "account_information", "accounts": [ "account1", "account2" ], "locations": [ "https://example.com/accounts" ] } -
The consent service returns a consent response JWT containing the approved
authorization_details. -
Advanced Identity Cloud verifies the response, and intersects the returned
authorization_detailswith the requested ones. Advanced Identity Cloud keeps only the returned objects whosetypematches a type in the original request. -
Advanced Identity Cloud issues the access token with the consented
authorization_details. -
The client presents the access token to the resource server, which enforces the
authorization_details. -
The client returns the protected resource to the resource owner.
Learn more about the consent request and response JWTs in Remote consent.
Configure clients for RAR
This section assumes Advanced Identity Cloud also meets the Requirements for RAR.
To let a client request authorization_details, configure the Authorization Detail Type(s) client property with the types the client can request.
Clients can also register their supported types dynamically by including the authorization_details_types parameter in dynamic client registration requests.
Each requested type must be one the OAuth 2.0 provider advertises in the authorization_details_types_supported metadata parameter, which Advanced Identity Cloud populates from the consent service metadata.
Example: Request authorization details for an Open Banking flow
The following example shows a typical RAR authorization request for an Open Banking-style use case:
$ curl \
--request GET \
--data-urlencode "client_id=myClient" \
--data-urlencode "redirect_uri=https://www.example.com:8443/openbanking/callback" \
--data-urlencode "response_type=code" \
--data-urlencode "scope=openid profile" \
--data-urlencode 'authorization_details=[{
"type": "account_information",
"actions": [
"list_accounts",
"read_balances",
"read_transactions"
],
"locations": [
"https://example.com/accounts"
]
}]' \
"https://<tenant-env-fqdn>/am/oauth2/realms/root/realms/alpha/authorize"
In this example:
-
The
typenames the kind of permission; here, read-only access to account information. -
The
actionsandlocationsfields are specific to theaccount_informationtype, and narrow the request to specific operations on a specific resource.
The consent service decides how to present these details to the resource owner and whether to enrich them.
Limitations
-
RAR is supported in the authorization code and implicit grant flows only. Advanced Identity Cloud ignores
authorization_detailsin other grant flows, including the device flow. -
Clients can’t request
authorization_detailsat the /oauth2/access_token endpoint. Advanced Identity Cloud returns the granted details stored on the grant instead. -
Advanced Identity Cloud doesn’t support RAR with UMA (User-Managed Access).
-
The example consent service doesn’t support RAR.