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

<front>
<title abbrev="OAuth DPoP">OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)</title><seriesInfo value="draft-ietf-oauth-dpop-07" stream="IETF" 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>
<author initials="B." surname="Campbell" fullname="Brian Campbell"><organization>Ping Identity</organization><address><postal><street></street>
</postal><email>bcampbell@pingidentity.com</email>
</address></author>
<author initials="J." surname="Bradley" fullname="John Bradley"><organization>Yubico</organization><address><postal><street></street>
</postal><email>ve7jtb@ve7jtb.com</email>
</address></author>
<author initials="T." surname="Lodderstedt" fullname="Torsten Lodderstedt"><organization>yes.com</organization><address><postal><street></street>
</postal><email>torsten@lodderstedt.net</email>
</address></author>
<author initials="M." surname="Jones" fullname="Michael Jones"><organization>Microsoft</organization><address><postal><street></street>
</postal><email>mbj@microsoft.com</email>
<uri>https://self-issued.info/</uri>
</address></author>
<author initials="D." surname="Waite" fullname="David Waite"><organization>Ping Identity</organization><address><postal><street></street>
</postal><email>david@alkaline-solutions.com</email>
</address></author>
<date/>
<area>Security</area>
<workgroup>Web Authorization Protocol</workgroup>
<keyword>security</keyword>
<keyword>oauth2</keyword>

<abstract>
<t>This document describes a mechanism for sender-constraining OAuth 2.0
tokens via a proof-of-possession mechanism on the application level.
This mechanism allows for the detection of replay attacks with access and refresh
tokens.</t>
</abstract>

</front>

<middle>

<section anchor="Introduction"><name>Introduction</name>
<t>DPoP (for Demonstrating Proof-of-Possession at the Application Layer)
is an application-level mechanism for
sender-constraining OAuth access and refresh tokens. It enables a client to
prove the possession of a public/private key pair by including
a <tt>DPoP</tt> header in an HTTP request. The value of the header is a JSON Web Token
(JWT) <xref target="RFC7519"></xref> that enables the authorization
server to bind issued tokens to the public part of a client's
key pair. Recipients of such tokens are then able to verify the binding of the
token to the key pair that the client has demonstrated that it holds via
the <tt>DPoP</tt> header, thereby providing some assurance that the client presenting
the token also possesses the private key.
In other words, the legitimate presenter of the token is constrained to be
the sender that holds and can prove possession of the private part of the
key pair.</t>
<t>The mechanism described herein can be used in cases where other
methods of sender-constraining tokens that utilize elements of the underlying
secure transport layer, such as <xref target="RFC8705"></xref> or <xref target="I-D.ietf-oauth-token-binding"></xref>,
are not available or desirable. For example, due to a sub-par user experience
of TLS client authentication in user agents and a lack of support for HTTP token
binding, neither mechanism can be used if an OAuth client is a Single Page
Application (SPA) running in a web browser. Native applications installed
and run on a user's device are another example well positioned to benefit
from DPoP-bound tokens to guard against misuse of tokens by a compromised
or malicious resource. Such applications often have dedicated protected storage
for cryptographic keys.</t>
<t>DPoP can be used to sender-constrain access tokens regardless of the
client authentication method employed, but DPoP itself is not used for client authentication.
DPoP can also be used to sender-constrain refresh tokens issued to public clients
(those without authentication credentials associated with the <tt>client_id</tt>).</t>

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

<section anchor="objective"><name>Objectives</name>
<t>The primary aim of DPoP is to prevent unauthorized or illegitimate
parties from using leaked or stolen access tokens, by binding a token
to a public key upon issuance and requiring that the client proves
possession of the corresponding private key when using the token.
This constrains the legitimate sender of the token to only the party with
access to the private key and gives the server receiving the token added
assurances that the sender is legitimately authorized to use it.</t>
<t>Access tokens that are sender-constrained via DPoP thus stand in
contrast to the typical bearer token, which can be used by any party in
possession of such a token. Although protections generally exist to
prevent unintended disclosure of bearer tokens, unforeseen vectors for
leakage have occurred due to vulnerabilities and implementation issues
in other layers in the protocol or software stack (CRIME, BREACH,
Heartbleed, and the Cloudflare parser bug are some examples).
There have also been numerous published token theft attacks on OAuth
implementations themselves. DPoP provides a general defense in depth
against the impact of unanticipated token leakage. DPoP is not, however,
a substitute for a secure transport and MUST always be used in
conjunction with HTTPS.</t>
<t>The very nature of the typical OAuth protocol interaction
necessitates that the client discloses the access token to the
protected resources that it accesses. The attacker model
in <xref target="I-D.ietf-oauth-security-topics"></xref> describes cases where a
protected resource might be counterfeit, malicious or compromised
and plays received tokens against other protected resources to gain
unauthorized access. Properly audience restricting access tokens can
prevent such misuse, however, doing so in practice has proven to be
prohibitively cumbersome for many deployments (even despite extensions such as <xref target="RFC8707"></xref>).
Sender-constraining access tokens is a more robust and straightforward
mechanism to prevent such token replay at a different endpoint and DPoP
is an accessible application layer means of doing so.</t>
<t>Due to the potential for cross-site scripting (XSS), browser-based
OAuth clients bring to bear added considerations with respect to protecting
tokens. The most straightforward XSS-based attack is for an attacker to
exfiltrate a token and use it themselves completely independent of the
legitimate client. A stolen access token is used for protected
resource access and a stolen refresh token for obtaining new access tokens.
If the private key is non-extractable (as is possible with <xref target="W3C.WebCryptoAPI"></xref>),
DPoP renders exfiltrated tokens alone unusable.</t>
<t>XSS vulnerabilities also allow an attacker to execute code in the context of
the browser-based client application and maliciously use a token indirectly
through the client. That execution context has access to utilize the signing
key and thus can produce DPoP proofs to use in conjunction with the token.
At this application layer there is most likely no feasible defense against
this threat except generally preventing XSS, therefore it is considered
out of scope for DPoP.</t>
<t>Malicious XSS code executed in the context of the browser-based client
application is also in a position to create DPoP proofs with timestamp values in
the future and exfiltrate them in conjunction with a token. These stolen
artifacts can later be used together independent of the client application to
access protected resources. To prevent this, servers can optionally require
clients to include a server-chosen value into the proof that cannot be predicted
by an attacker (nonce). In the absence of the optional nonce, the impact of
pre-computed DPoP proofs is limited somewhat by the proof being bound to an
access token on protected resource access. Because a proof covering an access
token that does not yet exist cannot feasibly be created, access tokens obtained
with an exfiltrated refresh token and pre-computed proofs will be unusable.</t>
<t>Additional security considerations are discussed in <xref target="Security"></xref>.</t>
</section>

<section anchor="concept"><name>Concept</name>
<t>The main data structure introduced by this specification is a DPoP
proof JWT, described in detail below, which is sent as a header in an
HTTP request. A client uses a DPoP proof JWT to prove
the possession of a private key corresponding to a certain public key.</t>
<t>Roughly speaking, a DPoP proof is a signature over some
data of the HTTP request to which it is attached, a timestamp, a unique identifier, an optional server-provided nonce,
and a hash of the associated access token when an access token is present within the request.</t>
<figure anchor="basic-flow"><name>Basic DPoP Flow </name>
<sourcecode type="ascii-art">+--------+                                          +---------------+
|        |--(A)-- Token Request -------------------&gt;|               |
| Client |        (DPoP Proof)                      | Authorization |
|        |                                          |     Server    |
|        |&lt;-(B)-- DPoP-bound Access Token ----------|               |
|        |        (token_type=DPoP)                 +---------------+
|        |
|        | 
|        |                                          +---------------+
|        |--(C)-- DPoP-bound Access Token ---------&gt;|               |
|        |        (DPoP Proof)                      |    Resource   |
|        |                                          |     Server    |
|        |&lt;-(D)-- Protected Resource ---------------|               |
|        |                                          +---------------+
+--------+
</sourcecode>
</figure>
<t>The basic steps of an OAuth flow with DPoP (without the optional nonce) are shown in <xref target="basic-flow"></xref>:</t>

<ul>
<li>(A) In the Token Request, the client sends an authorization grant
(e.g., an authorization code, refresh token, etc.)<br />
to the authorization server in order to obtain an access token
(and potentially a refresh token). The client attaches a DPoP
proof to the request in an HTTP header.</li>
<li>(B) The authorization server binds (sender-constrains) the access token to the
public key claimed by the client in the DPoP proof; that is, the access token cannot
be used without proving possession of the respective private key.
If a refresh token is issued to a public client, it too is
bound to the public key of the DPoP proof.</li>
<li>(C) To use the access token, the client has to prove
possession of the private key by, again, adding a header to the
request that carries a DPoP proof for that request. The resource server needs to
receive information about the public key to which the access token is bound. This
information may be encoded directly into the access token (for
JWT structured access tokens) or provided via token
introspection endpoint (not shown).
The resource server verifies that the public key to which the
access token is bound matches the public key of the DPoP proof.
It also verifies that the access token hash in the DPoP proof matches the
access token presented in the request.</li>
<li>(D) The resource server refuses to serve the request if the
signature check fails or the data in the DPoP proof is wrong,
e.g., the request URI does not match the URI claim in the DPoP
proof JWT. The access token itself, of course, must also be
valid in all other respects.</li>
</ul>
<t>The DPoP mechanism presented herein is not a client authentication method.
In fact, a primary use case of DPoP is for public clients (e.g., single page
applications and native applications) that do not use client authentication. Nonetheless, DPoP
is designed such that it is compatible with <tt>private_key_jwt</tt> and all
other client authentication methods.</t>
<t>DPoP does not directly ensure message integrity but relies on the TLS
layer for that purpose. See <xref target="Security"></xref> for details.</t>
</section>

