<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-ietf-oauth-rar-06" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" consensus="true">

<front>
<title abbrev="oauth-rar">OAuth 2.0 Rich Authorization Requests</title><seriesInfo value="draft-ietf-oauth-rar-06" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="T." surname="Lodderstedt" fullname="Torsten Lodderstedt"><organization>yes.com</organization><address><postal><street></street>
</postal><email>torsten@lodderstedt.net</email>
</address></author>
<author initials="J." surname="Richer" fullname="Justin Richer"><organization>Bespoke Engineering</organization><address><postal><street></street>
</postal><email>ietf@justin.richer.org</email>
</address></author>
<author initials="B." surname="Campbell" fullname="Brian Campbell"><organization>Ping Identity</organization><address><postal><street></street>
</postal><email>bcampbell@pingidentity.com</email>
</address></author>
<date/>
<area>Security</area>
<workgroup>Web Authorization Protocol</workgroup>
<keyword>security</keyword>
<keyword>oauth2</keyword>

<abstract>
<t>This document specifies a new parameter <tt>authorization_details</tt> that is
used to carry fine grained authorization data in the OAuth authorization
request.</t>
</abstract>

</front>

<middle>

<section anchor="Introduction"><name>Introduction</name>
<t>The OAuth 2.0 authorization framework <xref target="RFC6749"></xref> defines the parameter <tt>scope</tt> 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 &quot;give me read access to
the resource owner's profile&quot; but it is not sufficient to specify
fine-grained authorization requirements, such as &quot;please let me make a
payment with the amount of 45 Euros&quot; or &quot;please give me read access to
folder A and write access to file X&quot;.</t>
<t>This draft introduces a new parameter <tt>authorization_details</tt> that allows clients to specify their fine-grained authorization requirements using the expressiveness of JSON data structures.</t>
<t>For example, a request for payment authorization can be represented using a JSON object like this:</t>

<sourcecode type="JSON">{
   &quot;type&quot;: &quot;payment_initiation&quot;,
   &quot;locations&quot;: [
      &quot;https://example.com/payments&quot;
   ],
   &quot;instructedAmount&quot;: {
      &quot;currency&quot;: &quot;EUR&quot;,
      &quot;amount&quot;: &quot;123.50&quot;
   },
   &quot;creditorName&quot;: &quot;Merchant123&quot;,
   &quot;creditorAccount&quot;: {
      &quot;iban&quot;: &quot;DE02100100109307118603&quot;
   },
   &quot;remittanceInformationUnstructured&quot;: &quot;Ref Number Merchant&quot;
}
</sourcecode>
<t>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.</t>
<t>For a comprehensive discussion of the challenges arising from new use cases in the open banking and electronic signing spaces see <xref target="transaction-authorization"></xref>.</t>
<t>In addition to facilitating custom authorization requests, this draft also introduces a set of common data type fields for use across different APIs.</t>
<t>Most notably, the field <tt>locations</tt> 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 <tt>read</tt> scope value potentially applicable for an email as well as a cloud service). In combination with the <tt>resource</tt> token request parameter as specified in <xref target="RFC8707"></xref> or by specifing authorization details with a single location only in the token request, it enables the AS to mint RS-specific structured access tokens that only contain the permissions applicable to the respective RS.</t>

<section anchor="conventions-and-terminology"><name>Conventions and Terminology</name>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL
NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;NOT RECOMMENDED&quot;,
&quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref> when, and only when, they
appear in all capitals, as shown here.</t>
<t>This specification uses the terms &quot;access token&quot;, &quot;refresh token&quot;,
&quot;authorization server&quot;, &quot;resource server&quot;, &quot;authorization endpoint&quot;,
&quot;authorization request&quot;, &quot;authorization response&quot;, &quot;token endpoint&quot;,
&quot;grant type&quot;, &quot;access token request&quot;, &quot;access token response&quot;, and
&quot;client&quot; defined by The OAuth 2.0 Authorization Framework <xref target="RFC6749"></xref>.</t>
</section>
</section>

<section anchor="authz_details"><name>Request parameter &quot;authorization_details&quot;</name>
<t>The request parameter <tt>authorization_details</tt> 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 <tt>type</tt> field.</t>
<t>This example shows the specification of authorization details using the payment authorization object shown above:</t>

<sourcecode type="JSON">[
   {
      &quot;type&quot;: &quot;payment_initiation&quot;,
      &quot;actions&quot;: [
         &quot;initiate&quot;,
         &quot;status&quot;,
         &quot;cancel&quot;
      ],
      &quot;locations&quot;: [
         &quot;https://example.com/payments&quot;
      ],
      &quot;instructedAmount&quot;: {
         &quot;currency&quot;: &quot;EUR&quot;,
         &quot;amount&quot;: &quot;123.50&quot;
      },
      &quot;creditorName&quot;: &quot;Merchant123&quot;,
      &quot;creditorAccount&quot;: {
         &quot;iban&quot;: &quot;DE02100100109307118603&quot;
      },
      &quot;remittanceInformationUnstructured&quot;: &quot;Ref Number Merchant&quot;
   }
]
</sourcecode>
<t>This example shows a combined request asking for access to account information and permission to initiate a payment:</t>

<sourcecode type="JSON">[
   {
      &quot;type&quot;: &quot;account_information&quot;,
      &quot;actions&quot;: [
         &quot;list_accounts&quot;,
         &quot;read_balances&quot;,
         &quot;read_transactions&quot;
      ],
      &quot;locations&quot;: [
         &quot;https://example.com/accounts&quot;
      ]
   },
   {
      &quot;type&quot;: &quot;payment_initiation&quot;,
      &quot;actions&quot;: [
         &quot;initiate&quot;,
         &quot;status&quot;,
         &quot;cancel&quot;
      ],
      &quot;locations&quot;: [
         &quot;https://example.com/payments&quot;
      ],
      &quot;instructedAmount&quot;: {
         &quot;currency&quot;: &quot;EUR&quot;,
         &quot;amount&quot;: &quot;123.50&quot;
      },
      &quot;creditorName&quot;: &quot;Merchant123&quot;,
      &quot;creditorAccount&quot;: {
         &quot;iban&quot;: &quot;DE02100100109307118603&quot;
      },
      &quot;remittanceInformationUnstructured&quot;: &quot;Ref Number Merchant&quot;
   }
]
</sourcecode>
<t>The JSON objects with <tt>type</tt> fields of <tt>account_information</tt> and <tt>payment_initiation</tt> 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 <tt>type</tt>.</t>

<section anchor="authorization-data-elements-types"><name>Authorization data elements types</name>
<t>The allowable contents of the authorization details object are determined by the <tt>type</tt> parameter.</t>

<dl>
<dt><tt>type</tt>:</dt>
<dd><t>The type of authorization data as a string. This field MAY define which other elements are allowed in the request. This element is REQUIRED.</t>
</dd>
</dl>
<t>This field MUST be compared using an exact byte match of the string value against known types by the AS. The AS MUST ensure that there is no collision between different authorization data types that it supports. The AS MUST NOT do any collation or normalization of data types during comparison.</t>
<t>The value of the <tt>type</tt> field determines the allowable contents of the object which contains it. 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. All data elements are OPTIONAL for use by a given API definition. The allowable values of all elements are determined by the API being protected.</t>

