OAuth 2.0 Rich Authorization Requestsyes.comtorsten@lodderstedt.netBespoke Engineeringietf@justin.richer.orgPing Identitybcampbell@pingidentity.com
SecurityWeb Authorization Protocolsecurityoauth2This document specifies a new parameter authorization_details that is
used to carry fine grained authorization data in the OAuth authorization
request.The OAuth 2.0 authorization framework defines the parameter scope that allows OAuth clients to
specify the requested scope, i.e., the permission, of an access token.
This mechanism is sufficient to implement static scenarios and
coarse-grained authorization requests, such as "give me read access to
the resource owner's profile" but it is 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 be represented using a JSON object like this:This object contains detailed information about the intended payment, such as amount, currency, and creditor, that are required to inform the user and obtain her consent. The AS and the respective RS (providing the payment initation 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 .In addition to facilitating custom authorization requests, this draft also introduces a set of common data type fields for use across different APIs.Most notably, the field locations allows a client to specify where it intends to use a certain authorization, i.e., it is now possible to unambiguously assign permissions to resource servers. In situations with multiple resource servers, this prevents unintended client authorizations (e.g. a read scope value potentially applicable for an email as well as a cloud service). In combination with the resource token request parameter as specified in it enables the AS to mint RS-specific structured access tokens that only contain the permissions applicable to the respective RS.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, 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 the type field.This example shows the specification of authorization details using the payment authorization object shown above:This example shows a combined request asking for access to account information and permission to initiate a payment:The JSON objects with type fields of account_information and payment_initiation 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 resource servers. The array MAY contain several elements of the same type.This draft defines a set of common data elements that are designed to be usable across different types of APIs. These data elements MAY be combined in different ways depending on the needs of the API. Unless otherwise noted, all data elements are OPTIONAL.The type of resource request as a string. This field MAY define which other elements are allowed in the request. This element is REQUIRED.An array of strings representing the location of the resource or resource server. This is typically composed of URIs.An array of strings representing the kinds of actions to be taken at the resource. The values of the strings are determined by the API being protected.An array of strings representing the kinds of data being requested from the resource.A string identifier indicating a specific resource available at the API.When different element types are used in combination, the permissions the client requests is the cartesian product of the values. In the following examplethe client is requesting read and write access to both the contacts and photos belonging to customers in a customer information API. If the client wishes to have finer control over its access, it can send multiple objects. For example:The client is asking for read access to the contacts and write access to the photos in the same API endpoint.An API MAY define its own extensions, subject to the type of the respective authorization object. It is assumed that the full structure of each of the authorization objects is tailored to the needs of a certain application, API, or resource type. The example structures shown above are based on certain kinds of APIs that can be found in the Open Banking space.Note: 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.example.org/ to ensure collision resistant element names.authorization_details and scope can be used in the same authorization request for carrying independent authorization requirements.The AS MUST consider 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.It is RECOMMENDED that a given API use only one form of requirement specification.When gathering user consent, the AS MUST present the merged set of requirements represented by the authorization request.OpenID Connect specifies the JSON-based claims request parameter that can be used to specify the claims a client (acting as OpenID Connect Relying Party) wishes to receive in a fine-grained and privacy preserving way as well as assign those claims to a certain delivery mechanisms, i.e. ID Token or userinfo response.The combination of the scope value openid and the additional parameter claims can be used beside authorization_details in the same way as every non-OIDC scope value.Alternatively, there could be an authorization data type for OpenID Connect. gives an example of how such an authorization data type could look like.The request parameter resource as defined in indicates 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 server specific access tokens.If a client uses authorization_details with locations elements and the resource parameter in the same authorization request, the locations data take precedence over the data conveyed in the resource parameter for that particular authorization details object.If such a client uses the resource parameter in a subsequent token requests, the AS MUST utilize the data provided in the locations elements to filter the authorization data objects applicable to the respective resource server. The AS will select all authorization details object where the resource string matches as prefix of one of the URLs provided in the respective locations element.This shall be illustrated using an example.The client has sent an authorization request using the following example authorization details.If this client then sends the following token request to the AS,that contains a resource parameter with the value of https://example.com/payments, this value will be matched against the locations elements (https://example.com/accounts and https://example.com/payments) and will select the element
of type payment_initiation for inclusion in the access token as illustrated by the following example JWT content.The request parameter can be used to specify authorization requirements in all places where the scope parameter is used for the same purpose, examples include:Authorization requests as specified in ,Access token requests as specified in , if also used as authorization requests, e.g. in the case of assertion grant types ,Request objects as specified in ,Device Authorization Request as specified in ,Backchannel Authentication Requests as defined 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 of the serialized JSON as shown in the following example:Implementors MUST ensure to protect personal identifiable information
in transit. One way is to utilize encrypted request objects as defined
in . In the context of a request object,
authorization_details is added as another top level JSON element.Authorization request URIs containing authorization details in a request parameter or a request object can become very long. Implementers SHOULD therefore consider using the request_uri parameter as defined in in combination with the pushed request object mechanism as defined in to pass authorization 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 a HTTPS-protected connection:Based on the data provided in the authorization_details parameter the AS will ask the user for consent to the requested access permissions.The AS MUST refuse to process any unknown authorization data type. If the authorization_details contain any unknown authorization data type, the AS MUST abort processing and respond with an error invalid_authorization_details to the client.Note: If the authorization request also contained the scope parameter, the AS MUST present the merged set of requirements represented by the authorization request in the user consent.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 (and scope values, if applicable).Note: 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 (see below).Clients utilizing authorization details are RECOMMENDED to use the resource token request parameter to allow the AS to issue audience restricted access tokens as recommended in .For example the following token request selects authorization details applicable for the resource server represented by the URI https://example.com/payments.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:In order to enable the RS to enforce the authorization details as approved in the authorization process, the AS MUST make this data available to the RS.If the access token is a JWT , the AS is RECOMMENDED to add the authorization_details object, filtered to the specific audience, as top-level claim.The AS will typically also add further claims to the JWT the RS requires for 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 initation example above:In this case, the AS added the following example claims:sub: conveys the user on which behalf the client is asking for payment initationtxn: transaction id used to trace the transaction across the services of provider example.comdebtorAccount: API-specific element containing the debtor account. In the example, this account was not passed in the authorization details but selected by the user during the authorization process. The field user_role conveys the role the user has with respect to this particuar account. In this case, she is the owner. This data is used for access control at the payment API (the RS).In case of opaque access tokens, the data provided to a certain RS is determined using the RS's identifier with the AS (see , section 3).The token endpoint response provides the RS with the authorization details applicable to it as a top-level JSON element along with the claims the RS requires for request processing.Here is an example for the payment initation example RS:The 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 announce the authorization data types they 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.The scheme and processing will vary significantly 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.All strings MUST be compared using the exact byte representation of the characters as defined by . This is especially true for the type field, which dictates which other fields and functions are allowed in the request. The server MUST NOT perform any form of collation, transformation, or equivalence on the string values.Implementers MUST design and use authorization details in a privacy preserving manner.Any sensitive personal data included in authorization details MUST be prevented from leaking, 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 and authorization server by utilizing the request_uri authorization request parameter as defined in .Even if the request data are encrypted, an attacker could use the authorization server to learn the user data by injecting the encrypted request data into an authorization request on a device under his control and use the authorization server's user consent screens to show the (decrypted) user data in the clear. Implementations MUST consider this attacker vector and implement appropriate counter measures, e.g. by only showing portions of the data or, if possible, determing whether the assumed user context is still the same (after user authentication).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.We would would like to thank Daniel Fett, Sebastian Ebling, Dave Tonge, Mike Jones, Nat Sakimura, and Rob Otto for their valuable feedback during the preparation of this draft.We would also like to thank
Daniel Fett,
Dave Tonge,
Travis Spencer,
Jørgen Binningsbø,
Aamund Bremer,
Steinar Noem,
and Aaron Parecki for their valuable feedback to this draft.TBDauthorization_details as JWT claimauthorization_details_supported and authorization_data_types_supported as metadata parametersauthorization_data_types as dynamic client registration parameterestablish authorization data type registryregister type openid_claimsOpenID Connect Core 1.0 incorporating errata set 1NRIPing IdentityMicrosoftGoogleSalesforceOpenID Connect Client Initiated Backchannel Authentication Flow - Core 1.0Telefonica I+DDeutsche Telekom AGDeutsche Telekom AGMoneyhubPing IdentityTransaction Authorization or why we need to re-think OAuth scopesyes.comArchitectures and protocols for remote signature applicationsCloud Signature ConsortiumETSI TS 119 432, Electronic Signatures and Infrastructures (ESI); Protocols for remote digital signature creation ETSIThese 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 elements are based on the definitions given in :claim_sets: names of predefined claim sets, replacement for respective scope values, such as profilemax_age: Maximum Authentication Ageacr_values: array of ACR valuesclaims: the claims JSON structure as defined in This is a simple request for some claim sets.Note: locations specifies the location of the userinfo endpoint since this is the only place where an access token is used by a client (RP) in OpenID Connect to obtain claims.A more sophisticated example is shown in the followingThe following example is based on the concept layed out for remote electronic signing in ETSI TS 119 432 and the CSC API for remote signature creation .The top-level elements have the following meaning:credentialID: identifier of the certificate to be used for signingdocumentDigests: array containing the hash of every document to be signed (hash elements). Additionally, the corresponding label element identifies the respective document to the user, e.g. to be used in user consent.hashAlgorithm: algomrithm that was used to calculate the hash values.The AS is supposed to ask the user for consent for the creation of signatues for the documents listed in the structure. The client uses the access token issued as result of the process to call the sign doc endpoint 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 credit worthiness.The top-level elements have the following meaning:periods: determines the periods the client wants to accessduration_of_access: how long does the client intend to access the data in daystax_payer_id: identifier of the tax payer (if known to the client)This example is inspired by an API used in the Norwegian eHealth system.In this use case the physical therapist sits in front of her computer using a local Electronic Health Records (EHR) system. She wants to look at the electronic patient records of a certain patient and she also wants to fetch the patients 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.Here is an example authorization details object:Description of the elements:patient_identifier: the identifier of the patient composed of a system identifier in OID format (namespace) and the acutal value within this namespace.reason_for_request: the reason why the user wants to access a certain APIrequesting_entity: specification of the requester by means of identity, role and organizational context. This data is provided to facilitate authorization and for auditing purposes.In this use case, the AS authenticates the requester, who is not the patient, and approves access based on policies.[[ To be removed from the final specification ]]-00 (WG draft)inital WG revision-03Reworked examples to illustrate privacy preserving use of authorization_detailsAdded text on audience restrictionAdded description of relationship between scope and authorization_detailsAdded text on token request & response and authorization_detailsAdded text on how authorization details are conveyed to RSs by JWTs or token endpoint responseAdded description of relationship between claims and authorization_detailsAdded more example from different sectorsClarified string comparison to be byte-exact without collation-02Added 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 responsechanged authorization_details structure from object to arrayadded Justin Richer & Brian Campbell as Co-Authors-00 / -01first draft