<section anchor="the-proof"><name>DPoP Proof JWTs</name>
<t>DPoP introduces the concept of a DPoP proof, which is a JWT created by
the client and sent with an HTTP request using the <tt>DPoP</tt> header field.
Each HTTP request requires a unique DPoP proof.</t>
<t>A valid DPoP proof demonstrates to the server that the client holds the private
key that was used to sign the DPoP proof JWT. This enables authorization servers to bind
issued tokens to the corresponding public key (as described in <xref target="access-token-request"></xref>)
and for resource servers to verify the key-binding of tokens that
it receives (see <xref target="http-auth-scheme"></xref>), which prevents said tokens from
being used by any entity that does not have access to the private key.</t>
<t>The DPoP proof demonstrates possession of a key and, by itself, is not
an authentication or access control mechanism. When presented
in conjunction with a key-bound access token as described in <xref target="http-auth-scheme"></xref>,
the DPoP proof provides additional assurance about the legitimacy of the client
to present the access token. However, a valid DPoP proof JWT is not sufficient alone
to make access control decisions.</t>

<section anchor="the-dpop-http-header"><name>The DPoP HTTP Header</name>
<t>A DPoP proof is included in an HTTP request using the following message header field.</t>

<dl>
<dt><tt>DPoP</tt></dt>
<dd>A JWT that adheres to the structure and syntax of <xref target="DPoP-Proof-Syntax"></xref>.</dd>
</dl>
<t><xref target="dpop-proof-jwt"></xref> shows an example DPoP HTTP header field (line breaks
and extra whitespace for display purposes only).</t>
<figure anchor="dpop-proof-jwt"><name>Example <tt>DPoP</tt> header </name>
<artwork>DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVTMjU2IiwiandrIjp7Imt0eSI6Ik
 VDIiwieCI6Imw4dEZyaHgtMzR0VjNoUklDUkRZOXpDa0RscEJoRjQyVVFVZldWQVdCR
 nMiLCJ5IjoiOVZFNGpmX09rX282NHpiVFRsY3VOSmFqSG10NnY5VERWclUwQ2R2R1JE
 QSIsImNydiI6IlAtMjU2In19.eyJqdGkiOiItQndDM0VTYzZhY2MybFRjIiwiaHRtIj
 oiUE9TVCIsImh0dSI6Imh0dHBzOi8vc2VydmVyLmV4YW1wbGUuY29tL3Rva2VuIiwia
 WF0IjoxNTYyMjYyNjE2fQ.2-GxA6T8lP4vfrg8v-FdWP0A0zdrj8igiMLvqRMUvwnQg
 4PtFLbdLXiOSsX0x7NVY-FNyJK70nfbV37xRZT3Lg
</artwork>
</figure>
<t>Note that per <xref target="RFC7230"></xref> header field names are case-insensitive;
so <tt>DPoP</tt>, <tt>DPOP</tt>, <tt>dpop</tt>, etc., are all valid and equivalent header
field names. Case is significant in the header field value, however.</t>
</section>

<section anchor="DPoP-Proof-Syntax"><name>DPoP Proof JWT Syntax</name>
<t>A DPoP proof is a JWT (<xref target="RFC7519"></xref>) that is signed (using JSON Web Signature (JWS)
<xref target="RFC7515"></xref>) with a private key chosen by the client (see below). The
header of a DPoP JWT contains at least the following parameters:</t>

<ul>
<li><tt>typ</tt>: type header, value <tt>dpop+jwt</tt> (REQUIRED).</li>
<li><tt>alg</tt>: a digital signature algorithm identifier as per <xref target="RFC7518"></xref>
(REQUIRED). MUST NOT be <tt>none</tt> or an identifier for a symmetric
algorithm (MAC).</li>
<li><tt>jwk</tt>: representing the public key chosen by the client, in JSON Web Key (JWK) <xref target="RFC7517"></xref>
format, as defined in Section 4.1.3 of <xref target="RFC7515"></xref> (REQUIRED).
MUST NOT contain the private key.</li>
</ul>
<t>The payload of a DPoP proof contains at least the following claims:</t>

<ul>
<li><tt>jti</tt>: Unique identifier for the DPoP proof JWT (REQUIRED).
The value MUST be assigned such that there is a negligible
probability that the same value will be assigned to any
other DPoP proof used in the same context during the time window of validity.
Such uniqueness can be accomplished by encoding (base64url or any other
suitable encoding) at least 96 bits of
pseudorandom data or by using a version 4 UUID string according to <xref target="RFC4122"></xref>.
The <tt>jti</tt> can be used by the server for replay
detection and prevention, see <xref target="Token_Replay"></xref>.</li>
<li><tt>htm</tt>: The HTTP method for the request to which the JWT is
attached, as defined in <xref target="RFC7231"></xref> (REQUIRED).</li>
<li><tt>htu</tt>: The HTTP URI used for the request, without query and
fragment parts (REQUIRED).</li>
<li><tt>iat</tt>: Time at which the JWT was created (REQUIRED).</li>
</ul>
<t>When the DPoP proof is used in conjunction with the presentation of an access token, see
<xref target="protected-resource-access"></xref>, the DPoP proof MUST also contain the following claim:</t>

<ul>
<li><tt>ath</tt>: hash of the access token (REQUIRED).
The value MUST be the result of a base64url encoding (with no padding) the SHA-256
hash of the ASCII encoding of the associated access token's value.</li>
</ul>
<t>A DPoP proof MAY contain other headers or claims as defined by extension,
profile, or deployment specific requirements.</t>
<t><xref target="dpop-proof"></xref> is a conceptual example showing the decoded content of the DPoP
proof in <xref target="dpop-proof-jwt"></xref>. The JSON of the JWT header and payload are shown,
but the signature part is omitted. As usual, line breaks and extra whitespace
are included for formatting and readability.</t>
<figure anchor="dpop-proof"><name>Example JWT content of a <tt>DPoP</tt> proof </name>
<artwork>{
  &quot;typ&quot;:&quot;dpop+jwt&quot;,
  &quot;alg&quot;:&quot;ES256&quot;,
  &quot;jwk&quot;: {
    &quot;kty&quot;:&quot;EC&quot;,
    &quot;x&quot;:&quot;l8tFrhx-34tV3hRICRDY9zCkDlpBhF42UQUfWVAWBFs&quot;,
    &quot;y&quot;:&quot;9VE4jf_Ok_o64zbTTlcuNJajHmt6v9TDVrU0CdvGRDA&quot;,
    &quot;crv&quot;:&quot;P-256&quot;
  }
}
.
{
  &quot;jti&quot;:&quot;-BwC3ESc6acc2lTc&quot;,
  &quot;htm&quot;:&quot;POST&quot;,
  &quot;htu&quot;:&quot;https://server.example.com/token&quot;,
  &quot;iat&quot;:1562262616
}
</artwork>
</figure>
<t>Of the HTTP content in the request, only the HTTP method and URI are
included in the DPoP JWT, and therefore only these 2 headers of the request
are covered by the DPoP proof and its signature.
The idea is sign just enough of the HTTP data to
provide reasonable proof-of-possession with respect to the HTTP request. But
that it be a minimal subset of the HTTP data so as to avoid the substantial
difficulties inherent in attempting to normalize HTTP messages.
Nonetheless, DPoP proofs can be extended to contain other information of the
HTTP request (see also <xref target="request_integrity"></xref>).</t>
</section>

<section anchor="checking"><name>Checking DPoP Proofs</name>
<t>To check if a string that was received as part of an HTTP Request is a
valid DPoP proof, the receiving server MUST ensure that</t>

<ol>
<li>that there is not more than one <tt>DPoP</tt> header in the request,</li>
<li>the string value of the header field is a well-formed JWT,</li>
<li>all required claims per <xref target="DPoP-Proof-Syntax"></xref> are contained in the JWT,</li>
<li>the <tt>typ</tt> field in the header has the value <tt>dpop+jwt</tt>,</li>
<li>the algorithm in the header of the JWT indicates an asymmetric digital
signature algorithm, is not <tt>none</tt>, is supported by the
application, and is deemed secure,</li>
<li>the JWT signature verifies with the public key contained in the <tt>jwk</tt>
header of the JWT,</li>
<li>the <tt>jwk</tt> header of the JWT does not contain a private key,</li>
<li>the <tt>htm</tt> claim matches the HTTP method value of the HTTP
request in which the JWT was received,</li>
<li>the <tt>htu</tt> claim matches the HTTPS URI value for the HTTP
request in which the JWT was received, ignoring any query and
fragment parts,</li>
<li>if the server provided a nonce value to the client,
the <tt>nonce</tt> claim matches the server-provided nonce value,</li>
<li>the <tt>iat</tt> claim value is within an acceptable timeframe and,
within a reasonable consideration of accuracy and resource utilization,
a proof JWT with the same <tt>jti</tt> value has not previously been received at the same resource
during that time period (see <xref target="Token_Replay"></xref>),</li>
<li><t>if presented to a protected resource in conjunction with an access token,</t>

<ol>
<li>ensure that the value of the <tt>ath</tt> claim equals the hash of that access token,</li>
<li>confirm that the public key to which the access token is bound matches the public key from the DPoP proof.</li>
</ol></li>
</ol>
<t>Servers SHOULD employ Syntax-Based Normalization and Scheme-Based
Normalization in accordance with Section 6.2.2. and Section 6.2.3. of
<xref target="RFC3986"></xref> before comparing the <tt>htu</tt> claim.</t>
</section>
</section>

<section anchor="access-token-request"><name>DPoP Access Token Request</name>
<t>To request an access token that is bound to a public key using DPoP, the client MUST
provide a valid DPoP proof JWT in a <tt>DPoP</tt> header when making an access token
request to the authorization server's token endpoint. This is applicable for all
access token requests regardless of grant type (including, for example,
the common <tt>authorization_code</tt> and <tt>refresh_token</tt> grant types but also extension grants
such as the JWT authorization grant <xref target="RFC7523"></xref>). The HTTPS request shown in
<xref target="token-request-code"></xref> illustrates such an access
token request using an authorization code grant with a DPoP proof JWT
in the <tt>DPoP</tt> header (extra line breaks and whitespace for display purposes only).</t>
<figure anchor="token-request-code"><name>Token Request for a DPoP sender-constrained token using an authorization code </name>
<artwork>POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVTMjU2IiwiandrIjp7Imt0eSI6Ik
 VDIiwieCI6Imw4dEZyaHgtMzR0VjNoUklDUkRZOXpDa0RscEJoRjQyVVFVZldWQVdCR
 nMiLCJ5IjoiOVZFNGpmX09rX282NHpiVFRsY3VOSmFqSG10NnY5VERWclUwQ2R2R1JE
 QSIsImNydiI6IlAtMjU2In19.eyJqdGkiOiItQndDM0VTYzZhY2MybFRjIiwiaHRtIj
 oiUE9TVCIsImh0dSI6Imh0dHBzOi8vc2VydmVyLmV4YW1wbGUuY29tL3Rva2VuIiwia
 WF0IjoxNTYyMjYyNjE2fQ.2-GxA6T8lP4vfrg8v-FdWP0A0zdrj8igiMLvqRMUvwnQg
 4PtFLbdLXiOSsX0x7NVY-FNyJK70nfbV37xRZT3Lg
 
