OAuth 2.0 Rich Authorization Requestsyes.comtorsten@lodderstedt.net
SecurityWeb Authorization Protocolsecurityoauth2This document specifies a new parameter authorization_details that is
used to carry fine grained authorization data into the OAuth authorization
request. defines the parameter scope that allows OAuth clients
to specify the expected scope, i.e. the permission, of an access token.
This mechanism is sufficient to implement static scenarios and course
grain authorization requests, such as "give me read access to
the resource owner's profile" but it's not sufficient to specify
fine grained authorization requirements, such as "please let me
make a payment with the amount of 45 Euros" or "please give me
read access to folder A and write access to file X".This draft introduces a new parameter authorization_details that allows clients to specify their fine grained authorization requirements using the expressiveness of JSON data structures.For example, a request for payment authorization can use a JSON object like this:For a comprehensive discussion of the challenges arising from new use cases in the open banking and eletronic signing spaces see .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 when, and only when, they
appear in all capitals, as shown here.This specification uses the terms "access token", "refresh token",
"authorization server", "resource server", "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 .The request parameter authorization_details contains a JSON object. This JSON object is composed of one or more JSON objects on the second level, each of them containing the data to specify the authorization requirements for a certain type of resource. The type of resource or access requirement is determined by the name of the JSON object.This example shows the specification of authorization details for a payment initiation transaction:This example shows a combined request asking for access to account information and allowance to initiate a payment:The named JSON objects account and payment represent the different authorization data to be used by the AS to ask for consent and MUST subsequently also be made available to the respective RSs.It is assumed that the structure of each of the authorization data elements is tailored to the needs of a certain application, API, or resource type. For example, the example structures shown above are based on certain kinds of APIs that can be found in the Open Banking space.This draft therefore only defines the authorization_details element (the container) and a minimal set of requirements regarding the structure of the contained authorization data elements.Note: different applications MUST ensure that their authorization data types do not collide. This is either achieved by using a namespace under the control of the entity defining the type name or by registering the type with the new OAuth Authorization Data Type Registry (see ).The following example shows how an implementation could utilize the namespace https://scheme.examples.org/ to ensure collision resistent element names.It's possible that the client asks for different kinds of access to different resources of the same type. There are two ways to cope with such a situation.For some applications, e.g. file access, it might be reasonable to build a way to allocated authorization data to certain resources into the application specific JSON structure.Here is an example:Alternatively, a client MAY specify multiple instances of the same authorization data element type and distinguish those elements by adding a suffix $+<instancename>. The following shows authorization details for requesting access to different folder on different IMAP servers (assuming the resource owner has access to both of them):The request parameter can be used anywhere where the scope parameter is used, examples include:Authorization requests as specified in ,Request objects as specified in ,Device Authorization Request as specified in Parameter encoding is determined by the respective context.In the context of an authorization request according to , the parameter is encoded using the application/x-www-form-urlencoded format as shown in the following example (JSON string trimmed for brevity):In the context of a request object, autorization_details is added as another top level JSON element.Note: Authorization request URIs containing authorization details in a request parameter or a request object can become very long. Implementers SHOULD therefore consider to use the request_uri parameter as defined in , potentially in combination with the pushed request object mechanism as defined in to pass authorization details in a reliable and secure manner.Based on the data provided in the authorization_details parameter the AS will ask the user for consent to the requested access permissions.Note: the AS is supposed to merge the authorization requirements given in the scope parameter and the authorization_details parameter if both are present in the authorization request.The AS MUST refuse to process any unknown authorization data type. If the authorization_details contains any unknown authorization data type, the AS MUST abort processing and respond with an error invalid_scope to the client.If the resource owner grants the client the requested access, the AS will issue tokens to the client that are associated with the respective authorization_details.The AS MUST make the authorization_details available to the respective resource servers. The AS MAY add the authorization_details element to access tokens in JWT format and to Token Introspection responses.The AS MUST take into consideration the privacy implications when sharing authorization details with the resource servers. The AS SHOULD share this data with the resource servers on a "need to know" basis.In addition to the token response parameters as defined in , the authorization server MUST also return the authorization details as granted by the resource owner and assigned to the respective access token.This is shown in the following example: defines the request parameter resource indicating to the AS the resource(s) where the client intends to use the access tokens issued based on a certain grant.This mechanism is a way to audience restrict access tokens and to allow the AS to create resource specific access tokens.This draft can be used in conjunction with in the same way as the scope parameter. The AS is supposed to narrow down the authorization details and respective permissions to the needs of the particular resource when minting an access token.While this depends on the AS to know what authorization details are relevant for what RS, this draft can also be combined with the concept of resource indicators to make this relationsship explicit and to narrow the privileges of an access token down to certain permissions given on a certain resource down to the individual operation (see , section-3.3).As an example, it is possible to specify that the client will get "read" access to "file X" stored at the resource "https://store.example.com". To achieve this, the example given above for access to an IMAP server is slightly modfied to use the resource element as part of the top level claims within the authorization data element.The AS MUST respect the value of the resource element when deciding whether a certain element is placed into a (structured) access token or token introspection response.TBDThe AS advertises support for authorization_details using the metadata parameter authorization_details_supported of type boolean.The authorization data types supported can be determined using the metadata parameter authorization_data_types_supported, which is an JSON array.Clients annonce the authorization data types the use in the new dynamic client registration parameter authorization_data_types.The registration of new authorization data types with the AS is out of scope of this draft.TBDself contained (account information, claims, signing)external reference (payment)multiple paymentsaccess to e-mailaccess to files/directoriesThe scheme and processing will significantly vary among different authorization data types. Any implementation of this draft is therefore supposed to allow the customization of the user consent and the handling of access token data.One option 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 resource server by way of structured access tokens or token introspection responses.Authorization details are sent through the user agent in case of an OAuth authorization request, which makes them vulnerable to modifications by the user. In order to ensure their integrity, the client SHOULD send authorization details in a signed request object as defined in or use the request_uri authorization request parameter as defined in to pass the URI of the request object to the authorization server.Implementers MUST design and use authorization details in a privacy preserving manner. Any sensitive personal data included in authorization details MUST be prevented from leakage, e.g. through referrer headers. Implementation options include encrypted request objects as defined in or transmission of authorization details via end-to-end encrypted connections between client ans authorization server by utilizing the request_uri authorization request parameter as defined in .I would would like to thank Brian Campbell, Daniel Fett, Sebastian Ebling, Dave Tonge, Mike Jones, Nat Sakimura, Rob Otto, and Justin Richer for their valuable feedback during the preparation of this draft.I would like to thank Dave Tonge and Aaron Parecki for their valuable feedback.authorization_details as JWT claimauthorization_details_supported and authorization_data_types_supported as metadata parametersauthorization_data_types as dynamic client registration parameterestablish authorization data type registryTransaction Authorization or why we need to re-think OAuth scopesyes.comFinancial-grade API: Pushed Request Objectyes.comPing Identity[[ To be removed from the final specification ]]-01Added Security ConsiderationsAdded Privacy ConsiderationsAdded notes on URI size and authorization detailsAdded requirement to return the effective authorization details granted by the resource owner in the token response-00first draft