Internet-Draft | oauth-rar | October 2020 |
Lodderstedt, et al. | Expires 21 April 2021 | [Page] |
This document specifies a new parameter authorization_details
that is
used to carry fine grained authorization data in the OAuth authorization
request.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 21 April 2021.¶
Copyright (c) 2020 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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
The OAuth 2.0 authorization framework [RFC6749] 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:¶
{ "type": "payment_initiation", "locations": [ "https://example.com/payments" ], "instructedAmount": { "currency": "EUR", "amount": "123.50" }, "creditorName": "Merchant123", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" }¶
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 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-authorization].¶
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 [RFC8707] 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 [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", "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 [RFC6749].¶
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:¶
[ { "type": "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" } ]¶
This example 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": "Merchant123", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" } ]¶
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
.¶
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 [OIDC] 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. Appendix A.1 gives an example of how such an authorization data type could look like.¶
The request parameter resource
as defined in [RFC8707] 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. The authorization_details
parameter also allows the client to designate the audience of a certain authorization details object in the respective locations
element.¶
This specification allows a client to use both parameters together in an authorization request, and it defines how the resource
parameter in the token request can be used to assign authorization details to a certain access token.¶
If used together, the locations
element within objects of the authorization_details
parameter overrides the value of the resources
parameter. In the absence of a locations
element, the value of the resources
parameter is applied to the object.¶
If a client uses the resource
parameter in a token requests, the AS MUST utilize the data provided in the locations
elements to filter the authorization data objects applicable to the respective resource(s).¶
The logic is as follows:¶
For every authorization details object without a locations
element: the authorization server treats it as applicable to all resources, i.e. it assigns this authorization details object to the access token.¶
For every authorization details object with a locations
element: the authorization server adds this object to the access token, if at least one of the locations
values exactly matches the resource
parameter value. The authorization server MUST compare both values using an exact byte match of the string values.¶
This shall be illustrated using an example.¶
The client has sent an authorization request using the following example authorization details.¶
[ { "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": "Merchant123", "creditorAccount": { "iban": "DE02100100109307118603" }, "remittanceInformationUnstructured": "Ref Number Merchant" } ]¶
If this client then sends the following token request to the AS,¶
POST /token HTTP/1.1 Host: as.example.com Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW Content-Type: application/x-www-form-urlencoded grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb &resource=https%3A%2F%2Fexample%2Ecom%2Fpayments¶
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.¶
{ "iss": "https://as.example.com", "sub": "24400320", "aud": "a7AfcPcsl2", "exp": 1311281970, ... "authorization_details": [ { "type": "https://www.someorg.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" } ], ... }¶
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 [I-D.ietf-oauth-jwsreq] or use the request_uri
authorization request parameter as defined in [I-D.ietf-oauth-jwsreq] 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 [RFC8259]. 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 [I-D.ietf-oauth-jwsreq] 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 [I-D.ietf-oauth-jwsreq].¶
Even if the request data is 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 Vladimir Dzhuvinov, Takahiko Kawasaki, Daniel Fett, Dave Tonge, Travis Spencer, Jørgen Binningsbø, Aamund Bremer, Steinar Noem, and Aaron Parecki for their valuable feedback to this draft.¶
TBD¶
authorization_details
as JWT claim¶
authorization_details_supported
and authorization_data_types_supported
as metadata parameters¶
authorization_data_types
as dynamic client registration parameter¶
[[ possibly establish authorization data type registry (and declare: type
, actions
, locations
, datatypes
, identifier
, others?) ]]¶
[[ register type openid_claims
on a URL by the OpenID foundation? ]]¶
register invalidauthorizationdetails to OAuth Extensions Error Registry¶
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 elements are based on the definitions given in [OIDC]:¶
claim_sets
: names of predefined claim sets, replacement for respective scope values, such as profile
¶
max_age
: Maximum Authentication Age¶
acr_values
: array of ACR values¶
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 (RP) in OpenID Connect to obtain claims.¶
A more sophisticated example is shown in the following¶
[ { "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.info/claims/groups": null }, "id_token": { "auth_time": { "essential": true } } } } ]¶
The following example is based on the concept layed out for remote electronic signing in ETSI TS 119 432 [ETSI] and the 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 elements have the following meaning:¶
credentialID
: identifier of the certificate to be used for signing¶
documentDigests
: 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.¶
[ { "type": "tax_data", "locations": [ "https://taxservice.govehub.no" ], "actions":"read_tax_declaration", "periods": ["2018"], "duration_of_access": 30, "tax_payer_id": "23674185438934" } ]¶
The top-level elements 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 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.¶
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.org/fhir/organization-type", "code": "dept", "display": "Hospital Department" } ] }, "name": "Akuttmottak" }, "profession": { "coding": [ { "system": "http://snomed.info/sct", "code": "36682004", "display": "Physical therapist" } ] } } } } ]¶
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 API¶
requesting_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 ]]¶
-03¶
Updated referenes to current revisions or RFC numbers¶
Added section about enrichment of authorization details objects by the AS¶
Clarified processing of unknown authorization details parameters¶
clarified dependencies between resource
and authorization_details
parameters¶
-02¶
Clarify "type" parameter processing¶
-01¶
Minor fix-up in a few examples¶
-00 (WG draft)¶
initial WG revision¶
-03¶
Reworked examples to illustrate privacy preserving use of authorization_details
¶
Added text on audience restriction¶
Added description of relationship between scope
and authorization_details
¶
Added text on token request & response and authorization_details
¶
Added text on how authorization details are conveyed to RSs by JWTs or token endpoint response¶
Added description of relationship between claims
and authorization_details
¶
Added more example from different sectors¶
Clarified string comparison to be byte-exact without collation¶
-02¶
Added Security Considerations¶
Added Privacy Considerations¶
Added notes on URI size and authorization details¶
Added requirement to return the effective authorization details granted by the resource owner in the token response¶
changed authorization_details
structure from object to array¶
added Justin Richer & Brian Campbell as Co-Authors¶
-00 / -01¶
first draft¶