<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.nl" -->
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
<rfc ipr="trust200902" category="std" xml:lang="en">
<?rfc toc="yes"?><?rfc symrefs="yes"?><?rfc sortrefs="yes"?><?rfc compact="yes"?><?rfc subcompact="no"?><?rfc comments="no"?><?rfc iprnotified="no" ?> <?rfc tocdepth="5" ?> <?rfc private="Final" ?>
<front>
<title abbrev="FAPI 1.0 Baseline">Financial-grade API Security Profile 1.0 - Part 1: Baseline</title><author initials="N." surname="Sakimura" fullname="Nat Sakimura"><organization abbrev="Nat Consulting">Nat Consulting</organization><address><postal><street></street>
</postal><email>nat@nat.consulting</email>
<uri>http://nat.sakimura.org/</uri>
</address></author>
<author initials="J." surname="Bradley" fullname="John Bradley"><organization abbrev="Yubico">Yubico</organization><address><postal><street></street>
</postal><email>ve7jtb@ve7jtb.com</email>
<uri>http://www.thread-safe.com/</uri>
</address></author>
<author initials="E." surname="Jay" fullname="Illumila"><organization abbrev="Illumila">Illumila</organization><address><postal><street></street>
</postal><email>ejay@mgi1.com</email>
<uri>http://illumi.la/</uri>
</address></author>
<date/>
<area>Internet</area><workgroup>OpenID FAPI</workgroup><keyword>FAPI</keyword>
<keyword>Baseline Security</keyword>

<note title="Foreword">
<t>The OpenID Foundation (OIDF) promotes, protects and nurtures the OpenID community and technologies. As a non-profit international standardizing body, it is comprised by over 160 participating entities (workgroup participants). The work of preparing implementer drafts and final international standards is carried out through OIDF workgroups in accordance with the OpenID Process. Participants interested in a subject for which a workgroup has been established have the right to be represented in that workgroup. International organizations, governmental and non-governmental, in liaison with OIDF, also take part in the work. OIDF collaborates closely with other standardizing bodies in the related fields.</t>
<t>Final drafts adopted by the Workgroup through consensus are circulated publicly for the public review for 60 days and for the OIDF members for voting. Publication as an OIDF Standard requires approval by at least 50 % of the members casting a vote. There is a possibility that some of the elements of this document may be the subject to patent rights. OIDF shall not be held responsible for identifying any or all such patent rights.</t>
<t>Financial-grade API Security Profile 1.0 consists of the following parts:</t>
<t>
<list style="symbols">
<t>Financial-grade API Security Profile 1.0 - Part 1: Baseline</t>
<t><eref target="https://openid.net/specs/openid-financial-api-part-2-1_0.html">Financial-grade API Security Profile 1.0 - Part 2: Advanced</eref></t>
</list>
</t>
<t>These parts are intended to be used with <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref>, <eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref>, <eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref>, and <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>.</t>
</note>

<note title="Introduction">
<t>The Financial-grade API is a highly secured OAuth profile that aims to provide specific implementation guidelines for security and interoperability. The Financial-grade API security profile can be applied to APIs in any market area that requires a higher level of security than provided by standard <eref target="https://tools.ietf.org/html/rfc6749">OAuth</eref> or <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OpenID Connect</eref>. Among other security enhancements, this specification provides a secure alternative to screen scraping. Screen scraping accesses user's data and functions by impresonating a user through password sharing. This brittle, inefficient, and insecure practice creates security vulnerabilities which require financial institutions to allow what appears to be an automated attack against their applications.</t>
<t>This document is Part 1 of FAPI Security Profile 1.0. It specifies a baseline security profile of OAuth that is suitable for protecting APIs with a moderate inherent risk. Importantly, this profile does not provide non-repudiation (signing of authorization requests and responses) and sender-constrained access tokens. If such features or a higher level of security is desired, the use of <eref target="https://openid.net/specs/openid-financial-api-part-2-1_0.html">Financial-grade API Security Profile 1.0 - Part 2: Advanced</eref> is recommended.</t>
<t>Although it is possible to code an OpenID Provider and Relying Party from first principles using this specification, the main audience for this specification is parties who already have a certified implementation of OpenID Connect and want to achieve a higher level of security. Implementers are encouraged to understand the security considerations contained in Section 7.6 before embarking on a 'from scratch' implementation.</t>
</note>

<note title="Notational Conventions">
<t>The key words &quot;shall&quot;, &quot;shall not&quot;,
&quot;should&quot;, &quot;should not&quot;, &quot;may&quot;, and
&quot;can&quot; in this document are to be interpreted as described in
<eref target="https://www.iso.org/sites/directives/current/part2/index.xhtml">ISO Directive Part 2</eref>.
These key words are not used as dictionary terms such that
any occurrence of them shall be interpreted as key words
and are not to be interpreted with their natural language meanings.</t>
</note>