<dl>
<dt><tt>locations</tt>:</dt>
<dd><t>An array of strings representing the location of the resource or resource server. These strings are typically URIs identifying the
location of the RS.</t>
</dd>
<dt><tt>actions</tt>:</dt>
<dd><t>An array of strings representing the kinds of actions to be taken at the resource.</t>
</dd>
<dt><tt>datatypes</tt>:</dt>
<dd><t>An array of strings representing the kinds of data being requested from the resource.</t>
</dd>
<dt><tt>identifier</tt>:</dt>
<dd><t>A string identifier indicating a specific resource available at the API.</t>
</dd>
<dt><tt>privileges</tt>:</dt>
<dd><t>An array of strings representing the types or levels of privilege being requested at the resource.</t>
</dd>
</dl>
<t>When different element types are used in combination, the permissions the client requests is the cartesian product of the values. That is to
say, the object represents a request for all <tt>action</tt> values listed within the object
to be used at all <tt>locations</tt> values listed within the object for all <tt>datatype</tt>
values listed within the object. In the following example, the client is requesting <tt>read</tt> and <tt>write</tt>
access to both the <tt>contacts</tt> and <tt>photos</tt> belonging to customers in a <tt>customer_information</tt> API. If
this request is granted, the client would assume it would be able to use any combination of rights
defined by the API, such as reading the photos and writing the contacts.</t>

<sourcecode type="JSON">[
   {
      &quot;type&quot;: &quot;customer_information&quot;,
      &quot;locations&quot;: [
         &quot;https://example.com/customers&quot;,
      ]
      &quot;actions&quot;: [
         &quot;read&quot;,
         &quot;write&quot;
      ],
      &quot;datatypes&quot;: [
         &quot;contacts&quot;,
         &quot;photos&quot;
      ]
   }
]
</sourcecode>
<t>If the client wishes to have finer control over its access, it can send multiple objects. In this example,
the client is asking for <tt>read</tt> access to the <tt>contacts</tt> and <tt>write</tt> access to the <tt>photos</tt> in the same API endpoint.
If this request is granted, the client would not be able to write to the contacts.</t>

<sourcecode type="JSON">[
   {
      &quot;type&quot;: &quot;customer_information&quot;,
      &quot;locations&quot;: [
         &quot;https://example.com/customers&quot;
      ],
      &quot;actions&quot;: [
         &quot;read&quot;
      ],
      &quot;datatypes&quot;: [
         &quot;contacts&quot;
      ]
   },
   {
      &quot;type&quot;: &quot;customer_information&quot;,
      &quot;locations&quot;: [
         &quot;https://example.com/customers&quot;
      ],
      &quot;actions&quot;: [
         &quot;write&quot;
      ],
      &quot;datatypes&quot;: [
         &quot;photos&quot;
      ]
   }
]
</sourcecode>
<t>An API MAY define its own extensions, subject to the <tt>type</tt> of the respective authorization object.
It is anticipated that API designers will use a combination
of common fields defined in this specification as well as
fields specific to the API itself. The following non-normative
example shows the use of both common and API-specific fields as
part of two different fictitious API <tt>type</tt> values. The first
access request includes the <tt>actions</tt>, <tt>locations</tt>, and <tt>datatypes</tt>
fields specified here as well as the API-specific <tt>geolocation</tt>
field. The second access request includes the <tt>actions</tt> and
<tt>identifier</tt> fields specified here as well as the API-specific
<tt>currency</tt> field.</t>

<artwork>    &quot;resources&quot;: [
        {
            &quot;type&quot;: &quot;photo-api&quot;,
            &quot;actions&quot;: [
                &quot;read&quot;,
                &quot;write&quot;
            ],
            &quot;locations&quot;: [
                &quot;https://server.example.net/&quot;,
                &quot;https://resource.local/other&quot;
            ],
            &quot;datatypes&quot;: [
                &quot;metadata&quot;,
                &quot;images&quot;
            ],
            &quot;geolocation&quot;: [
                { lat: -32.364, lng: 153.207 },
                { lat: -35.364, lng: 158.207 }
            ]
        },
        {
            &quot;type&quot;: &quot;financial-transaction&quot;,
            &quot;actions&quot;: [
                &quot;withdraw&quot;
            ],
            &quot;identifier&quot;: &quot;account-14-32-32-3&quot;, 
            &quot;currency&quot;: &quot;USD&quot;
        }
    ]
</artwork>
<t>If this request is approved, the resulting access token's access rights will be
the union of the requested types of access for each of the two APIs, just as above.</t>
</section>

<section anchor="authorization-data-types"><name>Authorization Data Types</name>
<t>Interpretation of the value of the <tt>type</tt> parameter, and the object elements that the <tt>type</tt> parameter allows, is under the control of the AS. However, the value of the <tt>type</tt> parameter is also generally documented and intended to be used by developers, it is RECOMMENDED that API designers choose <tt>type</tt> 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 depending than what the AS has defined. Possible means of reducing potential confusion are limiting the value to ASCII characters, providing a machine-readable listing of data type values, or instructing developers to copy and paste directly from documentation.</t>
<t>If an application or API is expected to be deployed across different servers, such as the case in an open standard, the API designer is RECOMMENDED to use a collision-resistant namespace under their control, such as a URI that the API designer controls.</t>
<t>The following example shows how an implementation could utilize the namespace <tt>https://scheme.example.org/</tt> to ensure collision resistant element names.</t>

<sourcecode type="JSON">{
   &quot;type&quot;: &quot;https://scheme.example.org/files&quot;,
   &quot;locations&quot;: [
      &quot;https://example.com/files&quot;
   ],
   &quot;permissions&quot;: [
      {
         &quot;path&quot;: &quot;/myfiles/A&quot;,
         &quot;access&quot;: [
            &quot;read&quot;
         ]
      },
      {
         &quot;path&quot;: &quot;/myfiles/A/X&quot;,
         &quot;access&quot;: [
            &quot;read&quot;,
            &quot;write&quot;
         ]
      }
   ]
}
</sourcecode>
</section>
</section>

<section anchor="authz_request"><name>Authorization Request</name>
<t>The <tt>authorization_details</tt> authorization request parameter can be used to specify authorization requirements in all places where the <tt>scope</tt> parameter is used for the same purpose, examples include:</t>

<ul>
<li><t>Authorization requests as specified in <xref target="RFC6749"></xref>,</t>
</li>
<li><t>Device Authorization Request as specified in <xref target="RFC8628"></xref>,</t>
</li>
<li><t>Backchannel Authentication Requests as defined in <xref target="OpenID.CIBA"></xref>.</t>
</li>
</ul>
<t>Parameter encoding is determined by the respective context. In the context of an authorization request according to <xref target="RFC6749"></xref>, the parameter is encoded using the <tt>application/x-www-form-urlencoded</tt> format of the serialized JSON as shown in the following using the example from <xref target="authz_details"></xref> (line breaks for display purposes only):</t>

<artwork>GET /authorize?response_type=code
   &amp;client_id=s6BhdRkqt3
   &amp;state=af0ifjsldkj
   &amp;redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb
   &amp;code_challenge_method=S256
   &amp;code_challenge=K2-ltc83acc4h0c9w6ESC_rEMTJ3bwc-uCHaoeK1t8U
   &amp;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%22Merchant123%22%2C%22creditorAccount%22%3A%7B%
   22iban%22%3A%22DE02100100109307118603%22%7D%2C%22remittance
   InformationUnstructured%22%3A%22RefNumberMerchant%22%7D%5D HTTP/1.1
