< draft-fett-oauth-dpop-01.txt   draft-fett-oauth-dpop-02.txt >
Web Authorization Protocol D. Fett Web Authorization Protocol D. Fett
Internet-Draft yes.com Internet-Draft yes.com
Intended status: Standards Track J. Bradley Intended status: Standards Track J. Bradley
Expires: October 4, 2019 Yubico Expires: January 9, 2020 Yubico
B. Campbell B. Campbell
Ping Identity Ping Identity
T. Lodderstedt T. Lodderstedt
yes.com yes.com
M. Jones M. Jones
Microsoft Microsoft
April 2, 2019 July 8, 2019
OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer
draft-fett-oauth-dpop-01 draft-fett-oauth-dpop-02
Abstract Abstract
This document describes a mechanism for sender-constraining OAuth 2.0 This document describes a mechanism for sender-constraining OAuth 2.0
tokens via a proof-of-possession mechanism on the application level. tokens via a proof-of-possession mechanism on the application level.
This mechanism allows to detect replay attacks with access and This mechanism allows for the detection of replay attacks with access
refresh tokens. and refresh tokens.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 4, 2019. This Internet-Draft will expire on January 9, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 17 skipping to change at page 2, line 17
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Conventions and Terminology . . . . . . . . . . . . . . . 3 1.1. Conventions and Terminology . . . . . . . . . . . . . . . 3
2. Main Objective . . . . . . . . . . . . . . . . . . . . . . . 3 2. Main Objective . . . . . . . . . . . . . . . . . . . . . . . 3
3. Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4. DPoP JWT Syntax . . . . . . . . . . . . . . . . . . . . . . . 5 4. DPoP Proof JWTs . . . . . . . . . . . . . . . . . . . . . . . 5
5. Token Request (Binding Tokens to a Public Key) . . . . . . . 6 4.1. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.2. Checking DPoP Proofs . . . . . . . . . . . . . . . . . . 6
5. Token Request (Binding Tokens to a Public Key) . . . . . . . 7
6. Resource Access (Proof of Possession for Access Tokens) . . . 8 6. Resource Access (Proof of Possession for Access Tokens) . . . 8
7. Refresh Token Usage (Proof of Possession for Refresh Tokens) 8 7. Public Key Confirmation . . . . . . . . . . . . . . . . . . . 8
8. Public Key Confirmation . . . . . . . . . . . . . . . . . . . 8 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 9
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 9 9. Security Considerations . . . . . . . . . . . . . . . . . . . 9
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 9.1. DPoP Proof Replay . . . . . . . . . . . . . . . . . . . . 9
10.1. OAuth Access Token Type Registration . . . . . . . . . . 9 9.2. Signed JWT Swapping . . . . . . . . . . . . . . . . . . . 10
10.2. JWT Confirmation Methods Registration . . . . . . . . . 10 9.3. Signature Algorithms . . . . . . . . . . . . . . . . . . 10
10.3. JSON Web Signature and Encryption Type Values 9.4. Message Integrity . . . . . . . . . . . . . . . . . . . . 10
Registration . . . . . . . . . . . . . . . . . . . . . . 10 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11
11. Security Considerations . . . . . . . . . . . . . . . . . . . 10 10.1. OAuth Access Token Type Registration . . . . . . . . . . 11
11.1. Token Replay at the Same Authorization Server . . . . . 10 10.2. JSON Web Signature and Encryption Type Values
11.2. Token Replay at the Same Resource Server Endpoint . . . 11 Registration . . . . . . . . . . . . . . . . . . . . . . 11
11.3. Signed JWT Swapping . . . . . . . . . . . . . . . . . . 11 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 11
11.4. Comparison to mTLS and OAuth Token Binding . . . . . . . 11 11.1. Normative References . . . . . . . . . . . . . . . . . . 11
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 11.2. Informative References . . . . . . . . . . . . . . . . . 12
12.1. Normative References . . . . . . . . . . . . . . . . . . 11 11.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 13
12.2. Informative References . . . . . . . . . . . . . . . . . 12
12.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Appendix A. Document History . . . . . . . . . . . . . . . . . . 13 Appendix A. Document History . . . . . . . . . . . . . . . . . . 13
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 13 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14
1. Introduction 1. Introduction
[I-D.ietf-oauth-mtls] describes methods to bind (sender-constrain) [I-D.ietf-oauth-mtls] describes methods to bind (sender-constrain)
access tokens using mutual Transport Layer Security (TLS) access tokens using mutual Transport Layer Security (TLS)
authentication with X.509 certificates. authentication with X.509 certificates.
[I-D.ietf-oauth-token-binding] provides mechanisms to sender- [I-D.ietf-oauth-token-binding] provides mechanisms to sender-
constrain access tokens using HTTP token binding. constrain access tokens using HTTP token binding.
skipping to change at page 3, line 36 skipping to change at page 3, line 36
"grant type", "access token request", "access token response", and "grant type", "access token request", "access token response", and
"client" defined by The OAuth 2.0 Authorization Framework [RFC6749]. "client" defined by The OAuth 2.0 Authorization Framework [RFC6749].
2. Main Objective 2. Main Objective
Under the attacker model defined in [I-D.ietf-oauth-security-topics], Under the attacker model defined in [I-D.ietf-oauth-security-topics],
the mechanism defined by this specification tries to ensure that the mechanism defined by this specification tries to ensure that
token replay at a different endpoint is prevented. token replay at a different endpoint is prevented.
More precisely, if an adversary is able to get hold of an access More precisely, if an adversary is able to get hold of an access
token because it set up a counterfeit authorization server or token or refresh token because it set up a counterfeit authorization
resource server, the adversary is not able to replay the respective server or resource server, the adversary is not able to replay the
access token at another authorization or resource server. respective token at another authorization or resource server.
Secondary objectives are discussed in Section 11. Secondary objectives are discussed in Section 9.
3. Concept 3. Concept
The main data structure introduced by this specification is a DPoP
proof JWT, described in detail below. A client uses a DPoP proof JWT
to prove the possession of a private key belonging to a certain
public key. Roughly speaking, a DPoP proof is a signature over some
data of the request to which it is attached to and a timestamp.
+--------+ +---------------+ +--------+ +---------------+
| |--(A)-- Token Request ------------------->| | | |--(A)-- Token Request ------------------->| |
| Client | (DPop-Binding/Proof) | Authorization | | Client | (DPoP Proof) | Authorization |
| | | Server | | | | Server |
| |<-(B)-- PoP Access Token -----------------| | | |<-(B)-- DPoP-bound Access Token ----------| |
| | (token_type=Bearer+DPoP) +---------------+ | | (token_type=DPoP) +---------------+
| | PoP Refresh Token for public clients | | PoP Refresh Token for public clients
| | | |
| | +---------------+ | | +---------------+
| |--(C)-- PoP Access Token ---------------->| | | |--(C)-- DPoP-bound Access Token --------->| |
| | (DPoP-Proof) | Resource | | | (DPoP Proof) | Resource |
| | | Server | | | | Server |
| |<-(D)-- Protected Resource ---------------| | | |<-(D)-- Protected Resource ---------------| |
| | +---------------+ | | +---------------+
+--------+ +--------+
Figure 1: Basic DPoP Flow Figure 1: Basic DPoP Flow
The new elements introduced by this specification are shown in The basic steps of an OAuth flow with DPoP are shown in Figure 1:
Figure 1:
o (A) In the Token Request, the client sends an authorization grant, o (A) In the Token Request, the client sends an authorization code
e.g., an authorization code or a refresh token, to the to the authorization server in order to obtain an access token
authorization server in order to obtain an access token (and (and potentially a refresh token). The client attaches a DPoP
potentially a refresh token). The client proves the possession of proof to the request in an HTTP header.
a private key belonging to some public key by sending a request
header containing a JWT that was signed using this private key.
The corresponding public key is contained in the same request.
o (B) The AS binds (sender-constrains) the access token to the o (B) The AS binds (sender-constrains) the access token to the
public key claimed by the client; that is, the access token cannot public key claimed by the client in the DPoP proof; that is, the
be used without proving possession of the respective private key. access token cannot be used without proving possession of the
This is signaled to the client by using the "token_type" value respective private key. This is signaled to the client by using
"Bearer+DPoP". If a refresh token is issued to the client, it is the "token_type" value "DPoP".
sender-constrained in the same way if the client is a public
client. Note: refresh tokens are automatically bound to the o If a refresh token is issued to a public client, it is sender-
"client_id" of a confidential client, which is more flexible than constrained in the same way. For confidential clients, refresh
tokens are bound to the "client_id", which is more flexible than
binding it to a particular public key. binding it to a particular public key.
o (C) If the client wants to use the access token, it has to prove o (C) If the client wants to use the access token, it has to prove
possession of the private key by adding a header to the request possession of the private key by, again, adding a header to the
that, again, contains a JWT signed with this private key. The JWT request that contains a DPoP proof. The resource server needs to
contains the endpoint URL and the request method. The resource receive information about which public key to check against. This
server needs to receive information about which public key to information is either encoded directly into the access token (for
check against. This information is either encoded directly into JWT structured access tokens), or provided at the token
the access token, for JWT structured access tokens, or provided at introspection endpoint of the authorization server (not shown).
the token introspection endpoint of the authorization server
(request not shown).
o (D) The resource server refuses to serve the request if the o (D) The resource server refuses to serve the request if the
signature check fails or the data in the JWT do not match, e.g., signature check fails or the data in the DPoP proof is wrong,
the request URI does not match the URI claim in the JWT. e.g., the request URI does not match the URI claim in the DPoP
proof JWT.
o Steps (A) and (B) can be repeated using a refresh token to obtain o When a refresh token that is sender-constrained using DPoP is used
fresh access tokens. In this case, the client sends a DPoP proof by the client, the client has to provide a DPoP proof just as in
JWT as in step (C) above. The client can optionally proof the the case of a resource access. The new access token will be bound
possession of a new private/public key pair to which the new to the same public key.
tokens are then bound by the authorization server. Otherwise, the
authorization server binds the new tokens to the previously used
public key.
The mechanism presented herein is not a client authentication method. The mechanism presented herein is not a client authentication method.
In fact, a primary use case are public clients (single page In fact, a primary use case is public clients (single page
applications) that do not use client authentication. Nonetheless, applications) that do not use client authentication. Nonetheless,
DPoP is designed such that it is compatible with "private_key_jwt" DPoP is designed such that it is compatible with "private_key_jwt"
and all other client authentication methods. and all other client authentication methods.
Note: DPoP does not directly ensure message integrity but relies on DPoP does not directly ensure message integrity but relies on the TLS
the TLS layer for that purpose. layer for that purpose. See Section 9 for details.
4. DPoP JWT Syntax 4. DPoP Proof JWTs
DPoP uses so-called DPoP JWTs for binding public keys (DPoP Binding DPoP uses so-called DPoP proof JWTs for binding public keys and
JWT) and proving knowledge about private keys (DPoP Proof JWT). proving knowledge about private keys.
A DPoP JWT is a JWT ([RFC7519]) that is signed (using JWS, [RFC7515]) 4.1. Syntax
using a private key chosen by the client (see below). The header of
a DPoP JWT contains the following fields:
o "typ": type header, value "dpop_binding+jwt" for a DPoP Binding A DPoP proof is a JWT ([RFC7519]) that is signed (using JWS,
JWT or "dpop_proof+jwt" for a DPoP Proof JWT (REQUIRED). [RFC7515]) using a private key chosen by the client (see below). The
header of a DPoP JWT contains at least the following parameters:
o "typ": type header, value "dpop+jwt" (REQUIRED).
o "alg": a digital signature algorithm identifier as per [RFC7518] o "alg": a digital signature algorithm identifier as per [RFC7518]
(REQUIRED). MUST NOT be "none" or an identifier for a symmetric (REQUIRED). MUST NOT be "none" or an identifier for a symmetric
algorithm (MAC). algorithm (MAC).
The body of a DPoP JWT contains the following fields: o "jwk": representing the public key chosen by the client, in JWK
format, as defined in [RFC7515] (REQUIRED)
The body of a DPoP proof contains at least the following claims:
o "jti": Unique identifier for this JWT chosen freshly when creating o "jti": Unique identifier for this JWT chosen freshly when creating
the JWT (REQUIRED). SHOULD be used by the AS for replay detection the DPoP proof (REQUIRED). SHOULD be used by the AS for replay
and prevention. See Security Considerations [1]. detection and prevention. See Security Considerations [1].
o "http_method": The HTTP method for the request to which the JWT is o "http_method": The HTTP method for the request to which the JWT is
attached, in upper case ASCII characters, as defined in [RFC7231] attached, as defined in [RFC7231] (REQUIRED).
(REQUIRED).
o "http_uri": The HTTP URI used for the request, without query and o "http_uri": The HTTP URI used for the request, without query and
fragment parts (REQUIRED). fragment parts (REQUIRED).
o "exp": Expiration time of the JWT (REQUIRED). See Security o "iat": Time at which the JWT was created (REQUIRED).
Considerations [2].
o "cnf": Confirmation claim as per [RFC7800] containing a member
"dpop+jwk", representing the public key chosen by the client in
JWK format (REQUIRED for DPoP Binding JWTs, OPTIONAL for DPoP
Proof JWTs).
An example DPoP JWT is shown in Figure 2. An example DPoP proof is shown in Figure 2.
{ {
"typ": "dpop_binding+jwt", "typ": "dpop+jwt",
"alg": "ES512", "alg": "ES256",
"jwk": {
"kty": "EC",
"crv": "P-256",
"x": "f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU",
"y": "x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"
}
}.{ }.{
"jti": "HK2PmfnHKwXP", "jti": "HK2PmfnHKwXP",
"http_method": "POST", "http_method": "POST",
"http_uri": "https://server.example.com/token", "http_uri": "https://server.example.com/token",
"exp": "..." "iat": 1555555555
"cnf":{
"dpop+jwk": {
"kty" : "EC",
"kid" : "11",
"crv" : "P-256",
"x" : "usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8",
"y" : "3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4"
}
}
} }
Figure 2: Example JWT contents for "DPoP-Binding" header. Figure 2: Example JWT content for "DPoP" proof header.
5. Token Request (Binding Tokens to a Public Key)
To bind a token to a public key in the token request, the client MUST
provide a public key and prove the possession of the corresponding
private key. The HTTPS request shown in Figure 3 illustrates the
protocol for this (with extra line breaks for display purposes only).
POST /token HTTP/1.1 Note: To keep DPoP simple to implement, only the HTTP method and URI
Host: server.example.com are signed in DPoP proofs. Nonetheless, DPoP proofs can be extended
Content-Type: application/x-www-form-urlencoded;charset=UTF-8 to contain other information of the HTTP request (see also
DPoP-Binding: eyJhbGciOiJSU0ExXzUi ... Section 9.4).
grant_type=authorization_code 4.2. Checking DPoP Proofs
&code=SplxlOBeZQQYbYS6WxSbIA
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
(remainder of JWK omitted for brevity)
Figure 3: Token Request for a DPoP bound token. 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
The HTTP header "DPoP-Binding" MUST contain a DPoP Binding JWT signed 1. the string value is a well-formed JWT,
using the private key chosen by the client.
It is RECOMMENDED that clients reuse the same JWT if possible to 2. all required claims are contained in the JWT,
improve the performance of the client, the data transfer (caching),
and the authorization server.
If the authorization server receives a "DPoP-Binding" header in a 3. the "typ" field in the header has the value "dpop+jwt",
token request, the authorization server MUST check that:
1. the header value is a well-formed JWT, 4. the algorithm in the header of the JWT indicates an asymmetric
digital signature algorithm, is not "none", is supported by the
application, and is deemed secure,
2. all required claims are contained in the JWT, 5. that the JWT is signed using the public key contained in the
"jwk" header of the JWT,
3. the "typ" field in the header has the correct value, 6. the "http_method" claim matches the respective value for the HTTP
request in which the JWT was received (case-insensitive),
4. the algorithm in the header of the JWT designates a digital 7. the "http_uri" claims matches the respective value for the HTTP
signature algorithm, is not "none", is supported by the request in which the JWT was received, ignoring any query and
application, and is deemed secure, fragment parts,
5. the JWT is signed using the public key contained in the "cnf" 8. the token was issued within an acceptable timeframe (see
claim of the JWT, Section 9.1), and
6. the "http_method" and "http_uri" claims match the respective 9. that, within a reasonable consideration of accuracy and resource
values for the HTTP request in which the header was received, utilization, a JWT with the same "jti" value has not been
received previously (see Section 9.1).
7. the token has not expired, and Servers SHOULD employ Syntax-Based Normalization and Scheme-Based
Normalization in accordance with Section 6.2.2. and Section 6.2.3. of
[RFC3986] before comparing the "http_uri" claim.
8. if replay protection is desired, that a JWT with the same "jti" 5. Token Request (Binding Tokens to a Public Key)
value has not been received previously.
If these checks are successful, the authorization server MUST To bind a token to a public key in the token request, the client MUST
associate the access token with the public key. It then sets provide a valid DPoP proof JWT in a "DPoP" header. The HTTPS request
"token_type" to "Bearer+DPoP" in the token response. The client MAY shown in Figure 3 illustrates the protocol for this (with extra line
use the value of the "token_type" parameter to determine whether the breaks for display purposes only).
server supports the mechanisms specified in this document.
6. Resource Access (Proof of Possession for Access Tokens) POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
DPoP: eyJhbGciOiJSU0ExXzUi...
To make use of an access token that is token-bound to a public key grant_type=authorization_code
using DPoP, a client MUST prove the possession of the corresponding &code=SplxlOBeZQQYbYS6WxSbIA
private key. More precisely, the client MUST create a DPoP Proof JWT &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
and sign it using the previously chosen private key. The signed JWT
MUST then be sent in the "DPoP-Proof" request header.
If a resource server detects that an access token that is to be used Figure 3: Token Request for a DPoP sender-constrained token.
for resource access is bound to a public key using DPoP (via the
methods described in Section 8) it MUST check that:
1. a header "DPoP-Proof" was received in the HTTP request, The HTTP header "DPoP" MUST contain a valid DPoP proof.
2. the header's value is a well-formed DPoP Proof JWT, The authorization server, after checking the validity of the token,
MUST associate the access token issued at the token endpoint with the
public key. It then sets "token_type" to "DPoP" in the token
response.
3. all required claims are contained in the JWT, A client typically cannot know whether a certain AS supports DPoP.
It therefore SHOULD use the value of the "token_type" parameter
returned from the AS to determine support for DPoP: If the token type
returned is "Bearer" or another value, the AS does not support DPoP.
If it is "DPoP", DPoP is supported. Only then, the client needs to
send the "DPoP" header in subsequent requests and use the token type
"DPoP" in the "Authorization" header as described below.
4. the algorithm in the header of the JWT designates a digital If a refresh token is issued to a public client at the token endpoint
signature algorithm, is not "none", is supported by the and a valid DPoP proof is presented, the refresh token MUST be bound
application, and is deemed secure, to the public key contained in the header of the DPoP proof JWT.
5. the JWT is signed using the public key to which the access token If a DPoP-bound refresh token is to be used at the token endpoint by
was bound, a public client, the AS MUST ensure that the DPoP proof contains the
same public key as the one the refresh token is bound to. The access
token issued MUST be bound to the public key contained in the DPoP
proof.
6. the "typ" field in the header has the correct value, 6. Resource Access (Proof of Possession for Access Tokens)
7. the "http_method" and "http_uri" claims match the respective To make use of an access token that is token-bound to a public key
values for the HTTP request in which the header was received, using DPoP, a client MUST prove the possession of the corresponding
private key by providing a DPoP proof in the "DPoP" request header.
8. the token has not expired, and The DPoP-bound access token must be sent in the "Authorization"
header with the prefix "DPoP".
9. if replay protection is desired, that a JWT with the same "jti" If a resource server detects that an access token that is to be used
value has not been received previously. for resource access is bound to a public key using DPoP (via the
methods described in Section 7) it MUST check that a header "DPoP"
was received in the HTTP request, and check the header's contents
according to the rules in Section 4.2.
If any of these checks fails, the resource server MUST NOT grant The resource server MUST NOT grant access to the resource unless all
access to the resource. checks are successful.
7. Refresh Token Usage (Proof of Possession for Refresh Tokens) GET /protectedresource HTTP/1.1
Host: resourceserver.example.com
Authorization: DPoP eyJhbGciOiJIUzI1...
DPoP: eyJhbGciOiJSU0ExXzUi...
At the token endpoint, public clients using a refresh token MUST Figure 4: Protected Resource Request with a DPoP sender-constrained
provide a proof of possession in the same way as for access tokens. access token.
8. Public Key Confirmation 7. Public Key Confirmation
It MUST be ensured that resource servers can reliably identify It MUST be ensured that resource servers can reliably identify
whether a token is bound using DPoP and learn the public key to which whether a token is bound using DPoP and learn the public key to which
the token is bound. the token is bound.
Access tokens that are represented as JSON Web Tokens (JWT)[RFC7519] Access tokens that are represented as JSON Web Tokens (JWT) [RFC7519]
MUST contain information about the DPoP public key (in JWK format) in MUST contain information about the DPoP public key (in JWK format) in
the member "dpop+jwk" of the "cnf" claim, as shown in Figure 4. the member "jkt#S256" of the "cnf" claim, as shown in Figure 5.
The value in "jkt#S256" MUST be the base64url encoding [RFC7515] of
the JWK SHA-256 Thumbprint (according to [RFC7638]) of the public key
to which the access token is bound.
{ {
"iss": "https://server.example.com", "iss": "https://server.example.com",
"sub": "something@example.com", "sub": "something@example.com",
"exp": 1493726400, "exp": 1503726400,
"nbf": 1493722800, "nbf": 1503722800,
"cnf":{ "cnf":{
"dpop+jwk": { "jkt#S256": "oKIywvGUpTVTyxMQ3bwIIeQUudfr_CkLMjCE19ECD-U"
"kty" : "EC",
"kid" : "11",
"crv" : "P-256",
"x" : "usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8",
"y" : "3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4"
}
} }
} }
Figure 4: Example access token body with "cnf" claim. Figure 5: Example access token body with "cnf" claim.
When access token introspection is used, the same "cnf" claim as When access token introspection is used, the same "cnf" claim as
above MUST be contained in the introspection response. above MUST be contained in the introspection response.
9. Acknowledgements Resource servers MUST ensure that the fingerprint of the public key
in the DPoP proof JWT equals the value in the "jkt#S256" claim in the
access token or introspection response.
8. Acknowledgements
We would like to thank David Waite, Filip Skokan, Mike Engan, and
Justin Richer for their valuable input and feedback.
This document resulted from discussions at the 4th OAuth Security This document resulted from discussions at the 4th OAuth Security
Workshop in Stuttgart, Germany. We thank the organizers of this Workshop in Stuttgart, Germany. We thank the organizers of this
workshop (Ralf Kuesters, Guido Schmitz). workshop (Ralf Kuesters, Guido Schmitz).
10. IANA Considerations 9. Security Considerations
10.1. OAuth Access Token Type Registration
This specification registers the following access token type in the
OAuth Access Token Types registry defined in [RFC6749].
o Type name: "Bearer+DPoP"
o Additional Token Endpoint Response Parameters: (none)
o HTTP Authentication Scheme(s): Bearer
o Change controller: IETF The Prevention of Token Replay at a Different Endpoint [2] is
achieved through the binding of the DPoP proof to a certain URI and
HTTP method. However, DPoP does not achieve the same level of
protection as, for example, OAuth Mutual TLS [I-D.ietf-oauth-mtls],
as described in the following.
o Specification document(s): [[ this specification ]] 9.1. DPoP Proof Replay
10.2. JWT Confirmation Methods Registration If an adversary is able to get hold of a DPoP proof JWT, the
adversary could replay that token later 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 "iat" time, preferably only for a
brief period. Furthermore, the "jti" claim in each JWT MUST contain
a unique (incrementing or randomly chosen) value, as proposed in
[RFC7253]. Resource servers SHOULD store values at least for the
time window in which the respective JWT is accepted and decline HTTP
requests by clients if a "jti" value has been seen before.
This specification requests registration of the following value in Note: To acommodate for clock offsets, the server MAY accept DPoP
the IANA "JWT Confirmation Methods" registry [IANA.JWT.Claims] for proofs that carry an "iat" time in the near future (e.g., up to one
JWT "cnf" member values established by [RFC7800]. second in the future).
o Confirmation Method Value: "dpop+jwk" 9.2. Signed JWT Swapping
o Confirmation Method Description: JWK encoded public key for dpop Servers accepting signed DPoP proof JWTs MUST check the "typ" field
proof token in the headers of the JWTs to ensure that adversaries cannot use JWTs
created for other purposes in the DPoP headers.
o Change Controller: IESG 9.3. Signature Algorithms
o Specification Document(s): [[ this specification ]] Implementers MUST ensure that only digital signature algorithms that
are deemed secure can be used for signing DPoP proofs. In
particular, the algorithm "none" MUST NOT be allowed.
10.3. JSON Web Signature and Encryption Type Values Registration 9.4. Message Integrity
This specification registers the "dpop_proof+jwt" and DPoP does not ensure the integrity of the payload or headers of
"dpop_binding+jwt" type values in the IANA JSON Web Signature and requests. The signature of DPoP proofs only contains the HTTP URI
Encryption Type Values registry [RFC7515]: and method, but not, for example, the message body or other request
headers.
o "typ" Header Parameter Value: "dpop_proof+jwt" This is an intentional design decision 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.
o Abbreviation for MIME Type: None 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
[I-D.ietf-oauth-mtls] and OAuth Token Binding
[I-D.ietf-oauth-token-binding].
o Change Controller: IETF Note: While signatures on (parts of) requests are out of the scope of
this specification, signatures or information to be signed can be
added into DPoP proofs.
o Specification Document(s): [[ this specification ]] 10. IANA Considerations
o "typ" Header Parameter Value: "dpop_binding+jwt" 10.1. OAuth Access Token Type Registration
o Abbreviation for MIME Type: None This specification registers the following access token type in the
OAuth Access Token Types registry defined in [RFC6749].
o Change Controller: IETF o Type name: "DPoP"
o Specification Document(s): [[ this specification ]] o Additional Token Endpoint Response Parameters: (none)
11. Security Considerations o HTTP Authentication Scheme(s): Bearer
The Prevention of Token Replay at a Different Endpoint [3] is o Change controller: IETF
achieved through the binding of the DPoP JWT to a certain URI and
HTTP method.
11.1. Token Replay at the Same Authorization Server o Specification document(s): [[ this specification ]]
If an adversary is able to get hold of an DPoP-Binding JWT, it might 10.2. JSON Web Signature and Encryption Type Values Registration
replay it at the authorization server's token endpoint with the same
or different payload. The issued access token is useless as long as
the adversary does not get hold of a valid DPoP-Binding JWT for the
corresponding resource server.
11.2. Token Replay at the Same Resource Server Endpoint This specification registers the "dpop+jwt" type value in the IANA
JSON Web Signature and Encryption Type Values registry [RFC7515]:
If an adversary is able to get hold of a DPoP-Proof JWT, the o "typ" Header Parameter Value: "dpop+jwt"
adversary could replay that token later at the same endpoint (the
HTTP endpoint and method are enforced via the respective claims in
the JWTs). To prevent this, clients MUST limit the lifetime of the
JWTs, preferably to a brief period. Furthermore, the "jti" claim in
each JWT MUST contain a unique (incrementing or randomly chosen)
value, as proposed in [RFC7253]. Resource servers SHOULD store
values at least for the lifetime of the respective JWT and decline
HTTP requests by clients if a "jti" value has been seen before.
11.3. Signed JWT Swapping o Abbreviation for MIME Type: None
Servers accepting signed DPoP JWTs MUST check the "typ" field in the o Change Controller: IETF
headers of the JWTs to ensure that adversaries cannot use JWTs
created for other purposes in the DPoP headers.
11.4. Comparison to mTLS and OAuth Token Binding o Specification Document(s): [[ this specification ]]
o mTLS stronger against intercepted connections 11. References
12. References 11.1. Normative References
12.1. Normative References [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, DOI 10.17487/RFC3986, January 2005,
<https://www.rfc-editor.org/info/rfc3986>.
[RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework",
RFC 6749, DOI 10.17487/RFC6749, October 2012, RFC 6749, DOI 10.17487/RFC6749, October 2012,
<https://www.rfc-editor.org/info/rfc6749>. <https://www.rfc-editor.org/info/rfc6749>.
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Semantics and Content", RFC 7231, Protocol (HTTP/1.1): Semantics and Content", RFC 7231,
DOI 10.17487/RFC7231, June 2014, DOI 10.17487/RFC7231, June 2014,
<https://www.rfc-editor.org/info/rfc7231>. <https://www.rfc-editor.org/info/rfc7231>.
skipping to change at page 12, line 9 skipping to change at page 12, line 17
2014, <https://www.rfc-editor.org/info/rfc7253>. 2014, <https://www.rfc-editor.org/info/rfc7253>.
[RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518,
DOI 10.17487/RFC7518, May 2015, DOI 10.17487/RFC7518, May 2015,
<https://www.rfc-editor.org/info/rfc7518>. <https://www.rfc-editor.org/info/rfc7518>.
[RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token
(JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015,
<https://www.rfc-editor.org/info/rfc7519>. <https://www.rfc-editor.org/info/rfc7519>.
12.2. Informative References [RFC7638] Jones, M. and N. Sakimura, "JSON Web Key (JWK)
Thumbprint", RFC 7638, DOI 10.17487/RFC7638, September
2015, <https://www.rfc-editor.org/info/rfc7638>.
11.2. Informative References
[I-D.ietf-oauth-mtls] [I-D.ietf-oauth-mtls]
Campbell, B., Bradley, J., Sakimura, N., and T. Campbell, B., Bradley, J., Sakimura, N., and T.
Lodderstedt, "OAuth 2.0 Mutual TLS Client Authentication Lodderstedt, "OAuth 2.0 Mutual TLS Client Authentication
and Certificate-Bound Access Tokens", draft-ietf-oauth- and Certificate-Bound Access Tokens", draft-ietf-oauth-
mtls-13 (work in progress), February 2019. mtls-15 (work in progress), July 2019.
[I-D.ietf-oauth-security-topics] [I-D.ietf-oauth-security-topics]
Lodderstedt, T., Bradley, J., Labunets, A., and D. Fett, Lodderstedt, T., Bradley, J., Labunets, A., and D. Fett,
"OAuth 2.0 Security Best Current Practice", draft-ietf- "OAuth 2.0 Security Best Current Practice", draft-ietf-
oauth-security-topics-12 (work in progress), March 2019. oauth-security-topics-13 (work in progress), July 2019.
[I-D.ietf-oauth-token-binding] [I-D.ietf-oauth-token-binding]
Jones, M., Campbell, B., Bradley, J., and W. Denniss, Jones, M., Campbell, B., Bradley, J., and W. Denniss,
"OAuth 2.0 Token Binding", draft-ietf-oauth-token- "OAuth 2.0 Token Binding", draft-ietf-oauth-token-
binding-08 (work in progress), October 2018. binding-08 (work in progress), October 2018.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web
Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May
2015, <https://www.rfc-editor.org/info/rfc7515>. 2015, <https://www.rfc-editor.org/info/rfc7515>.
[RFC7800] Jones, M., Bradley, J., and H. Tschofenig, "Proof-of-
Possession Key Semantics for JSON Web Tokens (JWTs)",
RFC 7800, DOI 10.17487/RFC7800, April 2016,
<https://www.rfc-editor.org/info/rfc7800>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
12.3. URIs 11.3. URIs
[1] #Security [1] #Security
[2] #Security [2] #Objective_Replay_Different_Endpoint
[3] #Objective_Replay_Different_Endpoint
Appendix A. Document History Appendix A. Document History
[[ To be removed from the final specification ]] [[ To be removed from the final specification ]]
-00 -02
o first draft o added normalization rules for URIs
o removed distinction between proof and binding
o "jwk" header again used instead of "cnf" claim in DPoP proof
o renamed "Bearer-DPoP" token type to "DPoP"
o removed ability for key rotation
o added security considerations on request integrity
o explicit advice on extending DPoP proofs to sign other parts of
the HTTP messages
o only use the jkt#S256 in ATs
o iat instead of exp in DPoP proof JWTs
o updated guidance on token_type evaluation
-01 -01
o fixed inconsistencies o fixed inconsistencies
o moved binding and proof messages to headers instead of parameters o moved binding and proof messages to headers instead of parameters
o extracted and unified definition of DPoP JWTs o extracted and unified definition of DPoP JWTs
o improved description o improved description
-00
o first draft
Authors' Addresses Authors' Addresses
Daniel Fett Daniel Fett
yes.com yes.com
Email: mail@danielfett.de Email: mail@danielfett.de
John Bradley John Bradley
Yubico Yubico
 End of changes. 111 change blocks. 
265 lines changed or deleted 300 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/