</front>

<middle>

<section anchor="scope" title="Scope">
<t>This document specifies the method for an application to:</t>
<t>
<list style="symbols">
<t>obtain OAuth tokens in a moderately secure manner for access to protected data;</t>
<t>use OpenID Connect (OIDC) to identify the customer (user); and</t>
<t>use tokens to access REST APIs in a moderately secure manner.</t>
</list>
</t>
</section>

<section anchor="normative-references" title="Normative references">
<t>The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applied. For undated references, the latest edition of the referenced document (including any amendments) applies.</t>
<t><eref target="https://www.iso.org/sites/directives/current/part2/index.xhtml">ISODIR2</eref> - ISO/IEC Directives Part 2</t>
<t><eref target="https://tools.ietf.org/html/rfc4122">RFC4122</eref> - A Universally Unique IDentifier (UUID) URN Namespace</t>
<t><eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref> - The OAuth 2.0 Authorization Framework</t>
<t><eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref> - The OAuth 2.0 Authorization Framework: Bearer Token Usage</t>
<t><eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref> - Proof Key for Code Exchange by OAuth Public Clients</t>
<t><eref target="https://tools.ietf.org/html/rfc6125">RFC6125</eref> - Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS)</t>
<t><eref target="https://tools.ietf.org/html/bcp212">BCP212</eref> - OAuth 2.0 for Native Apps</t>
<t><eref target="https://tools.ietf.org/html/rfc6819">RFC6819</eref> - OAuth 2.0 Threat Model and Security Considerations</t>
<t><eref target="https://tools.ietf.org/html/bcp195">BCP195</eref> - Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)</t>
<t><eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref> - OpenID Connect Core 1.0 incorporating errata set 1</t>
<t><eref target="https://www.itu.int/rec/T-REC-X.1254">X.1254</eref> - Entity authentication assurance framework</t>
<t><eref target="https://tools.ietf.org/html/rfc8705">MTLS</eref> - OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens</t>
<t><eref target="https://tools.ietf.org/html/rfc8414">RFC8414</eref> - OAuth 2.0 Authorization Server Metadata</t>
<t><eref target="http://openid.net/specs/openid-connect-discovery-1_0.html">OIDD</eref> -  OpenID Connect Discovery 1.0 incorporating errata set 1</t>
<t><eref target="https://tools.ietf.org/html/rfc7231">RFC7231</eref> - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</t>
</section>

<section anchor="terms-and-definitions" title="Terms and definitions">
<t>For the purpose of this document, the terms defined in <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref>, <eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref>, <eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref>, <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OpenID Connect Core</eref> apply.</t>
</section>

<section anchor="symbols-and-abbreviated-terms" title="Symbols and abbreviated terms">
<t><spanx style="strong">API</spanx> – Application Programming Interface</t>
<t><spanx style="strong">CSRF</spanx> - Cross Site Request Forgery</t>
<t><spanx style="strong">FAPI</spanx> - Financial-grade API</t>
<t><spanx style="strong">HTTP</spanx> – Hyper Text Transfer Protocol</t>
<t><spanx style="strong">REST</spanx> – Representational State Transfer</t>
<t><spanx style="strong">TLS</spanx> – Transport Layer Security</t>
</section>

<section anchor="baseline-security-profile" title="Baseline security profile">

<section anchor="introduction-1" title="Introduction">
<t>The OIDF Financial-grade API (FAPI) security profile specifies security requirements for API resources protected by the OAuth 2.0 Authorization Framework that consists of <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref>, <eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref>, <eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref>, and other specifications.</t>
<t>FAPI Security Profile 1.0 - Part 1: Baseline and <eref target="https://openid.net/specs/openid-financial-api-part-2-1_0.html">Part 2: Advanced</eref> specify different levels of security. The characteristics required of the tokens are different and the methods to obtain tokens are explained separately. This document specifies the baseline security provisions.</t>
</section>

<section anchor="baseline-security-provisions" title="Baseline security provisions">

<section anchor="introduction-2" title="Introduction">
<t>Some APIs, such as ones that provide potentially sensitive information, require a greater level of protection than basic <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref> requires. FAPI provides such greater protection.</t>
<t>As a profile of the OAuth 2.0 Authorization Framework, this document mandates the following to the baseline profile of the FAPI Security Profile 1.0.</t>
</section>