grant_type=authorization_code
&amp;code=SplxlOBeZQQYbYS6WxSbIA
&amp;redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
&amp;code_verifier=bEaL42izcC-o-xBk0K2vuJ6U-y1p9r_wW2dFWIWgjz-
</artwork>
</figure>
<t>The <tt>DPoP</tt> HTTP header MUST contain a valid DPoP proof JWT.
If the DPoP proof is invalid, the authorization server issues an error
response per Section 5.2 of <xref target="RFC6749"></xref> with <tt>invalid_dpop_proof</tt> as the
value of the <tt>error</tt> parameter.</t>
<t>To sender-constrain the access token, after checking the validity of the
DPoP proof, the authorization server associates the issued access token with the
public key from the DPoP proof, which can be accomplished as described in <xref target="Confirmation"></xref>.
A <tt>token_type</tt> of <tt>DPoP</tt> MUST be included in the access token
response to signal to the client that the access token was bound to
its DPoP key and can be used as described in <xref target="http-auth-scheme"></xref>.
The example response shown in <xref target="token-response"></xref> illustrates such a
response.</t>
<figure anchor="token-response"><name>Access Token Response </name>
<artwork>HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store

{
 &quot;access_token&quot;: &quot;Kz~8mXK1EalYznwH-LC-1fBAo.4Ljp~zsPE_NeO.gxU&quot;,
 &quot;token_type&quot;: &quot;DPoP&quot;,
 &quot;expires_in&quot;: 2677,
 &quot;refresh_token&quot;: &quot;Q..Zkm29lexi8VnWg2zPW1x-tgGad0Ibc3s3EwM_Ni4-g&quot;
}
</artwork>
</figure>
<t>The example response in <xref target="token-response"></xref> includes a refresh token which the
client can use to obtain a new access token when the previous one expires.
Refreshing an access token is a token request using the <tt>refresh_token</tt>
grant type made to the authorization server's token endpoint.  As with
all access token requests, the client makes it a DPoP request by including
a DPoP proof, as shown in the <xref target="token-request-rt"></xref> example
(extra line breaks and whitespace for display purposes only).</t>
<figure anchor="token-request-rt"><name>Token Request for a DPoP-bound Token using a Refresh Token </name>
<artwork>POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVTMjU2IiwiandrIjp7Imt0eSI6Ik
 VDIiwieCI6Imw4dEZyaHgtMzR0VjNoUklDUkRZOXpDa0RscEJoRjQyVVFVZldWQVdCR
 nMiLCJ5IjoiOVZFNGpmX09rX282NHpiVFRsY3VOSmFqSG10NnY5VERWclUwQ2R2R1JE
 QSIsImNydiI6IlAtMjU2In19.eyJqdGkiOiItQndDM0VTYzZhY2MybFRjIiwiaHRtIj
 oiUE9TVCIsImh0dSI6Imh0dHBzOi8vc2VydmVyLmV4YW1wbGUuY29tL3Rva2VuIiwia
 WF0IjoxNTYyMjY1Mjk2fQ.pAqut2IRDm_De6PR93SYmGBPXpwrAk90e8cP2hjiaG5Qs
 GSuKDYW7_X620BxqhvYC8ynrrvZLTk41mSRroapUA

grant_type=refresh_token
&amp;refresh_token=Q..Zkm29lexi8VnWg2zPW1x-tgGad0Ibc3s3EwM_Ni4-g

</artwork>
</figure>
<t>When an authorization server supporting DPoP issues a
refresh token to a public client that presents a valid DPoP proof at the
token endpoint, the refresh token MUST be bound
to the respective public key. The binding MUST be validated when the refresh
token is later presented to get new access tokens. As a result, such a client
MUST present a DPoP proof for the same key that was used to obtain the refresh
token each time that refresh token is used to obtain a new access token.
The implementation details of the binding of the refresh token are at the discretion of
the authorization server. The server both produces and
validates the refresh tokens that it issues so there is no interoperability
consideration in the specific details of the binding.</t>
<t>An authorization server MAY elect to issue access tokens which are not DPoP bound,
which is signaled to the client with a value of <tt>Bearer</tt> in the <tt>token_type</tt> parameter
of the access token response per <xref target="RFC6750"></xref>. For a public client that is
also issued a refresh token, this has the effect of DPoP-binding the refresh token
alone, which can improve the security posture even when protected resources are not
updated to support DPoP.</t>
<t>If a client receives a different <tt>token_type</tt> value than <tt>DPoP</tt> in the response, the
access token protection provided by DPoP is not given. The client MUST discard the response in this
case if this protection is deemed important for the security of the
application and MAY continue as in a regular OAuth interaction otherwise.</t>
<t>Refresh tokens issued to confidential clients (those having
established authentication credentials with the authorization server)
are not bound to the DPoP proof public key because they are already
sender-constrained with a different existing mechanism. The OAuth 2.0 Authorization
Framework <xref target="RFC6749"></xref> already requires that an authorization server bind
refresh tokens to the client to which they were issued and that
confidential clients authenticate to the authorization server when
presenting a refresh token.  As a result, such refresh tokens
are sender-constrained by way of the client ID and the associated
authentication requirement. This existing sender-constraining mechanism
is more flexible (e.g., it allows credential rotation for the client
without invalidating refresh tokens) than binding directly to a particular public key.</t>

<section anchor="as-meta"><name>Authorization Server Metadata</name>
<t>This document introduces the following authorization server metadata
<xref target="RFC8414"></xref> parameter to signal support for DPoP in general and the specific
JWS <tt>alg</tt> values the authorization server supports for DPoP proof JWTs.</t>

<dl>
<dt><tt>dpop_signing_alg_values_supported</tt></dt>
<dd>A JSON array containing a list of the JWS <tt>alg</tt> values supported
by the authorization server for DPoP proof JWTs.</dd>
</dl>
</section>

<section anchor="client-meta"><name>Client Registration Metadata</name>
<t>The Dynamic Client Registration Protocol <xref target="RFC7591"></xref> defines an API
for dynamically registering OAuth 2.0 client metadata with authorization servers.
The metadata defined by <xref target="RFC7591"></xref>, and registered extensions to it,
also imply a general data model for clients that is useful for authorization server implementations
even when the Dynamic Client Registration Protocol isn't in play.
Such implementations will typically have some sort of user interface available for managing client configuration.</t>
<t>This document introduces the following client registration metadata
<xref target="RFC7591"></xref> parameter to indicate that the client always uses
DPoP when requesting tokens from the authorization server.</t>

<dl>
<dt><tt>dpop_bound_access_tokens</tt></dt>
<dd>Boolean value specifying whether the client always uses DPoP for token requests.  If omitted, the default value is <tt>false</tt>.</dd>
</dl>
<t>If <tt>true</tt>, the authorization server MUST reject token requests from this client that do not contain the DPoP header.</t>
</section>
</section>

<section anchor="Confirmation"><name>Public Key Confirmation</name>
<t>Resource servers MUST be able to reliably identify whether
an access token is bound using DPoP and ascertain sufficient information
about the public key to which the token is bound in order to verify the
binding with respect to the presented DPoP proof (see <xref target="http-auth-scheme"></xref>).
Such a binding is accomplished by associating the public key
with the token in a way that can be
accessed by the protected resource, such as embedding the JWK
hash in the issued access token directly, using the syntax described
in <xref target="jwk-thumb-jwt"></xref>, or through token introspection as described in
<xref target="jwk-thumb-intro"></xref>. Other methods of associating a
public key with an access token are possible, per agreement by the
authorization server and the protected resource, but are beyond the
scope of this specification.</t>
<t>Resource servers supporting DPoP MUST ensure that the public key from
the DPoP proof matches the public key to which the access token is bound.</t>

<section anchor="jwk-thumb-jwt"><name>JWK Thumbprint Confirmation Method</name>
<t>When access tokens are represented as JSON Web Tokens (JWT) <xref target="RFC7519"></xref>,
the public key information SHOULD be represented
using the <tt>jkt</tt> confirmation method member defined herein.
To convey the hash of a public key in a JWT, this specification
introduces the following JWT Confirmation Method <xref target="RFC7800"></xref> member for
use under the <tt>cnf</tt> claim.</t>

<dl>
<dt><tt>jkt</tt></dt>
<dd>JWK SHA-256 Thumbprint Confirmation Method. The value of the <tt>jkt</tt> member
MUST be the base64url encoding (as defined in <xref target="RFC7515"></xref>)
of the JWK SHA-256 Thumbprint (according to <xref target="RFC7638"></xref>) of the DPoP public key
(in JWK format) to which the access token is bound.</dd>
</dl>
<t>The following example JWT in <xref target="cnf-claim-jwt"></xref> with decoded JWT payload shown in
<xref target="cnf-claim"></xref> contains a <tt>cnf</tt> claim with the <tt>jkt</tt> JWK Thumbprint confirmation
method member.  The <tt>jkt</tt> value in these examples is the hash of the public key
from the DPoP proofs in the examples in <xref target="access-token-request"></xref>.</t>
<figure anchor="cnf-claim-jwt"><name>JWT containing a JWK SHA-256 Thumbprint Confirmation </name>
<artwork>eyJhbGciOiJFUzI1NiIsImtpZCI6IkJlQUxrYiJ9.eyJzdWIiOiJzb21lb25lQGV4YW1
wbGUuY29tIiwiaXNzIjoiaHR0cHM6Ly9zZXJ2ZXIuZXhhbXBsZS5jb20iLCJuYmYiOjE
1NjIyNjI2MTEsImV4cCI6MTU2MjI2NjIxNiwiY25mIjp7ImprdCI6IjBaY09DT1JaTll
5LURXcHFxMzBqWnlKR0hUTjBkMkhnbEJWM3VpZ3VBNEkifX0.3Tyo8VTcn6u_PboUmAO
YUY1kfAavomW_YwYMkmRNizLJoQzWy2fCo79Zi5yObpIzjWb5xW4OGld7ESZrh0fsrA
</artwork>
</figure>
<figure anchor="cnf-claim"><name>JWT Claims Set with a JWK SHA-256 Thumbprint Confirmation </name>
<artwork>{
  &quot;sub&quot;:&quot;someone@example.com&quot;,
  &quot;iss&quot;:&quot;https://server.example.com&quot;,
  &quot;nbf&quot;:1562262611,
  &quot;exp&quot;:1562266216,
  &quot;cnf&quot;:{&quot;jkt&quot;:&quot;0ZcOCORZNYy-DWpqq30jZyJGHTN0d2HglBV3uiguA4I&quot;}
}
</artwork>
</figure>
</section>

