<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title>Financial Services – Financial API - Part 1: Read Only API Security Profile</title>
  <style type="text/css">code{white-space: pre;}</style>
  <link rel="stylesheet" href="github-pandoc.css" type="text/css" />
</head>
<body>
<!-- #######  YAY, I AM THE SOURCE EDITOR! #########-->
<h1 id="markdown-header-financial-services-financial-api-part-1-read-only-api-security-profile">Financial Services – Financial API - Part 1: Read Only API Security Profile</h1>
<h2 id="markdown-header-warning">Warning</h2>
<p>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.</p>
<p>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.</p>
<h2 id="markdown-header-copyright-notice">Copyright notice</h2>
<p>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.</p>
<p>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.</p>
<h2 id="markdown-header-foreword">Foreword</h2>
<p>OIDF (OpenID Foundation) is an international standardizing body comprised by over 160 participating entities (work group participants). The work of preparing international standards is carried out through OIDF work groups according to OpenID Process. Each participants interested in a subject for which a work group has been established has the right to be represented on that work group. 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.</p>
<p>OpenID Foundation standards are drafted in accordance with the rules given in the OpenID Process.</p>
<p>The main task of work group is to prepare Implementers Draft and Final Draft. Final Draft adopted by the Work Group 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.</p>
<p>Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. OIDF shall not be held responsible for identifying any or all such patent rights.</p>
<p>Financial API - Part 1: Read Only API Security Profile was prepared by OpenID Foundation Financial API Work Group.</p>
<p>Financial API consists of the following parts, under the general title Financial Services — Financial API:</p>
<ul>
<li>Part 1: Read Only API Security Profile</li>
<li>Part 2: Read and Write API Security Profile</li>
<li>Part 3: Open Data API</li>
<li>Part 4: Protected Data API and Schema - Read only</li>
<li>Part 5: Protected Data API and Schema - Read and Write</li>
</ul>
<p>This part is intended to be used with <a href="https://tools.ietf.org/html/rfc6749">RFC6749</a>, <a href="https://tools.ietf.org/html/rfc6750">RFC6750</a>, [RFC6736], and <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>.</p>
<h2 id="markdown-header-introduction">Introduction</h2>
<p>In many cases, Fintech services such as aggregation services uses screen scraping and stores user passwords. This model is both brittle and insecure. To cope with the brittleness, it should utilize an API model with structured data and to cope with insecurity, it should utilize a token model such as OAuth [RFC6749, RFC6750].</p>
<p>This working group aims to rectify the situation by developing a REST/JSON model protected by OAuth. Specifically, the FAPI WG aims to provide JSON data schemas, security and privacy recommendations and protocols to:</p>
<ul>
<li>enable applications to utilize the data stored in the financial account,</li>
<li>enable applications to interact with the financial account, and</li>
<li>enable users to control the security and privacy settings.</li>
</ul>
<p>Both commercial and investment banking accounts as well as insurance, and credit card accounts are to be considered.</p>
<h1 id="markdown-header-financial-services-financial-api-part-1-read-only-api-security-profile_1"><strong>Financial Services – Financial API - Part 1: Read Only API Security Profile</strong></h1>
<div class="toc">
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-financial-services-financial-api-part-1-read-only-api-security-profile">Financial Services – Financial API - Part 1: Read Only API Security Profile</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-warning">Warning</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-copyright-notice">Copyright notice</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-foreword">Foreword</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-introduction">Introduction</a></li>
</ul>
</li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-financial-services-financial-api-part-1-read-only-api-security-profile_1">Financial Services – Financial API - Part 1: Read Only API Security Profile</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-1-scope">1. Scope</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-2-normative-references">2. Normative references</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-3-terms-and-definitions">3. Terms and definitions</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-4-symbols-and-abbreviated-terms">4. Symbols and Abbreviated terms</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-5-read-only-api-security-profile">5. Read Only API Security Profile</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-51-introduction">5.1 Introduction</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-52-read-only-api-security-provisions">5.2 Read Only API Security Provisions</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-521-introduction">5.2.1 Introduction</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-522-authorization-server">5.2.2 Authorization Server</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-523-public-client">5.2.3 Public Client</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-524-confidential-client">5.2.4 Confidential Client</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-6-accessing-protected-resources">6. Accessing Protected Resources</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-61-introduction">6.1 Introduction</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-62-read-only-access-provisions">6.2 Read only access provisions</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-621-protected-resources-provisions">6.2.1 Protected resources provisions</a></li>
</ul>
</li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-622-client-provisions">6.2.2 Client provisions</a></li>
</ul>
</li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-7-security-considerations">7. Security Considerations</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-71-tls-considerations">7.1 TLS Considerations</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-72-message-source-authentication-failure">7.2 Message source authentication failure</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-73-message-integrity-protection-failure">7.3 Message integrity protection failure</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-74-message-containment-failure">7.4 Message containment failure</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-741-authorization-request-and-response">7.4.1 Authorization request and response</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-742-token-request-and-response">7.4.2 Token request and response</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-743-resource-request-and-response">7.4.3 Resource request and response</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-8-privacy-considerations">8. Privacy Considerations</a>
<ul>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-81-privacy-by-design">8.1 Privacy by design</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-82-adhering-to-privacy-principles">8.2 Adhering to privacy principles</a></li>
</ul>
</li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-9-acknowledgement">9. Acknowledgement</a></li>
<li><a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_001.md?at=master&fileviewer=file-view-default#markdown-header-10-bibliography">10. Bibliography</a></li>
</ul>
</li>
</ul>
</div>
<h2 id="markdown-header-1-scope">1. Scope</h2>
<p>This document specifies the method of</p>
<ul>
<li>applications to obtain the OAuth tokens in an appropriately secure manner for the financial data access;</li>
<li>application to utilize OpenID Connect to identify the customer;</li>
<li>representing financial data in JSON format;</li>
<li>using the tokens to interact with the REST endpoints that provides financial data; and</li>
<li>enabling users to control the security and privacy settings.</li>
</ul>
<p>This document is applicable to both commercial and investment banking accounts as well as insurance, and credit card accounts are to be considered.</p>
<h2 id="markdown-header-2-normative-references">2. Normative references</h2>
<p>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.</p>
<p><a href="https://tools.ietf.org/html/rfc2616">RFC2616</a> - Hypertext Transfer Protocol -- HTTP/1.1</p>
<p><a href="https://tools.ietf.org/html/rfc4122">RFC4122</a> A Universally Unique IDentifier (UUID) URN Namespace</p>
<p><a href="https://tools.ietf.org/html/rfc6749">RFC6749</a> - The OAuth 2.0 Authorization Framework</p>
<p><a href="https://tools.ietf.org/html/rfc6750">RFC6750</a> - The OAuth 2.0 Authorization Framework: Bearer Token Usage</p>
<p><a href="https://tools.ietf.org/html/rfc7636">RFC7636</a> - Proof Key for Code Exchange by OAuth Public Clients</p>
<p><a href="https://tools.ietf.org/html/rfc5246">RFC5246</a> - The Transport Layer Security (TLS) Protocol Version 1.2</p>
<p><a href="https://tools.ietf.org/html/rfc7525">RFC7525</a> - Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)</p>
<p><a href="https://tools.ietf.org/html/rfc6125">RFC6125</a> - 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)</p>
<p><a href="https://tools.ietf.org/html/draft-ietf-oauth-native-apps-05">O2fNA</a> - OAuth 2.0 for Native Apps</p>
<p><a href="https://tools.ietf.org/html/rfc6819">RFC6819</a> - OAuth 2.0 Threat Model and Security Considerations</p>
<p><a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a> - OpenID Connect Core 1.0 incorporating errata set 1</p>
<p><a href="http://openid.net/specs/openid-connect-discovery-1_0.html">OIDD</a> - OpenID Connect Discovery 1.0 incorporating errata set 1</p>
<p><a href="http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html">OIDM</a> - OAuth 2.0 Multiple Response Type Encoding Practices</p>
<p><a href="https://www.itu.int/rec/T-REC-X.1254">X.1254</a> - Entity authentication assurance framework</p>
<p><a href="https://tools.ietf.org/html/draft-campbell-oauth-tls-client-auth">TLSM</a> - Mutual X.509 Transport Layer Security (TLS) Authentication for OAuth Clients</p>
<h2 id="markdown-header-3-terms-and-definitions">3. Terms and definitions</h2>
<p>For the purpose of this standard, the terms defined in <a href="https://tools.ietf.org/html/rfc6749">RFC6749</a>, <a href="https://tools.ietf.org/html/rfc6750">RFC6750</a>, <a href="https://tools.ietf.org/html/rfc7636">RFC7636</a>, <a href="http://openid.net/specs/openid-connect-core-1_0.html">OpenID Connect Core</a> apply.</p>
<h2 id="markdown-header-4-symbols-and-abbreviated-terms">4. Symbols and Abbreviated terms</h2>
<p><strong>API</strong> – Application Programming Interface</p>
<p><strong>CSRF</strong> - Cross Site Request Forgery</p>
<p><strong>FAPI</strong> - Financial API</p>
<p><strong>FI</strong> – Financial Institution</p>
<p><strong>HTTP</strong> – Hyper Text Transfer Protocol</p>
<p><strong>REST</strong> – Representational State Transfer</p>
<p><strong>TLS</strong> – Transport Layer Security</p>
<h2 id="markdown-header-5-read-only-api-security-profile">5. Read Only API Security Profile</h2>
<h3 id="markdown-header-51-introduction">5.1 Introduction</h3>
<p>The OIDF Financial API (FAPI) is a REST API that provides JSON data representing accounts and transactions related data. These APIs are protected by the OAuth 2.0 Authorization Framework that consists of <a href="https://tools.ietf.org/html/rfc6749">RFC6749</a>, <a href="https://tools.ietf.org/html/rfc6750">RFC6750</a>, <a href="https://tools.ietf.org/html/rfc7636">RFC7636</a>, and other specifications.</p>
<p>These API accesses have several levels of risks associated to them. Read only access is generally speaking associated with lower financial risk than the write access. As such, the characteristics required to the tokens are also different.</p>
<p>In the following subclauses, the method to obtain tokens are explained separately.</p>
<h3 id="markdown-header-52-read-only-api-security-provisions">5.2 Read Only API Security Provisions</h3>
<h4 id="markdown-header-521-introduction">5.2.1 Introduction</h4>
<p>Read Only Access typically is the lower risk scenario compared to the Write access, so the protection level can also be lower. However, since the FAPI would provide potentially sensitive information, it requires more protection level than a basic <a href="https://tools.ietf.org/html/rfc6749">RFC6749</a> requires.</p>
<p>As a profile of The OAuth 2.0 Authorization Framework, this document mandates the following to the Read Only API of the FAPI.</p>
<h4 id="markdown-header-522-authorization-server">5.2.2 Authorization Server</h4>
<p>The Authorization Server</p>
<ul>
<li>shall support both public and confidential clients;</li>
<li>shall provide a client secret that adhears to the requirements in section 16.19 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a> if symmetric key is used;</li>
<li>shall authenticate the confidential client at the Token Endpoint using one of the following methods:
<ol>
<li>TLS mutual authentication <a href="https://tools.ietf.org/html/draft-campbell-oauth-tls-client-auth">TLSM</a>;</li>
<li>JWS Client Assertion using the <code>client_secret</code> or a private key as specified in section 9 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>;</li>
</ol>
</li>
<li>shall require a key of size 2048 bits or larger if RSA algorithms are used for the client authentication;</li>
<li>shall require a key of size 160 bits or larger if eliptic curve algorithms are used for the client authentication;</li>
<li>shall support <a href="https://tools.ietf.org/html/rfc7636">RFC7636</a> with <code>S256</code> as the code challenge method;</li>
<li>shall require Redirect URIs to be pre-registered;</li>
<li>shall require the <code>redirect_uri</code> parameter in the authorization request;</li>
<li>shall require the value of <code>redirect_uri</code> to exactly match one of the pre-registered Redirect URIs;</li>
<li>shall require user authentication at LoA 2 as defined in <a href="https://www.itu.int/rec/T-REC-X.1254">X.1254</a> or more;</li>
<li>shall require explicit consent by the user to authorize the requested scope if it has not been previously authorized;</li>
<li>shall verify that the Authorization Code has not been previously used if possible;</li>
<li>shall return the token response as defined in 4.1.4 of <a href="https://tools.ietf.org/html/rfc6749">RFC6749</a>;</li>
<li>shall return the list of allowed scopes with the issued access token;</li>
<li>shall provide opaque, non-monotonically increasing or non-guessable access tokens with a minimum of 128 bits as defined in section 5.1.4.2.2 of <a href="https://tools.ietf.org/html/rfc6819">RFC6819</a>.</li>
<li>should clearly identify long-term grants to the user during authorization as in 16.18 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>; and</li>
<li>
<p>should provide a mechanism for the end-user to revoke access tokens and refresh tokens granted to a Client as in 16.18 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>.</p>
<p><strong>NOTE</strong>: The Financial API server may limit the scopes for the purpose of not implementing certain APIs.</p>
<p><strong>NOTE</strong>: Section 4.1.3 of <a href="https://tools.ietf.org/html/rfc6749">RFC6749</a> does not say anything about the <code>code</code> reuse, but this document is putting limitation on it as per Section 3.1.3.2 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>.</p>
<p><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.</p>
</li>
</ul>
<p>Further, if it wishes to provide the authenticated user's identifier to the client in the token response, the authorization server</p>
<ul>
<li>shall support the authentication request as in Section 3.1.2.1 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>;</li>
<li>shall perform the authentication request verification as in Section 3.1.2.2 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>;</li>
<li>shall authenticate the user as in Section 3.1.2.2 and 3.1.2.3 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>;</li>
<li>shall provide the authentication response as in Section 3.1.2.4 and 3.1.2.5 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a> depending on the outcome of the authentication;</li>
<li>shall perform the token request verification as in Section 3.1.3.2 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>; and</li>
<li>shall issue an ID Token in the token response when <code>openid</code> was included in the requested <code>scope</code> as in Section 3.1.3.3 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a> with its <code>sub</code> value equal to the value of the <code>CustomerId</code> of the <code>Customer</code> object corresponding to the authenticated user and optional <code>acr</code> value in ID Token.</li>
</ul>
<h4 id="markdown-header-523-public-client">5.2.3 Public Client</h4>
<p>A Public Client</p>
<ul>
<li>shall support <a href="https://tools.ietf.org/html/rfc7636">RFC7636</a> or the mechanisms defined in <a href="https://bitbucket.org/openid/fapi/src/81b537a7e33531836c45096a71dcd452afeba496/Financial_API_WD_002.md">Financial API - Part 2</a>;</li>
<li>shall use <code>S256</code> as the code challenge method for the <a href="https://tools.ietf.org/html/rfc7636">RFC7636</a>;</li>
<li>shall use separate and distinct Redirect URI for each Authorization Server that it talks to;</li>
<li>shall store the Redirect URI value in the User-Agent 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;</li>
<li>shall adhere to the best practice stated by <a href="https://tools.ietf.org/html/draft-ietf-oauth-native-apps-05">O2fNA</a>; and</li>
<li>shall implement an effective CSRF protection.</li>
</ul>
<p>Further, if it wishes to obtain a persistent identifier of the authenticated user, it</p>
<ul>
<li>shall include <code>openid</code> in the <code>scope</code> value; and</li>
<li>
<p>shall include <code>nonce</code> parameter defined in Section 3.1.2.1 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a> in the authentication request.</p>
<p><strong>NOTE</strong>: Adherence to <a href="https://tools.ietf.org/html/rfc7636">RFC7636</a> means that the token request includes <code>code_verifier</code> parameter in the request.</p>
</li>
</ul>
<h4 id="markdown-header-524-confidential-client">5.2.4 Confidential Client</h4>
<p>In addition to the provision to the Public Client, the Confidential Client</p>
<ul>
<li>shall support the following methods to authenticate against the Token Endpoint:
<ol>
<li>TLS mutual authentication <a href="https://tools.ietf.org/html/draft-campbell-oauth-tls-client-auth">TLSM</a>; or</li>
<li>JWS Client Assertion using the <code>client_secret</code> or a private key as specified in section 9 of <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a>;</li>
</ol>
</li>
<li>shall use RSA keys with a minimum 2048 bits if using RSA cryptography;</li>
<li>shall use Elliptic Curve keys with a minimum of 160 bits if using Elliptic Curve cryptography; and</li>
<li>shall verify that it's client secret has a minimum of 128 bits if using symmetric key cryptography.</li>
</ul>
<h2 id="markdown-header-6-accessing-protected-resources">6. Accessing Protected Resources</h2>
<h3 id="markdown-header-61-introduction">6.1 Introduction</h3>
<p>The FAPI endpoints are OAuth 2.0 protected resource endpoints that return financial information for the resource owner associated with the submitted access token.</p>
<h3 id="markdown-header-62-read-only-access-provisions">6.2 Read only access provisions</h3>
<h4 id="markdown-header-621-protected-resources-provisions">6.2.1 Protected resources provisions</h4>
<p>The resource server with the FAPI endpoints</p>
<ul>
<li>shall mandate TLS 1.2 or later as defined in <a href="https://tools.ietf.org/html/rfc5246">RFC5246</a> with the usage following the best practice in <a href="https://tools.ietf.org/html/rfc7525">RFC7525</a>;</li>
<li>shall support the use of the HTTP GET method defined in <a href="https://tools.ietf.org/html/rfc2616">RFC2616</a>;</li>
<li>shall accept access tokens in the HTTP header as in Section 2.1 of OAuth 2.0 Bearer Token Usage <a href="https://tools.ietf.org/html/rfc6750">RFC6750</a>;</li>
<li>shall not accept access tokens in the query parameters stated in Section 2.3 of OAuth 2.0 Bearer Token Usage <a href="https://tools.ietf.org/html/rfc6750">RFC6750</a>;</li>
<li>shall verify that the access token is not expired nor revoked;</li>
<li>shall verify that the scope associated with the access token authorizes the reading of the resource it is representing;</li>
<li>shall identify the associated user to the access token;</li>
<li>shall only return the resource identified by the combination of the user implicit in the access and the granted scope and otherwise return errors as in section 3.1 of <a href="https://tools.ietf.org/html/rfc6750">RFC6750</a>;</li>
<li>shall encode the response in UTF-8; // DDA allows client to ask for charset but restricting may be better for interoperability</li>
<li>shall send the <code>Content-type</code> HTTP header <code>Content-Type: application/json; charset=UTF-8</code>;</li>
<li>shall send the server date in HTTP date header as in section 14.18 of <a href="https://tools.ietf.org/html/rfc2616">RFC2616</a>;</li>
<li>shall set the response header <code>x-fapi-interaction-id</code> to the value received from the corresponding fapi client request header or to a <a href="https://tools.ietf.org/html/rfc4122">RFC4122</a> UUID value if the request header was not provided to track the interaction, e.g., <code>x-fapi-interaction-id: c770aef3-6784-41f7-8e0e-ff5f97bddb3a</code>; and</li>
<li>
<p>shall log the value of <code>x-fapi-interaction-id</code> in the log entry.</p>
<p><strong>NOTE</strong>: While this document does not specify the exact method to find out the user associated with the access token and the granted scope, the protected resource can use OAuth Token Introspection [RFC7662].</p>
</li>
</ul>
<p>Further, it</p>
<ul>
<li>
<p>should support the use of Cross Origin Resource Sharing (CORS) [CORS] and or other methods as appropriate to enable Java Script Clients to access the endpoint if it decides to provide access to Javascript clients.</p>
<p><strong>NOTE</strong>: Providing access to Javascript clients or not has different security properites.;</p>
</li>
</ul>
<h3 id="markdown-header-622-client-provisions">6.2.2 Client provisions</h3>
<p>The client supporting this document</p>
<ul>
<li>shall use TLS 1.2 or later as defined in <a href="https://tools.ietf.org/html/rfc5246">RFC5246</a> with the usage following the best practice in <a href="https://tools.ietf.org/html/rfc7525">RFC7525</a>;</li>
<li>shall send access tokens in the HTTP header as in Section 2.1 of OAuth 2.0 Bearer Token Usage <a href="https://tools.ietf.org/html/rfc6750">RFC6750</a>;</li>
<li>shall send <code>User-Agent</code> header that identifies the client, e.g., <code>User-Agent: Intuit/1.2.3 Mint/4.3.1</code>; and</li>
<li>
<p>shall send <code>x-fapi-financial-id</code> whose value is the unique identifier of the desired financial institution to interact assigned by the service bureau where the API is provided by a service bureau which uses the same endpoint for multiple institutions.</p>
<p><strong>NOTE</strong>: Conceptually, the value of the <code>x-fapi-financial-id</code> corresponds to <code>iss</code> in the ID Token but is not required to be an https URI. It often is the routing number of the FI.</p>
<p><strong>NOTE</strong>: The use of <code>User-Agent</code> and <code>x-fapi-financial-id</code> is not a security feature.</p>
</li>
</ul>
<p>Further, the client</p>
<ul>
<li>can optionally supply the <code>sub</code> value associated with the customer with the <code>x-fapi-customer-id</code> request header, e.g., <code>x-fapi-customer-id: a237cb74-61c9-4319-9fc5-ff5812778d6b</code>;</li>
<li>can optionally supply the last time the customer logged into the client in the <code>x-fapi-customer-last-logged-time</code> header where the value is supplied as <strong>w3c date </strong>, e.g., <code>x-fapi-customer-last-logged-time: Tue, 11 Sep 2012 19:43:31 UTC</code>; and</li>
<li>can supply the customer’s IP address if this data is available or applicable in the <code>x-fapi-customer-ip-address</code> header, e.g., <code>x-fapi-customer-ip-address: 198.51.100.119</code>; and</li>
<li>may send the <code>x-fapi-interaction-id</code> request header whose value is a <a href="https://tools.ietf.org/html/rfc4122">RFC4122</a> UUID to the server to help correlate log entries between client and server, e.g., <code>x-fapi-interaction-id: c770aef3-6784-41f7-8e0e-ff5f97bddb3a</code>.</li>
</ul>
<h2 id="markdown-header-7-security-considerations">7. Security Considerations</h2>
<h3 id="markdown-header-71-tls-considerations">7.1 TLS Considerations</h3>
<p>Since confidential information is being exchanged, all interactions shall be encrypted with TLS/SSL (HTTPS) in accordance with the recommendations in <a href="https://tools.ietf.org/html/rfc7525">RFC7525</a>. TLS version 1.2 or later shall be used for all communications.</p>
<h3 id="markdown-header-72-message-source-authentication-failure">7.2 Message source authentication failure</h3>
<p>Authorization request and response are not authenticated. For a higher risk scenarios, it should be taken care of. See Part 2, which uses request object to achieve the message source authentication.</p>
<h3 id="markdown-header-73-message-integrity-protection-failure">7.3 Message integrity protection failure</h3>
<p>Authorization request is not message integrity protected thus request tampering and parameter injection are possible. Where the protection is desired, it should use Part 2.</p>
<p>The response is integrity protected when ID Token is returned from the authorization endpoint.</p>
<h3 id="markdown-header-74-message-containment-failure">7.4 Message containment failure</h3>
<h4 id="markdown-header-741-authorization-request-and-response">7.4.1 Authorization request and response</h4>
<p>In this document, the authorization request is not encrypted. Thus, it is possible to leak the information contained if the browser was infected with virus, etc.</p>
<p>Authorization response can be encrypted as ID Token can be encrypted.</p>
<p>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.</p>
<h4 id="markdown-header-742-token-request-and-response">7.4.2 Token request and response</h4>
<p>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.</p>
<h4 id="markdown-header-743-resource-request-and-response">7.4.3 Resource request and response</h4>
<p>Care should be taken so that the sensitive data will not be leaked through the referrer.</p>
<p>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 it 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 <a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a> for more discussion on the lifetimes of access tokens and refresh tokens.</p>
<h2 id="markdown-header-8-privacy-considerations">8. Privacy Considerations</h2>
<h3 id="markdown-header-81-privacy-by-design">8.1 Privacy by design</h3>
<ul>
<li>Privacy impact analysis (PIA) should be performed in the initial phase of the system planning.</li>
<li>For PIA, use of ISO/IEC 29134 Privacy impact analysis - Guidelines is recommended.</li>
<li>The provider should establish a management system to help respect privacy of the customer.</li>
</ul>
<h3 id="markdown-header-82-adhering-to-privacy-principles">8.2 Adhering to privacy principles</h3>
<p>Stakeholders should follow the privacy principles of ISO/IEC 29100. In particular:</p>
<ol>
<li>Consent and Choice</li>
<li>Purpose legitimacy and specification</li>
<li>Collection limitation</li>
<li>Data (access) limitation</li>
<li>Use, retention, and data disclosure limitation:
<ol>
<li>Use limitation:</li>
<li>Retention limitation: Where the data is no longer being used, clients should delete such data from their system within 180 days except for the cases it needs to retain due to the legal restrictions;</li>
<li>Data disclosure limitation:</li>
</ol>
</li>
<li>Accuracy and quality</li>
<li>Openness, transparency and notice</li>
<li>Individual participation and access</li>
<li>Accountability</li>
<li>Information security</li>
<li>Privacy compliance</li>
</ol>
<h2 id="markdown-header-9-acknowledgement">9. Acknowledgement</h2>
<p>Following people contributed heavily towards this document.</p>
<ul>
<li>Nat Sakimura (Nomura Research Institute) -- Chair, Editor</li>
<li>Anoop Saxana (Intuit) -- Co-chair, FS-ISAC Liaison</li>
<li>Anthony Nadalin (Microsoft) -- Co-chair</li>
<li>Edmund Jay (Illumila) -- Co-editor</li>
<li>Dave Tonge (Momentum Financial Technology) -- UK Implementation Entity Liaison</li>
<li>Sascha H. Preibisch (CA)</li>
<li>Henrik Bearing (Peercraft)</li>
<li>Anton Taborszky (Deutche Telecom)</li>
<li>John Bradley (Ping Identity)</li>
<li>(add yourself)</li>
</ul>
<h2 id="markdown-header-10-bibliography">10. Bibliography</h2>
<ul>
<li>[OFX2.2] Open Financial Exchange 2.2</li>
<li>[HTML4.01] “HTML 4.01 Specification,” World Wide Web Consortium Recommendation REC-html401-19991224, December 1999</li>
<li><a href="https://tools.ietf.org/html/rfc2616">RFC2616</a> Hypertext Transfer Protocol -- HTTP/1.1</li>
<li><a href="https://tools.ietf.org/html/rfc4122">RFC4122</a> A Universally Unique IDentifier (UUID) URN Namespace</li>
<li><a href="https://tools.ietf.org/html/rfc5246">RFC5246</a> The Transport Layer Security (TLS) Protocol Version 1.2</li>
<li><a href="https://tools.ietf.org/html/rfc6749">RFC6749</a> The OAuth 2.0 Authorization Framework</li>
<li><a href="https://tools.ietf.org/html/rfc6750">RFC6750</a> The OAuth 2.0 Authorization Framework: Bearer Token Usage</li>
<li><a href="https://tools.ietf.org/html/rfc7525">RFC7525</a> Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)</li>
<li><a href="https://tools.ietf.org/html/rfc7636">RFC7636</a> Proof Key for Code Exchange by OAuth Public Clients</li>
<li>[RFC7662] OAuth 2.0 Token Introspection</li>
<li><a href="https://tools.ietf.org/html/rfc6125">RFC6125</a> 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)</li>
<li><a href="https://tools.ietf.org/html/draft-ietf-oauth-native-apps-05">O2fNA</a> OAuth 2.0 for Native Apps</li>
<li><a href="https://tools.ietf.org/html/rfc6819">RFC6819</a> OAuth 2.0 Threat Model and Security Considerations</li>
<li><a href="http://openid.net/specs/openid-connect-core-1_0.html">OIDC</a> OpenID Connect Core 1.0 incorporating errata set 1</li>
<li><a href="http://openid.net/specs/openid-connect-discovery-1_0.html">OIDD</a> OpenID Connect Discovery 1.0 incorporating errata set 1</li>
<li><a href="http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html">OIDM</a> OAuth 2.0 Multiple Response Type Encoding Practices</li>
<li><a href="https://www.itu.int/rec/T-REC-X.1254">X.1254</a> - Entity authentication assurance framework</li>
<li><a href="https://tools.ietf.org/html/draft-campbell-oauth-tls-client-auth">TLSM</a> - Mutual X.509 Transport Layer Security (TLS) Authentication for OAuth Clients</li>
<li>[DDA] Durable Data API, (2015), FS-ISAC</li>
<li>[ISO29100] ISO/IEC 29100 Information technology -- Security techniques -- Privacy framework <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c045123_ISO_IEC_29100_2011.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c045123_ISO_IEC_29100_2011.zip</a></li>
<li>[ISO29134] ISO/IEC 29134 Information technology -- Security techniques -- Privacy impact assessment -- Guidelines</li>
</ul>
  </body>
</html>