<section anchor="authorization-server" title="Authorization server">
<t>The authorization server</t>
<t>
<list style="numbers">
<t>shall support confidential clients;</t>
<t>should support public clients;</t>
<t>shall provide a client secret that adheres to the requirements in Section 16.19 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref> if a symmetric key is used;</t>
<t>shall authenticate the confidential client using one of the following methods:
<list style="numbers">
<t>Mutual TLS for OAuth Client Authentication as specified in Section 2 of <eref target="https://tools.ietf.org/html/rfc8705">MTLS</eref>, or</t>
<t><spanx style="verb">client_secret_jwt</spanx> or <spanx style="verb">private_key_jwt</spanx> as specified in Section 9 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>;</t>
</list></t>
<t>shall require and use a key of size 2048 bits or larger for RSA algorithms;</t>
<t>shall require and use a key of size 160 bits or larger for elliptic curve algorithms;</t>
<t>shall require <eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref> with <spanx style="verb">S256</spanx> as the code challenge method;</t>
<t>shall require redirect URIs to be pre-registered;</t>
<t>shall require the <spanx style="verb">redirect_uri</spanx> in the authorization request;</t>
<t>shall require the value of <spanx style="verb">redirect_uri</spanx> to exactly match one of the pre-registered redirect URIs;</t>
<t>shall require user authentication to an appropriate Level of Assurance for the operations the client will be authorized to perform on behalf of the user;</t>
<t>shall require explicit approval by the user to authorize the requested scope if it has not been previously authorized;</t>
<t>shall reject an authorization code (Section 1.3.1 of <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref>) if it has been previously used;</t>
<t>shall return token responses that conform to Section 4.1.4 of <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref>;</t>
<t>shall return the list of granted scopes with the issued access token if the request was passed in the front channel and was not integrity protected;</t>
<t>shall provide non-guessable access tokens, authorization codes, and refresh token
(where applicable), with sufficient entropy such that the probability of an attacker guessing
the generated token is computationally infeasible as per <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref> Section 10.10;</t>
<t>should clearly identify the details of the grant to the user during authorization as in 16.18 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>;</t>
<t>should provide a mechanism for the end-user to revoke access tokens and refresh tokens granted to a client as in 16.18 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>;</t>
<t>shall return an <spanx style="verb">invalid_client</spanx> error as defined in 5.2 of <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref> when mis-matched client identifiers were provided through the client authentication methods that permits sending the client identifier in more than one way;</t>
<t>shall require redirect URIs to use the https scheme;</t>
<t>should issue access tokens with a lifetime of under 10 minutes unless the tokens are sender-constrained; and</t>
<t>shall support <eref target="http://openid.net/specs/openid-connect-discovery-1_0.html">OIDD</eref>, may support <eref target="https://tools.ietf.org/html/rfc8414">RFC8414</eref> and shall not distribute discovery metadata (such as the authorization endpoint) by any other means.<vspace />
<spanx style="strong">NOTE</spanx>: The use of refresh tokens instead of long-lived access tokens for both
public and confidential clients is recommended.<vspace />
<spanx style="strong">NOTE</spanx>: The Financial-grade API Security Profile 1.0 server may limit the scopes for the purpose of not implementing certain APIs.<vspace />
<spanx style="strong">NOTE</spanx>: Clients are expected to treat access tokens as opaque strings and replay them as is. Authorization servers can issue unstructured or structured access tokens (for example, a signed JWT).<vspace />
<spanx style="strong">NOTE</spanx>: The requirement to return the list of granted scopes allows clients to detect when the authorization request was modified to include different scopes. Servers must still return the granted scopes if they are different from those requested.</t>
</list>
</t>

<section anchor="returning-authenticated-user-s-identifier" title="Returning authenticated user's identifier">
<t>Further, if it is desired to provide the authenticated user's identifier to the client in the token response, the authorization server:</t>
<t>
<list style="numbers">
<t>shall support the authentication request as in Section 3.1.2.1 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>;</t>
<t>shall perform the authentication request verification as in Section 3.1.2.2 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>;</t>
<t>shall authenticate the user as in Section 3.1.2.2 and 3.1.2.3 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>;</t>
<t>shall provide the authentication response as in Section 3.1.2.4 and 3.1.2.5 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref> depending on the outcome of the authentication;</t>
<t>shall perform the token request verification as in Section 3.1.3.2 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>; and</t>
<t>shall issue an ID Token in the token response when <spanx style="verb">openid</spanx> was included in the requested <spanx style="verb">scope</spanx>
as in Section 3.1.3.3 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref> with its <spanx style="verb">sub</spanx> value corresponding to the authenticated user
and optional <spanx style="verb">acr</spanx> value in ID Token.</t>
</list>
</t>
</section>

<section anchor="client-requesting-openid-scope" title="Client requesting openid scope">
<t>If the client requests the openid scope, the authorization server</t>
<t>
<list style="numbers">
<t>shall require the <spanx style="verb">nonce</spanx> parameter defined in Section 3.1.2.1 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref> in the authentication request.</t>
</list>
</t>
</section>

<section anchor="clients-not-requesting-openid-scope" title="Clients not requesting openid scope">
<t>If the client does not requests the openid scope, the authorization server</t>
<t>
<list style="numbers">
<t>shall require the <spanx style="verb">state</spanx> parameter defined in Section 4.1.1 of <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref>.</t>
</list>
</t>
</section>
</section>