<section anchor="jwk-thumb-intro"><name>JWK Thumbprint Confirmation Method in Token Introspection</name>
<t>OAuth 2.0 Token Introspection <xref target="RFC7662"></xref> defines a method for a
protected resource to query an authorization server about the active
state of an access token as well as to determine metainformation
about the token.</t>
<t>For a DPoP-bound access token, the hash of the public key to which the token
is bound is conveyed to the protected resource as metainformation in a token
introspection response. The hash is conveyed using the same <tt>cnf</tt> content with
<tt>jkt</tt> member structure as the JWK Thumbprint confirmation method, described in
<xref target="jwk-thumb-jwt"></xref>, as a top-level member of the
introspection response JSON. Note that the resource server
does not send a DPoP proof with the introspection request and the authorization
server does not validate an access token's DPoP binding at the introspection
endpoint. Rather the resource server uses the data of the introspection response
to validate the access token binding itself locally.</t>
<t>If the <tt>token_type</tt> member is included in the introspection response, it MUST contain
the value <tt>DPoP</tt>.</t>
<t>The example introspection request in <xref target="introspect-req"></xref> and corresponding response in
<xref target="introspect-resp"></xref> illustrate an introspection exchange for the example DPoP-bound
access token that was issued in <xref target="token-response"></xref>.</t>
<figure anchor="introspect-req"><name>Example Introspection Request </name>
<artwork>POST /as/introspect.oauth2 HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic cnM6cnM6TWt1LTZnX2xDektJZHo0ZnNON2tZY3lhK1Rp

token=Kz~8mXK1EalYznwH-LC-1fBAo.4Ljp~zsPE_NeO.gxU
</artwork>
</figure>
<figure anchor="introspect-resp"><name>Example Introspection Response for a DPoP-Bound Access Token </name>
<artwork>HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store

{
  &quot;active&quot;: true,
  &quot;sub&quot;: &quot;someone@example.com&quot;,
  &quot;iss&quot;: &quot;https://server.example.com&quot;,
  &quot;nbf&quot;: 1562262611,
  &quot;exp&quot;: 1562266216,
  &quot;cnf&quot;: {&quot;jkt&quot;: &quot;0ZcOCORZNYy-DWpqq30jZyJGHTN0d2HglBV3uiguA4I&quot;}
}
</artwork>
</figure>
</section>
</section>

<section anchor="protected-resource-access"><name>Protected Resource Access</name>
<t>To make use of an access token that is bound to a public key
using DPoP, a client MUST prove possession of the corresponding
private key by providing a DPoP proof in the <tt>DPoP</tt> request header.
As such, protected resource requests with a DPoP-bound access token
necessarily must include both a DPoP proof as per <xref target="the-proof"></xref> and
the access token as described in <xref target="http-auth-scheme"></xref>.
The DPoP proof MUST include the <tt>ath</tt> claim with a valid hash of the
associated access token.</t>

<section anchor="http-auth-scheme"><name>The DPoP Authentication Scheme</name>
<t>A DPoP-bound access token is sent using the <tt>Authorization</tt> request
header field per Section 2 of <xref target="RFC7235"></xref> using an
authentication scheme of <tt>DPoP</tt>. The syntax of the <tt>Authorization</tt>
header field for the <tt>DPoP</tt> scheme
uses the <tt>token68</tt> syntax defined in Section 2.1 of <xref target="RFC7235"></xref>
(repeated below for ease of reference) for credentials.
The Augmented Backus-Naur Form (ABNF) notation <xref target="RFC5234"></xref> syntax
for DPoP authentication scheme credentials is as follows:</t>
<figure><name>DPoP Authentication Scheme ABNF
</name>
<artwork> token68    = 1*( ALPHA / DIGIT /
                   &quot;-&quot; / &quot;.&quot; / &quot;_&quot; / &quot;~&quot; / &quot;+&quot; / &quot;/&quot; ) *&quot;=&quot;

 credentials = &quot;DPoP&quot; 1*SP token68
</artwork>
</figure>
<t>For such an access token, a resource server MUST check that a DPoP proof
was also received in the <tt>DPoP</tt> header field of the HTTP request,
check the DPoP proof according to the rules in <xref target="checking"></xref>,
and check that the public key of the DPoP proof matches the public
key to which the access token is bound per <xref target="Confirmation"></xref>.</t>
<t>The resource server MUST NOT grant access to the resource unless all
checks are successful.</t>
<t><xref target="protected-resource-request"></xref> shows an example request to a protected
resource with a DPoP-bound access token in the <tt>Authorization</tt> header
and the DPoP proof in the <tt>DPoP</tt> header.
Following that is <xref target="dpop-proof-pr"></xref>, which shows the decoded content of that DPoP
proof. The JSON of the JWT header and payload are shown
but the signature part is omitted. As usual, line breaks and extra whitespace
are included for formatting and readability in both examples.</t>
<figure anchor="protected-resource-request"><name>DPoP Protected Resource Request </name>
<artwork>GET /protectedresource HTTP/1.1
Host: resource.example.org
Authorization: DPoP Kz~8mXK1EalYznwH-LC-1fBAo.4Ljp~zsPE_NeO.gxU
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVTMjU2IiwiandrIjp7Imt0eSI6Ik
 VDIiwieCI6Imw4dEZyaHgtMzR0VjNoUklDUkRZOXpDa0RscEJoRjQyVVFVZldWQVdCR
 nMiLCJ5IjoiOVZFNGpmX09rX282NHpiVFRsY3VOSmFqSG10NnY5VERWclUwQ2R2R1JE
 QSIsImNydiI6IlAtMjU2In19.eyJqdGkiOiJlMWozVl9iS2ljOC1MQUVCIiwiaHRtIj
 oiR0VUIiwiaHR1IjoiaHR0cHM6Ly9yZXNvdXJjZS5leGFtcGxlLm9yZy9wcm90ZWN0Z
 WRyZXNvdXJjZSIsImlhdCI6MTU2MjI2MjYxOCwiYXRoIjoiZlVIeU8ycjJaM0RaNTNF
 c05yV0JiMHhXWG9hTnk1OUlpS0NBcWtzbVFFbyJ9.2oW9RP35yRqzhrtNP86L-Ey71E
 OptxRimPPToA1plemAgR6pxHF8y6-yqyVnmcw6Fy1dqd-jfxSYoMxhAJpLjA
</artwork>
</figure>
<figure anchor="dpop-proof-pr"><name>Decoded Content of the <tt>DPoP</tt> Proof JWT in <xref target="protected-resource-request"></xref> </name>
<artwork>{
  &quot;typ&quot;:&quot;dpop+jwt&quot;,
  &quot;alg&quot;:&quot;ES256&quot;,
  &quot;jwk&quot;: {
    &quot;kty&quot;:&quot;EC&quot;,
    &quot;x&quot;:&quot;l8tFrhx-34tV3hRICRDY9zCkDlpBhF42UQUfWVAWBFs&quot;,
    &quot;y&quot;:&quot;9VE4jf_Ok_o64zbTTlcuNJajHmt6v9TDVrU0CdvGRDA&quot;,
    &quot;crv&quot;:&quot;P-256&quot;
  }
}
.
{
  &quot;jti&quot;:&quot;e1j3V_bKic8-LAEB&quot;,
  &quot;htm&quot;:&quot;GET&quot;,
  &quot;htu&quot;:&quot;https://resource.example.org/protectedresource&quot;,
  &quot;iat&quot;:1562262618,
  &quot;ath&quot;:&quot;fUHyO2r2Z3DZ53EsNrWBb0xWXoaNy59IiKCAqksmQEo&quot;
}
</artwork>
</figure>
<t>Upon receipt of a request to a protected resource within
the protection space requiring DPoP authentication, if the request does
not include valid credentials or does not contain an access
token sufficient for access, the server
can respond with a challenge to the client to provide DPoP authentication information.
Such a challenge is made using the 401 (Unauthorized) response status code
(<xref target="RFC7235"></xref>, Section 3.1) and the <tt>WWW-Authenticate</tt> header field
(<xref target="RFC7235"></xref>, Section 4.1). The server MAY include the
<tt>WWW-Authenticate</tt> header in response to other conditions as well.</t>
<t>In such challenges:</t>

