OAuth Working Group | N. Sakimura |
Internet-Draft | Nomura Research Institute |
Intended status: Standards Track | K. Li |
Expires: September 11, 2017 | Alibaba Group |
J. Bradley | |
Ping Identity | |
March 10, 2017 |
The OAuth 2.0 Authorization Framework: JWT Pop Token Usage
draft-sakimura-oauth-jpop-00
This specification describes how to use JWT POP (Jpop) tokens that were obtained through [POPKD] in HTTP requests to access OAuth 2.0 protected resources. Only the party in possession of a corresponding cryptographic key with the Jpop token can use it to get access to the associated resources unlike in the case of the bearer token described in [RFC6750] where any party in posession of the access token can access the resource.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 11, 2017.
Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
This document specifies the method for the client to use a proof-of-possestion token against a protected resource. The format of such token is defined in section 3 of [RFC7800].
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
Unless otherwise noted, all the protocol parameter names and values are case sensitive.
For the purpose of this document, the terms defined in [RFC6749] and [RFC7800] are used.
JWT PoP token is a JWS signed JWT whose payload is a JWT Claims Set. The JWT claims set MUST include the following:
Their semantics are defined in [RFC7519] and [RFC7800].
Following is an example of such.
{ "iss": "https://server.example.com", "aud": "https://resource.example.org", "iat": "1360189224", "exp": "1361398868", "cnf":{...} }
Figure 1: Example of JWT PoP Token.
There are several varieties of sender constrained token. Namely:
CN constrained token is typically used when X.509 client certificate authentication is used at the token endpoint. In this case, the constraint is expressed by including the following member at the top level of cnf claim.
The authorization server finds the relevant CN from the X.509 client certificate authentication that is performed at the token endpoint.
{ "iss": "https://server.example.com", "sub": "joe@example.com", "aud": "https://resource.example.org", "exp": "1361398824", "nbf": "1360189224", "cnf":{ "cn": "client.example.com" }
Figure 2: Example of CN Constrained JWT.
The constraint in the Client ID constrained token is expressed by including the following member at the top level of cnf claim.
The authorization server finds the client ID from the client ID used in the client authentication at the token endpoint.
Methods to express key constraints are extensively described in the section 3 of [RFC7800]. Such cnf claim is used in the access token described in section 3 to form a key constrained token. [RFC7800] defines 4 confirmation methods.
Following is an example of such JWT payload.
{ "iss": "https://server.example.com", "sub": "joe@example.com", "aud": "https://resource.example.org", "exp": "1361398824", "nbf": "1360189224", "cnf":{ "jwk":{ "kty": "EC", "use": "sig", "crv": "P-256", "x": "18wHLeIgW9wVN6VD1Txgpqy2LszYkMf6J8njVAibvhM", "y": "-V4dS4UaLMgP_4fY4j8ir7cl1TXlFdAgcx55o7TkcSA" } } }
Figure 3: Example of a Key Constrained JWT.
The resource server that supports this specification MUST authenticate the Client by having it demonstrate that it is the holder of the key associated with the access token being used. The confirmation method can be broadly categorized in two forms.
Under this method, X.509 client certificate authentication at the resource endpoint is being leveraged. The resource endpoint MUST obtain the CN of the client certificate used for the authentication and MUST verify that the value of the cn member in the cnf member matches with it.
If it does not match, the process stops here and the resource access MUST be denied.
If it was valid, then the resource server MUST verify the access token. If it is valid, the resource SHOULD be returned as HTTP response.
For this, the following steps are taken:
1. The client prepares a nonce.
2. The client creates JWS compact serialization over the nonce.
To obtain it, first create a JSON with a name "nonce" and the value being what was received in the previous step. e.g.,
{ "nonce":"dcd98b7102dd2f0e8b11d0f600bfb0c093" }
Then, jws-on-nonce is obtained by creating a compact serialization of JWS on this JSON.
3. The client sends the request to the resource server, this time with Authorization Request Header as defined in section 4.2 of [RFC7235] with the credential as follows:
credentials = "Jpop" jpop-response jpop-response = at-response "," s-response at-response = "at" "=" access-token; As specified by [POPKD] s-response = "s" "=" jws-on-nonce; Created in the step 3. access-token = quoted-string jws-on-nonce = quoted-string
In the following example, the access token and the jws-on-nonce are represented as access.token.jwt and jws.of.nonce for the sake of brevity.
GET /resource/1234 HTTP/1.0 Host: server.example.com Authorization: Jpop at="access.token.jwt", s="jws.of.nonce"
Figure 4: Example resouce request
4. The resource server finds the client's public key form the access token through the methods described in [RFC7800].
5. The resource server MUST verify the value of s of the Authorization header. If it fails, the process stops here and the resource access MUST be denied.
6. The resource server MUST verify the access token. If it is valid, the resource SHOULD be returned as HTTP response.
If the client requests the resource without the proper authoization header, the resource server returns a HTTP 401 response with WWW-Authenticate header as defined in section 4.1 of [RFC7235] with the challenge as follows:
challenge = "Jpop" jpop-challenge jpop-challenge = "nonce" "=" nonce-value nonce-value = quoted-string
Following example depicts what the response would look like.
HTTP/1.0 401 Unauthorized Server: HTTPd/0.9 Date: Wed, 14 March 2017 09:26:53 GMT WWW-Authenticate: Jpop nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093"
Figure 5: Example error response.
A new scheme has been registered in the HTTP Authentication Scheme Registry as follows:
Authentication Scheme Name: Jpop
Reference: Section 3 of this specification
Notes (optional): The Named Authentication scheme is intended to be used only with OAuth Resource Access, and thus does not support proxy authentication.
The "cn" JWT confirmation method relies its security property on the X.509 client certificate authentication. In particular, the validity of the certificate needs to be verified properly. It involves the traversal of all the certificate chain and the certificate validation (e.g., with OCSP).
The client's secret key must be kept securely. Otherwise, the notion of PoP breaks down.
It should be noted that JWE confirmation method is significantly weaker form of the PoP, as the resource server and the authorization server can masquerade as the client.
The authors thank the following people for providing valuable feedback to this document. Nov Matake (YAuth).
[PKCE] | Sakimura, N., "Proof Key for Code Exchange by OAuth Public Clients", July 2015. |
[POPA] | Hunt, P., "OAuth 2.0 Proof-of-Possession (PoP) Security Architecture", March 2015. |
[TINTRO] | Richer, J., "OAuth 2.0 Token Introspection", July 2015. |