<section anchor="public-client" title="Public client">
<t>A public client</t>
<t>
<list style="numbers">
<t>shall support <eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref>;</t>
<t>shall use <spanx style="verb">S256</spanx> as the code challenge method for the <eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref>;</t>
<t>shall use separate and distinct redirect URI for each authorization server that it talks to;</t>
<t>shall store the redirect URI value in the resource owner's user-agents (such as browser) session and compare it with the redirect URI that the authorization response was received at, where, if the URIs do not match, the client shall terminate the process with error;</t>
<t>(withdrawn); and</t>
<t>shall implement an effective CSRF protection.<vspace />
Further, if it is desired to obtain a persistent identifier of the authenticated user, then the public client</t>
<t>shall include <spanx style="verb">openid</spanx> in the <spanx style="verb">scope</spanx> value; and</t>
<t>shall include the <spanx style="verb">nonce</spanx> parameter defined in Section 3.1.2.1 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref> in the authentication request.<vspace />
If <spanx style="verb">openid</spanx> is not in the <spanx style="verb">scope</spanx> value, then the public client</t>
<t>shall include the <spanx style="verb">state</spanx> parameter defined in Section 4.1.1 of <eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref>;</t>
<t>shall verify that the <spanx style="verb">scope</spanx> received in the token response is either an exact match,
or contains a subset of the <spanx style="verb">scope</spanx> sent in the authorization request; and</t>
<t>shall only use Authorization Server metadata obtained from the metadata document published by the Authorization Server at its well known endpoint as defined in <eref target="http://openid.net/specs/openid-connect-discovery-1_0.html">OIDD</eref> or <eref target="https://tools.ietf.org/html/rfc8414">RFC8414</eref>.<vspace />
<spanx style="strong">NOTE</spanx>: Adherence to <eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref> means that the token request includes <spanx style="verb">code_verifier</spanx> parameter in the request.</t>
</list>
</t>
</section>

<section anchor="confidential-client" title="Confidential client">
<t>In addition to the provisions for a public client, a confidential client</t>
<t>
<list style="numbers">
<t>shall support the following methods to authenticate against the token endpoint:
<list style="numbers">
<t>Mutual TLS for OAuth Client Authentication as specified in Section 2 of <eref target="https://tools.ietf.org/html/rfc8705">MTLS</eref>, and</t>
<t><spanx style="verb">client_secret_jwt</spanx> or <spanx style="verb">private_key_jwt</spanx> as specified in Section 9 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref>;</t>
</list></t>
<t>shall use RSA keys with a minimum 2048 bits if using RSA cryptography;</t>
<t>shall use elliptic curve keys with a minimum of 160 bits if using Elliptic Curve cryptography; and</t>
<t>shall verify that its client secret has a minimum of 128 bits if using symmetric key cryptography.</t>
</list>
</t>
</section>
</section>
</section>

<section anchor="accessing-protected-resources" title="Accessing Protected Resources">

<section anchor="introduction-3" title="Introduction">
<t>The FAPI endpoints are OAuth 2.0 protected resource endpoints that return protected information for the resource owner associated with the submitted access token.</t>
</section>

<section anchor="baseline-access-provisions" title="Baseline access provisions">

<section anchor="protected-resources-provisions" title="Protected resources provisions">
<t>The resource server with the FAPI endpoints</t>
<t>
<list style="numbers">
<t>shall support the use of the HTTP GET method as in Section 4.3.1 of <eref target="https://tools.ietf.org/html/rfc7231">RFC7231</eref>;</t>
<t>shall accept access tokens in the HTTP header as in Section 2.1 of OAuth 2.0 Bearer Token Usage <eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref>;</t>
<t>shall not accept access tokens in the query parameters stated in Section 2.3 of OAuth 2.0 Bearer Token Usage <eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref>;</t>
<t>shall verify that the access token is neither expired nor revoked;</t>
<t>shall verify that the scope associated with the access token authorizes access to the resource it is representing;</t>
<t>shall identify the associated entity to the access token;</t>
<t>shall only return the resource identified by the combination of the entity implicit in the access and the granted scope and otherwise return errors as in Section 3.1 of <eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref>;</t>
<t>shall encode the response in UTF-8 if applicable;</t>
<t>shall send the <spanx style="verb">Content-type</spanx> HTTP header <spanx style="verb">Content-Type: application/json</spanx> if applicable;</t>
<t>shall send the server date in HTTP Date header as in Section 7.1.1.2 of <eref target="https://tools.ietf.org/html/rfc7231">RFC7231</eref>;</t>
<t>shall set the response header <spanx style="verb">x-fapi-interaction-id</spanx> to the value received from the corresponding FAPI client request header or to a <eref target="https://tools.ietf.org/html/rfc4122">RFC4122</eref> UUID value if the request header was not provided to track the interaction, e.g., <spanx style="verb">x-fapi-interaction-id: c770aef3-6784-41f7-8e0e-ff5f97bddb3a</spanx>;</t>
<t>shall log the value of <spanx style="verb">x-fapi-interaction-id</spanx> in the log entry; and</t>
<t>shall not reject requests with a <spanx style="verb">x-fapi-customer-ip-address</spanx> header containing a
valid IPv4 or IPv6 address.<vspace />
<spanx style="strong">NOTE</spanx>: While this document does not specify the exact method to obtain the entity associated with the
access token and the granted scope, the protected resource can use OAuth Token Introspection <eref target="https://tools.ietf.org/html/rfc7662">RFC7662</eref>.<vspace />
Further, the resource server</t>
<t>should support the use of Cross Origin Resource Sharing (CORS) [CORS] and or other methods as appropriate to enable JavaScript clients to access the endpoint if it decides to provide access to JavaScript clients.<vspace />
<spanx style="strong">NOTE</spanx>: Providing access to JavaScript clients has other security implications. Before supporting those clients <eref target="https://tools.ietf.org/html/rfc6819">RFC6819</eref> should be consulted.</t>
</list>
</t>
</section>