<ul>
<li>The scheme name is <tt>DPoP</tt>.</li>
<li>The authentication parameter <tt>realm</tt> MAY be included to indicate the
scope of protection in the manner described in <xref target="RFC7235"></xref>, Section 2.2.</li>
<li>A <tt>scope</tt> authentication parameter MAY be included as defined in
<xref target="RFC6750"></xref>, Section 3.</li>
<li>An <tt>error</tt> parameter (<xref target="RFC6750"></xref>, Section 3) SHOULD be included
to indicate the reason why the request was declined,
if the request included an access token but failed authentication.
The error parameter values described in Section 3.1 of <xref target="RFC6750"></xref> are suitable
as are any appropriate values defined by extension. The value <tt>use_dpop_nonce</tt> can be
used as described in <xref target="RSNonce"></xref> to signal that a nonce is needed in the DPoP proof of
subsequent request(s). And <tt>invalid_dpop_proof</tt> is used to indicate that the DPoP proof
itself was deemed invalid based on the criteria of <xref target="checking"></xref>.</li>
<li>An <tt>error_description</tt> parameter (<xref target="RFC6750"></xref>, Section 3) MAY be included
along with the <tt>error</tt> parameter to provide developers a human-readable
explanation that is not meant to be displayed to end-users.</li>
<li>An <tt>algs</tt> parameter SHOULD be included to signal to the client the
JWS algorithms that are acceptable for the DPoP proof JWT.
The value of the parameter is a space-delimited list of JWS <tt>alg</tt> (Algorithm)
header values (<xref target="RFC7515"></xref>, Section 4.1.1).</li>
<li>Additional authentication parameters MAY be used and unknown parameters
MUST be ignored by recipients.</li>
</ul>
<t>For example, in response to a protected resource request without
authentication:</t>
<figure><name>HTTP 401 Response to a Protected Resource Request without Authentication
</name>
<artwork> HTTP/1.1 401 Unauthorized
 WWW-Authenticate: DPoP algs=&quot;ES256 PS256&quot;
</artwork>
</figure>
<t>And in response to a protected resource request that was rejected
because the confirmation of the DPoP binding in the access token failed:</t>
<figure><name>HTTP 401 Response to a Protected Resource Request with an Invalid Token
</name>
<artwork> HTTP/1.1 401 Unauthorized
 WWW-Authenticate: DPoP error=&quot;invalid_token&quot;,
   error_description=&quot;Invalid DPoP key binding&quot;, algs=&quot;ES256&quot;
</artwork>
</figure>
</section>

<section anchor="compatibility-with-the-bearer-authentication-scheme"><name>Compatibility with the Bearer Authentication Scheme</name>
<t>Protected resources simultaneously supporting both the <tt>DPoP</tt> and <tt>Bearer</tt>
schemes need to update how evaluation of bearer tokens is performed to prevent
downgraded usage of a DPoP-bound access tokens.
Specifically, such a protected resource MUST reject an access
token received as a bearer token per <xref target="RFC6750"></xref>, if that token is
determined to be DPoP-bound.</t>
<t>Section 4.1 of <xref target="RFC7235"></xref> allows a protected resource to indicate support for
multiple authentication schemes (i.e., <tt>Bearer</tt> and <tt>DPoP</tt>) with the
<tt>WWW-Authenticate</tt> header field of a 401 (Unauthorized) response.</t>
<t>A protected resource that supports only <xref target="RFC6750"></xref> and is unaware of DPoP
would most presumably accept a DPoP-bound access token as a bearer token
(JWT <xref target="RFC7519"></xref> says to ignore unrecognized claims, Introspection <xref target="RFC7662"></xref>
says that other parameters might be present while placing no functional
requirements on their presence, and <xref target="RFC6750"></xref> is effectively silent on
the content of the access token as it relates to validity).  As such, a
client MAY send a DPoP-bound access token using the <tt>Bearer</tt> scheme upon
receipt of a <tt>WWW-Authenticate: Bearer</tt> challenge from a protected resource
(or if it has prior such knowledge about the capabilities of the protected
resource). The effect of this likely simplifies the logistics of phased
upgrades to protected resources in their support DPoP or even
prolonged deployments of protected resources with mixed token type support.</t>
</section>
</section>

<section anchor="ASNonce"><name>Authorization Server-Provided Nonce</name>
<t>Including a nonce value contributed by the authorization server in the DPoP proof
MAY be used by authorization servers to limit the lifetime of DPoP proofs.
The server is in control of when to require the use of a new nonce value
in subsequent DPoP proofs.</t>
<t>Without employing such a mechanism, a malicious party controlling the client
(including potentially the end user)
can create DPoP proofs for use arbitrarily far in the future.
This section specifies how server-provided nonces are used with DPoP.</t>
<t>An authorization server MAY supply a nonce value to be included by the client
in DPoP proofs sent. In this case, the authorization server responds to requests not including a nonce
with an HTTP <tt>400</tt> (Bad Request) error response per Section 5.2 of <xref target="RFC6749"></xref> using <tt>use_dpop_nonce</tt> as the
error code value. The authorization server includes a <tt>DPoP-Nonce</tt> HTTP header in the response supplying
a nonce value to be used when sending the subsequent request.
This same error code is used when supplying a new nonce value when there was a nonce mismatch.
The client will typically retry the request with the new nonce value supplied
upon receiving a <tt>use_dpop_nonce</tt> error with an accompanying nonce value.</t>
<t>For example, in response to a token request without a nonce when the authorization server requires one,
the authorization server can respond with a <tt>DPoP-Nonce</tt> value such as the following to provide
a nonce value to include in the DPoP proof:</t>
<figure><name>HTTP 400 Response to a Token Request without a Nonce
</name>
<artwork> HTTP/1.1 400 Bad Request
 DPoP-Nonce: eyJ7S_zG.eyJH0-Z.HX4w-7v

 {
  &quot;error&quot;: &quot;use_dpop_nonce&quot;
  &quot;error_description&quot;:
    &quot;Authorization server requires nonce in DPoP proof&quot;
 }
</artwork>
</figure>
<t>Other HTTP headers and JSON fields MAY also be included in the error response,
but there MUST NOT be more than one <tt>DPoP-Nonce</tt> header.</t>
<t>Upon receiving the nonce, the client is expected to retry its token request
using a DPoP proof including the supplied nonce value in the <tt>nonce</tt> claim
of the DPoP proof.
An example unencoded JWT Payload of such a DPoP proof including a nonce is:</t>
<figure><name>DPoP Proof Payload Including a Nonce Value
</name>
<artwork> {
  &quot;jti&quot;: &quot;-BwC3ESc6acc2lTc&quot;,
  &quot;htm&quot;: &quot;POST&quot;,
  &quot;htu&quot;: &quot;https://server.example.com/token&quot;,
  &quot;iat&quot;: 1562262616,
  &quot;nonce&quot;: &quot;eyJ7S_zG.eyJH0-Z.HX4w-7v&quot;
 }
</artwork>
</figure>
<t>The nonce syntax in ABNF as used by <xref target="RFC6749"></xref>
(which is the same as the <tt>scope-token</tt> syntax) is:</t>
<figure><name>Nonce ABNF
</name>
<artwork>  nonce = 1*NQCHAR
</artwork>
</figure>
<t>The nonce is opaque to the client.</t>
<t>If the <tt>nonce</tt> claim in the DPoP proof of a token request
does not exactly match a nonce recently supplied by the authorization server to the client,
the authorization server MUST reject the request.
The rejection response MAY include a <tt>DPoP-Nonce</tt> HTTP header
providing a new nonce value to use for subsequent requests.</t>
<t>The intent is that both clients and servers need to keep only one nonce value for one another.
That said, transient circumstances may arise in which the server's and client's
stored nonce values differ.
However, this situation is self-correcting;
with any rejection message,
the server can send the client the nonce value that the server wants it to use
and the client can store that nonce value and retry the request with it.
Even if the client and/or server discard their stored nonce values,
that situation is also self-correcting because new nonce values can be communicated
when responding to or retrying failed requests.</t>

<section anchor="NewNonce"><name>Providing a New Nonce Value</name>
<t>It is up to the authorization server when to supply a new nonce value
for the client to use.
The client is expected to use the existing supplied nonce in DPoP proofs
until the server supplies a new nonce value.</t>
<t>The authorization server MAY supply the new nonce in the same way that
the initial one was supplied:
by using a <tt>DPoP-Nonce</tt> HTTP header in the response.
Of course, each time this happens it requires an extra protocol round trip.</t>
<t>A more efficient manner of supplying a new nonce value is also defined --
by including a <tt>DPoP-Nonce</tt> HTTP header
in the HTTP <tt>200</tt> (OK) response from the previous request.
The client MUST use the new nonce value supplied for the next token request,
and for all subsequent token requests until the authorization server
supplies a new nonce.</t>
<t>Responses that include the <tt>DPoP-Nonce</tt> HTTP header should be uncacheable
(e.g., using <tt>Cache-Control: no-store</tt> in response to a <tt>GET</tt> request) to
prevent the response being used to serve a subsequent request and a stale
nonce value being used as a result.</t>
<t>An example 200 OK response providing a new nonce value is:</t>
<figure><name>HTTP 200 Response Providing the Next Nonce Value
</name>
<artwork> HTTP/1.1 200 OK
 Cache-Control: no-store
 DPoP-Nonce: eyJ7S_zG.eyJbYu3.xQmBj-1
</artwork>
</figure>
</section>
</section>

<section anchor="RSNonce"><name>Resource Server-Provided Nonce</name>
<t>Resource servers can also choose to provide a nonce value to be included
in DPoP proofs sent to them.
They provide the nonce using the <tt>DPoP-Nonce</tt> header in same way that authorization servers do.
The error signaling is performed as described in <xref target="http-auth-scheme"></xref>.
Resource servers use an HTTP <tt>401</tt> (Unauthorized) error code
with an accompanying <tt>WWW-Authenticate: DPoP</tt> value
and <tt>DPoP-Nonce</tt> value to accomplish this.</t>
<t>For example, in response to a resource request without a nonce when the resource server requires one,
the resource server can respond with a <tt>DPoP-Nonce</tt> value such as the following to provide
a nonce value to include in the DPoP proof:</t>
<figure><name>HTTP 401 Response to a Resource Request without a Nonce
</name>
<artwork> HTTP/1.1 401 Unauthorized
 WWW-Authenticate: DPoP error=&quot;use_dpop_nonce&quot;,
   error_description=&quot;Resource server requires nonce in DPoP proof&quot;
 DPoP-Nonce: eyJ7S_zG.eyJH0-Z.HX4w-7v
</artwork>
</figure>
<t>Note that the nonces provided by an authorization server and a resource server are different
and should not be confused with one another,
since nonces will be only accepted by the server that issued them.
Likewise, should a client use multiple authorization servers and/or resource servers,
a nonce issued by any of them should be used only at the issuing server.
Developers should also take care to not confuse DPoP nonces with the
OpenID Connect <xref target="OpenID.Core"></xref> ID Token nonce.</t>
</section>

