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

<front>
<title abbrev="fapi-2-baseline">FAPI 2.0 Baseline Profile</title><seriesInfo value="fapi-2_0-baseline-00" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="D." surname="Fett" fullname="Daniel Fett"><organization>yes.com</organization><address><postal><street></street>
</postal><email>mail@danielfett.de</email>
</address></author>
<date/>
<area>Internet</area>
<workgroup>connect</workgroup>
<keyword>security</keyword>
<keyword>openid</keyword>

<abstract>
<t>The Financial-grade API (FAPI) 2.0 Baseline profile is an API security profile
based on the OAuth 2.0 Authorization Framework <xref target="RFC6749"></xref>.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Financial-grade API (FAPI) 2.0 is an API security profile based on the OAuth 2.0
Authorization Framework <xref target="RFC6749"></xref> and related specifications suitable for
protecting APIs in high-value scenarios. While the security profile was
initially developed with a focus on financial applications, it is designed to be
universally applicable for protecting APIs exposing high-value and sensitive
(personal and other) data, for example, in e-health and e-government
applications.</t>

<section anchor="warning"><name>Warning</name>
<t>This document is not an OIDF International Standard. It is distributed for
review and comment. It is subject to change without notice and may not be
referred to as an International Standard.</t>
<t>Recipients of this draft are invited to submit, with their comments,
notification of any relevant patent rights of which they are aware and to
provide supporting documentation.</t>
</section>

<section anchor="copyright-notice-license"><name>Copyright notice &amp; license</name>
<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>

<section anchor="notational-conventions"><name>Notational Conventions</name>
<t>The keywords &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 ISO Directive Part 2
<xref target="ISODIR2"></xref>. These keywords are not used as dictionary terms such that any
occurrence of them shall be interpreted as keywords and are not to be
interpreted with their natural language meanings.</t>
</section>
</section>

<section anchor="baseline-profile"><name>Baseline Profile</name>
<t>OIDF FAPI is an API security profile based on the OAuth 2.0 Authorization
Framework <xref target="RFC6749"></xref>. This Baseline Profile aims to reach the security goals
laid out in the [Attacker Model].</t>

<section anchor="network-layer-protections"><name>Network Layer Protections</name>
<t>To protect against network attackers, clients, authorization servers, and
resource servers shall only offer TLS protected endpoints and shall establish
connections to other servers using TLS. TLS connections shall be set up to use
TLS version 1.2 or later and follow <xref target="RFC7525"></xref>.</t>
<t>Endpoints for the use by web browsers shall use methods to ensure that
connections cannot be downgraded using TLS Stripping attacks. A preloaded
<xref target="preload"></xref> HTTP Strict Transport Security policy <xref target="RFC6797"></xref> can be used for
this purpose. Some top-level domains, like .bank and .insurance, 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. Note: 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 <xref target="RFC8659"></xref> can
help to mitigate this risk.</t>
</section>

<section anchor="profile"><name>Profile</name>
<t>In the following, a profile of the following technologies is defined:</t>

<ul>
<li><t>OAuth 2.0 Authorization Framework <xref target="RFC6749"></xref></t>
</li>
<li><t>OAuth 2.0 Bearer Tokens <xref target="RFC6750"></xref></t>
</li>
<li><t>Proof Key for Code Exchange by OAuth Public Clients (PKCE) <xref target="RFC7636"></xref></t>
</li>
<li><t>OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access
Tokens (MTLS) <xref target="RFC8705"></xref></t>
</li>
<li><t>OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)
<xref target="I-D.ietf-oauth-dpop"></xref></t>
</li>
<li><t>OAuth 2.0 Pushed Authorization Requests (PAR) <xref target="I-D.ietf-oauth-par"></xref></t>
</li>
<li><t>OAuth 2.0 Rich Authorization Requests (RAR) <xref target="I-D.ietf-oauth-rar"></xref></t>
</li>
<li><t>OAuth 2.0 Authorization Server Metadata <xref target="RFC8414"></xref></t>
</li>
<li><t>OAuth 2.0 Authorization Server Issuer Identifier in Authorization Response <xref target="I-D.ietf-oauth-iss-auth-resp"></xref></t>
</li>
<li><t>OpenID Connect Core 1.0 incorporating errata set 1 <xref target="OpenID"></xref></t>
</li>
</ul>

<section anchor="requirements-for-authorization-servers"><name>Requirements for Authorization Servers</name>
<t>Authorization servers</t>

<ol>
<li><t>shall distribute discovery metadata (such as the authorization endpoint) via
the metadata document as specified in [OIDD] and [RFC8414]</t>
</li>
<li><t>shall support the authorization code grant described in <xref target="RFC6749"></xref></t>
</li>
<li><t>shall reject requests using the resource owner password credentials grant or
the implicit grant described in <xref target="RFC6749"></xref></t>
</li>
<li><t>shall support client-authenticated pushed authorization requests
according to <xref target="I-D.ietf-oauth-par"></xref></t>
</li>
<li><t>shall reject authorization requests sent without
<xref target="I-D.ietf-oauth-par"></xref></t>
</li>
<li><t>shall reject pushed authorization requests without client authentication</t>
</li>
<li><t>shall support the <tt>authorization_details</tt> parameter according to
<xref target="I-D.ietf-oauth-rar"></xref> to convey the authorization clients want to obtain if
the <tt>scope</tt> parameter is not expressive enough for that purpose</t>
</li>
<li><t>shall support confidential clients as defined in <xref target="RFC6749"></xref></t>
</li>
<li><t>shall only issue sender-constrained access tokens using one of the following
methods:</t>