<section anchor="client-provisions" title="Client provisions">
<t>The client supporting this document</t>
<t>
<list style="numbers">
<t>shall send access tokens in the HTTP header as in Section 2.1 of OAuth 2.0 Bearer Token Usage <eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref>; and</t>
<t>(withdrawn);<vspace />
Further, the client</t>
<t>may send the last time the customer logged into the client in the <spanx style="verb">x-fapi-auth-date</spanx> header where the value is supplied as a HTTP-date as in Section 7.1.1.1 of <eref target="https://tools.ietf.org/html/rfc7231">RFC7231</eref>, e.g., <spanx style="verb">x-fapi-auth-date: Tue, 11 Sep 2012 19:43:31 GMT</spanx>;</t>
<t>may send the customer’s IP address if this data is available in the <spanx style="verb">x-fapi-customer-ip-address</spanx> header, e.g., <spanx style="verb">x-fapi-customer-ip-address: 2001:DB8::1893:25c8:1946</spanx> or  <spanx style="verb">x-fapi-customer-ip-address: 198.51.100.119</spanx>; and</t>
<t>may send the <spanx style="verb">x-fapi-interaction-id</spanx> request header, in which case the value shall be a
RFC4122 UUID to the server to help correlate log entries between client and server,
e.g., <spanx style="verb">x-fapi-interaction-id: c770aef3-6784-41f7-8e0e-ff5f97bddb3a</spanx>.</t>
</list>
</t>
</section>
</section>
</section>

<section anchor="security-considerations" title="Security considerations">

<section anchor="tls-and-dnssec-considerations" title="TLS and DNSSEC considerations">
<t>As confidential information is being exchanged, all interactions shall be encrypted with TLS (HTTPS).</t>
<t>The recommendations for Secure Use of Transport Layer Security in <eref target="https://tools.ietf.org/html/bcp195">BCP195</eref> shall be followed, with the following additional requirements:</t>
<t>
<list style="numbers">
<t>TLS version 1.2 or later shall be used for all communications.</t>
<t>A TLS server certificate check shall be performed, as per <eref target="https://tools.ietf.org/html/rfc6125">RFC6125</eref>.</t>
</list>
</t>
<t>Endpoints for the use by web browsers should use mechanisms to ensure that connections cannot be downgraded using TLS Stripping attacks. A preloaded HTTP Strict Transport Security policy (see <eref target="https://hstspreload.org/">PRELOAD</eref> and <eref target="https://tools.ietf.org/html/rfc6797">RFC6797</eref>) can be used for this purpose. Some top-level domains, like <spanx style="verb">.bank</spanx> and <spanx style="verb">.insurance</spanx>, have set such a policy and therefore protect all second-level domains below them.</t>
<t>For a comprehensive protection against network attackers, all
endpoints should additionally use DNSSEC to protect against DNS
spoofing attacks that can lead to the issuance of rogue
domain-validated TLS certificates.</t>
<t><spanx style="strong">NOTE</spanx>: Even if an endpoint uses only
organization validated (OV) or extended validation (EV) TLS
certificates, rogue domain-validated certificates can be used to
impersonate the endpoints and conduct man-in-the-middle attacks.
CAA records <eref target="https://tools.ietf.org/html/rfc8659">RFC8659</eref> can help to mitigate this risk.</t>
</section>

<section anchor="message-source-authentication-failure" title="Message source authentication failure">
<t>Authorization request and response are not authenticated.
For higher risk scenarios, they should be authenticated.
See <eref target="https://openid.net/specs/openid-financial-api-part-2-1_0.html">Financial-grade API Security Profile 1.0 - Part 2: Advanced</eref>, which uses request objects to achieve the message source authentication.</t>
</section>