<section anchor="dpop_jkt"><name>Authorization Code Binding to DPoP Key</name>
<t>Binding the authorization code issued to the client's proof-of-possession key
can enable end-to-end binding of the entire authorization flow.
This specification defines the <tt>dpop_jkt</tt> authorization request parameter for this purpose.
The value of the <tt>dpop_jkt</tt> authorization request parameter is the
JSON Web Key (JWK) Thumbprint <xref target="RFC7638"></xref> of the proof-of-possession public key
using the SHA-256 hash function -
the same value as used for the <tt>jkt</tt> confirmation method defined in <xref target="jwk-thumb-jwt"></xref>.</t>
<t>When a token request is received, the authorization server computes the
JWK thumbprint of the proof-of-possession public key in the DPoP proof
and verifies that it matches the <tt>dpop_jkt</tt> parameter value in the authorization request.
If they do not match, it MUST reject the request.</t>
<t>An example authorization request using the <tt>dpop_jkt</tt> authorization request parameter is:</t>
<figure><name>Authorization Request using the <tt>dpop_jkt</tt> Parameter
</name>
<artwork> GET /authorize?response_type=code&amp;client_id=s6BhdRkqt3&amp;state=xyz
     &amp;redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
     &amp;code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
     &amp;code_challenge_method=S256
     &amp;dpop_jkt=NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs HTTP/1.1
 Host: server.example.com
</artwork>
</figure>
<t>Use of the <tt>dpop_jkt</tt> authorization request parameter is OPTIONAL.
Note that the <tt>dpop_jkt</tt> authorization request parameter MAY also be used
in combination with PKCE <xref target="RFC7636"></xref>.</t>

<section anchor="dpop-with-pushed-authorization-requests"><name>DPoP with Pushed Authorization Requests</name>
<t>When Pushed Authorization Requests  (PAR, <xref target="RFC9126"></xref>) are used in conjunction with DPoP, there are two ways in which the DPoP key can be communicated in the PAR request:</t>

<ul>
<li>The <tt>dpop_jkt</tt> parameter can be used as described above to bind the issued
authorization code to a specific key. In this case, <tt>dpop_jkt</tt> MUST be included alongside other authorization request parameters in the POST body of the PAR request.</li>
<li>Alternatively, the <tt>DPoP</tt> header can be added to the PAR request. In this
case, the authorization server MUST check the provided DPoP proof JWT as
defined in <xref target="checking"></xref>. It MUST further behave as if the contained public key's
thumbprint was provided using <tt>dpop_jkt</tt>, i.e., reject the subsequent token
request unless a DPoP proof for the same key is provided. This can help to
simplify the implementation of the client, as it can &quot;blindly&quot; attach the
<tt>DPoP</tt> header to all requests to the authorization server regardless of the
type of request. Additionally, it provides a stronger binding, as the <tt>DPoP</tt>
header contains a proof of possession of the private key.</li>
</ul>
<t>Both mechanisms MUST be supported by an authorization server that supports PAR and DPoP. If both mechanisms are used at the same time, the authorization server MUST reject the request if the JWK Thumbprint in <tt>dpop_jkt</tt> does not match the public key in the <tt>DPoP</tt> header.</t>
</section>
</section>

<section anchor="Security"><name>Security Considerations</name>
<t>In DPoP, the prevention of token replay at a different endpoint (see
<xref target="objective"></xref>) is achieved through the
binding of the DPoP proof to a certain URI and HTTP method plus the optional server-provided nonce. DPoP, however,
has a somewhat different nature of protection than TLS-based
methods such as OAuth Mutual TLS <xref target="RFC8705"></xref> or OAuth Token
Binding <xref target="I-D.ietf-oauth-token-binding"></xref> (see also <xref target="Token_Replay"></xref> and <xref target="request_integrity"></xref>).
TLS-based mechanisms can leverage a tight integration
between the TLS layer and the application layer to achieve a very high
level of message integrity with respect to the transport layer to which the token is bound
and replay protection in general.</t>

<section anchor="Token_Replay"><name>DPoP Proof Replay</name>
<t>If an adversary is able to get hold of a DPoP proof JWT, the adversary
could replay that token at the same endpoint (the HTTP endpoint
and method are enforced via the respective claims in the JWTs). To
prevent this, servers MUST only accept DPoP proofs for a limited time
window after their <tt>iat</tt> time, preferably only for a relatively brief period (on the order of seconds or minutes).</t>
<t>Servers SHOULD store, in the context of the request URI, the <tt>jti</tt> value of
each DPoP proof for the time window in which the respective DPoP proof JWT
would be accepted and decline HTTP requests to the same URI
for which the <tt>jti</tt> value has been seen before. In order to guard against
memory exhaustion attacks a server SHOULD reject DPoP proof JWTs with unnecessarily
large <tt>jti</tt> values or store only a hash thereof.</t>
<t>Note: To accommodate for clock offsets, the server MAY accept DPoP
proofs that carry an <tt>iat</tt> time in the reasonably near future (on the order of seconds or minutes).
Because clock skews between servers and clients may be large,
servers may choose to limit DPoP proof lifetimes by using
server-provided nonce values containing the time at the server
rather than comparing the client-supplied <tt>iat</tt> time to the time at the server,
yielding intended results even in the face of arbitrarily large clock skews.</t>
<t>Server-provided nonces are an effective means of preventing DPoP proof replay.</t>
</section>

<section anchor="Pre-Generation"><name>DPoP Proof Pre-Generation</name>
<t>An attacker in control of the client can pre-generate DPoP proofs for use
arbitrarily far into the future by choosing the <tt>iat</tt> value in the
DPoP proof to be signed by the proof-of-possession key.
Note that one such attacker is the person who is the legitimate user of the client.
The user may pre-generate DPoP proofs to exfiltrate
from the machine possessing the proof-of-possession key
upon which they were generated
and copy them to another machine that does not possess the key.
For instance, a bank employee might pre-generate DPoP proofs
on a bank computer and then copy them to another machine
for use in the future, thereby bypassing bank audit controls.
When DPoP proofs can be pre-generated and exfiltrated,
all that is actually being proved in DPoP protocol interactions
is possession of a DPoP proof -- not of the proof-of-possession key.</t>
<t>Use of server-provided nonce values that are not predictable by attackers can prevent this attack.
By providing new nonce values at times of its choosing,
the server can limit the lifetime of DPoP proofs,
preventing pre-generated DPoP proofs from being used.
When server-provided nonces are used, possession
of the proof-of-possession key is being demonstrated --
not just possession of a DPoP proof.</t>
<t>The <tt>ath</tt> claim limits the use of pre-generated DPoP proofs to the lifetime
of the access token. Deployments that do not utilize the nonce mechanism
SHOULD NOT issue long-lived DPoP constrained access tokens,
preferring instead to use short-lived access tokens and refresh tokens.
Whilst an attacker could pre-generate DPoP proofs to use the refresh token
to obtain a new access token, they would be unable to realistically
pre-generate DPoP proofs to use a newly issued access token.</t>
</section>

<section anchor="Nonce-Downgrade"><name>DPoP Nonce Downgrade</name>
<t>A server MUST NOT accept any DPoP proofs without the <tt>nonce</tt> claim when a DPoP nonce has been provided to the client.</t>
</section>

<section anchor="untrusted-code-in-the-client-context"><name>Untrusted Code in the Client Context</name>
<t>If an adversary is able to run code in the client's execution context,
the security of DPoP is no longer guaranteed. Common issues in web
applications leading to the execution of untrusted code are cross-site
scripting and remote code inclusion attacks.</t>
<t>If the private key used for DPoP is stored in such a way that it
cannot be exported, e.g., in a hardware or software security module,
the adversary cannot exfiltrate the key and use it to create arbitrary
DPoP proofs. The adversary can, however, create new DPoP proofs as
long as the client is online, and use these proofs (together with the
respective tokens) either on the victim's device or on a device under
the attacker's control to send arbitrary requests that will be
accepted by servers.</t>
<t>To send requests even when the client is offline, an adversary can try
to pre-compute DPoP proofs using timestamps in the future and
exfiltrate these together with the access or refresh token.</t>
<t>An adversary might further try to associate tokens issued from the
token endpoint with a key pair under the adversary's control. One way
to achieve this is to modify existing code, e.g., by replacing
cryptographic APIs. Another way is to launch a new authorization grant
between the client and the authorization server in an iframe. This
grant needs to be &quot;silent&quot;, i.e., not require interaction with the
user. With code running in the client's origin, the adversary has
access to the resulting authorization code and can use it to associate
their own DPoP keys with the tokens returned from the token endpoint.
The adversary is then able to use the resulting tokens on their own
device even if the client is offline.</t>
<t>Therefore, protecting clients against the execution of untrusted code
is extremely important even if DPoP is used. Besides secure coding
practices, Content Security Policy <xref target="W3C.CSP"></xref> can be used as a second
layer of defense against cross-site scripting.</t>
</section>

<section anchor="signed-jwt-swapping"><name>Signed JWT Swapping</name>
<t>Servers accepting signed DPoP proof JWTs MUST check the <tt>typ</tt> field in the
headers of the JWTs to ensure that adversaries cannot use JWTs created
for other purposes.</t>
</section>

<section anchor="signature-algorithms"><name>Signature Algorithms</name>
<t>Implementers MUST ensure that only asymmetric digital signature algorithms that
are deemed secure can be used for signing DPoP proofs. In particular,
the algorithm <tt>none</tt> MUST NOT be allowed.</t>
</section>

<section anchor="request_integrity"><name>Message Integrity</name>
<t>DPoP does not ensure the integrity of the payload or headers of
requests. The DPoP proof only contains claims for the HTTP URI and
method, but not, for example, the message body or general request
headers.</t>
<t>This is an intentional design decision intended to keep DPoP simple to use, but
as described, makes DPoP potentially susceptible to replay attacks
where an attacker is able to modify message contents and headers. In
many setups, the message integrity and confidentiality provided by TLS
is sufficient to provide a good level of protection.</t>
<t>Implementers that have stronger requirements on the integrity of
messages are encouraged to either use TLS-based mechanisms or signed
requests. TLS-based mechanisms are in particular OAuth Mutual TLS
<xref target="RFC8705"></xref> and OAuth Token Binding
<xref target="I-D.ietf-oauth-token-binding"></xref>.</t>
<t>Note: While signatures covering other parts of requests are out of the scope of
this specification, additional information to be signed can be
added into DPoP proofs.</t>
</section>