Host: server.example.com
</artwork>
<t>Based on the data provided in the <tt>authorization_details</tt> parameter the AS will ask the user for consent to the requested access permissions. In this example, the client wants to get access to account information and intiate a payment:</t>

<sourcecode type="JSON">[
   {
      &quot;type&quot;: &quot;account_information&quot;,
      &quot;actions&quot;: [
         &quot;list_accounts&quot;,
         &quot;read_balances&quot;,
         &quot;read_transactions&quot;
      ],
      &quot;locations&quot;: [
         &quot;https://example.com/accounts&quot;
      ]
   },
   {
      &quot;type&quot;: &quot;payment_initiation&quot;,
      &quot;actions&quot;: [
         &quot;initiate&quot;,
         &quot;status&quot;,
         &quot;cancel&quot;
      ],
      &quot;locations&quot;: [
         &quot;https://example.com/payments&quot;
      ],
      &quot;instructedAmount&quot;: {
         &quot;currency&quot;: &quot;EUR&quot;,
         &quot;amount&quot;: &quot;123.50&quot;
      },
      &quot;creditorName&quot;: &quot;Merchant123&quot;,
      &quot;creditorAccount&quot;: {
         &quot;iban&quot;: &quot;DE02100100109307118603&quot;
      },
      &quot;remittanceInformationUnstructured&quot;: &quot;Ref Number Merchant&quot;
   }
]
</sourcecode>

<section anchor="scope"><name>Relationship to &quot;scope&quot; parameter</name>
<t><tt>authorization_details</tt> and <tt>scope</tt> can be used in the same authorization request for carrying independent authorization requirements.</t>
<t>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.</t>
<t>It is RECOMMENDED that a given API uses only one form of requirement specification.</t>
<t>When gathering user consent, the AS MUST present the merged set of requirements represented by the authorization request.</t>
<t>If the resource owner grants the client the requested access, the AS will issue tokens to the client that are associated with the respective <tt>authorization_details</tt> (and scope values, if applicable).</t>
</section>

<section anchor="relationship-to-resource-parameter"><name>Relationship to &quot;resource&quot; parameter</name>
<t>The <tt>resource</tt> authorization request parameter as defined in <xref target="RFC8707"></xref> can be used to further determine the resources where the requested scope can be applied. The  <tt>resource</tt> parameter does not have any impact on the way the AS processes the <tt>authorization_details</tt> authorization request parameter.</t>
</section>
</section>

<section anchor="authorization-response"><name>Authorization Response</name>
<t>This specification does not define extensions to the authorization response.</t>
</section>

<section anchor="authz_details_error"><name>Authorization Error Response</name>
<t>The AS MUST refuse to process any unknown authorization data type or authorization details not conforming to the respective type definition. If any of the objects in <tt>authorization_details</tt> contains an unknown authorization data type or an object of known type but containing unknown elements or elements of the wrong type or elements
with invalid values or if required elements are missing, the AS MUST abort processing and respond with an error <tt>invalid_authorization_details</tt> to the client.</t>
</section>

<section anchor="token-request"><name>Token Request</name>
<t>The <tt>authorization_details</tt> token request parameter can be used to specify the authorization details a client wants the AS to assign to an access token. The AS checks whether the underlying grant (in case of grant types <tt>authorization_code</tt>, <tt>refresh_token</tt>, ...) or the client's policy (in case of grant type <tt>client_credential</tt>) allows the issuance of an access token with the requested authorization details. Otherwise, the AS refuses the request with error code <tt>invalid_authorization_details</tt> (similar to <tt>invalid_scope</tt>).</t>

<section anchor="comparing-authorization-details"><name>Comparing authorization details</name>
<t>Many actions in the OAuth protocol allow the AS and RS to make security decisions based on whether or not the request
is asking for &quot;more&quot; or &quot;less&quot; than a previous, existing request. For example, upon refreshing a token, the client can
ask for a new access token with &quot;fewer permissions&quot; than had been previously authorized by the resource owner.
Since the nature of an authorization details request is based solely on the API or APIs that it is describing, there is not
a simple means of comparing any two arbitrary authorization details requests.
Authorization servers should not rely on simple object comparison in most cases, as the intersection of some elements
within a request could have side effects in the access rights granted, depending on how the API
has been designed and deployed. This is a similar effect to the scope values used with some APIs.</t>
<t>However, when comparing a new request to an existing request, authorization servers can use the same
processing techniques as used in granting the request in the first place to determine if a resource
owner needs to authorize the request. The details of this comparison are dependent on the definition
of the <tt>type</tt> of authorization request and outside the scope of this specification, but common patterns
can be applied.</t>
<t>This shall be illustrated using our running example. The example authorization request in <xref target="authz_request"></xref>, if approved by the user, resulted in the issuance of an authorization code associated with the privileges to</t>

<ul>
<li><t>list accounts</t>
</li>
<li><t>access the balance of one or more accounts,</t>
</li>
<li><t>access the transactions of one or more accounts, and</t>
</li>
<li><t>to initiate a payment.</t>
</li>
</ul>
<t>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:</t>

<sourcecode type="JSON">[
   {
      &quot;type&quot;:&quot;account_information&quot;,
      &quot;actions&quot;:[
         &quot;list_accounts&quot;
      ],
      &quot;locations&quot;:[
         &quot;https://example.com/accounts&quot;
      ]
   }
]
</sourcecode>
<t>The example API is designed such that each field used by the <tt>account_information</tt> type contains additive rights,
with each value within the <tt>actions</tt> and <tt>locations</tt> arrays specifying a different element of access. To make a comparison in this
instance, the AS would perform the following steps:</t>

<ul>
<li><t>compare that the authorization code issued in the previous step contains an authorization details object of type <tt>account_information</tt></t>
</li>
<li><t>compare whether the approved list of actions contains <tt>list_account</tt>, and</t>
</li>
<li><t>whether the <tt>locations</tt> value includes only previously-approved locations.</t>
</li>
</ul>
<t>If all checks succeed, the AS would issue the requested access token with the reduced set of access.</t>
<t>Note that this comparison is relevant to this specific API type definition. A different API type definition could have different processing rules. For example, the
value of an <tt>action</tt> could subsume the rights associated with another <tt>action</tt> value. For example, if a client initially asks for
a token with <tt>write</tt> access, which implies both read and write access to this API:</t>

<sourcecode type="JSON">[
    {
        &quot;type&quot;: &quot;example_api&quot;,
        &quot;actions&quot;: [
            &quot;write&quot;
        ]
    }
]
</sourcecode>
<t>Later that same client makes a refresh request for <tt>read</tt> access:</t>

<sourcecode type="JSON">[
    {
        &quot;type&quot;: &quot;example_api&quot;,
        &quot;actions&quot;: [
            &quot;read&quot;
        ]
    }
]
</sourcecode>
<t>The AS would compare the <tt>type</tt> value and the <tt>action</tt> value to determine that the <tt>read</tt> access is
already covered by the <tt>write</tt> access previously granted to the client.</t>
<t>The predefined authorization data element <tt>locations</tt> MAY be used by the client to request an access token valid for a certain resource server,
i.e. it is the recommended way to request issuance of audience restricted access tokens.</t>
<t>For our running example, the client MAY ask for all permissions of the approved grant of type <tt>payment_iniation</tt> applicable to the resource server residing at <tt>https://example.com/payments</tt> as follows:</t>