<section anchor="message-integrity-protection-failure" title="Message integrity protection failure">
<t>The authorization request does not have message integrity protection and hence
request tampering and parameter injection are possible.
Where such protection is desired, <eref target="https://openid.net/specs/openid-financial-api-part-2-1_0.html">Financial-grade API Security Profile 1.0 - Part 2: Advanced</eref> should be used.</t>
<t>The response is integrity protected when the ID Token is returned
from the authorization endpoint.</t>
</section>

<section anchor="message-containment-failure" title="Message containment failure">

<section anchor="authorization-request-and-response" title="Authorization request and response">
<t>In this document, the authorization request is not encrypted.
Thus, it is possible to leak the information contained
if the web browser is compromised.</t>
<t>Authorization response can be encrypted as ID Token
can be encrypted.</t>
<t>It is possible to leak the information through the logs
if the parameters were recorded in the logs and
the access to the logs are compromised.
Strict access control to the logs in such cases should be
enforced.</t>
</section>

<section anchor="token-request-and-response" title="Token request and response">
<t>It is possible to leak information through the logs
if the parameters were recorded in the logs and
the access to the logs are compromised.
Strict access control to the logs in such cases should be
enforced.</t>
</section>

<section anchor="resource-request-and-response" title="Resource request and response">
<t>Care should be taken so that the sensitive data will not be leaked
through the referrer.</t>
<t>If the access token is a bearer token, it is possible to
exercise the stolen token. Since the access token can be
used against multiple URIs, the risk of leaking is
much larger than the refresh token, which is used only
against the token endpoint. Thus, the lifetime of
the access token should be much shorter than that of
the refresh token. Refer to Section 16.18 of <eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref> for
more discussion on the lifetimes of access tokens and
refresh tokens.</t>
</section>
</section>

<section anchor="native-apps" title="Native Apps">
<t>When native apps are used as either public clients, dynamically registered confidential clients or user-agents receiving the authorization response for a server based confidential client, the recommendations for OAuth 2.0 for Native Apps in <eref target="https://tools.ietf.org/html/bcp212">BCP212</eref> shall be followed, with the following additional requirements:</t>
<t>When registering redirect URIs, authorization servers</t>
<t>
<list style="numbers">
<t>shall not support &quot;Private-Use URI Scheme Redirection&quot;; and</t>
<t>shall not support &quot;Loopback Interface Redirection&quot;.</t>
</list>
</t>
<t>These requirements mean that FAPI Security Profile 1.0 compliant implementations can only
support native apps through the use of &quot;Claimed https Scheme URI Redirection&quot;.</t>
<t><spanx style="strong">NOTE</spanx>: Nothing in this document seeks to disallow fixed urls in the
form https://localhost:port-number/callback, as these are particularly
useful in non-production systems or in clients used in development, to
facilitate faster and easier development.</t>
</section>

<section anchor="incomplete-or-incorrect-implementations-of-the-specifications" title="Incomplete or incorrect implementations of the specifications">
<t>To achieve the full security benefits, it is important the implementation of this specification, and the underlying OpenID Connect and OAuth specifications, are both complete and correct.</t>
<t>The OpenID Foundation provides tools that can be used to confirm that an implementation is correct:</t>
<t><eref target="https://openid.net/certification/">https://openid.net/certification/</eref></t>
<t>The OpenID Foundation maintains a list of certified implementations:</t>
<t><eref target="https://openid.net/developers/certified/">https://openid.net/developers/certified/</eref></t>
<t>Deployments that use this specification should use a certified implementation.</t>
</section>