<ul>
<li><t>MTLS as described in <xref target="RFC8705"></xref></t>
</li>
<li><t>DPoP as described in <xref target="I-D.ietf-oauth-dpop"></xref></t>
</li>
</ul></li>
<li><t>shall authenticate clients using one of the following methods:</t>

<ul>
<li><t>MTLS as specified in section 2 of <xref target="RFC8705"></xref></t>
</li>
<li><t><tt>private_key_jwt</tt> as specified in section 9 of <xref target="OpenID"></xref></t>
</li>
</ul></li>
<li><t>shall require PKCE <xref target="RFC7636"></xref> with <tt>S256</tt> as the code challenge method</t>
</li>
<li><t>shall only issue authorization codes and refresh tokens that are
 sender-constrained</t>
</li>
<li><t>shall require the <tt>redirect_uri</tt> parameter in pushed authorization requests</t>
</li>
<li><t>shall return an <tt>iss</tt> parameter in the authorization response according to
 <xref target="I-D.ietf-oauth-iss-auth-resp"></xref></t>
</li>
<li><t>shall not transmit authorization responses over unencrypted network
 connections, and, to this end, shall not allow redirect URIs that use the
 &quot;http&quot; scheme except for native clients that use Loopback Interface
 Redirection as described in <xref target="RFC8252"></xref>, Section 7.3,</t>
</li>
<li><t>shall reject an authorization code (section 1.3.1 of <xref target="RFC6749"></xref>) if it has
 been previously used</t>
</li>
<li><t>shall provide a means for resource servers to verify the validity,
 integrity, sender-constraining, scope (incl. <tt>authorization_details</tt>),
 expiration and revocation status of an access token, either by providing an
 introspection endpoint <xref target="RFC7662"></xref>, by exposing signature verification
 keys, or by deployment-specific means.</t>
</li>
<li><t>shall not use the HTTP 307 status code when redirecting a request that
 contains user credentials to avoid forwarding the credentials to a third
 party accidentally (see section 4.11 of <xref target="I-D.ietf-oauth-security-topics"></xref>)</t>
</li>
<li><t>shall not expose open redirectors (see section 4.10 of
 <xref target="I-D.ietf-oauth-security-topics"></xref>)</t>
</li>
</ol>
<t><strong>NOTE</strong>: If replay identification of the authorization code is not possible, it
is desirable to set the validity period of the authorization code to one minute
or a suitable short period of time. The validity period may act as a cache
control indicator of when to clear the authorization code cache if one is used.</t>

<section anchor="returning-authenticated-user-s-identifier"><name>Returning Authenticated User's Identifier</name>
<t>If it is desired to provide the authenticated user's identifier to the client in
the token response, the authorization server shall support OpenID Connect
<xref target="OpenID"></xref>.</t>
</section>
</section>

<section anchor="requirements-for-clients"><name>Requirements for Clients</name>
<t>Clients</t>

<ol>
<li><t>shall use the authorization code grant described in <xref target="RFC6749"></xref></t>
</li>
<li><t>shall use pushed authorization requests according to <xref target="I-D.ietf-oauth-par"></xref></t>
</li>
<li><t>shall support sender-constrained access tokens using one of the following methods:</t>

<ul>
<li><t>MTLS as described in <xref target="RFC8705"></xref></t>
</li>
<li><t>DPoP as described in <xref target="I-D.ietf-oauth-dpop"></xref></t>
</li>
</ul></li>
<li><t>shall support client authentication using one of the following methods:</t>

<ul>
<li><t>MTLS as specified in section 2 of <xref target="RFC8705"></xref></t>
</li>
<li><t><tt>private_key_jwt</tt> as specified in section 9 of <xref target="OpenID"></xref></t>
</li>
</ul></li>
<li><t>shall use PKCE <xref target="RFC7636"></xref> with <tt>S256</tt> as the code challenge method</t>
</li>
<li><t>shall send access tokens in the HTTP header as in Section 2.1 of OAuth 2.0
Bearer Token Usage <xref target="RFC6750"></xref></t>
</li>
<li><t>shall check the <tt>iss</tt> parameter in the authorization response according to
<xref target="I-D.ietf-oauth-iss-auth-resp"></xref> to prevent Mix-Up attacks</t>
</li>
<li><t>shall not expose open redirectors (see section 4.10 of
 <xref target="I-D.ietf-oauth-security-topics"></xref>)</t>
</li>
</ol>
</section>

<section anchor="requirements-for-resource-servers"><name>Requirements for Resource Servers</name>
<t>The FAPI 2.0 endpoints are OAuth 2.0 protected resource endpoints that return
protected information for the resource owner associated with the submitted
access token.</t>
<t>Resource servers with the FAPI endpoints</t>