<sourcecode type="JSON">[
   {
      &quot;type&quot;: &quot;payment_initiation&quot;,
      &quot;locations&quot;: [
         &quot;https://example.com/payments&quot;
      ]
   }
]
</sourcecode>
</section>
</section>

<section anchor="token-response"><name>Token Response</name>
<t>The authorization details assigned to the access token issued in a token response are determined by the <tt>authorization_detail</tt> parameter of the corresponding token request. If the client does not specify the <tt>authorization_detail</tt> token request parameters, the AS determines the resulting authorization details at its discretion.</t>
<t>In addition to the token response parameters as defined in <xref target="RFC6749"></xref>, the authorization server MUST also return the authorization details as granted by the resource owner and assigned to the respective access token.</t>
<t>For our running example, this would look like this:</t>

<sourcecode type="JSON">HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-cache, no-store

{
   &quot;access_token&quot;: &quot;2YotnFZFEjr1zCsicMWpAA&quot;,
   &quot;token_type&quot;: &quot;example&quot;,
   &quot;expires_in&quot;: 3600,
   &quot;refresh_token&quot;: &quot;tGzv3JOkF0XG5Qx2TlKWIA&quot;,
   &quot;authorization_details&quot;: [
      {
         &quot;type&quot;: &quot;https://www.someorg.com/payment_initiation&quot;,
         &quot;actions&quot;: [
            &quot;initiate&quot;,
            &quot;status&quot;,
            &quot;cancel&quot;
         ],
         &quot;locations&quot;: [
            &quot;https://example.com/payments&quot;
         ],
         &quot;instructedAmount&quot;: {
            &quot;currency&quot;: &quot;EUR&quot;,
            &quot;amount&quot;: &quot;123.50&quot;
         },
         &quot;creditorName&quot;: &quot;Merchant123&quot;,
         &quot;creditorAccount&quot;: {
            &quot;iban&quot;: &quot;DE02100100109307118603&quot;
         },
         &quot;remittanceInformationUnstructured&quot;: &quot;Ref Number Merchant&quot;
      }
   ]
}
</sourcecode>

<section anchor="enriched-authorization-details-in-token-response"><name>Enriched authorization details in Token Response</name>
<t>The authorization details attached to the access token MAY differ from what the client requests. In addition to the user authorizing less than what the client requested, there are use cases where the authorization server enriches the data in an authorization details object. For example, a client may ask for access to account information but leave the decision about the accounts it will be able to access to the user. The user would select the sub set of accounts they wants the client to entitle to access in the course of the authorization process. In order to allow the client to determine the accounts it is entitled to access, the authorization server will add this information to the respective authorization details object.</t>
<t>As an example, the requested authorization detail parameter could look like this:</t>

<sourcecode type="JSON">&quot;authorization_details&quot;: [
   {
      &quot;type&quot;: &quot;account_information&quot;,
      &quot;access&quot;: {
         &quot;accounts&quot;: [],
         &quot;balances&quot;: [],
         &quot;transactions&quot;: []
      },
      &quot;recurringIndicator&quot;:true
   }
]
</sourcecode>
<t>The authorization server then would expand the authorization details object and add the respective account identifiers.</t>

<sourcecode type="JSON">HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-cache, no-store

{
   &quot;access_token&quot;:&quot;2YotnFZFEjr1zCsicMWpAA&quot;,
   &quot;token_type&quot;:&quot;example&quot;,
   &quot;expires_in&quot;:3600,
   &quot;refresh_token&quot;:&quot;tGzv3JokF0XG5Qx2TlKWIA&quot;,
   &quot;authorization_details&quot;:[
      {
         &quot;type&quot;:&quot;account_information&quot;,
         &quot;access&quot;:{
            &quot;accounts&quot;:[
               {
                  &quot;iban&quot;:&quot;DE2310010010123456789&quot;
               },
               {
                  &quot;maskedPan&quot;:&quot;123456xxxxxx1234&quot;
               }
            ],
            &quot;balances&quot;:[
               {
                  &quot;iban&quot;:&quot;DE2310010010123456789&quot;
               }
            ],
            &quot;transactions&quot;:[
               {
                  &quot;iban&quot;:&quot;DE2310010010123456789&quot;
               },
               {
                  &quot;maskedPan&quot;:&quot;123456xxxxxx1234&quot;
               }
            ]
         },
         &quot;recurringIndicator&quot;:true
      }
   ]
}
</sourcecode>
<t>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.</t>