<section anchor="discovery-multiple-brands" title="Discovery &amp; Multiple Brands">
<t>Organizations who need to support multiple &quot;brands&quot; with individual authorization endpoints
from a single Authorization Server deployment shall use a separate <spanx style="verb">issuer</spanx> per brand.
This can be achieved either at the domain level (e.g. <spanx style="verb">https://brand-a.auth.example.com</spanx>
and  <spanx style="verb">https://brand-b.auth.example.com</spanx>) or with different paths (e.g. <spanx style="verb">https://auth.example.com/brand-a</spanx> and <spanx style="verb">https://auth.example.com/brand-b</spanx>)</t>
<t>As stated in 5.2.2-22 Clients shall only use metadata values obtained via metadata documents
as defined in <eref target="http://openid.net/specs/openid-connect-discovery-1_0.html">OIDD</eref>. Communicating metadata through other means (e.g. via email) opens
up a social engineering attack vector.</t>
<t>Note that the requirement to use <eref target="http://openid.net/specs/openid-connect-discovery-1_0.html">OIDD</eref> is not a requirement to support Dynamic Client
Registration.</t>
</section>
</section>

<section anchor="privacy-considerations" title="Privacy considerations">

<section anchor="introduction-4" title="Introduction">
<t>There are many factors to be considered in terms of privacy
when implementing this document. However, since this document
is a profile of OAuth and OpenID Connect, all of them
are generic and apply to OAuth or OpenID Connect and
are not specific to this document. Implementers are advised to
perform a thorough privacy impact assessment and manage identified risks appropriately.</t>
<t><spanx style="strong">NOTE</spanx>: Implementers can consult documents like
<eref target="http://standards.iso.org/ittf/PubliclyAvailableStandards/c045123_ISO_IEC_29100_2011.zip">ISO29100</eref> and [ISO29134] for this purpose.</t>
<t>Privacy threats to OAuth and OpenID Connect implementations include the following:</t>
<t>
<list style="symbols">
<t>(Inappropriate privacy notice) A privacy notice provided at a <spanx style="verb">policy_url</spanx> or by other means can be inappropriate.</t>
<t>(Inadequate choice) Providing a consent screen without adequate choices does not form consent.</t>
<t>(Misuse of data) An AS, RS or Client can potentially use the data not according to the purpose that was agreed.</t>
<t>(Collection minimization violation) A client asking for more data than it absolutely needs to fulfil the purpose is violating the collection minimization principle.</t>
<t>(Unsolicited personal data from the Resource) Some bad resource server implementations may return more data than was requested. If the data is personal data, then this would be a  violation of privacy principles.</t>
<t>(Data minimization violation) Any process that is processing more data than it needs is violating the data minimization principle.</t>
<t>(RP tracking by AS/OP) AS/OP identifying what data is being provided to which Client/RP.</t>
<t>(User tracking by RPs) Two or more RPs correlating access tokens or ID Tokens to track users.</t>
<t>(RP misidentification by User at AS) User misunderstands who the RP is due to a confusing representation of the RP at
the AS's authorization page.</t>
<t>(Mismatch between User’s understanding or what RP is displaying to a user and the actual authorization request) To enhance
the trust of the ecosystem, best practice is for the AS to make clear what is included in the authorization request (for example,
what data will be released to the RP).</t>
<t>(Attacker observing personal data in authorization request) Authorization request might contain personal data. This can be observed by an attacker.</t>
<t>(Attacker observing personal data in authorization endpoint response) In some frameworks, even state is deemed personal data.
This can be observed by an attacker through various means.</t>
<t>(Data leak from AS) AS stores personal data. If AS is compromised, these data can leak or be modified.</t>
<t>(Data leak from Resource) Some resource servers store personal data. If a resource server is compromised, these data can leak or be modified.</t>
<t>(Data leak from Clients) Some clients store personal data. If the client is compromised, these data can leak or be modified.</t>
</list>
</t>
<t>These threats can be mitigated by choosing appropriate options in OAuth or OpenID, or by introducing some operational rules.
For example, &quot;Attacker observing personal data in authorization request&quot; can be mitigated by either using authorization request by reference
using <spanx style="verb">request_uri</spanx> or by encrypting the request object.
Similarly, &quot;Attacker observing personal data in authorization endpoint response&quot; can be mitigated by encrypting the ID Token or JARM response.</t>
</section>
</section>

<section anchor="acknowledgement" title="Acknowledgement">
<t>The following people contributed to this document:</t>
<t>
<list style="symbols">
<t>Nat Sakimura (NAT Consulting) -- Chair, Editor</t>
<t>Anoop Saxena (Intuit) -- Co-chair, FS-ISAC Liaison</t>
<t>Anthony Nadalin (Microsoft) -- Co-chair, SC 27 Liaison</t>
<t>Edmund Jay (Illumila) -- Co-editor</t>
<t>Dave Tonge (Moneyhub) -- Co-chair, UK Implementation Entity Liaison</t>
<t>Paul A. Grassi (NIST) -- X9 Liaison</t>
<t>Joseph Heenan (Authlete)</t>
<t>Sascha H. Preibisch (CA)</t>
<t>Henrik Biering (Peercraft)</t>
<t>Anton Taborszky (Deutsche Telecom)</t>
<t>John Bradley (Yubico)</t>
<t>Tom Jones (Independent)</t>
<t>Axel Nennker (Deutsche Telekom)</t>
<t>Daniel Fett (yes.com)</t>
<t>Torsten Lodderstedt (yes.com)</t>
<t>Ralph Bragg (Raidiam)</t>
<t>Brian Campbell (Ping Identity)</t>
<t>Dima Postnikov (Independent)</t>
<t>Stuart Low (Biza.io)</t>
<t>Takahiko Kawasaki (Authlete)</t>
<t>Vladimir Dzhuvinov (Connect2Id)</t>
<t>Chris Michael (Open Banking)</t>
<t>Freddi Gyara (Open Banking)</t>
<t>Rob Otto (Ping Identity)</t>
<t>Francis Pouatcha (adorsys)</t>
<t>Kosuke Koiwai (KDDI)</t>
<t>Bjorn Hjelm (Verizon)</t>
<t>Lukasz Jaromin (Cloudentity)</t>
<t>James Manger</t>
</list>
</t>
</section>

<section anchor="bibliography" title="Bibliography">
<t>
<list style="symbols">
<t><eref target="https://openid.net/specs/openid-financial-api-part-2-1_0.html">Part2</eref> Financial-grade API Security Profile 1.0 - Part 2: Advanced</t>
<t><eref target="https://www.iso.org/sites/directives/current/part2/index.xhtml">ISODIR2</eref> ISO/IEC Directives Part 2</t>
<t><eref target="http://standards.iso.org/ittf/PubliclyAvailableStandards/c045123_ISO_IEC_29100_2011.zip">ISO29100</eref> ISO/IEC 29100 Information technology — Security techniques — Privacy framework</t>
<t>[ISO29134] ISO/IEC 29134 Information technology — Security techniques — Guidelines for privacy impact assessment</t>
<t><eref target="https://tools.ietf.org/html/rfc4122">RFC4122</eref> A Universally Unique IDentifier (UUID) URN Namespace</t>
<t><eref target="https://tools.ietf.org/html/rfc6749">RFC6749</eref> The OAuth 2.0 Authorization Framework</t>
<t><eref target="https://tools.ietf.org/html/rfc6750">RFC6750</eref> The OAuth 2.0 Authorization Framework: Bearer Token Usage</t>
<t><eref target="https://tools.ietf.org/html/rfc6797">RFC6797</eref> HTTP Strict Transport Security (HSTS)</t>
<t><eref target="https://tools.ietf.org/html/rfc7636">RFC7636</eref> Proof Key for Code Exchange by OAuth Public Clients</t>
<t><eref target="https://tools.ietf.org/html/rfc7662">RFC7662</eref> OAuth 2.0 Token Introspection</t>
<t><eref target="https://tools.ietf.org/html/rfc6125">RFC6125</eref> Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS)</t>
<t><eref target="https://tools.ietf.org/html/bcp212">BCP212</eref> OAuth 2.0 for Native Apps</t>
<t><eref target="https://tools.ietf.org/html/rfc6819">RFC6819</eref> OAuth 2.0 Threat Model and Security Considerations</t>
<t><eref target="https://tools.ietf.org/html/rfc8414">RFC8414</eref> OAuth 2.0 Authorization Server Metadata</t>
<t><eref target="https://tools.ietf.org/html/rfc8659">RFC8659</eref> DNS Certification Authority Authorization (CAA) Resource Record</t>
<t><eref target="http://openid.net/specs/openid-connect-discovery-1_0.html">OIDD</eref> OpenID Connect Discovery 1.0 incorporating errata set 1</t>
<t><eref target="https://tools.ietf.org/html/bcp195">BCP195</eref> Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)</t>
<t><eref target="https://openid.net/specs/openid-connect-core-1_0.html">OIDC</eref> OpenID Connect Core 1.0 incorporating errata set 1</t>
<t><eref target="https://www.itu.int/rec/T-REC-X.1254">X.1254</eref> Entity authentication assurance framework</t>
<t><eref target="https://tools.ietf.org/html/rfc8705">MTLS</eref> OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens</t>
<t><eref target="https://hstspreload.org/">PRELOAD</eref> HSTS Preload List Submission</t>
</list>
</t>
</section>

