RFC 9396 | OAuth-RAR | May 2023 |
Lodderstedt, et al. | Standards Track | [Page] |
This document specifies a new parameterauthorization_details
that isused to carry fine-grained authorization data in OAuth messages.¶
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained athttps://www.rfc-editor.org/info/rfc9396.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
"The OAuth 2.0 Authorization Framework"[RFC6749] defines thescope
parameter that allows OAuth clients tospecify the requested scope, i.e., the limited capability, of an access token.This mechanism is sufficient to implement static scenarios andcoarse-grained authorization requests, such as "give me read access tothe resource owner's profile." However, it is not sufficient to specifyfine-grained authorization requirements, such as "please let me transfer an amount of 45 Euros to Merchant A"or "please give me read access to directory A and write access to file X."¶
This specification introduces a new parameterauthorization_details
that allows clients to specify their fine-grained authorization requirements using the expressiveness of JSON[RFC8259] data structures.¶
For example, an authorization request for a credit transfer (designated as "payment initiation" in several open banking initiatives) can be represented using a JSON object like this:¶
{ "type": "payment_initiation", "locations": [ "https://example.com/payments" ], "instructedAmount": { "currency": "EUR", "amount": "123.50" }, "creditorName": "Merchant A", "creditorAccount": { "bic":"ABCIDEFFXXX", "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant"}
This object contains detailed information about the intended payment, such as amount, currency, and creditor, that is required to inform the user and obtain their consent. The authorization server (AS) and the respective resource server (RS) (providing the payment initiation API) will together enforce this consent.¶
For a comprehensive discussion of the challenges arising from new use cases in the open banking and electronic signing spaces, see[Transaction-Auth].¶
In addition to facilitating custom authorization requests, this specification also introduces a set of common data type fields for use across different APIs.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14[RFC2119][RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This specification uses the terms "access token", "refresh token","authorization server" (AS), "resource server" (RS), "authorization endpoint","authorization request", "authorization response", "token endpoint","grant type", "access token request", "access token response", and"client" defined by "The OAuth 2.0 Authorization Framework"[RFC6749].¶
The request parameterauthorization_details
contains, in JSON notation, an array of objects. Each JSON object contains the data to specify the authorization requirements for a certain type of resource. The type of resource or access requirement is determined by thetype
field, which is defined as follows:¶
type
:type
field determines the allowable contents of the object that contains it. The value is unique for the described API in the context of the AS. This field isREQUIRED.¶Anauthorization_details
arrayMAY contain multiple entries of the sametype
.¶
Figure 2 shows anauthorization_details
of typepayment_initiation
using the example data shown above:¶
[ { "type": "payment_initiation", "actions": [ "initiate", "status", "cancel" ], "locations": [ "https://example.com/payments" ], "instructedAmount": { "currency": "EUR", "amount": "123.50" }, "creditorName": "Merchant A", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" }]
Figure 3 shows a combined request asking for access to account information and permission to initiate a payment:¶
[ { "type": "account_information", "actions": [ "list_accounts", "read_balances", "read_transactions" ], "locations": [ "https://example.com/accounts" ] }, { "type": "payment_initiation", "actions": [ "initiate", "status", "cancel" ], "locations": [ "https://example.com/payments" ], "instructedAmount": { "currency": "EUR", "amount": "123.50" }, "creditorName": "Merchant A", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" }]
The JSON objects withtype
fields ofaccount_information
andpayment_initiation
represent the differentauthorization_details
to be used by the AS to ask for consent.¶
Note: The AS will make this data subsequently available to the respective RSs (seeSection 9).¶
The AS controls the interpretation of the value of thetype
parameter as well as the object fields that thetype
parameter allows. However, the value of thetype
parameter is also generally documented and intended to be used by developers. It isRECOMMENDED that API designers choosetype
values that are easily copied without ambiguity. For example, some glyphs have multiple Unicode code points for the same visual character, and a developer could potentially type a different character than what the AS has defined. Possible means of reducing potential confusion are limiting the value to ASCII[RFC0020] characters, providing a machine-readable listing of data type values, or instructing developers to copy and paste directly from the documentation.¶
If an application or API is expected to be deployed across different servers, such as the case in an open standard, the API designer isRECOMMENDED to use a collision-resistant namespace under their control, such as a URI that the API designer controls.¶
The following example shows how an implementation could utilize the namespacehttps://scheme.example.org/
to ensure collision-resistant type values.¶
{ "type": "https://scheme.example.org/files", "locations": [ "https://example.com/files" ], "permissions": [ { "path": "/myfiles/A", "access": [ "read" ] }, { "path": "/myfiles/A/X", "access": [ "read", "write" ] } ]}
This specification defines a set of common data fields that are designed to be usable across different types of APIs. This specification does not require the use of these common fields by an API definition but, instead, provides them as reusable generic components for API designers to make use of. The allowable values of all fields are determined by the API being protected, as defined by a particular "type" value.¶
locations
:actions
:datatypes
:identifier
:privileges
:When different common data fields are used in combination, the permissions the client requests are the product of all the values.The object represents a request for allactions
values listed within the objectto be used at alllocations
values listed within the object for alldatatypes
values listed within the object. In the following example, the client is requestingread
andwrite
access to both thecontacts
andphotos
belonging to customers in acustomer_information
API. If this request is granted, the clientwould assume it would be able to use any combination of rightsdefined by the API, such as read access to the photos and writeaccess to the contacts.¶
[ { "type": "customer_information", "locations": [ "https://example.com/customers" ], "actions": [ "read", "write" ], "datatypes": [ "contacts", "photos" ] }]
If the client wishes to have finer control over its access, it can send multiple objects. In this example,the client is asking forread
access to thecontacts
andwrite
access to thephotos
in the same API endpoint.If this request is granted, the client would not be able to write to the contacts.¶
[ { "type": "customer_information", "locations": [ "https://example.com/customers" ], "actions": [ "read" ], "datatypes": [ "contacts" ] }, { "type": "customer_information", "locations": [ "https://example.com/customers" ], "actions": [ "write" ], "datatypes": [ "photos" ] }]
An APIMAY define its own extensions, subject to thetype
of the respective authorization object.It is anticipated that API designers will use a combinationof common data fields defined in this specification as well asfields specific to the API itself. The following non-normativeexample shows the use of both common and API-specific fields aspart of two different fictitious APItype
values. The firstaccess request includes theactions
,locations
, anddatatypes
fields specified here as well as the API-specificgeolocation
field, indicating access to photos taken at the given coordinates.The second access request includes theactions
andidentifier
fields specified here as well as the API-specificcurrency
fields.¶
[ { "type":"photo-api", "actions":[ "read", "write" ], "locations":[ "https://server.example.net/", "https://resource.local/other" ], "datatypes":[ "metadata", "images" ], "geolocation":[ { "lat":-32.364, "lng":153.207 }, { "lat":-35.364, "lng":158.207 } ] }, { "type":"financial-transaction", "actions":[ "withdraw" ], "identifier":"account-14-32-32-3", "currency":"USD" }]
If this request is approved, the resulting access token's access rights will bethe union of the requested types of access for each of the two APIs, just as above.¶
Theauthorization_details
authorization request parameter can be used to specify authorization requirements in all places where thescope
parameter is used for the same purpose, examples include:¶
In case of authorization requests as defined in[RFC6749], implementersMAY consider using pushed authorization requests[RFC9126] to improve the security, privacy, and reliability of the flow. See Sections12,13, and11.4 for details.¶
Parameter encoding is determined by the respective context. In the context of an authorization request according to[RFC6749], the parameter is encoded using theapplication/x-www-form-urlencoded
format of the serialized JSON as shown inFigure 8, using the example fromSection 2 (line breaks for display purposes only):¶
GET /authorize?response_type=code &client_id=s6BhdRkqt3 &state=af0ifjsldkj &redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb &code_challenge_method=S256 &code_challenge=K2-ltc83acc4h0c9w6ESC_rEMTJ3bwc-uCHaoeK1t8U &authorization_details=%5B%7B%22type%22%3A%22account%5Finfo rmation%22%2C%22actions%22%3A%5B%22list%5Faccounts%22%2C%22 read%5Fbalances%22%2C%22read%5Ftransactions%22%5D%2C%22loca tions%22%3A%5B%22https%3A%2F%2Fexample%2Ecom%2Faccounts%22% 5D%7D%2C%7B%22type%22%3A%22payment%5Finitiation%22%2C%22act ions%22%3A%5B%22initiate%22%2C%22status%22%2C%22cancel%22%5 D%2C%22locations%22%3A%5B%22https%3A%2F%2Fexample%2Ecom%2Fp ayments%22%5D%2C%22instructedAmount%22%3A%7B%22currency%22% 3A%22EUR%22%2C%22amount%22%3A%22123%2E50%22%7D%2C%22credito rName%22%3A%22Merchant%20A%22%2C%22creditorAccount%22%3A%7B %22iban%22%3A%22DE02100100109307118603%22%7D%2C%22remittanc eInformationUnstructured%22%3A%22Ref%20Number%20Merchant%22 %7D%5D HTTP/1.1Host: server.example.com
Based on the data provided in theauthorization_details
parameter, the AS will ask the user for consent to the requested access permissions.¶
Note: The user may also grant a subset of the requested authorization details.¶
InFigure 9, the client wants to get access to account information and initiate a payment:¶
[ { "type": "account_information", "actions": [ "list_accounts", "read_balances", "read_transactions" ], "locations": [ "https://example.com/accounts" ] }, { "type": "payment_initiation", "actions": [ "initiate", "status", "cancel" ], "locations": [ "https://example.com/payments" ], "instructedAmount": { "currency": "EUR", "amount": "123.50" }, "creditorName": "Merchant A", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" }]
authorization_details
andscope
can be used in the same authorization request for carrying independent authorization requirements.¶
Combined use ofauthorization_details
andscope
is supported by this specification in part to allow existing OAuth-based applications to incrementally migrate towards usingauthorization_details
exclusively. It isRECOMMENDED that a given API use only one form of requirement specification.¶
The ASMUST process both sets of requirements in combination with each other for the given authorization request. The details of how the AS combines these parameters are specific to the APIs being protected and outside the scope of this specification.¶
When gathering user consent, the ASMUST present the merged set of requirements represented by the authorization request.¶
If the resource owner grants the client the requested access, the AS will issue tokens to the client that are associated with the respectiveauthorization_details
(and scope values, if applicable).¶
Theresource
authorization request parameter, as defined in[RFC8707], can be used to further determine the resources where the requested scope can be applied. Theresource
parameter does not have any impact on the way the AS processes theauthorization_details
authorization request parameter.¶
This specification does not define extensions to the authorization response.¶
The ASMUST refuse to process any unknown authorization details type or authorization details not conforming to the respective type definition. The ASMUST abort processing and respond with an errorinvalid_authorization_details
to the client if any of the following are true of the objects in theauthorization_details
structure:¶
Theauthorization_details
token request parameter can be used to specify the authorization details that a client wants the AS to assign to an access token. The AS checks whether the underlying grant (in case of grant typesauthorization_code
,refresh_token
, etc.) or the client's policy (in case of grant typeclient_credentials
) allows the issuance of an access token with the requested authorization details. Otherwise, the AS refuses the request with the error codeinvalid_authorization_details
(similar toinvalid_scope
).¶
Many actions in the OAuth protocol allow the AS and RS to make security decisions based on whether the requestis asking for "more" or "less" than a previous, existing request. For example, upon refreshing a token, the client canask for a new access token with "fewer permissions" than had been previously authorized by the resource owner.The requested access token will convey the reduced permissions, but the resource owner's previous authorization is unchanged by such requests.Since the semantics of the fields in theauthorization_details
will be implementation specific to a given API or set of APIs, there is nostandardized mechanism to compare two arbitrary authorization detail requests.An AS should not rely on simple object comparison in most cases, as the intersection of some fieldswithin a request could have side effects on the access rights granted, depending on how the APIhas been designed and deployed. This is a similar effect to the scope values used with some APIs.¶
When comparing a new request to an existing request, an AS can use the sameprocessing techniques as used in granting the request in the first place to determine if a resourceowner needs to authorize the request. The details of this comparison are dependent on the definitionof thetype
of authorization request and outside the scope of this specification, but common patternscan be applied.¶
This shall be illustrated using our running example. The example authorization request inSection 3, if approved by the user, resulted in the issuance of an authorization code associated with the privileges to:¶
The client could now request the AS to issue an access token assigned with the privilege to just access a list of accounts as follows:¶
[ { "type": "account_information", "actions": [ "list_accounts" ], "locations": [ "https://example.com/accounts" ] }]
The example API is designed such that each field used by theaccount_information
type contains additive rights,with each value within theactions
andlocations
arrays specifying a different element of access. To make a comparison in thisinstance, the AS would perform the following steps:¶
account_information
,¶list_accounts
, and¶locations
value includes only previously approved locations.¶If all checks succeed, the AS would issue the requested access token with the reduced set of access.¶
Note that this comparison is relevant to this specific API type definition. A different API type definition could have different processing rules. For example, anactions
value could subsume the rights associated with anotheractions
value. For example, if a client initially asks fora token withwrite
access, this implies both read and write access to this API:¶
[ { "type": "example_api", "actions": [ "write" ] }]
Later, that same client makes a refresh request forread
access:¶
[ { "type": "example_api", "actions": [ "read" ] }]
The AS would compare thetype
value and theactions
value to determine that theread
access isalready covered by thewrite
access previously granted to the client.¶
This same API could be designed with a possible value forprivileges
ofadmin
, used in this example todenote that the resulting token is allowed to perform any of the functions on the resources.If thatclient is then granted suchadmin
privileges to the API, theauthorization_details
would be as follows:¶
[ { "type": "example_api", "privileges": [ "admin" ] }]
The AS would compare thetype
value and find that theprivileges
value subsumes any aspects ofread
orwrite
access that had been granted to the client previously. Note that otherAPI definitions can useprivileges
such that values do not subsume one another.¶
The next example shows how the client can use the common data elementlocations
(seeSection 2.2) to request the issuance of an access token restricted to a certain RS. In our running example, the client may ask for all permissions of the approved grant of typepayment_initiation
applicable to the RS residing athttps://example.com/payments
as follows:¶
[ { "type": "payment_initiation", "locations": [ "https://example.com/payments" ] }]
In addition to the token response parameters as defined in[RFC6749], the ASMUST also return theauthorization_details
as granted by the resource owner and assigned to the respective access token.¶
The authorization details assigned to the access token issued in a token response are determined by theauthorization_details
parameter of the corresponding token request. If the client does not specify theauthorization_details
token request parameters, the AS determines the resultingauthorization_details
at its discretion.¶
The ASMAY omit values in theauthorization_details
to the client.¶
For our running example, it would look like this:¶
HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: no-store{ "access_token": "2YotnFZFEjr1zCsicMWpAA", "token_type": "example", "expires_in": 3600, "refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA", "authorization_details": [ { "type": "payment_initiation", "actions": [ "initiate", "status", "cancel" ], "locations": [ "https://example.com/payments" ], "instructedAmount": { "currency": "EUR", "amount": "123.50" }, "creditorName": "Merchant A", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" } ]}
The authorization details attached to the access tokenMAY differ from what the client requests. In addition to the user authorizing less than what the client requested, there are some use cases where the AS enriches the data in an authorization details object. Whether enrichment is allowed and specifics of how it works are necessarily part of the definition of the respective authorization details type.¶
As one example, a client may ask for access to account information but leave the decision about the specific accounts it will be able to access to the user. During the course of the authorization process, the user would select the subset of their accounts that they want to allow the client to access. As one design option to convey the selected accounts, the AS could add this information to the respective authorization details object.¶
In that example, the requestedauthorization_details
parameter might look like the following. In this example, the empty arrays serve as placeholders for where data will be added during enrichment by the AS. This example is illustrative only and is not intended to suggest a preference for designing the specifics of any authorization details type this way.¶
"authorization_details": [ { "type": "account_information", "access": { "accounts": [], "balances": [], "transactions": [] }, "recurringIndicator":true }]
The AS then would expand the authorization details object and add the respective account identifiers.¶
HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: no-store{ "access_token":"2YotnFZFEjr1zCsicMWpAA", "token_type":"example", "expires_in":3600, "refresh_token":"tGzv3JokF0XG5Qx2TlKWIA", "authorization_details":[ { "type":"account_information", "access":{ "accounts":[ { "iban":"DE2310010010123456789" }, { "maskedPan":"123456xxxxxx1234" } ], "balances":[ { "iban":"DE2310010010123456789" } ], "transactions":[ { "iban":"DE2310010010123456789" }, { "maskedPan":"123456xxxxxx1234" } ] }, "recurringIndicator":true } ]}
For another example, the client is asking for access to a medical record but does not know the record number at request time. In this example, the client specifies the type of access it wants but doesn't specify the location or identifier of that access.¶
{"authorization_details": [ { "type": "medical_record", "sens": [ "HIV", "ETH", "MART" ], "actions": [ "read" ], "datatypes": [ "Patient", "Observation", "Appointment" ] }]}
When the user interacts with the AS, they select which of the medical records they are responsible for giving to the client. This information gets returned with the access token.¶
{ "access_token":"2YotnFZFEjr1zCsicMWpAA", "token_type":"example", "expires_in":3600, "refresh_token":"tGzv3JokF0XG5Qx2TlKWIA", "authorization_details":[ { "type": "medical_record", "sens": [ "HIV", "ETH", "MART" ], "actions": [ "read" ], "datatypes": [ "Patient", "Observation", "Appointment" ], "identifier": "patient-541235", "locations": [ "https://records.example.com/" ] } ]}
Note: The client needs to be aware upfront of the possibility that a certain authorization details object can be enriched. It is assumed that this property is part of the definition of the respective authorization details type.¶
The Token Error ResponseMUST conform to the rules given inSection 5.¶
In order to enable the RS to enforce the authorization details as approved in the authorization process, the ASMUST make this data available to the RS. The ASMAY add theauthorization_details
field to access tokens in JSON Web Token (JWT) format or to token introspection responses.¶
If the access token is a JWT[RFC7519], the AS isRECOMMENDED to add the authorization details object, filtered to the specific audience, as a top-level claim.¶
The AS will typically also add further claims to the JWT that the RS requires request processing, e.g., user ID, roles, and transaction-specific data. What claims the particular RS requires is defined by the RS-specific policy with the AS.¶
The following shows the contents of an example JWT for the payment initiation example above:¶
{ "iss": "https://as.example.com", "sub": "24400320", "aud": "a7AfcPcsl2", "exp": 1311281970, "acr": "psd2_sca", "txn": "8b4729cc-32e4-4370-8cf0-5796154d1296", "authorization_details": [ { "type": "https://scheme.example.com/payment_initiation", "actions": [ "initiate", "status", "cancel" ], "locations": [ "https://example.com/payments" ], "instructedAmount": { "currency": "EUR", "amount": "123.50" }, "creditorName": "Merchant A", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" } ], "debtorAccount": { "iban": "DE40100100103307118608", "user_role": "owner" }}
In this case, the AS added the following example claims to the JWT-based access token:¶
sub
:txn
:example.com
¶debtorAccount
:authorization_details
but was selected by the user during the authorization process. The fielduser_role
conveys the role the user has with respect to this particular account. In this case, they are the owner. This data is used for access control at the payment API (the RS).¶Token introspection[RFC7662] provides a means for an RS to query the AS to determine information about an access token. If the AS includes authorization detail information for the token in its response, the informationMUST be conveyed withauthorization_details
as a top-level member of the introspection response JSON object. Theauthorization_details
memberMUST contain the same structure defined inSection 2, potentially filtered and extended for the RS making the introspection request.¶
Here is an example introspection response for the payment initiation example:¶
{ "active": true, "sub": "24400320", "aud": "s6BhdRkqt3", "exp": 1311281970, "acr": "psd2_sca", "txn": "8b4729cc-32e4-4370-8cf0-5796154d1296", "authorization_details": [ { "type": "https://scheme.example.com/payment_initiation", "actions": [ "initiate", "status", "cancel" ], "locations": [ "https://example.com/payments" ], "instructedAmount": { "currency": "EUR", "amount": "123.50" }, "creditorName": "Merchant123", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" } ], "debtorAccount": { "iban": "DE40100100103307118608", "user_role": "owner" }}
To advertise its support for this feature, the supported list of authorization details types is included in the AS metadata response[RFC8414] using the metadata parameterauthorization_details_types_supported
, which is a JSON array.¶
This is illustrated by the following example:¶
{ ... "authorization_details_types_supported":[ "payment_initiation", "account_information" ]}
ClientsMAY indicate the authorization details types they will use when requesting authorization with the client registration metadata parameterauthorization_details_types
, which is a JSON array.¶
This is illustrated by the following example:¶
{ ... "authorization_details_types":[ "payment_initiation" ]}
The registration of authorization details types with the AS is outside the scope of this specification.¶
Using authorization details in a certain deployment will require the following steps:¶
General AS implementations supporting this specification should provide the following basic functions:¶
authorization_details
parameter in authorization requests in conformance with this specification¶authorization_code
andrefresh_token
.¶Processing and presentation of authorization details will vary significantly among different authorization details types. Implementations should therefore support customization of the respective behavior. In particular, implementations should allow deployments to:¶
One approach to supporting such customization would be to have a mechanism allowing the registration of extension modules, each of them responsible for rendering the respective user consent and any transformation needed to provide the data needed to the RS by way of structured access tokens or token introspection responses.¶
Implementations might allow deployments to use machine-readable schema languages for defining authorization details types to facilitate creating and validating authorization details objects against such schemas. For example, if an authorization detailstype
were defined using JSON Schemas[JSON.Schema], the JSON Schema identifier could be used astype
value in the respective authorization details objects.¶
Note, however, thattype
values are identifiers understood by the AS and, to the extent necessary, the client and RS.This specification makes no assumption that atype
value would point to a machine-readable schema format or that any party in the system (such as the client, AS, or RS) would dereference or process the contents of thetype
field in any specific way.¶
Authorization request URIs containingauthorization_details
in a request parameter or a request object can become very long. Therefore, implementers should consider using therequest_uri
parameter as defined in[RFC9101] in combination with the pushed request object mechanism as defined in[RFC9126] to passauthorization_details
in a reliable and secure manner. Here is an example of such a pushed authorization request that sends the authorization request data directly to the AS via an HTTPS-protected connection:¶
POST /as/par HTTP/1.1 Host: as.example.com Content-Type: application/x-www-form-urlencoded Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3 response_type=code& client_id=s6BhdRkqt3 &state=af0ifjsldkj &redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb &code_challenge_method=S256 &code_challenge=K2-ltc83acc4h0c9w6ESC_rEMTJ3bwc-uCHaoeK1t8U &authorization_details=%5B%7B%22type%22%3A%22account_information%22 %2C%22actions%22%3A%5B%22list_accounts%22%2C%22read_balances%22%2C% 22read_transactions%22%5D%2C%22locations%22%3A%5B%22https%3A%2F%2Fe xample.com%2Faccounts%22%5D%7D%2C%7B%22type%22%3A%22payment_initiat ion%22%2C%22actions%22%3A%5B%22initiate%22%2C%22status%22%2C%22canc el%22%5D%2C%22locations%22%3A%5B%22https%3A%2F%2Fexample.com%2Fpaym ents%22%5D%2C%22instructedAmount%22%3A%7B%22currency%22%3A%22EUR%22 %2C%22amount%22%3A%22123.50%22%7D%2C%22creditorName%22%3A%22Merchan t123%22%2C%22creditorAccount%22%3A%7B%22iban%22%3A%22DE021001001093 07118603%22%7D%2C%22remittanceInformationUnstructured%22%3A%22Ref%2 0Number%20Merchant%22%7D%5D
Theauthorization_details
parameter is sent through the user agent in case of an OAuth authorization request, which makes them vulnerable to modifications by the user. If the integrity of theauthorization_details
is a concern, clientsMUST protectauthorization_details
against tampering and swapping. This can be achieved by signing the request using signed request objects as defined in[RFC9101] or using therequest_uri
authorization request parameter as defined in[RFC9101] in conjunction with[RFC9126] to pass the URI of the request object to the AS.¶
All string comparisons in anauthorization_details
parameter are to be done as defined by[RFC8259]. No additional transformation or normalization is to be done in evaluating equivalence of string values.¶
The common data fieldlocations
allows a client to specify where it intends to use a certain authorization, i.e., it is possible to unambiguously assign permissions to RSs. In situations with multiple RSs, this prevents unintended client authorizations (e.g., aread
scope value potentially applicable for an email as well as a cloud service) through audience restriction.¶
The ASMUST properly sanitize and handle the data passed in theauthorization_details
in order to prevent injection attacks.¶
The Security Considerations of[RFC6749],[RFC7662], and[RFC8414] also apply.¶
It is especially important for implementers to design and use authorization details in a privacy-preserving manner.¶
Any sensitive personal data included inauthorization_details
must be prevented from leaking, e.g., through referrer headers. Implementation options include encrypted request objects as defined in[RFC9101] or transmission ofauthorization_details
via end-to-end encrypted connections between client and AS by utilizing[RFC9126] and therequest_uri
authorization request parameter as defined in[RFC9101]. The latter does not require application-level encryption, but it requires another message exchange between the client and the AS.¶
Even if the request data is encrypted, an attacker could use the AS to learn the user's data by injecting the encrypted request data into an authorization request on a device under their control and use the AS's user consent screens to show the (decrypted) user data in the clear. Implementations need to consider this attack vector and implement appropriate countermeasures, e.g., by only showing portions of the data or, if possible, determining whether the assumed user context is still the same (after user authentication).¶
The AS needs to take into consideration the privacy implications when sharingauthorization_details
with the client or RSs. The AS should share this data with those parties on a "need to know" basis as determined by local policy.¶
The following parameter has been registered in the "OAuth Parameters" registry[IANA.OAuth.Parameters]established by[RFC6749].¶
The following value has been registered in the IANA "JSON Web Token Claims" registry established by[RFC7519].¶
authorization_details
¶authorization_details
contains a JSON array of JSON objects representing the rights of the access token. Each JSON object contains the data to specify the authorization requirements for a certain type of resource.¶The following value has been registered in the IANA "OAuth Token Introspection Response" registry established by[RFC7662].¶
authorization_details
¶authorization_details
contains a JSON array of JSON objects representing the rights of the access token. Each JSON object contains the data to specify the authorization requirements for a certain type of resource.¶The following values have been registered in the IANA "OAuth Authorization Server Metadata" registry of[IANA.OAuth.Parameters] established by[RFC8414].¶
authorization_details_types_supported
¶The following value has been registered in the IANA "OAuth Dynamic Client Registration Metadata" registry of[IANA.OAuth.Parameters] established by[RFC7591].¶
authorization_details_types
¶The following value has been registered in the IANA "OAuth Extensions Error Registry" of[IANA.OAuth.Parameters] established by[RFC6749].¶
OpenID Connect[OIDC] specifies the JSON-basedclaims
request parameter that can be used to specify the claims a client (acting as an OpenID Connect Relying Party) wishes to receive in a fine-grained and privacy-preserving way as well as assign those claims to certain delivery mechanisms, i.e., ID Token or userinfo response.¶
The combination of the scope valueopenid
and the additional parameterclaims
can be used besideauthorization_details
in the same way as every non-OIDC scope value.¶
Alternatively, there could be an authorization details type for OpenID Connect. This section gives an example of what such an authorization details type could look like, but defining this authorization details type is outside the scope of this specification.¶
These hypothetical examples try to encapsulate all details specific to the OpenID Connect part of an authorization process into an authorization JSON object.¶
The top-level fields are based on the definitions given in[OIDC]:¶
claim_sets
:profile
¶max_age
:acr_values
:claims
:claims
JSON structure as defined in[OIDC]¶This is a simple request for some claim sets.¶
[ { "type": "openid", "locations": [ "https://op.example.com/userinfo" ], "claim_sets": [ "email", "profile" ] }]
Note:locations
specifies the location of the userinfo endpoint since this is the only place where an access token is used by a client (Relying Party) in OpenID Connect to obtain claims.¶
A more sophisticated example is shown inFigure 26.¶
[ { "type": "openid", "locations": [ "https://op.example.com/userinfo" ], "max_age": 86400, "acr_values": "urn:mace:incommon:iap:silver", "claims": { "userinfo": { "given_name": { "essential": true }, "nickname": null, "email": { "essential": true }, "email_verified": { "essential": true }, "picture": null, "http://example.com/claims/groups": null }, "id_token": { "auth_time": { "essential": true } } } }]
The following example is based on the concept laid out for remote electronic signing in ETSI TS 119 432[ETSI] and the Cloud Signature Consortium (CSC) API for remote signature creation[CSC].¶
[ { "type": "sign", "locations": [ "https://signing.example.com/signdoc" ], "credentialID": "60916d31-932e-4820-ba82-1fcead1c9ea3", "documentDigests": [ { "hash": "sTOgwOm+474gFj0q0x1iSNspKqbcse4IeiqlDg/HWuI=", "label": "Credit Contract" }, { "hash": "HZQzZmMAIWekfGH0/ZKW1nsdt0xg3H6bZYztgsMTLw0=", "label": "Contract Payment Protection Insurance" } ], "hashAlgorithmOID": "2.16.840.1.101.3.4.2.1" }]
The top-level fields have the following meaning:¶
credentialID
:documentDigests
:hash
fields). Additionally, the correspondinglabel
field identifies the respective document to the user, e.g., to be used in user consent.¶hashAlgorithm
:The AS is supposed to ask the user for consent for the creation of signatures for the documents listed in the structure. The client uses the access token issued as a result of the process to call the document signature API at the respective signing service to actually create the signature. This access token is bound to the client, the user ID and the hashes (and signature algorithm) as consented by the user.¶
This example is inspired by an API allowing third parties to access citizen's tax declarations and income statements, for example, to determine their creditworthiness.¶
[ { "type": "tax_data", "locations": [ "https://taxservice.govehub.no.example.com" ], "actions":"read_tax_declaration", "periods": ["2018"], "duration_of_access": 30, "tax_payer_id": "23674185438934" }]
The top-level fields have the following meaning:¶
These two examples are inspired by requirements for APIs used in the Norwegian eHealth system.¶
In this use case, the physical therapist sits in front of their computer using a local Electronic Health Records (EHR) system. They want to look at the electronic patient records of a certain patient, and they also want to fetch the patient's journal entries in another system, perhaps at another institution or a national service. Access to this data is provided by an API.¶
The information necessary to authorize the request at the API is only known by the EHR system and must be presented to the API.¶
In the first example, the authorization details object contains the identifier of an organization. In this case, the API needs to know if the given organization has the lawful basis for processing personal health information to give access to sensitive data.¶
"authorization_details": { "type": "patient_record", "requesting_entity": { "type": "Practitioner", "identifier": [ { "system": "urn:oid:2.16.578.1.12.4.1.4.4", "value": "1234567" }], "practitioner_role": { "organization": { "identifier": { "system": "urn:oid:2.16.578.1.12.4.1.2.101", "type": "ENH", "value": "[organizational number]" } } } }}
In the second example, the API requires more information to authorize the request. In this case, the authorization details object contains additional information about the health institution and the current profession the user has at the time of the request. The additional level of detail could be used for both authorization and data minimization.¶
[ { "type": "patient_record", "location": "https://fhir.example.com/patient", "actions": [ "read" ], "patient_identifier": [ { "system": "urn:oid:2.16.578.1.12.4.1.4.1", "value": "12345678901" } ], "reason_for_request": "Clinical treatment", "requesting_entity": { "type": "Practitioner", "identifier": [ { "system": "urn:oid:2.16.578.1.12.4.1.4.4", "value": "1234567" } ], "practitioner_role": { "organization": { "identifier": [ { "system": "urn:oid:2.16.578.1.12.4.1.2.101", "type": "ENH", "value": "<organizational number>" } ], "type": { "coding": [ { "system": "http://hl7.example.org/fhir/org-type", "code": "dept", "display": "Hospital Department" } ] }, "name": "Akuttmottak" }, "profession": { "coding": [ { "system": "http://snomed.example.org/sct", "code": "36682004", "display": "Physical therapist" } ] } } } }]
Description of the fields:¶
patient_identifier
:reason_for_request
:requesting_entity
:In this use case, the AS authenticates the requester, who is not the patient, and approves access based on policies.¶
We would like to thankDaniel Fett,Sebastian Ebling,Dave Tonge,Mike Jones,Nat Sakimura, andRob Otto for their valuable feedback during the preparation of this specification.¶
We would also like to thankVladimir Dzhuvinov,Takahiko Kawasaki,Daniel Fett,Dave Tonge,Travis Spencer,Joergen Binningsboe,Aamund Bremer,Steinar Noem,Francis Pouatcha,Jacob Ideskog,Hannes Tschofenig, andAaron Parecki for their valuablefeedback to this specification.¶