<section anchor="access-token-and-public-key-binding"><name>Access Token and Public Key Binding</name>
<t>The binding of the access token to the DPoP public key, which is
specified in <xref target="Confirmation"></xref>, uses a cryptographic hash of the JWK
representation of the public key. It relies
on the hash function having sufficient second-preimage resistance so
as to make it computationally infeasible to find or create another
key that produces to the same hash output value. The SHA-256
hash function was used because it meets the aforementioned
requirement while being widely available.  If, in the future,
JWK Thumbprints need to be computed using hash function(s)
other than SHA-256, it is suggested that an additional related JWT
confirmation method member be defined for that purpose,
registered in the respective IANA registry, and used in place of the
<tt>jkt</tt> confirmation method defined herein.</t>
<t>Similarly, the binding of the DPoP proof to the access token uses a
hash of that access token as the value of the <tt>ath</tt> claim
in the DPoP proof (see <xref target="DPoP-Proof-Syntax"></xref>). This relies on the value
of the hash being sufficiently unique so as to reliably identify the
access token. The collision resistance of SHA-256 meets that requirement.
If, in the future, access token digests need be computed using hash function(s)
other than SHA-256, it is suggested that an additional related JWT
claim be defined for that purpose, registered in the respective IANA registry,
 and used in place of the <tt>ath</tt> claim defined herein.</t>
</section>

<section anchor="authorization-code-and-public-key-binding"><name>Authorization Code and Public Key Binding</name>
<t>Cryptographic binding of the authorization code to the DPoP public key,
is specified in <xref target="dpop_jkt"></xref>.
This binding prevents attacks in which the attacker captures the authorization code
and creates a DPoP proof using a proof-of-possession key
other than that held by the client
and redeems the authorization code using that DPoP proof.
By ensuring end-to-end that only the client's DPoP key can be used,
this prevents captured authorization codes from being exfiltrated and used
at locations other than the one to which the authorization code was issued.</t>
<t>Authorization codes can, for instance, be harvested by attackers
from places that the HTTP messages containing them are logged.
Even when efforts are made to make authorization codes one-time-use,
in practice, there is often a time window during which attackers can replay them.
For instance, when authorization servers are implemented as scalable replicated services,
some replicas may temporarily not yet have the information needed to prevent replay.
DPoP binding of the authorization code solves these problems.</t>
<t>If an authorization server does not (or cannot) strictly enforce the single-use limitation for authorization codes
and an attacker can access the authorization code (and if PKCE is used, the <tt>code_verifier</tt>),
the attacker can create a forged token request, binding the resulting token to an attacker-controlled key.
For example, using cross-site scripting, attackers might obtain access to the authorization code and PKCE parameters.
Use of the <tt>dpop_jkt</tt> parameter prevents this attack.</t>
<t>The binding of the authorization code to the DPoP public key
uses a JWK Thumbprint of the public key, just as the access token binding does.
The same JWK Thumbprint considerations apply.</t>
</section>
</section>

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

<section anchor="oauth-access-token-type-registration"><name>OAuth Access Token Type Registration</name>
<t>This specification requests registration of the following access token
type in the &quot;OAuth Access Token Types&quot; registry <xref target="IANA.OAuth.Params"></xref>
established by <xref target="RFC6749"></xref>.</t>

<ul>
<li>Type name: <tt>DPoP</tt></li>
<li>Additional Token Endpoint Response Parameters: (none)</li>
<li>HTTP Authentication Scheme(s): <tt>DPoP</tt></li>
<li>Change controller: IESG</li>
<li>Specification document(s): [[ this specification ]]</li>
</ul>
</section>

<section anchor="oauth-extensions-error-registration"><name>OAuth Extensions Error Registration</name>
<t>This specification requests registration of the following error values
in the &quot;OAuth Extensions Error&quot; registry <xref target="IANA.OAuth.Params"></xref>
established by <xref target="RFC6749"></xref>.</t>
<t>Invalid DPoP proof:</t>

<ul>
<li>Name: <tt>invalid_dpop_proof</tt></li>
<li>Usage Location: token error response, resource error response</li>
<li>Protocol Extension: Demonstrating Proof of Possession (DPoP)</li>
<li>Change controller: IETF</li>
<li>Specification document(s): [[ this specification ]]</li>
</ul>
<t>Use DPoP nonce:</t>

<ul>
<li>Name: <tt>use_dpop_nonce</tt></li>
<li>Usage Location: token error response, resource error response</li>
<li>Protocol Extension: Demonstrating Proof of Possession (DPoP)</li>
<li>Change controller: IETF</li>
<li>Specification document(s): [[ this specification ]]</li>
</ul>
</section>

<section anchor="oauth-parameters-registration"><name>OAuth Parameters Registration</name>
<t>This specification requests registration of the following
authorization request parameter
in the &quot;OAuth Parameters&quot; registry <xref target="IANA.OAuth.Params"></xref>
established by <xref target="RFC6749"></xref>.</t>