</middle>

<back>

<section anchor="copyright-notice-license" title="Copyright notice &amp; license">
<t>Copyright (c) 2021 The OpenID Foundation.</t>
<t>The OpenID Foundation (OIDF) grants to any Contributor, developer, implementer, or other interested party a non-exclusive, royalty-free, worldwide copyright license to reproduce, prepare derivative works from, distribute, perform and display, this Implementers Draft or Final Specification solely for the purposes of (i) developing specifications, and (ii) implementing Implementers Drafts and Final Specifications based on such documents, provided that attribution be made to the OIDF as the source of the material, but that such attribution does not indicate an endorsement by the OIDF.</t>
<t>The technology described in this specification was made available from contributions from various sources, including members of the OpenID Foundation and others. Although the OpenID Foundation has taken steps to help ensure that the technology is available for distribution, it takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this specification or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any independent effort to identify any such rights. The OpenID Foundation and the contributors to this specification make no (and hereby expressly disclaim any) warranties (express, implied, or otherwise), including implied warranties of merchantability, non-infringement, fitness for a particular purpose, or title, related to this specification, and the entire risk as to implementing this specification is assumed by the implementer. The OpenID Intellectual Property Rights policy requires contributors to offer a patent promise not to assert certain patent claims against other contributors and against implementers. The OpenID Foundation invites any interested party to bring to its attention any copyrights, patents, patent applications, or other proprietary rights that may cover technology that may be required to practice this specification.</t>
</section>

</back>

</rfc>