<ol>
<li><t>shall accept access tokens in the HTTP header as in Section 2.1 of OAuth 2.0
Bearer Token Usage <xref target="RFC6750"></xref></t>
</li>
<li><t>shall not accept access tokens in the query parameters stated in Section 2.3
of OAuth 2.0 Bearer Token Usage <xref target="RFC6750"></xref></t>
</li>
<li><t>shall verify the validity, integrity, expiration and revocation status of
access tokens</t>
</li>
<li><t>shall verify that the scope (incl. <tt>authorization_details</tt>) of the access
token authorizes the access to the resource it is representing</t>
</li>
<li><t>shall support and verify sender-constrained access tokens using one of the following methods:</t>

<ul>
<li><t>MTLS as described in <xref target="RFC8705"></xref></t>
</li>
<li><t>DPoP as described in <xref target="I-D.ietf-oauth-dpop"></xref></t>
</li>
</ul></li>
<li><t>shall identify the associated entity to the access token</t>
</li>
<li><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 <xref target="RFC6750"></xref></t>
</li>
</ol>
</section>
</section>

<section anchor="cryptography-and-secrets"><name>Cryptography and Secrets</name>

<ol>
<li><t>Authorization Servers, Clients, and Resource Servers shall adhere to
<xref target="RFC8725"></xref> when creating or processing JWTs. In particular,</t>

<ul>
<li><t>the algorithm-specific recommendations in Section 3.2 shall be followed,</t>
</li>
<li><t>and the <tt>none</tt> algorithm shall not be used or accepted.</t>
</li>
</ul></li>
<li><t>RSA keys shall have a minimum length of 2048 bits.</t>
</li>
<li><t>Elliptic curve keys shall have a minimum length of 160 bits.</t>
</li>
<li><t>Credentials not intended for handling by end-users (e.g., access tokens,
refresh tokens, authorization codes, etc.) shall be created with at least
128 bits of entropy such that an attacker correctly guessing the value is
computationally infeasible. Cf. Section 10.10 of  <xref target="RFC6749"></xref>.</t>
</li>
</ol>
</section>

<section anchor="differences-to-fapi-1-0"><name>Differences to FAPI 1.0</name>
<table>
<thead>
<tr>
<th align="left">FAPI 1.0 Read/Write</th>
<th align="left">FAPI 2.0</th>
<th align="left">Reasons</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">JAR, JARM</td>
<td align="left">PAR</td>
<td align="left">integrity protection and compatibility improvements for authorization requests; only code in response</td>
</tr>

<tr>
<td align="left">-</td>
<td align="left">RAR</td>
<td align="left">support complex and structured information about authorizations</td>
</tr>

<tr>
<td align="left">-</td>
<td align="left">shall adhere to Security BCP</td>
<td align="left"></td>
</tr>

<tr>
<td align="left"><tt>s_hash</tt></td>
<td align="left">-</td>
<td align="left">state integrity is protected by PAR; protection provided by state is now provided by PKCE</td>
</tr>

<tr>
<td align="left">pre-registered redirect URIs</td>
<td align="left">redirect URIs in PAR</td>
<td align="left">pre-registration is not required with client authentication and PAR</td>
</tr>

<tr>
<td align="left">response types <tt>code id_token</tt> or <tt>code</tt></td>
<td align="left">response type <tt>code</tt></td>
<td align="left">improve security: no ID token in front-channel; not needed</td>
</tr>

<tr>
<td align="left">ID Token as detached signature</td>
<td align="left">-</td>
<td align="left">ID token does not need to serve as a detached signature</td>
</tr>

<tr>
<td align="left">signed and encrypted ID Tokens</td>
<td align="left">signing and encryption not required</td>
<td align="left">ID Tokens only exchanged in back channel</td>
</tr>

<tr>
<td align="left"><tt>exp</tt> claim in request object</td>
<td align="left">-</td>
<td align="left">?</td>
</tr>

<tr>
<td align="left"><tt>x-fapi-*</tt> headers</td>
<td align="left">-</td>
<td align="left">Removed pending further discussion</td>
</tr>

<tr>
<td align="left">MTLS for sender-constrained access tokens</td>
<td align="left">MTLS or DPoP</td>
<td align="left"></td>
</tr>
</tbody>
</table></section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>(todo)</t>
</section>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7662.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8725.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-dpop.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-par.xml"/>
<reference anchor="OpenID" 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>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-rar.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-iss-auth-resp.xml"/>
<reference anchor="ISODIR2" target="https://www.iso.org/sites/directives/current/part2/index.xhtml">
  <front>
    <title>ISO/IEC Directives Part 2 - </title>
    <author fullname="International Organization for Standardization">
      <organization></organization>
    </author>
    <date></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6797.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6750.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7636.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6749.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8659.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8705.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8252.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7525.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8414.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="preload" target="https://hstspreload.org/">
  <front>
    <title>HSTS Preload List Submission</title>
    <author fullname="Anonymous">
      <organization></organization>
    </author>
    <date></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-security-topics.xml"/>
</references>

<section anchor="notices"><name>Notices</name>
<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>
