idnits 2.17.1 draft-ietf-oauth-jwt-bearer-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 14, 2012) is 4235 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-18) exists of draft-ietf-oauth-assertions-04 == Outdated reference: A later version (-06) exists of draft-ietf-oauth-urn-sub-ns-05 ** Downref: Normative reference to an Informational draft: draft-ietf-oauth-urn-sub-ns (ref. 'I-D.ietf-oauth-urn-sub-ns') == Outdated reference: A later version (-31) exists of draft-ietf-oauth-v2-28 -- Possible downref: Non-RFC (?) normative reference: ref. 'JWT' ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) == Outdated reference: A later version (-23) exists of draft-ietf-oauth-saml2-bearer-13 Summary: 2 errors (**), 0 flaws (~~), 5 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 OAuth Working Group M. Jones 3 Internet-Draft Microsoft 4 Intended status: Standards Track B. Campbell 5 Expires: March 18, 2013 Ping Identity 6 C. Mortimore 7 Salesforce 8 September 14, 2012 10 JSON Web Token (JWT) Bearer Token Profiles for OAuth 2.0 11 draft-ietf-oauth-jwt-bearer-02 13 Abstract 15 This specification defines the use of a JSON Web Token (JWT) Bearer 16 Token as a means for requesting an OAuth 2.0 access token as well as 17 for use as a means of client authentication. 19 Status of this Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on March 18, 2013. 36 Copyright Notice 38 Copyright (c) 2012 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 4 55 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 56 2. HTTP Parameter Bindings for Transporting Assertions . . . . . 4 57 2.1. Using JWTs as Authorization Grants . . . . . . . . . . . . 4 58 2.2. Using JWTs for Client Authentication . . . . . . . . . . . 5 59 3. JWT Format and Processing Requirements . . . . . . . . . . . . 5 60 3.1. Authorization Grant Processing . . . . . . . . . . . . . . 7 61 3.2. Client Authentication Processing . . . . . . . . . . . . . 7 62 4. Authorization Grant Example . . . . . . . . . . . . . . . . . 7 63 5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 64 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 65 6.1. Sub-Namespace Registration of 66 urn:ietf:params:oauth:grant-type:jwt-bearer . . . . . . . 8 67 6.2. Sub-Namespace Registration of 68 urn:ietf:params:oauth:client-assertion-type:jwt-bearer . . 9 69 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 9 70 7.1. Normative References . . . . . . . . . . . . . . . . . . . 9 71 7.2. Informative References . . . . . . . . . . . . . . . . . . 10 72 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 10 73 Appendix B. Document History . . . . . . . . . . . . . . . . . . 10 74 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 11 76 1. Introduction 78 JSON Web Token (JWT) [JWT] is a JavaScript Object Notation (JSON) 79 [RFC4627] based security token encoding that enables identity and 80 security information to be shared across security domains. A 81 security token is generally issued by an identity provider and 82 consumed by a relying party that relies on its content to identify 83 the token's subject for security related purposes. 85 The OAuth 2.0 Authorization Framework [I-D.ietf-oauth-v2] provides a 86 method for making authenticated HTTP requests to a resource using an 87 access token. Access tokens are issued to third-party clients by an 88 authorization server (AS) with the (sometimes implicit) approval of 89 the resource owner. In OAuth, an authorization grant is an abstract 90 term used to describe intermediate credentials that represent the 91 resource owner authorization. An authorization grant is used by the 92 client to obtain an access token. Several authorization grant types 93 are defined to support a wide range of client types and user 94 experiences. OAuth also allows for the definition of new extension 95 grant types to support additional clients or to provide a bridge 96 between OAuth and other trust frameworks. Finally, OAuth allows the 97 definition of additional authentication mechanisms to be used by 98 clients when interacting with the authorization server. 100 The Assertion Framework for OAuth 2.0 [I-D.ietf-oauth-assertions] is 101 an abstract extension to OAuth 2.0 that provides a general framework 102 for the use of Assertions (a.k.a. Security Tokens) as client 103 credentials and/or authorization grants with OAuth 2.0. This 104 specification profiles the Assertion Framework for OAuth 2.0 105 [I-D.ietf-oauth-assertions] to define an extension grant type that 106 uses a JSON Web Token (JWT) Bearer Token to request an OAuth 2.0 107 access token as well as for use as client credentials. The format 108 and processing rules for the JWT defined in this specification are 109 intentionally similar, though not identical, to those in the closely 110 related SAML 2.0 Bearer Assertion Profiles for OAuth 2.0 111 [I-D.ietf-oauth-saml2-bearer]. 113 This document defines how a JSON Web Token (JWT) Bearer Token can be 114 used to request an access token when a client wishes to utilize an 115 existing trust relationship, expressed through the semantics of (and 116 digital signature calculated over) the JWT, without a direct user 117 approval step at the authorization server. It also defines how a JWT 118 can be used as a client authentication mechanism. The use of a 119 security token for client authentication is orthogonal to and 120 separable from using a security token as an authorization grant. 121 They can be used either in combination or separately. Client 122 authentication using a JWT is nothing more than an alternative way 123 for a client to authenticate to the token endpoint and must be used 124 in conjunction with some grant type to form a complete and meaningful 125 protocol request. JWT authorization grants may be used with or 126 without client authentication or identification. Whether or not 127 client authentication is needed in conjunction with a JWT 128 authorization grant, as well as the supported types of client 129 authentication, are policy decisions at the discretion of the 130 authorization server. 132 The process by which the client obtains the JWT, prior to exchanging 133 it with the authorization server or using it for client 134 authentication, is out of scope. 136 1.1. Notational Conventions 138 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 139 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 140 document are to be interpreted as described in RFC 2119 [RFC2119]. 142 Unless otherwise noted, all the protocol parameter names and values 143 are case sensitive. 145 1.2. Terminology 147 All terms are as defined in The OAuth 2.0 Authorization Framework 148 [I-D.ietf-oauth-v2], Assertion Framework for OAuth 2.0 149 [I-D.ietf-oauth-assertions], and JSON Web Token (JWT) [JWT]. 151 2. HTTP Parameter Bindings for Transporting Assertions 153 The Assertion Framework for OAuth 2.0 [I-D.ietf-oauth-assertions] 154 defines generic HTTP parameters for transporting Assertions (a.k.a. 155 Security Tokens) during interactions with a token endpoint. This 156 section defines the values of those parameters for use with JWT 157 Bearer Tokens. 159 2.1. Using JWTs as Authorization Grants 161 To use a JWT Bearer Token as an authorization grant, use the 162 following parameter values and encodings. 164 The value of the "grant_type" parameter MUST be 165 "urn:ietf:params:oauth:grant-type:jwt-bearer". 167 The value of the "assertion" parameter MUST contain a single JWT. 169 The following non-normative example demonstrates an Access Token 170 Request with a JWT as an authorization grant (with extra line breaks 171 for display purposes only): 173 POST /token.oauth2 HTTP/1.1 174 Host: as.example.com 175 Content-Type: application/x-www-form-urlencoded 177 grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer 178 &assertion=eyJhbGciOiJFUzI1NiJ9. 179 eyJpc3Mi[...omitted for brevity...]. 180 J9l-ZhwP[...omitted for brevity...] 182 2.2. Using JWTs for Client Authentication 184 To use a JWT Bearer Token for client authentication grant, use the 185 following parameter values and encodings. 187 The value of the "client_assertion_type" parameter MUST be 188 "urn:ietf:params:oauth:client-assertion-type:jwt-bearer". 190 The value of the "client_assertion" parameter MUST contain a single 191 JWT. 193 The following non-normative example demonstrates client 194 authentication using a JWT during the presentation of an 195 authorization code grant in an Access Token Request (with extra line 196 breaks for display purposes only): 198 POST /token.oauth2 HTTP/1.1 199 Host: as.example.com 200 Content-Type: application/x-www-form-urlencoded 202 grant_type=authorization_code& 203 code=vAZEIHjQTHuGgaSvyW9hO0RpusLzkvTOww3trZBxZpo& 204 client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3A 205 client-assertion-type%3Ajwt-bearer& 206 client_assertion=eyJhbGciOiJSUzI1NiJ9. 207 eyJpc3Mi[...omitted for brevity...]. 208 cC4hiUPo[...omitted for brevity...] 210 3. JWT Format and Processing Requirements 212 In order to issue an access token response as described in The OAuth 213 2.0 Authorization Framework [I-D.ietf-oauth-v2] or to rely on a JWT 214 for client authentication, the authorization server MUST validate the 215 JWT according to the criteria below. Application of additional 216 restrictions and policy are at the discretion of the authorization 217 server. 219 o The JWT MUST contain an "iss" (issuer) claim that contains a 220 unique identifier for the entity that issued the JWT. 222 o The JWT MUST contain a "prn" (principal) claim identifying the 223 subject of the transaction. The principal MAY identify the 224 resource owner for whom the access token is being requested. For 225 client authentication, the principal MUST be the "client_id" of 226 the OAuth client. When using a JWT as an authorization grant, the 227 principal SHOULD identify an authorized accessor for whom the 228 access token is being requested (typically the resource owner, or 229 an authorized delegate). 231 o The JWT MUST contain an "aud" (audience) claim containing a URI 232 reference that identifies the authorization server, or the service 233 provider principal entity of its controlling domain, as an 234 intended audience. The token endpoint URL of the authorization 235 server MAY be used as an acceptable value for an "aud" element. 236 The authorization server MUST verify that it is an intended 237 audience for the JWT. 239 o The JWT MUST contain an "exp" (expiration) claim that limits the 240 time window during which the JWT can be used. The authorization 241 server MUST verify that the expiration time has not passed, 242 subject to allowable clock skew between systems. The 243 authorization server MAY reject JWTs with an "exp" claim value 244 that is unreasonably far in the future. 246 o The JWT MAY contain an "nbf" (not before) claim that identifies 247 the time before which the token MUST NOT be accepted for 248 processing. 250 o The JWT MAY contain an "iat" (issued at) claim that identifies the 251 time at which the JWT was issued. The authorization server MAY 252 reject JWTs with an "iat" claim value that is unreasonably far in 253 the past. 255 o The JWT MAY contain a "jti" (JWT ID) claim that provides a unique 256 identifier for the token. The authorization server MAY ensure 257 that JWTs are not replayed by maintaining the set of used "jti" 258 values for the length of time for which the JWT would be 259 considered valid based on the applicable "exp" instant. 261 o The JWT MAY contain other claims. 263 o The JWT MUST be digitally signed by the issuer and the 264 authorization server MUST verify the signature. 266 o The authorization server MUST verify that the JWT is valid in all 267 other respects per JSON Web Token (JWT) [JWT]. 269 3.1. Authorization Grant Processing 271 If present, the authorization server MUST also validate the client 272 credentials. 274 If the JWT is not valid, or the current time is not within the 275 token's valid time window for use, the authorization server MUST 276 construct an error response as defined in OAuth 2.0 277 [I-D.ietf-oauth-v2]. The value of the "error" parameter MUST be the 278 "invalid_grant" error code. The authorization server MAY include 279 additional information regarding the reasons the JWT was considered 280 invalid using the "error_description" or "error_uri" parameters. 282 For example: 284 HTTP/1.1 400 Bad Request 285 Content-Type: application/json 286 Cache-Control: no-store 288 { 289 "error":"invalid_grant", 290 "error_description":"Audience validation failed" 291 } 293 3.2. Client Authentication Processing 295 If the client JWT is not valid, or its subject confirmation 296 requirements cannot be met, the authorization server MUST construct 297 an error response as defined in OAuth 2.0 [I-D.ietf-oauth-v2]. The 298 value of the "error" parameter MUST be the "invalid_client" error 299 code. The authorization server MAY include additional information 300 regarding the reasons the JWT was considered invalid using the 301 "error_description" or "error_uri" parameters. 303 4. Authorization Grant Example 305 Though non-normative, the following examples illustrate what a 306 conforming JWT and access token request would look like. 308 Below is an example JSON object that could be encoded to produce the 309 JWT Claims Object for a JWT: 311 {"iss":"https://jwt-idp.example.com", 312 "prn":"mailto:mike@example.com", 313 "aud":"https://jwt-rp.example.net", 314 "nbf":1300815780, 315 "exp":1300819380, 316 "http://claims.example.com/member":true} 318 The following example JSON object, used as the header of a JWT, 319 declares that the JWT is signed with the ECDSA P-256 SHA-256 320 algorithm. 322 {"alg":"ES256"} 324 To present the JWT with the claims and header shown in the previous 325 example as part of an access token request, for example, the client 326 might make the following HTTPS request (with extra line breaks for 327 display purposes only): 329 POST /token.oauth2 HTTP/1.1 330 Host: authz.example.net 331 Content-Type: application/x-www-form-urlencoded 333 grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer 334 &assertion=eyJhbGciOiJFUzI1NiJ9. 335 eyJpc3Mi[...omitted for brevity...]. 336 J9l-ZhwP[...omitted for brevity...] 338 5. Security Considerations 340 No additional security considerations apply beyond those described 341 within The OAuth 2.0 Authorization Framework [I-D.ietf-oauth-v2], the 342 Assertion Framework for OAuth 2.0 [I-D.ietf-oauth-assertions], and 343 the JSON Web Token (JWT) [JWT] specification. 345 6. IANA Considerations 347 6.1. Sub-Namespace Registration of 348 urn:ietf:params:oauth:grant-type:jwt-bearer 350 This specification registers the value "grant-type:jwt-bearer" in the 351 IANA urn:ietf:params:oauth registry established in An IETF URN Sub- 352 Namespace for OAuth [I-D.ietf-oauth-urn-sub-ns]. 354 o URN: urn:ietf:params:oauth:grant-type:jwt-bearer 356 o Common Name: JWT Bearer Token Grant Type Profile for OAuth 2.0 358 o Change controller: IETF 360 o Specification Document: [[this document]] 362 6.2. Sub-Namespace Registration of 363 urn:ietf:params:oauth:client-assertion-type:jwt-bearer 365 This specification registers the value 366 "client-assertion-type:jwt-bearer" in the IANA urn:ietf:params:oauth 367 registry established in An IETF URN Sub-Namespace for OAuth 368 [I-D.ietf-oauth-urn-sub-ns]. 370 o URN: urn:ietf:params:oauth:client-assertion-type:jwt-bearer 372 o Common Name: JWT Bearer Token Profile for OAuth 2.0 Client 373 Authentication 375 o Change controller: IETF 377 o Specification Document: [[this document]] 379 7. References 381 7.1. Normative References 383 [I-D.ietf-oauth-assertions] 384 Campbell, B., Mortimore, C., Jones, M., and Y. Goland, 385 "Assertion Framework for OAuth 2.0", 386 draft-ietf-oauth-assertions-04 (work in progress), 387 July 2012. 389 [I-D.ietf-oauth-urn-sub-ns] 390 Campbell, B. and H. Tschofenig, "An IETF URN Sub-Namespace 391 for OAuth", draft-ietf-oauth-urn-sub-ns-05 (work in 392 progress), June 2012. 394 [I-D.ietf-oauth-v2] 395 Hammer-Lahav, E., Recordon, D., and D. Hardt, "The OAuth 396 2.0 Authorization Framework", draft-ietf-oauth-v2-28 (work 397 in progress), June 2012. 399 [JWT] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 400 (JWT)", July 2012. 402 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 403 Requirement Levels", BCP 14, RFC 2119, March 1997. 405 [RFC4627] Crockford, D., "The application/json Media Type for 406 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 408 7.2. Informative References 410 [I-D.ietf-oauth-saml2-bearer] 411 Campbell, B. and C. Mortimore, "SAML 2.0 Bearer Assertion 412 Profiles for OAuth 2.0", draft-ietf-oauth-saml2-bearer-13 413 (work in progress), July 2012. 415 Appendix A. Acknowledgements 417 This profile was derived from SAML 2.0 Bearer Assertion Profiles for 418 OAuth 2.0 [I-D.ietf-oauth-saml2-bearer] by Brian Campbell and Chuck 419 Mortimore. 421 Appendix B. Document History 423 [[ to be removed by the RFC editor before publication as an RFC ]] 425 -02 427 o Add more text to intro explaining that an assertion/JWT grant type 428 can be used with or without client authentication/identification 429 and that client assertion/JWT authentication is nothing more than 430 an alternative way for a client to authenticate to the token 431 endpoint 433 o Add examples to Sections 2.1 and 2.2 435 o Update references 437 -01 439 o Tracked specification name changes: "The OAuth 2.0 Authorization 440 Protocol" to "The OAuth 2.0 Authorization Framework" and "OAuth 441 2.0 Assertion Profile" to "Assertion Framework for OAuth 2.0". 443 o Merged in changes between draft-ietf-oauth-saml2-bearer-11 and 444 draft-ietf-oauth-saml2-bearer-13. All changes were strictly 445 editorial. 447 -00 448 o Created the initial IETF draft based upon 449 draft-jones-oauth-jwt-bearer-04 with no normative changes. 451 Authors' Addresses 453 Michael B. Jones 454 Microsoft 456 Email: mbj@microsoft.com 457 URI: http://self-issued.info/ 459 Brian Campbell 460 Ping Identity Corp. 462 Email: brian.d.campbell@gmail.com 464 Chuck Mortimore 465 Salesforce 467 Email: cmortimore@salesforce.com