<ul>
<li>Name: <tt>dpop_jkt</tt></li>
<li>Parameter Usage Location: authorization request</li>
<li>Change Controller: IESG</li>
<li>Reference: [[ {#dpop_jkt} of this specification ]]</li>
</ul>
</section>

<section anchor="http-authentication-scheme-registration"><name>HTTP Authentication Scheme Registration</name>
<t>This specification requests registration of the following scheme in the
&quot;Hypertext Transfer Protocol (HTTP) Authentication Scheme Registry&quot; <xref target="RFC7235"></xref><xref target="IANA.HTTP.AuthSchemes"></xref>:</t>

<ul>
<li>Authentication Scheme Name: <tt>DPoP</tt></li>
<li>Reference: [[ <xref target="http-auth-scheme"></xref> of this specification ]]</li>
</ul>
</section>

<section anchor="media-type-registration"><name>Media Type Registration</name>
<t>This section registers the <tt>application/dpop+jwt</tt> media type <xref target="RFC2046"></xref>
in the IANA &quot;Media Types&quot; registry <xref target="IANA.MediaTypes"></xref> in the manner described in <xref target="RFC6838"></xref>,
which is used to indicate that the content is a DPoP JWT.</t>

<ul>
<li>Type name: application</li>
<li>Subtype name: dpop+jwt</li>
<li>Required parameters: n/a</li>
<li>Optional parameters: n/a</li>
<li>Encoding considerations: binary; A DPoP JWT is a JWT; JWT values are encoded as a series of base64url-encoded values (some of which may be the empty string) separated by period ('.') characters.</li>
<li>Security considerations: See <xref target="Security"></xref> of [[ this specification ]]</li>
<li>Interoperability considerations: n/a</li>
<li>Published specification: [[ this specification ]]</li>
<li>Applications that use this media type: Applications using [[ this specification ]] for application-level proof of possession</li>
<li>Fragment identifier considerations: n/a</li>
<li><t>Additional information:</t>

<ul>
<li>File extension(s): n/a</li>
<li>Macintosh file type code(s): n/a</li>
</ul></li>
<li>Person &amp; email address to contact for further information: Michael B. Jones, mbj@microsoft.com</li>
<li>Intended usage: COMMON</li>
<li>Restrictions on usage: none</li>
<li>Author: Michael B. Jones, mbj@microsoft.com</li>
<li>Change controller: IETF</li>
<li>Provisional registration? No</li>
</ul>
</section>

<section anchor="jwt-confirmation-methods-registration"><name>JWT Confirmation Methods Registration</name>
<t>This specification requests registration of the following value
in the IANA &quot;JWT Confirmation Methods&quot; registry <xref target="IANA.JWT"></xref>
for JWT <tt>cnf</tt> member values established by <xref target="RFC7800"></xref>.</t>

<ul>
<li>Confirmation Method Value:  <tt>jkt</tt></li>
<li>Confirmation Method Description: JWK SHA-256 Thumbprint</li>
<li>Change Controller:  IESG</li>
<li>Specification Document(s):  [[ <xref target="Confirmation"></xref> of this specification ]]</li>
</ul>
</section>

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

<ul>
<li>Claim Name: <tt>htm</tt></li>
<li>Claim Description: The HTTP method of the request</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s):  [[ <xref target="DPoP-Proof-Syntax"></xref> of this specification ]]</li>
</ul>
<t>HTTP URI:</t>

<ul>
<li>Claim Name: <tt>htu</tt></li>
<li>Claim Description: The HTTP URI of the request (without query and fragment parts)</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s):  [[ <xref target="DPoP-Proof-Syntax"></xref> of this specification ]]</li>
</ul>
<t>Access token hash:</t>

<ul>
<li>Claim Name: <tt>ath</tt></li>
<li>Claim Description: The base64url encoded SHA-256 hash of the ASCII encoding of the associated access token's value</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s):  [[ <xref target="DPoP-Proof-Syntax"></xref> of this specification ]]</li>
</ul>
</section>

<section anchor="http-message-header-field-names-registration"><name>HTTP Message Header Field Names Registration</name>
<t>This document specifies the following HTTP header fields,
registration of which is requested in the &quot;Permanent Message Header
Field Names&quot; registry <xref target="IANA.Headers"></xref> defined in <xref target="RFC3864"></xref>.</t>

<ul>
<li>Header Field Name: <tt>DPoP</tt></li>
<li>Applicable protocol: HTTP</li>
<li>Status: standard</li>
<li>Author/change Controller: IETF</li>
<li>Specification Document(s): [[ this specification ]]</li>
</ul>
</section>

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

<ul>
<li>Metadata Name:  <tt>dpop_signing_alg_values_supported</tt></li>
<li>Metadata Description:  JSON array containing a list of the JWS algorithms supported for DPoP proof JWTs</li>
<li>Change Controller:  IESG</li>
<li>Specification Document(s):  [[ <xref target="as-meta"></xref> of this specification ]]</li>
</ul>
</section>

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

<ul>
<li>Metadata Name:  <tt>dpop_bound_access_tokens</tt></li>
<li>Metadata Description:  Boolean value specifying whether the client always uses DPoP for token requests</li>
<li>Change Controller:  IESG</li>
<li>Specification Document(s):  [[ <xref target="client-meta"></xref> of this specification ]]</li>
</ul>
</section>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3986.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.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.7231.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7517.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7518.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7638.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7800.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
</references>
<references><name>Informative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-security-topics.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-token-binding.xml"/>
<reference anchor="IANA.HTTP.AuthSchemes" target="https://www.iana.org/assignments/http-authschemes">
  <front>
    <title>Hypertext Transfer Protocol (HTTP) Authentication Scheme Registry</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date></date>
  </front>
</reference>
<reference anchor="IANA.Headers" target="https://www.iana.org/assignments/message-headers">
  <front>
    <title>Message Headers</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date></date>
  </front>
</reference>
<reference anchor="IANA.JWT" target="http://www.iana.org/assignments/jwt">
  <front>
    <title>JSON Web Token Claims</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date></date>
  </front>
</reference>
<reference anchor="IANA.MediaTypes" target="https://www.iana.org/assignments/media-types">
  <front>
    <title>Media Types</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date></date>
  </front>
</reference>
<reference anchor="IANA.OAuth.Params" target="https://www.iana.org/assignments/oauth-parameters">
  <front>
    <title>OAuth Parameters</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date></date>
  </front>
</reference>
<reference anchor="OpenID.Core" target="http://openid.net/specs/openid-connect-core-1_0.html">
  <front>
    <title>OpenID Connect Core 1.0</title>
    <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
      <organization></organization>
    </author>
    <author fullname="John Bradley" initials="J." surname="Bradley">
      <organization></organization>
    </author>
    <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
      <organization></organization>
    </author>
    <author fullname="Breno de Medeiros" initials="B.d." surname="Medeiros">
      <organization></organization>
    </author>
    <author fullname="Chuck Mortimore" initials="C." surname="Mortimore">
      <organization></organization>
    </author>
    <date year="2014" month="November"></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2046.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3864.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4122.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.6838.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7230.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7235.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7519.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7523.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7591.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.7662.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8414.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8705.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8707.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9126.xml"/>
<reference anchor="W3C.CSP" target="https://www.w3.org/TR/2018/WD-CSP3-20181015/">
  <front>
    <title>Content Security Policy Level 3</title>
    <author fullname="Mike West" initials="M." surname="West">
      <organization></organization>
    </author>
    <date year="2018" month="October" day="15"></date>
  </front>
  <format type="HTML" target="https://www.w3.org/TR/2018/WD-CSP3-20181015/"></format>
  <seriesInfo name="World Wide Web Consortium Working Draft" value="WD-CSP3-20181015"></seriesInfo>
</reference>
<reference anchor="W3C.WebCryptoAPI" target="https://www.w3.org/TR/2017/REC-WebCryptoAPI-20170126">
  <front>
    <title>Web Cryptography API</title>
    <author fullname="Mark Watson" initials="M." surname="Watson">
      <organization></organization>
    </author>
    <date year="2017" month="January" day="26"></date>
  </front>
  <format type="HTML" target="https://www.w3.org/TR/2017/REC-WebCryptoAPI-20170126"></format>
  <seriesInfo name="World Wide Web Consortium Recommendation" value="REC-WebCryptoAPI-20170126"></seriesInfo>
</reference>
</references>

<section anchor="Acknowledgements"><name>Acknowledgements</name>
<t>We would like to thank
Annabelle Backman,
Dominick Baier,
Andrii Deinega,
William Denniss,
Vladimir Dzhuvinov,
Mike Engan,
Nikos Fotiou,
Mark Haine,
Dick Hardt,
Joseph Heenan,
Bjorn Hjelm,
Jared Jennings,
Benjamin Kaduk,
Pieter Kasselman,
Steinar Noem,
Neil Madden,
Rohan Mahy,
Karsten Meyer zu Selhausen,
Nicolas Mora,
Rob Otto,
Aaron Parecki,
Michael Peck,
Paul Querna,
Justin Richer,
Filip Skokan,
Dmitry Telegin,
Dave Tonge,
Jim Willeke,
Philippe De Ryck,
and others (please let us know, if you've been mistakenly omitted)
for their valuable input, feedback and general support of this work.</t>
<t>This document originated from discussions at the 4th OAuth Security
Workshop in Stuttgart, Germany. We thank the organizers of this
workshop (Ralf Kusters, Guido Schmitz).</t>
</section>

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

<ul>
<li>Registered the <tt>application/dpop+jwt</tt> media type.</li>
<li>Editorial updates/clarifications based on review feedback.</li>
<li>Added &quot;(on the order of seconds or minutes)&quot; to somewhat qualify &quot;relatively brief period&quot; and &quot;reasonably near future&quot; and give a general idea of expected timeframe without being overly prescriptive.</li>
<li>Added a step to <xref target="checking"></xref> to reiterate that the jwk header cannot have a private key.</li>
</ul>
<t>-06</t>

<ul>
<li>Editorial updates and fixes</li>
<li>Changed name of client metadata parameter to <tt>dpop_bound_access_tokens</tt></li>
</ul>
<t>-05</t>

<ul>
<li>Added Authorization Code binding via the <tt>dpop_jkt</tt> parameter.</li>
<li>Described the authorization code reuse attack and how <tt>dpop_jkt</tt> mitigates it.</li>
<li>Enhanced description of DPoP proof expiration checking.</li>
<li>Described nonce storage requirements and how nonce mismatches and missing nonces are self-correcting.</li>
<li>Specified the use of the <tt>use_dpop_nonce</tt> error for missing and mismatched nonce values.</li>
<li>Specified that authorization servers use <tt>400 (Bad Request)</tt> errors to supply nonces and resource servers use <tt>401 (Unauthorized)</tt> errors to do so.</li>
<li>Added a bit more about <tt>ath</tt> and pre-generated proofs to the security considerations.</li>
<li>Mentioned confirming the DPoP binding of the access token in the list in <xref target="checking"></xref>.</li>
<li>Added the <tt>always_uses_dpop</tt> client registration metadata parameter.</li>
<li>Described the relationship between DPoP and Pushed Authorization Requests (PAR).</li>
<li>Updated references for drafts that are now RFCs.</li>
</ul>
<t>-04</t>

<ul>
<li>Added the option for a server-provided nonce in the DPoP proof.</li>
<li>Registered the <tt>invalid_dpop_proof</tt> and <tt>use_dpop_nonce</tt> error codes.</li>
<li>Removed fictitious uses of <tt>realm</tt> from the examples, as they added no value.</li>
<li>State that if the introspection response has a <tt>token_type</tt>, it has to be <tt>DPoP</tt>.</li>
<li>Mention that RFC7235 allows multiple authentication schemes in <tt>WWW-Authenticate</tt> with a 401.</li>
<li>Editorial fixes.</li>
</ul>
<t>-03</t>

<ul>
<li>Add an access token hash (<tt>ath</tt>) claim to the DPoP proof when used in conjunction with the presentation of an access token for protected resource access</li>
<li>add Untrusted Code in the Client Context section to security considerations</li>
<li>Editorial updates and fixes</li>
</ul>
<t>-02</t>

<ul>
<li>Lots of editorial updates and additions including expanding on the objectives,
 better defining the key confirmation representations, example updates and additions,
 better describing mixed bearer/dpop token type deployments, clarify RT binding only being
 done for public clients and why, more clearly allow for a bound RT but with bearer AT,
 explain/justify the choice of SHA-256 for key binding, and more</li>
<li>Require that a protected resource supporting bearer and DPoP at the same time
 must reject an access token received as bearer, if that token is DPoP-bound</li>
<li>Remove the case-insensitive qualification on the <tt>htm</tt> claim check</li>
<li>Relax the jti tracking requirements a bit and qualify it by URI</li>
</ul>
<t>-01</t>

<ul>
<li>Editorial updates</li>
<li>Attempt to more formally define the DPoP Authorization header scheme</li>
<li>Define the 401/WWW-Authenticate challenge</li>
<li>Added <tt>invalid_dpop_proof</tt> error code for DPoP errors in token request</li>
<li>Fixed up and added to the IANA section</li>
<li>Added <tt>dpop_signing_alg_values_supported</tt> authorization server metadata</li>
<li>Moved the Acknowledgements into an Appendix and added a bunch of names (best effort)</li>
</ul>
<t>-00 [[ Working Group Draft ]]</t>

<ul>
<li>Working group draft</li>
</ul>
<t>-04</t>

<ul>
<li>Update OAuth MTLS reference to RFC 8705</li>
<li>Use the newish RFC v3 XML and HTML format</li>
</ul>
<t>-03</t>

<ul>
<li>rework the text around uniqueness requirements on the jti claim in the DPoP proof JWT</li>
<li>make tokens a bit smaller by using <tt>htm</tt>, <tt>htu</tt>, and <tt>jkt</tt> rather than <tt>http_method</tt>, <tt>http_uri</tt>, and <tt>jkt#S256</tt> respectively</li>
<li>more explicit recommendation to use mTLS if that is available</li>
<li>added David Waite as co-author</li>
<li>editorial updates</li>
</ul>
<t>-02</t>

<ul>
<li>added normalization rules for URIs</li>
<li>removed distinction between proof and binding</li>
<li>&quot;jwk&quot; header again used instead of &quot;cnf&quot; claim in DPoP proof</li>
<li>renamed &quot;Bearer-DPoP&quot; token type to &quot;DPoP&quot;</li>
<li>removed ability for key rotation</li>
<li>added security considerations on request integrity</li>
<li>explicit advice on extending DPoP proofs to sign other parts of the HTTP messages</li>
<li>only use the jkt#S256 in ATs</li>
<li>iat instead of exp in DPoP proof JWTs</li>
<li>updated guidance on token_type evaluation</li>
</ul>
<t>-01</t>

<ul>
<li>fixed inconsistencies</li>
<li>moved binding and proof messages to headers instead of parameters</li>
<li>extracted and unified definition of DPoP JWTs</li>
<li>improved description</li>
</ul>
<t>-00</t>

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

</back>

</rfc>