<sourcecode type="JSON">{
&quot;authorization_details&quot;: [
   {
      &quot;type&quot;: &quot;medical_record&quot;,
      &quot;sens&quot;: [ &quot;HIV&quot;, &quot;ETH&quot;, &quot;MART&quot; ],
      &quot;actions&quot;: [ &quot;read&quot; ],
      &quot;datatypes&quot;: [ &quot;Patient&quot;, &quot;Observation&quot;, &quot;Appointment&quot; ]
   }
]
</sourcecode>
<t>When the user interacts with the AS, they select which of the medical records they are responsible for to give to the client. This information gets returned with the access token.</t>

<sourcecode type="JSON">{
   &quot;access_token&quot;:&quot;2YotnFZFEjr1zCsicMWpAA&quot;,
   &quot;token_type&quot;:&quot;example&quot;,
   &quot;expires_in&quot;:3600,
   &quot;refresh_token&quot;:&quot;tGzv3JokF0XG5Qx2TlKWIA&quot;,
   &quot;authorization_details&quot;:[
    {
      &quot;type&quot;: &quot;medical_record&quot;,
      &quot;sens&quot;: [ &quot;HIV&quot;, &quot;ETH&quot;, &quot;MART&quot; ],
      &quot;actions&quot;: [ &quot;read&quot; ],
      &quot;datatypes&quot;: [ &quot;Patient&quot;, &quot;Observation&quot;, &quot;Appointment&quot; ]
      &quot;identifier&quot;: &quot;patient-541235&quot;,
      &quot;locations&quot;: [ &quot;https://records.example.com/&quot; ]
     }
  ]
}
</sourcecode>
<t>Note: the client needs to be aware upfront of the possibility that a certain authorization details object can be enriched. It is assumned that this property is part of the definition of the respective authorization details type.</t>
</section>
</section>

<section anchor="token-error-response"><name>Token Error Response</name>
<t>The AS MUST refuse to process any unknown authorization data <tt>type</tt> or authorization details not conforming to the respective <tt>type</tt> definition. If any of the objects in <tt>authorization_details</tt> contains an unknown authorization data <tt>type</tt> or an object of known <tt>type</tt> but containing unknown elements or elements of the wrong <tt>type</tt>,  elements
with invalid values, or if required elements are missing, the AS MUST abort processing and respond with an error <tt>invalid_authorization_details</tt> to the client.</t>
</section>

<section anchor="resource-servers"><name>Resource Servers</name>
<t>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. The AS MAY add the <tt>authorization_details</tt> element to access tokens in JWT format or to Token Introspection responses.</t>

<section anchor="jwt-based-access-tokens"><name>JWT-based Access Tokens</name>
<t>If the access token is a JWT <xref target="RFC7519"></xref>, the AS is RECOMMENDED to add the <tt>authorization_details</tt> object, filtered to the specific audience, as top-level claim.</t>
<t>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.</t>
<t>The following shows the contents of an example JWT for the payment initation example above:</t>

<sourcecode type="JSON">{
   &quot;iss&quot;: &quot;https://as.example.com&quot;,
   &quot;sub&quot;: &quot;24400320&quot;,
   &quot;aud&quot;: &quot;a7AfcPcsl2&quot;,
   &quot;exp&quot;: 1311281970,
   &quot;acr&quot;: &quot;psd2_sca&quot;,
   &quot;txn&quot;: &quot;8b4729cc-32e4-4370-8cf0-5796154d1296&quot;,
   &quot;authorization_details&quot;: [
      {
         &quot;type&quot;: &quot;https://www.someorg.com/payment_initiation&quot;,
         &quot;actions&quot;: [
            &quot;initiate&quot;,
            &quot;status&quot;,
            &quot;cancel&quot;
         ],
         &quot;locations&quot;: [
            &quot;https://example.com/payments&quot;
         ],
         &quot;instructedAmount&quot;: {
            &quot;currency&quot;: &quot;EUR&quot;,
            &quot;amount&quot;: &quot;123.50&quot;
         },
         &quot;creditorName&quot;: &quot;Merchant123&quot;,
         &quot;creditorAccount&quot;: {
            &quot;iban&quot;: &quot;DE02100100109307118603&quot;
         },
         &quot;remittanceInformationUnstructured&quot;: &quot;Ref Number Merchant&quot;
      }
   ],
   &quot;debtorAccount&quot;: {
      &quot;iban&quot;: &quot;DE40100100103307118608&quot;,
      &quot;user_role&quot;: &quot;owner&quot;
   }
}
</sourcecode>
<t>In this case, the AS added the following example claims:</t>

<ul>
<li><t><tt>sub</tt>: conveys the user on which behalf the client is asking for payment initation</t>
</li>
<li><t><tt>txn</tt>: transaction id used to trace the transaction across the services of provider <tt>example.com</tt></t>
</li>
<li><t><tt>debtorAccount</tt>: 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 <tt>user_role</tt> conveys the role the user has with respect to this particuar account. In this case, they is the owner. This data is used for access control at the payment API (the RS).</t>
</li>
</ul>
</section>

<section anchor="token-introspection"><name>Token Introspection</name>
<t>In case of opaque access tokens, the data provided to a certain RS is determined using the RS's identifier with the AS (see <xref target="I-D.ietf-oauth-jwt-introspection-response"></xref>, section 3).</t>
<t>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.</t>
<t>Here is an example for the payment initation example RS:</t>

<sourcecode type="json">{
   &quot;active&quot;: true,
   &quot;sub&quot;: &quot;24400320&quot;,
   &quot;aud&quot;: &quot;s6BhdRkqt3&quot;,
   &quot;exp&quot;: 1311281970,
   &quot;acr&quot;: &quot;psd2_sca&quot;,
   &quot;txn&quot;: &quot;8b4729cc-32e4-4370-8cf0-5796154d1296&quot;,
   &quot;authorization_details&quot;: [
      {
         &quot;type&quot;: &quot;https://www.someorg.com/payment_initiation&quot;,
         &quot;actions&quot;: [
            &quot;initiate&quot;,
            &quot;status&quot;,
            &quot;cancel&quot;
         ],
         &quot;locations&quot;: [
            &quot;https://example.com/payments&quot;
         ],
         &quot;instructedAmount&quot;: {
            &quot;currency&quot;: &quot;EUR&quot;,
            &quot;amount&quot;: &quot;123.50&quot;
         },
         &quot;creditorName&quot;: &quot;Merchant123&quot;,
         &quot;creditorAccount&quot;: {
            &quot;iban&quot;: &quot;DE02100100109307118603&quot;
         },
         &quot;remittanceInformationUnstructured&quot;: &quot;Ref Number Merchant&quot;
      }
   ],
   &quot;debtorAccount&quot;: {
      &quot;iban&quot;: &quot;DE40100100103307118608&quot;,
      &quot;user_role&quot;: &quot;owner&quot;
   }
}
</sourcecode>
</section>
</section>

<section anchor="metadata"><name>Metadata</name>
<t>The AS publishes the list of authorization details types it supports using the metadata parameter <tt>authorization_details_types_supported</tt>, which is a JSON array.</t>
<t>Clients announce the authorization data types they use in the new dynamic client registration parameter <tt>authorization_details_types</tt>.</t>
<t>The registration of authorization data types with the AS is out of scope of this draft.</t>
</section>

<section anchor="scope-value-openid-and-claims-parameter"><name>Scope value &quot;openid&quot; and &quot;claims&quot; parameter</name>
<t>OpenID Connect <xref target="OIDC"></xref> specifies the JSON-based <tt>claims</tt> 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.</t>
<t>The combination of the scope value <tt>openid</tt> and the additional parameter <tt>claims</tt> can be used beside <tt>authorization_details</tt> in the same way as every non-OIDC scope value.</t>
<t>Alternatively, there could be an authorization data type for OpenID Connect. <xref target="openid"></xref> gives an example of what such an authorization data type could look like.</t>
</section>

<section anchor="implementation-considerations"><name>Implementation Considerations</name>

<section anchor="using-authorization-details-in-a-certain-deployment"><name>Using authorization details in a certain deployment</name>
<t>Using authorization details in a certain deployment will require the follwowing steps:</t>

<ul>
<li><t>Define authorization details types</t>
</li>
<li><t>Publish authorization details types in the OAuth server metadata</t>
</li>
<li><t>Determine how authorization details are shown to the user in the user consent</t>
</li>
<li><t>(if needed) Enrich authorization details in the user consent process (e.g. add selected accounts or set expirations)</t>
</li>
<li><t>(if needed) Determine how authorization details are reflected in access token content or introspection responses</t>
</li>
<li><t>Determine how the resource server(s) process(s) the authorization details or token data derived from authorization details</t>
</li>
</ul>
</section>

<section anchor="minimal-product-support"><name>Minimal product support</name>
<t>Products supporting this specification should provide the following basic functions:</t>

<ul>
<li><t>Support advertisement of supported authorization details types in OAuth server metadata</t>
</li>
<li><t>Accept <tt>authorization_details</tt> parameter in authorization requests including basic syntax check for compliance with this specification</t>
</li>
<li><t>Support storage of consented authorization details as part of a grant</t>
</li>
<li><t>Implement default behavior for adding authorization details to access tokens and token introspection responses in order to make them available to resource servers (similar to scope values). This should work with any grant type, especially <tt>authorization_code</tt> and <tt>refresh_token</tt>.</t>
</li>
<li><t>If the product supports resource indicators, it should also support filtering of the authorization details to be assigned to access tokens using the <tt>resource</tt> token request parameter.</t>
</li>
</ul>
<t>Processing and presentation of authorization details will vary significantly among different authorization data types. Products should therefore support customization of the respective behavior. In particular products should</t>

<ul>
<li><t>allow deployments to determine presentation of the authorization details</t>
</li>
<li><t>allow deployments to modify requested authorization details in the user consent process, e.g. adding fields</t>
</li>
<li><t>allow deployments to merge requested and pre-existing authorization details</t>
</li>
</ul>
<t>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.</t>
</section>

<section anchor="use-of-machine-readable-type-schemas"><name>Use of Machine-readable Type Schemas</name>
<t>Products 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 details <tt>type</tt> were defined using JSON Schemas <xref target="JSON.Schema"></xref>, the JSON schema id could be used as <tt>type</tt> value in the respective authorization details objects.</t>
<t>Note however that <tt>type</tt> values are identifiers understood by the AS and, to the extent necessary, the client and RS. This specification makes no assumption that a <tt>type</tt> value point to a machine-readable schema format, or that any party in the system (such as the client, AS, or RS) dereference or process the contents of the <tt>type</tt> field in any specific way.</t>
</section>

<section anchor="large-requests"><name>Large requests</name>
<t>Authorization request URIs containing authorization details in a request parameter or a request object can become very long. Implementers SHOULD therefore consider using the <tt>request_uri</tt> parameter as defined in <xref target="I-D.ietf-oauth-jwsreq"></xref> in combination with the pushed request object mechanism as defined in <xref target="I-D.ietf-oauth-par"></xref> 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:</t>

<artwork>  POST /as/par HTTP/1.1
  Host: as.example.com
  Content-Type: application/x-www-form-urlencoded
  Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3

  response_type=code&amp;
  client_id=s6BhdRkqt3
  &amp;state=af0ifjsldkj
  &amp;redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb 
  &amp;code_challenge_method=S256
  &amp;code_challenge=K2-ltc83acc4h0c9w6ESC_rEMTJ3bwc-uCHaoeK1t8U
  &amp;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
</artwork>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>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 <xref target="I-D.ietf-oauth-jwsreq"></xref> or use the <tt>request_uri</tt> authorization request parameter as defined in <xref target="I-D.ietf-oauth-jwsreq"></xref> in conjunction with <xref target="I-D.ietf-oauth-par"></xref> to pass the URI of the request object to the authorization server.</t>
<t>All strings MUST be compared using the exact byte representation of the characters as defined by <xref target="RFC8259"></xref>. This is especially true for the <tt>type</tt> 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.</t>
</section>

<section anchor="privacy-considerations"><name>Privacy Considerations</name>
<t>Implementers MUST design and use authorization details in a privacy preserving manner.</t>
<t>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 <xref target="I-D.ietf-oauth-jwsreq"></xref> or transmission of authorization details via end-to-end encrypted connections between client and authorization server by utilizing the <tt>request_uri</tt> authorization request parameter as defined in <xref target="I-D.ietf-oauth-jwsreq"></xref>.</t>
<t>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).</t>
<t>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 &quot;need to know&quot; basis.</t>
</section>

<section anchor="Acknowledgements"><name>Acknowledgements</name>
<t>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.</t>
<t>We would also like to thank
Vladimir Dzhuvinov,
Takahiko Kawasaki,
Daniel Fett,
Dave Tonge,
Travis Spencer,
Jørgen Binningsbø,
Aamund Bremer,
Steinar Noem,
Francis Pouatcha,
and Aaron Parecki for their valuable feedback to this draft.</t>
</section>

<section anchor="iana_considerations"><name>IANA Considerations</name>

<section anchor="json-web-token-claims-registration"><name>JSON Web Token Claims Registration</name>
<t>This specification requests registration of the following value in the IANA &quot;JSON Web Token Claims Registry&quot; established by <xref target="RFC7519"></xref>.</t>

<dl spacing="compact">
<dt>Claim Name:</dt>
<dd><t><tt>authorization_details</tt></t>
</dd>
<dt>Claim Description:</dt>
<dd><t>The request parameter <tt>authorization_details</tt> 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.</t>
</dd>
<dt>Change Controller:</dt>
<dd><t>IESG</t>
</dd>
<dt>Specification Document(s):</dt>
<dd><t><xref target="authz_details"></xref> of this document</t>
</dd>
</dl>
</section>

<section anchor="oauth-authorization-server-metadata"><name>OAuth Authorization Server Metadata</name>
<t>This specification requests registration of the following values in the IANA &quot;OAuth Authorization Server Metadata&quot; registry of <xref target="IANA.OAuth.Parameters"></xref> established by <xref target="RFC8414"></xref>.</t>

<dl spacing="compact">
<dt>Metadata Name:</dt>
<dd><t><tt>authorization_details_types_supported</tt></t>
</dd>
<dt>Metadata Description:</dt>
<dd><t>JSON array containing the authorization details types the AS supports</t>
</dd>
<dt>Change Controller:</dt>
<dd><t>IESG</t>
</dd>
<dt>Specification Document(s):</dt>
<dd><t><xref target="metadata"></xref> of [[ this document ]]</t>
</dd>
</dl>
</section>

<section anchor="oauth-dynamic-client-registration-metadata"><name>OAuth Dynamic Client Registration Metadata</name>
<t>This specification requests registration of the following value in the IANA &quot;OAuth Dynamic Client Registration Metadata&quot; registry of <xref target="IANA.OAuth.Parameters"></xref> established by <xref target="RFC7591"></xref>.</t>

<dl spacing="compact">
<dt>Metadata Name:</dt>
<dd><t><tt>authorization_details_types</tt></t>
</dd>
<dt>Metadata Description:</dt>
<dd><t>Indicates what authorization details types the client uses.</t>
</dd>
<dt>Change Controller:</dt>
<dd><t>IESG</t>
</dd>
<dt>Specification Document(s):</dt>
<dd><t><xref target="metadata"></xref> of [[ this document ]]</t>
</dd>
</dl>
</section>

<section anchor="oauth-extensions-error-registry"><name>OAuth Extensions Error registry</name>
<t>This specification requests registration of the following value in the IANA &quot;OAuth Extensions Error registry&quot; registry of <xref target="IANA.OAuth.Parameters"></xref> established by <xref target="RFC6749"></xref>.</t>

<dl spacing="compact">
<dt>Metadata Name:</dt>
<dd><t><tt>invalid_authorization_details</tt></t>
</dd>
<dt>Metadata Description:</dt>
<dd><t>indicates invalid <tt>authorization_details_parameter</tt>to the client.</t>
</dd>
<dt>Change Controller:</dt>
<dd><t>IESG</t>
</dd>
<dt>Specification Document(s):</dt>
<dd><t><xref target="authz_details_error"></xref> of [[ this document ]]</t>
</dd>
</dl>
</section>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8707.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7519.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8414.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8628.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="JSON.Schema" target="https://json-schema.org/">
  <front>
    <title>JSON Schema</title>
    <author fullname="json-schema.org">
      <organization abbrev="json-schema.org">json-schema.org</organization>
    </author>
    <date></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-jwsreq.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-par.xml"/>
<reference anchor="CSC" target="https://cloudsignatureconsortium.org/wp-content/uploads/2019/07/CSC_API_V1_1.0.4.0.pdf">
  <front>
    <title>Architectures and protocols for remote signature applications</title>
    <author fullname="Cloud Signature Consortium">
      <organization abbrev="CSC">Cloud Signature Consortium</organization>
    </author>
    <date year="2019" month="Jun" day="01"></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6749.xml"/>
<reference anchor="OpenID.CIBA" target="https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0.html">
  <front>
    <title>OpenID Connect Client Initiated Backchannel Authentication Flow - Core 1.0</title>
    <author fullname="Gonzalo Fernandez Rodriguez" initials="G." surname="Fernandez">
      <organization abbrev="Telefonica">Telefonica I+D</organization>
    </author>
    <author fullname="Florian Walter" initials="F." surname="Walter">
      <organization>Deutsche Telekom AG</organization>
    </author>
    <author fullname="Axel Nennker" initials="A." surname="Nennker">
      <organization>Deutsche Telekom AG</organization>
    </author>
    <author fullname="Dave Tonge" initials="D." surname="Tonge">
      <organization abbrev="Moneyhub">Moneyhub</organization>
    </author>
    <author fullname="Brian Campbell" initials="B." surname="Campbell">
      <organization abbrev="Ping Identity">Ping Identity</organization>
    </author>
    <date year="2019" month="January" day="16"></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8259.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7591.xml"/>
<reference anchor="transaction-authorization" target="https://medium.com/oauth-2/transaction-authorization-or-why-we-need-to-re-think-oauth-scopes-2326e2038948">
  <front>
    <title>Transaction Authorization or why we need to re-think OAuth scopes</title>
    <author fullname="Torsten Lodderstedt" initials="T." surname="Lodderstedt">
      <organization>yes.com</organization>
    </author>
    <date year="2019" month="Apr" day="20"></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-jwt-introspection-response.xml"/>
<reference anchor="OIDC" target="http://openid.net/specs/openid-connect-core-1_0.html">
  <front>
    <title>OpenID Connect Core 1.0 incorporating errata set 1</title>
    <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
      <organization>NRI</organization>
    </author>
    <author fullname="John Bradley" initials="J." surname="Bradley">
      <organization>Ping Identity</organization>
    </author>
    <author fullname="Mike Jones" initials="M." surname="Jones">
      <organization>Microsoft</organization>
    </author>
    <author fullname="Breno de Medeiros" initials="B." surname="de Medeiros">
      <organization>Google</organization>
    </author>
    <author fullname="Chuck Mortimore" initials="C." surname="Mortimore">
      <organization>Salesforce</organization>
    </author>
    <date year="2014" month="Nov" day="8"></date>
  </front>
</reference>
<reference anchor="IANA.OAuth.Parameters" target="http://www.iana.org/assignments/oauth-parameters">
  <front>
    <title>OAuth Parameters</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date></date>
  </front>
</reference>
<reference anchor="ETSI" target="https://www.etsi.org/deliver/etsi_ts/119400_119499/119432/01.01.01_60/ts_119432v010101p.pdf">
  <front>
    <title>ETSI TS 119 432, Electronic Signatures and Infrastructures (ESI); Protocols for remote digital signature creation </title>
    <author fullname="ETSI">
      <organization abbrev="ETSI">ETSI</organization>
    </author>
    <date year="2019" month="Mar" day="20"></date>
  </front>
</reference>
</references>

<section anchor="additional-examples"><name>Additional Examples</name>

<section anchor="openid"><name>OpenID Connect</name>
<t>These hypothetical examples try to encapsulate all details specific to the OpenID Connect part of an authorization process into an authorization JSON object.</t>
<t>The top-level elements are based on the definitions given in <xref target="OIDC"></xref>:</t>

<ul>
<li><t><tt>claim_sets</tt>: names of predefined claim sets, replacement for respective scope values, such as <tt>profile</tt></t>
</li>
<li><t><tt>max_age</tt>: Maximum Authentication Age</t>
</li>
<li><t><tt>acr_values</tt>: array of ACR values</t>
</li>
<li><t><tt>claims</tt>: the <tt>claims</tt> JSON structure as defined in <xref target="OIDC"></xref></t>
</li>
</ul>
<t>This is a simple request for some claim sets.</t>

<sourcecode type="json">[
   {
      &quot;type&quot;: &quot;openid&quot;,
      &quot;locations&quot;: [
         &quot;https://op.example.com/userinfo&quot;
      ],
      &quot;claim_sets&quot;: [
         &quot;email&quot;,
         &quot;profile&quot;
      ]
   }
]
</sourcecode>
<t>Note: <tt>locations</tt> 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.</t>
<t>A more sophisticated example is shown in the following</t>

<sourcecode type="json">[
   {
      &quot;type&quot;: &quot;openid&quot;,
      &quot;locations&quot;: [
         &quot;https://op.example.com/userinfo&quot;
      ],
      &quot;max_age&quot;: 86400,
      &quot;acr_values&quot;: &quot;urn:mace:incommon:iap:silver&quot;,
      &quot;claims&quot;: {
         &quot;userinfo&quot;: {
            &quot;given_name&quot;: {
               &quot;essential&quot;: true
            },
            &quot;nickname&quot;: null,
            &quot;email&quot;: {
               &quot;essential&quot;: true
            },
            &quot;email_verified&quot;: {
               &quot;essential&quot;: true
            },
            &quot;picture&quot;: null,
            &quot;http://example.info/claims/groups&quot;: null
         },
         &quot;id_token&quot;: {
            &quot;auth_time&quot;: {
               &quot;essential&quot;: true
            }
         }
      }
   }
]
</sourcecode>
</section>

<section anchor="signing"><name>Remote Electronic Signing</name>
<t>The following example is based on the concept layed out for remote electronic signing in ETSI TS 119 432 <xref target="ETSI"></xref> and the CSC API for remote signature creation <xref target="CSC"></xref>.</t>

<sourcecode type="json">[
   {
      &quot;type&quot;: &quot;sign&quot;,
      &quot;locations&quot;: [
         &quot;https://signing.example.com/signdoc&quot;
      ],
      &quot;credentialID&quot;: &quot;60916d31-932e-4820-ba82-1fcead1c9ea3&quot;,
      &quot;documentDigests&quot;: [
         {
            &quot;hash&quot;: &quot;sTOgwOm+474gFj0q0x1iSNspKqbcse4IeiqlDg/HWuI=&quot;,
            &quot;label&quot;: &quot;Credit Contract&quot;
         },
         {
            &quot;hash&quot;: &quot;HZQzZmMAIWekfGH0/ZKW1nsdt0xg3H6bZYztgsMTLw0=&quot;,
            &quot;label&quot;: &quot;Contract Payment Protection Insurance&quot;
         }
      ],
      &quot;hashAlgorithmOID&quot;: &quot;2.16.840.1.101.3.4.2.1&quot;
   }
]
</sourcecode>
<t>The top-level elements have the following meaning:</t>

<ul>
<li><t><tt>credentialID</tt>: identifier of the certificate to be used for signing</t>
</li>
<li><t><tt>documentDigests</tt>: array containing the hash of every document to be signed (<tt>hash</tt> elements). Additionally, the corresponding <tt>label</tt> element identifies the respective document to the user, e.g. to be used in user consent.</t>
</li>
<li><t><tt>hashAlgorithm</tt>: algomrithm that was used to calculate the hash values.</t>
</li>
</ul>
<t>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.</t>
</section>

<section anchor="tax"><name>Access to Tax Data</name>
<t>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.</t>

<sourcecode type="json">[
    {
        &quot;type&quot;: &quot;tax_data&quot;,
        &quot;locations&quot;: [
            &quot;https://taxservice.govehub.no&quot;
        ],
        &quot;actions&quot;:&quot;read_tax_declaration&quot;,
        &quot;periods&quot;: [&quot;2018&quot;],
        &quot;duration_of_access&quot;: 30,
        &quot;tax_payer_id&quot;: &quot;23674185438934&quot;
    }
]
</sourcecode>
<t>The top-level elements have the following meaning:</t>

<ul>
<li><t><tt>periods</tt>: determines the periods the client wants to access</t>
</li>
<li><t><tt>duration_of_access</tt>: how long does the client intend to access the data in days</t>
</li>
<li><t><tt>tax_payer_id</tt>: identifier of the tax payer (if known to the client)</t>
</li>
</ul>
</section>

<section anchor="ehealth"><name>eHealth</name>
<t>These two examples are inspired by requirements for APIs used in the Norwegian eHealth system.</t>
<t>In this use case the physical therapist sits in front of her computer using a local Electronic Health Records (EHR) system. They wants to look at the electronic patient records of a certain patient and they 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.</t>
<t>The information necessary to authorize the request at the API is only known by the EHR system, and must be presented to the API.</t>
<t>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.</t>

<sourcecode type="JSON">&quot;authorization_details&quot;:{ 
    &quot;type&quot;:&quot;patient_record&quot;,
    &quot;requesting_entity&quot;: {
        &quot;type&quot;: &quot;Practitioner&quot;,
        &quot;identifier&quot;: [
        {
            &quot;system&quot;: &quot; urn:oid:2.16.578.1.12.4.1.4.4&quot;,
            &quot;value&quot;: &quot;1234567&quot;
        }],
        &quot;practitioner_role&quot;:{ 
            &quot;organization&quot;:{ 
                &quot;identifier&quot;: {
                    &quot;system&quot;:&quot;urn:oid:2.16.578.1.12.4.1.2.101&quot;,
                    &quot;type&quot;:&quot;ENH&quot;,
                    &quot;value&quot;:&quot;[organizational number]&quot;
                }
            }
        }
    }
}
</sourcecode>
<t>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.</t>

<sourcecode type="JSON">[
   {
      &quot;type&quot;: &quot;patient_record&quot;,
      &quot;location&quot;: &quot;https://fhir.example.com/patient&quot;,
      &quot;actions&quot;: [
         &quot;read&quot;
      ],
      &quot;patient_identifier&quot;: [
         {
            &quot;system&quot;: &quot;urn:oid:2.16.578.1.12.4.1.4.1&quot;,
            &quot;value&quot;: &quot;12345678901&quot;
         }
      ],
      &quot;reason_for_request&quot;: &quot;Clinical treatment&quot;,
      &quot;requesting_entity&quot;: {
         &quot;type&quot;: &quot;Practitioner&quot;,
         &quot;identifier&quot;: [
            {
               &quot;system&quot;: &quot; urn:oid:2.16.578.1.12.4.1.4.4&quot;,
               &quot;value&quot;: &quot;1234567&quot;
            }
         ],
         &quot;practitioner_role&quot;: {
            &quot;organization&quot;: {
               &quot;identifier&quot;: [
                  {
                     &quot;system&quot;: &quot;urn:oid:2.16.578.1.12.4.1.2.101&quot;,
                     &quot;type&quot;: &quot;ENH&quot;,
                     &quot;value&quot;: &quot;&lt;organizational number&gt;&quot;
                  }
               ],
               &quot;type&quot;: {
                  &quot;coding&quot;: [
                     {
                        &quot;system&quot;: 
                           &quot;http://hl7.org/fhir/organization-type&quot;,
                        &quot;code&quot;: &quot;dept&quot;,
                        &quot;display&quot;: &quot;Hospital Department&quot;
                     }
                  ]
               },
               &quot;name&quot;: &quot;Akuttmottak&quot;
            },
            &quot;profession&quot;: {
               &quot;coding&quot;: [
                  {
                     &quot;system&quot;: &quot;http://snomed.info/sct&quot;,
                     &quot;code&quot;: &quot;36682004&quot;,
                     &quot;display&quot;: &quot;Physical therapist&quot;
                  }
               ]
            }
         }
      }
   }
]
</sourcecode>
<t>Description of the elements:</t>

<ul>
<li><t><tt>patient_identifier</tt>: the identifier of the patient composed of a system identifier in OID format (namespace) and the acutal value within this namespace.</t>
</li>
<li><t><tt>reason_for_request</tt>: the reason why the user wants to access a certain API</t>
</li>
<li><t><tt>requesting_entity</tt>: specification of the requester by means of identity, role and organizational context. This data is provided to facilitate authorization and for auditing purposes.</t>
</li>
</ul>
<t>In this use case, the AS authenticates the requester, who is not the patient, and approves access based on policies.</t>
</section>
</section>

<section anchor="document-history"><name>Document History</name>
<t>[[ To be removed from the final specification ]]</t>
<t>-06</t>

<ul>
<li><t>removed use of resource indicators to filter authorization details in token response</t>
</li>
</ul>
<t>-05</t>

<ul>
<li><t>added <tt>authorization_details</tt> token request parameter and discussion on authorization details comparison</t>
</li>
<li><t>added <tt>privileges</tt> field to authorization details (to align with GNAP)</t>
</li>
<li><t>added IANA text and changed metadata parameter names</t>
</li>
<li><t>added text about use of machine-readable type schemas, e.g JSON Schema</t>
</li>
<li><t>added text on how authorization details are determined for access token issued with token response</t>
</li>
<li><t>added token error response and further error conditions to authorization error response</t>
</li>
</ul>
<t>-04</t>

<ul>
<li><t>restructured draft for better readability</t>
</li>
<li><t>simplified normative text about use of the <tt>resource</tt> parameter with <tt>authorization_details</tt></t>
</li>
<li><t>added implementation considerations for deployments and products</t>
</li>
<li><t>added type union language from GNAP</t>
</li>
<li><t>added recommendation to use PAR to cope with large requests and for request protection</t>
</li>
</ul>
<t>-03</t>

<ul>
<li><t>Updated references to current revisions or RFC numbers</t>
</li>
<li><t>Added section about enrichment of authorization details objects by the AS</t>
</li>
<li><t>Clarified processing of unknown authorization details parameters</t>
</li>
<li><t>clarified dependencies between <tt>resource</tt> and <tt>authorization_details</tt> parameters</t>
</li>
</ul>
<t>-02</t>

<ul>
<li><t>Clarify &quot;type&quot; parameter processing</t>
</li>
</ul>
<t>-01</t>

<ul>
<li><t>Minor fix-up in a few examples</t>
</li>
</ul>
<t>-00 (WG draft)</t>

<ul>
<li><t>initial WG revision</t>
</li>
</ul>
<t>-03</t>

<ul>
<li><t>Reworked examples to illustrate privacy preserving use of <tt>authorization_details</tt></t>
</li>
<li><t>Added text on audience restriction</t>
</li>
<li><t>Added description of relationship between <tt>scope</tt> and <tt>authorization_details</tt></t>
</li>
<li><t>Added text on token request &amp; response and <tt>authorization_details</tt></t>
</li>
<li><t>Added text on how authorization details are conveyed to RSs by JWTs or token endpoint response</t>
</li>
<li><t>Added description of relationship between <tt>claims</tt> and <tt>authorization_details</tt></t>
</li>
<li><t>Added more example from different sectors</t>
</li>
<li><t>Clarified string comparison to be byte-exact without collation</t>
</li>
</ul>
<t>-02</t>

<ul>
<li><t>Added Security Considerations</t>
</li>
<li><t>Added Privacy Considerations</t>
</li>
<li><t>Added notes on URI size and authorization details</t>
</li>
<li><t>Added requirement to return the effective authorization details granted by the resource owner in the token response</t>
</li>
<li><t>changed <tt>authorization_details</tt> structure from object to array</t>
</li>
<li><t>added Justin Richer &amp; Brian Campbell as Co-Authors</t>
</li>
</ul>
<t>-00 / -01</t>

<ul>
<li><t>first draft</t>
</li>
</ul>
</section>

</back>

</rfc>
