idnits 2.17.00 (12 Aug 2021) /tmp/idnits60992/draft-ietf-oauth-json-web-token-12.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 seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- The document date (October 7, 2013) is 3147 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) -- Possible downref: Non-RFC (?) normative reference: ref. 'ECMAScript' == Outdated reference: draft-ietf-jose-json-web-algorithms has been published as RFC 7518 == Outdated reference: draft-ietf-jose-json-web-encryption has been published as RFC 7516 == Outdated reference: draft-ietf-jose-json-web-key has been published as RFC 7517 == Outdated reference: draft-ietf-jose-json-web-signature has been published as RFC 7515 ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Downref: Normative reference to an Informational RFC: RFC 6755 Summary: 3 errors (**), 0 flaws (~~), 6 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 J. Bradley 5 Expires: April 10, 2014 Ping Identity 6 N. Sakimura 7 NRI 8 October 7, 2013 10 JSON Web Token (JWT) 11 draft-ietf-oauth-json-web-token-12 13 Abstract 15 JSON Web Token (JWT) is a compact URL-safe means of representing 16 claims to be transferred between two parties. The claims in a JWT 17 are encoded as a JavaScript Object Notation (JSON) object that is 18 used as the payload of a JSON Web Signature (JWS) structure or as the 19 plaintext of a JSON Web Encryption (JWE) structure, enabling the 20 claims to be digitally signed or MACed and/or encrypted. 22 The suggested pronunciation of JWT is the same as the English word 23 "jot". 25 Status of this Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on April 10, 2014. 42 Copyright Notice 44 Copyright (c) 2013 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 60 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 4 61 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 62 3. JSON Web Token (JWT) Overview . . . . . . . . . . . . . . . . 6 63 3.1. Example JWT . . . . . . . . . . . . . . . . . . . . . . . 6 64 4. JWT Claims . . . . . . . . . . . . . . . . . . . . . . . . . . 8 65 4.1. Registered Claim Names . . . . . . . . . . . . . . . . . . 8 66 4.1.1. "iss" (Issuer) Claim . . . . . . . . . . . . . . . . . 8 67 4.1.2. "sub" (Subject) Claim . . . . . . . . . . . . . . . . 8 68 4.1.3. "aud" (Audience) Claim . . . . . . . . . . . . . . . . 9 69 4.1.4. "exp" (Expiration Time) Claim . . . . . . . . . . . . 9 70 4.1.5. "nbf" (Not Before) Claim . . . . . . . . . . . . . . . 9 71 4.1.6. "iat" (Issued At) Claim . . . . . . . . . . . . . . . 9 72 4.1.7. "jti" (JWT ID) Claim . . . . . . . . . . . . . . . . . 9 73 4.2. Public Claim Names . . . . . . . . . . . . . . . . . . . . 10 74 4.3. Private Claim Names . . . . . . . . . . . . . . . . . . . 10 75 5. JWT Header . . . . . . . . . . . . . . . . . . . . . . . . . . 10 76 5.1. "typ" (Type) Header Parameter . . . . . . . . . . . . . . 10 77 5.2. "cty" (Content Type) Header Parameter . . . . . . . . . . 11 78 5.3. Replicating Claims as Header Parameters . . . . . . . . . 11 79 6. Plaintext JWTs . . . . . . . . . . . . . . . . . . . . . . . . 11 80 6.1. Example Plaintext JWT . . . . . . . . . . . . . . . . . . 12 81 7. Rules for Creating and Validating a JWT . . . . . . . . . . . 12 82 7.1. String Comparison Rules . . . . . . . . . . . . . . . . . 14 83 8. Cryptographic Algorithms . . . . . . . . . . . . . . . . . . . 14 84 9. URI for Declaring that Content is a JWT . . . . . . . . . . . 15 85 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 86 10.1. JSON Web Token Claims Registry . . . . . . . . . . . . . . 15 87 10.1.1. Registration Template . . . . . . . . . . . . . . . . 16 88 10.1.2. Initial Registry Contents . . . . . . . . . . . . . . 17 89 10.2. Sub-Namespace Registration of 90 urn:ietf:params:oauth:token-type:jwt . . . . . . . . . . . 17 91 10.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 17 92 10.3. Media Type Registration . . . . . . . . . . . . . . . . . 18 93 10.3.1. Registry Contents . . . . . . . . . . . . . . . . . . 18 94 10.4. Registration of JWE Header Parameter Names . . . . . . . . 18 95 10.4.1. Registry Contents . . . . . . . . . . . . . . . . . . 18 97 11. Security Considerations . . . . . . . . . . . . . . . . . . . 19 98 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 20 99 12.1. Normative References . . . . . . . . . . . . . . . . . . . 20 100 12.2. Informative References . . . . . . . . . . . . . . . . . . 21 101 Appendix A. JWT Examples . . . . . . . . . . . . . . . . . . . . 22 102 A.1. Example Encrypted JWT . . . . . . . . . . . . . . . . . . 22 103 A.2. Example Nested JWT . . . . . . . . . . . . . . . . . . . . 22 104 Appendix B. Relationship of JWTs to SAML Assertions . . . . . . . 24 105 Appendix C. Relationship of JWTs to Simple Web Tokens (SWTs) . . 25 106 Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 25 107 Appendix E. Document History . . . . . . . . . . . . . . . . . . 25 108 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 29 110 1. Introduction 112 JSON Web Token (JWT) is a compact claims representation format 113 intended for space constrained environments such as HTTP 114 Authorization headers and URI query parameters. JWTs encode claims 115 to be transmitted as a JavaScript Object Notation (JSON) [RFC4627] 116 object that is used as the payload of a JSON Web Signature (JWS) 117 [JWS] structure or as the plaintext of a JSON Web Encryption (JWE) 118 [JWE] structure, enabling the claims to be digitally signed or MACed 119 and/or encrypted. JWTs are always represented using the JWS Compact 120 Serialization or the JWE Compact Serialization. 122 The suggested pronunciation of JWT is the same as the English word 123 "jot". 125 1.1. Notational Conventions 127 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 128 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 129 document are to be interpreted as described in Key words for use in 130 RFCs to Indicate Requirement Levels [RFC2119]. If these words are 131 used without being spelled in uppercase then they are to be 132 interpreted with their normal natural language meanings. 134 2. Terminology 136 JSON Web Token (JWT) A string representing a set of claims as a JSON 137 object that is encoded in a JWS or JWE, enabling the claims to be 138 digitally signed or MACed and/or encrypted. 140 Base64url Encoding Base64 encoding using the URL- and filename-safe 141 character set defined in Section 5 of RFC 4648 [RFC4648], with all 142 trailing '=' characters omitted (as permitted by Section 3.2). 143 (See Appendix C of [JWS] for notes on implementing base64url 144 encoding without padding.) 146 JSON Text Object A UTF-8 [RFC3629] encoded text string representing 147 a JSON object; the syntax of JSON objects is defined in Section 148 2.2 of [RFC4627]. 150 JWT Header A JSON Text Object that describes the cryptographic 151 operations applied to the JWT. When the JWT is digitally signed 152 or MACed, the JWT Header is a JWS Header. When the JWT is 153 encrypted, the JWT Header is a JWE Header. 155 Header Parameter A name/value pair that is member of the JWT Header. 157 Header Parameter Name The name of a member of the JWT Header. 159 Header Parameter Value The value of a member of the JWT Header. 161 JWT Claims Set A JSON Text Object that contains the Claims conveyed 162 by the JWT. 164 Claim A piece of information asserted about a subject. A Claim is 165 represented as a name/value pair consisting of a Claim Name and a 166 Claim Value. 168 Claim Name The name portion of a Claim representation. A Claim Name 169 is always a string. 171 Claim Value The value portion of a Claim representation. A Claim 172 Value can be any JSON value. 174 Encoded JWT Header Base64url encoding of the JWT Header. 176 Nested JWT A JWT in which nested signing and/or encryption are 177 employed. In nested JWTs, a JWT is used as the payload or 178 plaintext value of an enclosing JWS or JWE structure, 179 respectively. 181 Plaintext JWT A JWT whose Claims are not integrity protected or 182 encrypted. 184 Collision Resistant Name A name in a namespace that enables names to 185 be allocated in a manner such that they are highly unlikely to 186 collide with other names. Examples of collision resistant 187 namespaces include: Domain Names, Object Identifiers (OIDs) as 188 defined in the ITU-T X.660 and X.670 Recommendation series, and 189 Universally Unique IDentifiers (UUIDs) [RFC4122]. When using an 190 administratively delegated namespace, the definer of a name needs 191 to take reasonable precautions to ensure they are in control of 192 the portion of the namespace they use to define the name. 194 StringOrURI A JSON string value, with the additional requirement 195 that while arbitrary string values MAY be used, any value 196 containing a ":" character MUST be a URI [RFC3986]. StringOrURI 197 values are compared as case-sensitive strings with no 198 transformations or canonicalizations applied. 200 IntDate A JSON numeric value representing the number of seconds from 201 1970-01-01T0:0:0Z UTC until the specified UTC date/time. See RFC 202 3339 [RFC3339] for details regarding date/times in general and UTC 203 in particular. 205 3. JSON Web Token (JWT) Overview 207 JWTs represent a set of claims as a JSON object that is encoded in a 208 JWS and/or JWE structure. This JSON object is the JWT Claims Set. As 209 per RFC 4627 [RFC4627] Section 2.2, the JSON object consists of zero 210 or more name/value pairs (or members), where the names are strings 211 and the values are arbitrary JSON values. These members are the 212 claims represented by the JWT. 214 The member names within the JWT Claims Set are referred to as Claim 215 Names. The corresponding values are referred to as Claim Values. 217 The contents of the JWT Header describe the cryptographic operations 218 applied to the JWT Claims Set. If the JWT Header is a JWS Header, the 219 JWT is represented as a JWS, and the claims are digitally signed or 220 MACed, with the JWT Claims Set being the JWS Payload. If the JWT 221 Header is a JWE Header, the JWT is represented as a JWE, and the 222 claims are encrypted, with the JWT Claims Set being the input 223 Plaintext. A JWT may be enclosed in another JWE or JWS structure to 224 create a Nested JWT, enabling nested signing and encryption to be 225 performed. 227 A JWT is represented as a sequence of URL-safe parts separated by 228 period ('.') characters. Each part contains a base64url encoded 229 value. The number of parts in the JWT is dependent upon the 230 representation of the resulting JWS or JWE object using the JWS 231 Compact Serialization or the JWE Compact Serialization. 233 3.1. Example JWT 235 The following example JWT Header declares that the encoded object is 236 a JSON Web Token (JWT) and the JWT is a JWS that is MACed using the 237 HMAC SHA-256 algorithm: 239 {"typ":"JWT", 240 "alg":"HS256"} 242 The following octet sequence is the UTF-8 representation of the JWT 243 Header/JWS Header above: 245 [123, 34, 116, 121, 112, 34, 58, 34, 74, 87, 84, 34, 44, 13, 10, 32, 246 34, 97, 108, 103, 34, 58, 34, 72, 83, 50, 53, 54, 34, 125] 247 Base64url encoding the octets of the UTF-8 representation of the JWT 248 Header yields this Encoded JWT Header value (which is also the 249 underlying encoded JWS Header value): 251 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 253 The following is an example of a JWT Claims Set: 255 {"iss":"joe", 256 "exp":1300819380, 257 "http://example.com/is_root":true} 259 The following octet sequence, which is the UTF-8 representation of 260 the JWT Claims Set above, is the JWS Payload: 262 [123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10, 263 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56, 264 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 265 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111, 266 111, 116, 34, 58, 116, 114, 117, 101, 125] 268 Base64url encoding the JWS Payload yields this encoded JWS Payload 269 (with line breaks for display purposes only): 271 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly 272 9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ 274 MACing the encoded JWS Header and encoded JWS Payload with the HMAC 275 SHA-256 algorithm and base64url encoding the HMAC value in the manner 276 specified in [JWS], yields this encoded JWS Signature: 278 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 280 Concatenating these encoded parts in this order with period ('.') 281 characters between the parts yields this complete JWT (with line 282 breaks for display purposes only): 284 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 285 . 286 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 287 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 288 . 289 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 291 This computation is illustrated in more detail in Appendix A.1 of 292 [JWS]. See Appendix A.1 for an example of an encrypted JWT. 294 4. JWT Claims 296 The JWT Claims Set represents a JSON object whose members are the 297 claims conveyed by the JWT. The Claim Names within a JWT Claims Set 298 MUST be unique; recipients MUST either reject JWTs with duplicate 299 Claim Names or use a JSON parser that returns only the lexically last 300 duplicate member name, as specified in Section 15.12 (The JSON 301 Object) of ECMAScript 5.1 [ECMAScript]. 303 The set of claims that a JWT must contain to be considered valid is 304 context-dependent and is outside the scope of this specification. 305 Specific applications of JWTs will require implementations to 306 understand and process some claims in particular ways. However, in 307 the absence of such requirements, all claims that are not understood 308 by implementations SHOULD be ignored. 310 There are three classes of JWT Claim Names: Registered Claim Names, 311 Public Claim Names, and Private Claim Names. 313 4.1. Registered Claim Names 315 The following Claim Names are registered in the IANA JSON Web Token 316 Claims registry defined in Section 10.1. None of the claims defined 317 below are intended to be mandatory to use, but rather, provide a 318 starting point for a set of useful, interoperable claims. All the 319 names are short because a core goal of JWTs is for the representation 320 to be compact. 322 4.1.1. "iss" (Issuer) Claim 324 The "iss" (issuer) claim identifies the principal that issued the 325 JWT. The processing of this claim is generally application specific. 326 The "iss" value is a case sensitive string containing a StringOrURI 327 value. Use of this claim is OPTIONAL. 329 4.1.2. "sub" (Subject) Claim 331 The "sub" (subject) claim identifies the principal that is the 332 subject of the JWT. The Claims in a JWT are normally statements 333 about the subject. The subject value MAY be scoped to be locally 334 unique in the context of the issuer or MAY be globally unique. The 335 processing of this claim is generally application specific. The 336 "sub" value is a case sensitive string containing a StringOrURI 337 value. Use of this claim is OPTIONAL. 339 4.1.3. "aud" (Audience) Claim 341 The "aud" (audience) claim identifies the audiences that the JWT is 342 intended for. Each principal intended to process the JWT MUST 343 identify itself with a value in audience claim. If the principal 344 processing the claim does not identify itself with a value in the 345 "aud" claim, then the JWT MUST be rejected. In the general case, the 346 "aud" value is an array of case sensitive strings, each containing a 347 StringOrURI value. In the special case when the JWT has one 348 audience, the "aud" value MAY be a single case sensitive string 349 containing a StringOrURI value. The interpretation of audience 350 values is generally application specific. Use of this claim is 351 OPTIONAL. 353 4.1.4. "exp" (Expiration Time) Claim 355 The "exp" (expiration time) claim identifies the expiration time on 356 or after which the JWT MUST NOT be accepted for processing. The 357 processing of the "exp" claim requires that the current date/time 358 MUST be before the expiration date/time listed in the "exp" claim. 359 Implementers MAY provide for some small leeway, usually no more than 360 a few minutes, to account for clock skew. Its value MUST be a number 361 containing an IntDate value. Use of this claim is OPTIONAL. 363 4.1.5. "nbf" (Not Before) Claim 365 The "nbf" (not before) claim identifies the time before which the JWT 366 MUST NOT be accepted for processing. The processing of the "nbf" 367 claim requires that the current date/time MUST be after or equal to 368 the not-before date/time listed in the "nbf" claim. Implementers MAY 369 provide for some small leeway, usually no more than a few minutes, to 370 account for clock skew. Its value MUST be a number containing an 371 IntDate value. Use of this claim is OPTIONAL. 373 4.1.6. "iat" (Issued At) Claim 375 The "iat" (issued at) claim identifies the time at which the JWT was 376 issued. This claim can be used to determine the age of the JWT. Its 377 value MUST be a number containing an IntDate value. Use of this 378 claim is OPTIONAL. 380 4.1.7. "jti" (JWT ID) Claim 382 The "jti" (JWT ID) claim provides a unique identifier for the JWT. 383 The identifier value MUST be assigned in a manner that ensures that 384 there is a negligible probability that the same value will be 385 accidentally assigned to a different data object. The "jti" claim 386 can be used to prevent the JWT from being replayed. The "jti" value 387 is a case sensitive string. Use of this claim is OPTIONAL. 389 4.2. Public Claim Names 391 Claim Names can be defined at will by those using JWTs. However, in 392 order to prevent collisions, any new Claim Name SHOULD either be 393 registered in the IANA JSON Web Token Claims registry defined in 394 Section 10.1 or be a Public Name: a value that contains a Collision 395 Resistant Name. In each case, the definer of the name or value needs 396 to take reasonable precautions to make sure they are in control of 397 the part of the namespace they use to define the Claim Name. 399 4.3. Private Claim Names 401 A producer and consumer of a JWT MAY agree to use Claim Names that 402 are Private Names: names that are not Registered Claim Names 403 Section 4.1 or Public Claim Names Section 4.2. Unlike Public Claim 404 Names, Private Claim Names are subject to collision and should be 405 used with caution. 407 5. JWT Header 409 The members of the JSON object represented by the JWT Header describe 410 the cryptographic operations applied to the JWT and optionally, 411 additional properties of the JWT. The member names within the JWT 412 Header are referred to as Header Parameter Names. These names MUST 413 be unique; recipients MUST either reject JWTs with duplicate Header 414 Parameter Names or use a JSON parser that returns only the lexically 415 last duplicate member name, as specified in Section 15.12 (The JSON 416 Object) of ECMAScript 5.1 [ECMAScript]. The corresponding values are 417 referred to as Header Parameter Values. 419 JWS Header Parameters are defined by [JWS]. JWE Header Parameters 420 are defined by [JWE]. This specification further specifies the use 421 of the following Header Parameter in both the cases where the JWT is 422 a JWS and where it is a JWE. 424 5.1. "typ" (Type) Header Parameter 426 The "typ" (type) Header Parameter defined by [JWS] and [JWE] is used 427 to declare the MIME Media Type [IANA.MediaTypes] of this complete JWT 428 in contexts where this is useful to the application. This parameter 429 has no effect upon the JWT processing. If present, it is RECOMMENDED 430 that its value be "JWT" to indicate that this object is a JWT. While 431 media type names are not case sensitive, it is RECOMMENDED that "JWT" 432 always be spelled using uppercase characters for compatibility with 433 legacy implementations. Use of this Header Parameter is OPTIONAL. 435 5.2. "cty" (Content Type) Header Parameter 437 The "cty" (content type) Header Parameter defined by [JWS] and [JWE] 438 is used by this specification to convey structural information about 439 the JWT. 441 In the normal case where nested signing or encryption operations are 442 not employed, the use of this Header Parameter is NOT RECOMMENDED. 443 In the case that nested signing or encryption is employed, the use of 444 this Header Parameter is REQUIRED; in this case, the value MUST be 445 "JWT", to indicate that a Nested JWT is carried in this JWT. While 446 media type names are not case sensitive, it is RECOMMENDED that "JWT" 447 always be spelled using uppercase characters for compatibility with 448 legacy implementations. See Appendix A.2 for an example of a Nested 449 JWT. 451 5.3. Replicating Claims as Header Parameters 453 In some applications using encrypted JWTs, it is useful to have an 454 unencrypted representation of some Claims. This might be used, for 455 instance, in application processing rules to determine whether and 456 how to process the JWT before it is decrypted. 458 This specification allows Claims present in the JWT Claims Set to be 459 replicated as Header Parameters in a JWT that is a JWE, as needed by 460 the application. If such replicated Claims are present, the 461 application receiving them SHOULD verify that their values are 462 identical. It is the responsibility of the application to ensure 463 that only claims that are safe to be transmitted in an unencrypted 464 manner are replicated as Header Parameter Values in the JWT. 466 This specification registers the "iss" (issuer), "sub" (subject), and 467 "aud" (audience) Header Parameter Names for the purpose of providing 468 unencrypted replicas of these Claims in encrypted JWTs for 469 applications that need them. Other specifications MAY similarly 470 register other names that are registered Claim Names as Header 471 Parameter Names, as needed. 473 6. Plaintext JWTs 475 To support use cases where the JWT content is secured by a means 476 other than a signature and/or encryption contained within the JWT 477 (such as a signature on a data structure containing the JWT), JWTs 478 MAY also be created without a signature or encryption. A plaintext 479 JWT is a JWS using the "none" JWS "alg" Header Parameter Value 480 defined in JSON Web Algorithms (JWA) [JWA]; it is a JWS with the 481 empty string for its JWS Signature value. 483 6.1. Example Plaintext JWT 485 The following example JWT Header declares that the encoded object is 486 a Plaintext JWT: 488 {"alg":"none"} 490 Base64url encoding the octets of the UTF-8 representation of the JWT 491 Header yields this Encoded JWT Header: 493 eyJhbGciOiJub25lIn0 495 The following is an example of a JWT Claims Set: 497 {"iss":"joe", 498 "exp":1300819380, 499 "http://example.com/is_root":true} 501 Base64url encoding the octets of the UTF-8 representation of the JWT 502 Claims Set yields this encoded JWS Payload (with line breaks for 503 display purposes only): 505 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 506 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 508 The encoded JWS Signature is the empty string. 510 Concatenating these encoded parts in this order with period ('.') 511 characters between the parts yields this complete JWT (with line 512 breaks for display purposes only): 514 eyJhbGciOiJub25lIn0 515 . 516 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 517 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 518 . 520 7. Rules for Creating and Validating a JWT 522 To create a JWT, one MUST perform these steps. The order of the 523 steps is not significant in cases where there are no dependencies 524 between the inputs and outputs of the steps. 526 1. Create a JWT Claims Set containing the desired claims. Note that 527 white space is explicitly allowed in the representation and no 528 canonicalization need be performed before encoding. 530 2. Let the Message be the octets of the UTF-8 representation of the 531 JWT Claims Set. 533 3. Create a JWT Header containing the desired set of Header 534 Parameters. The JWT MUST conform to either the [JWS] or [JWE] 535 specifications. Note that white space is explicitly allowed in 536 the representation and no canonicalization need be performed 537 before encoding. 539 4. Base64url encode the octets of the UTF-8 representation of the 540 JWT Header. Let this be the Encoded JWT Header. 542 5. Depending upon whether the JWT is a JWS or JWE, there are two 543 cases: 545 * If the JWT is a JWS, create a JWS using the JWT Header as the 546 JWS Header and the Message as the JWS Payload; all steps 547 specified in [JWS] for creating a JWS MUST be followed. 549 * Else, if the JWT is a JWE, create a JWE using the JWT Header 550 as the JWE Header and the Message as the JWE Plaintext; all 551 steps specified in [JWE] for creating a JWE MUST be followed. 553 6. If a nested signing or encryption operation will be performed, 554 let the Message be the JWS or JWE, and return to Step 3, using a 555 "cty" (content type) value of "JWT" in the new JWT Header created 556 in that step. 558 7. Otherwise, let the resulting JWT be the JWS or JWE. 560 When validating a JWT the following steps MUST be taken. The order 561 of the steps is not significant in cases where there are no 562 dependencies between the inputs and outputs of the steps. If any of 563 the listed steps fails then the JWT MUST be rejected for processing. 565 1. The JWT MUST contain at least one period ('.') character. 567 2. Let the Encoded JWT Header be the portion of the JWT before the 568 first period ('.') character. 570 3. The Encoded JWT Header MUST be successfully base64url decoded 571 following the restriction given in this specification that no 572 padding characters have been used. 574 4. The resulting JWT Header MUST be completely valid JSON syntax 575 conforming to RFC 4627 [RFC4627]. 577 5. The resulting JWT Header MUST be validated to only include 578 parameters and values whose syntax and semantics are both 579 understood and supported or that are specified as being ignored 580 when not understood. 582 6. Determine whether the JWT is a JWS or a JWE by examining the 583 "alg" (algorithm) header value and optionally, the "enc" 584 (encryption method) header value, if present. 586 7. Depending upon whether the JWT is a JWS or JWE, there are two 587 cases: 589 * If the JWT is a JWS, all steps specified in [JWS] for 590 validating a JWS MUST be followed. Let the Message be the 591 result of base64url decoding the JWS Payload. 593 * Else, if the JWT is a JWE, all steps specified in [JWE] for 594 validating a JWE MUST be followed. Let the Message be the 595 JWE Plaintext. 597 8. If the JWT Header contains a "cty" (content type) value of 598 "JWT", then the Message is a JWT that was the subject of nested 599 signing or encryption operations. In this case, return to Step 600 1, using the Message as the JWT. 602 9. Otherwise, let the JWT Claims Set be the Message. 604 10. The JWT Claims Set MUST be completely valid JSON syntax 605 conforming to RFC 4627 [RFC4627]. 607 7.1. String Comparison Rules 609 Processing a JWT inevitably requires comparing known strings to 610 values in JSON objects. For example, in checking what the algorithm 611 is, the Unicode string encoding "alg" will be checked against the 612 member names in the JWT Header to see if there is a matching Header 613 Parameter Name. 615 Comparisons between JSON strings and other Unicode strings MUST be 616 performed by comparing Unicode code points without normalization as 617 specified in the String Comparison Rules in Section 5.3 of [JWS]. 619 8. Cryptographic Algorithms 621 JWTs use JSON Web Signature (JWS) [JWS] and JSON Web Encryption (JWE) 622 [JWE] to sign and/or encrypt the contents of the JWT. 624 Of the JWA signing algorithms, only HMAC SHA-256 ("HS256") and "none" 625 MUST be implemented by conforming JWT implementations. It is 626 RECOMMENDED that implementations also support RSASSA-PKCS1-V1_5 with 627 the SHA-256 hash algorithm ("RS256") and ECDSA using the P-256 curve 628 and the SHA-256 hash algorithm ("ES256"). Support for other 629 algorithms and key sizes is OPTIONAL. 631 If an implementation provides encryption capabilities, of the JWA 632 encryption algorithms, only RSAES-PKCS1-V1_5 with 2048 bit keys 633 ("RSA1_5"), AES Key Wrap with 128 and 256 bit keys ("A128KW" and 634 "A256KW"), and the composite authenticated encryption algorithm using 635 AES CBC and HMAC SHA-2 ("A128CBC-HS256" and "A256CBC-HS512") MUST be 636 implemented by conforming implementations. It is RECOMMENDED that 637 implementations also support using ECDH-ES to agree upon a key used 638 to wrap the Content Encryption Key ("ECDH-ES+A128KW" and 639 "ECDH-ES+A256KW") and AES in Galois/Counter Mode (GCM) with 128 bit 640 and 256 bit keys ("A128GCM" and "A256GCM"). Support for other 641 algorithms and key sizes is OPTIONAL. 643 9. URI for Declaring that Content is a JWT 645 This specification registers the URN 646 "urn:ietf:params:oauth:token-type:jwt" for use by applications that 647 declare content types using URIs (rather than, for instance, MIME 648 Media Types) to indicate that the content referred to is a JWT. 650 10. IANA Considerations 652 10.1. JSON Web Token Claims Registry 654 This specification establishes the IANA JSON Web Token Claims 655 registry for JWT Claim Names. The registry records the Claim Name 656 and a reference to the specification that defines it. This 657 specification registers the Claim Names defined in Section 4.1. 659 Values are registered with a Specification Required [RFC5226] after a 660 two-week review period on the [TBD]@ietf.org mailing list, on the 661 advice of one or more Designated Experts. However, to allow for the 662 allocation of values prior to publication, the Designated Expert(s) 663 may approve registration once they are satisfied that such a 664 specification will be published. 666 Registration requests must be sent to the [TBD]@ietf.org mailing list 667 for review and comment, with an appropriate subject (e.g., "Request 668 for access token type: example"). [[ Note to the RFC Editor: The name 669 of the mailing list should be determined in consultation with the 670 IESG and IANA. Suggested name: jwt-reg-review. ]] 672 Within the review period, the Designated Expert(s) will either 673 approve or deny the registration request, communicating this decision 674 to the review list and IANA. Denials should include an explanation 675 and, if applicable, suggestions as to how to make the request 676 successful. Registration requests that are undetermined for a period 677 longer than 21 days can be brought to the IESG's attention (using the 678 iesg@iesg.org mailing list) for resolution. 680 Criteria that should be applied by the Designated Expert(s) includes 681 determining whether the proposed registration duplicates existing 682 functionality, determining whether it is likely to be of general 683 applicability or whether it is useful only for a single application, 684 and whether the registration makes sense. 686 IANA must only accept registry updates from the Designated Expert(s) 687 and should direct all requests for registration to the review mailing 688 list. 690 It is suggested that multiple Designated Experts be appointed who are 691 able to represent the perspectives of different applications using 692 this specification, in order to enable broadly-informed review of 693 registration decisions. In cases where a registration decision could 694 be perceived as creating a conflict of interest for a particular 695 Expert, that Expert should defer to the judgment of the other 696 Expert(s). 698 10.1.1. Registration Template 700 Claim Name: 701 The name requested (e.g., "example"). Because a core goal of this 702 specification is for the resulting representations to be compact, 703 it is RECOMMENDED that the name be short -- not to exceed 8 704 characters without a compelling reason to do so. This name is 705 case sensitive. Names may not match other registered names in a 706 case insensitive manner unless the Designated Expert(s) state that 707 there is a compelling reason to allow an exception in this 708 particular case. 710 Change Controller: 711 For Standards Track RFCs, state "IESG". For others, give the name 712 of the responsible party. Other details (e.g., postal address, 713 email address, home page URI) may also be included. 715 Specification Document(s): 716 Reference to the document(s) that specify the parameter, 717 preferably including URI(s) that can be used to retrieve copies of 718 the document(s). An indication of the relevant sections may also 719 be included but is not required. 721 10.1.2. Initial Registry Contents 723 o Claim Name: "iss" 724 o Change Controller: IESG 725 o Specification Document(s): Section 4.1.1 of [[ this document ]] 727 o Claim Name: "sub" 728 o Change Controller: IESG 729 o Specification Document(s): Section 4.1.2 of [[ this document ]] 731 o Claim Name: "aud" 732 o Change Controller: IESG 733 o Specification Document(s): Section 4.1.3 of [[ this document ]] 735 o Claim Name: "exp" 736 o Change Controller: IESG 737 o Specification Document(s): Section 4.1.4 of [[ this document ]] 739 o Claim Name: "nbf" 740 o Change Controller: IESG 741 o Specification Document(s): Section 4.1.5 of [[ this document ]] 743 o Claim Name: "iat" 744 o Change Controller: IESG 745 o Specification Document(s): Section 4.1.6 of [[ this document ]] 747 o Claim Name: "jti" 748 o Change Controller: IESG 749 o Specification Document(s): Section 4.1.7 of [[ this document ]] 751 10.2. Sub-Namespace Registration of 752 urn:ietf:params:oauth:token-type:jwt 754 10.2.1. Registry Contents 756 This specification registers the value "token-type:jwt" in the IANA 757 urn:ietf:params:oauth registry established in An IETF URN Sub- 758 Namespace for OAuth [RFC6755], which can be used to indicate that the 759 content is a JWT. 761 o URN: urn:ietf:params:oauth:token-type:jwt 762 o Common Name: JSON Web Token (JWT) Token Type 763 o Change Controller: IESG 764 o Specification Document(s): [[this document]] 766 10.3. Media Type Registration 768 10.3.1. Registry Contents 770 This specification registers the "application/jwt" Media Type 771 [RFC2046] in the MIME Media Types registry [IANA.MediaTypes], which 772 can be used to indicate that the content is a JWT. 774 o Type Name: application 775 o Subtype Name: jwt 776 o Required Parameters: n/a 777 o Optional Parameters: n/a 778 o Encoding considerations: 8bit; JWT values are encoded as a series 779 of base64url encoded values (some of which may be the empty 780 string) separated by period ('.') characters. 781 o Security Considerations: See the Security Considerations section 782 of [[ this document ]] 783 o Interoperability Considerations: n/a 784 o Published Specification: [[ this document ]] 785 o Applications that use this media type: OpenID Connect, Mozilla 786 Persona, Salesforce, Google, numerous others 787 o Additional Information: Magic number(s): n/a, File extension(s): 788 n/a, Macintosh file type code(s): n/a 789 o Person & email address to contact for further information: Michael 790 B. Jones, mbj@microsoft.com 791 o Intended Usage: COMMON 792 o Restrictions on Usage: none 793 o Author: Michael B. Jones, mbj@microsoft.com 794 o Change Controller: IESG 796 10.4. Registration of JWE Header Parameter Names 798 This specification registers specific Claim Names defined in 799 Section 4.1 in the IANA JSON Web Signature and Encryption Header 800 Parameters registry defined in [JWS] for use by Claims replicated as 801 Header Parameters, per Section 5.3. 803 10.4.1. Registry Contents 805 o Header Parameter Name: "iss" 806 o Header Parameter Usage Location(s): JWE 807 o Change Controller: IESG 808 o Specification Document(s): Section 4.1.1 of [[ this document ]] 810 o Header Parameter Name: "sub" 811 o Header Parameter Usage Location(s): JWE 812 o Change Controller: IESG 813 o Specification Document(s): Section 4.1.2 of [[ this document ]] 815 o Header Parameter Name: "aud" 816 o Header Parameter Usage Location(s): JWE 817 o Change Controller: IESG 818 o Specification Document(s): Section 4.1.3 of [[ this document ]] 820 11. Security Considerations 822 All of the security issues faced by any cryptographic application 823 must be faced by a JWT/JWS/JWE/JWK agent. Among these issues are 824 protecting the user's private and symmetric keys, preventing various 825 attacks, and helping the user avoid mistakes such as inadvertently 826 encrypting a message for the wrong recipient. The entire list of 827 security considerations is beyond the scope of this document. 829 All the security considerations in the JWS specification also apply 830 to JWT, as do the JWE security considerations when encryption is 831 employed. In particular, the JWS JSON Security Considerations and 832 Unicode Comparison Security Considerations apply equally to the JWT 833 Claims Set in the same manner that they do to the JWS Header. 835 While syntactically, the signing and encryption operations for Nested 836 JWTs may be applied in any order, normally senders should sign the 837 message and then encrypt the result (thus encrypting the signature). 838 This prevents attacks in which the signature is stripped, leaving 839 just an encrypted message, as well as providing privacy for the 840 signer. Furthermore, signatures over encrypted text are not 841 considered valid in many jurisdictions. 843 Note that potential concerns about security issues related to the 844 order of signing and encryption operations are already addressed by 845 the underlying JWS and JWE specifications; in particular, because JWE 846 only supports the use of authenticated encryption algorithms, 847 cryptographic concerns about the potential need to sign after 848 encryption that apply in many contexts do not apply to this 849 specification. 851 12. References 852 12.1. Normative References 854 [ECMAScript] 855 Ecma International, "ECMAScript Language Specification, 856 5.1 Edition", ECMA 262, June 2011. 858 [IANA.MediaTypes] 859 Internet Assigned Numbers Authority (IANA), "MIME Media 860 Types", 2005. 862 [JWA] Jones, M., "JSON Web Algorithms (JWA)", 863 draft-ietf-jose-json-web-algorithms (work in progress), 864 October 2013. 866 [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web 867 Encryption (JWE)", draft-ietf-jose-json-web-encryption 868 (work in progress), October 2013. 870 [JWK] Jones, M., "JSON Web Key (JWK)", 871 draft-ietf-jose-json-web-key (work in progress), 872 October 2013. 874 [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 875 Signature (JWS)", draft-ietf-jose-json-web-signature (work 876 in progress), October 2013. 878 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 879 Extensions (MIME) Part Two: Media Types", RFC 2046, 880 November 1996. 882 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 883 Requirement Levels", BCP 14, RFC 2119, March 1997. 885 [RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the 886 Internet: Timestamps", RFC 3339, July 2002. 888 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 889 10646", STD 63, RFC 3629, November 2003. 891 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 892 Resource Identifier (URI): Generic Syntax", STD 66, 893 RFC 3986, January 2005. 895 [RFC4627] Crockford, D., "The application/json Media Type for 896 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 898 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 899 Encodings", RFC 4648, October 2006. 901 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 902 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 903 May 2008. 905 [RFC6755] Campbell, B. and H. Tschofenig, "An IETF URN Sub-Namespace 906 for OAuth", RFC 6755, October 2012. 908 12.2. Informative References 910 [CanvasApp] 911 Facebook, "Canvas Applications", 2010. 913 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 914 September 2010. 916 [MagicSignatures] 917 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 918 Signatures", January 2011. 920 [OASIS.saml-core-2.0-os] 921 Cantor, S., Kemp, J., Philpott, R., and E. Maler, 922 "Assertions and Protocol for the OASIS Security Assertion 923 Markup Language (SAML) V2.0", OASIS Standard saml-core- 924 2.0-os, March 2005. 926 [RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup 927 Language) XML-Signature Syntax and Processing", RFC 3275, 928 March 2002. 930 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 931 Unique IDentifier (UUID) URN Namespace", RFC 4122, 932 July 2005. 934 [SWT] Hardt, D. and Y. Goland, "Simple Web Token (SWT)", 935 Version 0.9.5.1, November 2009. 937 [W3C.CR-xml11-20021015] 938 Cowan, J., "Extensible Markup Language (XML) 1.1", W3C 939 CR CR-xml11-20021015, October 2002. 941 [W3C.REC-xml-c14n-20010315] 942 Boyer, J., "Canonical XML Version 1.0", World Wide Web 943 Consortium Recommendation REC-xml-c14n-20010315, 944 March 2001, 945 . 947 Appendix A. JWT Examples 949 This section contains examples of JWTs. For other example JWTs, see 950 Section 6.1 and Appendices A.1, A.2, and A.3 of [JWS]. 952 A.1. Example Encrypted JWT 954 This example encrypts the same claims as used in Section 3.1 to the 955 recipient using RSAES-PKCS1-V1_5 and AES_128_CBC_HMAC_SHA_256. 957 The following example JWE Header (with line breaks for display 958 purposes only) declares that: 960 o the Content Encryption Key is encrypted to the recipient using the 961 RSAES-PKCS1-V1_5 algorithm to produce the JWE Encrypted Key and 963 o the Plaintext is encrypted using the AES_128_CBC_HMAC_SHA_256 964 algorithm to produce the Ciphertext. 966 {"alg":"RSA1_5","enc":"A128CBC-HS256"} 968 Other than using the octets of the UTF-8 representation of the JWT 969 Claims Set from Section 3.1 as the plaintext value, the computation 970 of this JWT is identical to the computation of the JWE in Appendix 971 A.2 of [JWE], including the keys used. 973 The final result in this example (with line breaks for display 974 purposes only) is: 976 eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0. 977 QR1Owv2ug2WyPBnbQrRARTeEk9kDO2w8qDcjiHnSJflSdv1iNqhWXaKH4MqAkQtM 978 oNfABIPJaZm0HaA415sv3aeuBWnD8J-Ui7Ah6cWafs3ZwwFKDFUUsWHSK-IPKxLG 979 TkND09XyjORj_CHAgOPJ-Sd8ONQRnJvWn_hXV1BNMHzUjPyYwEsRhDhzjAD26ima 980 sOTsgruobpYGoQcXUwFDn7moXPRfDE8-NoQX7N7ZYMmpUDkR-Cx9obNGwJQ3nM52 981 YCitxoQVPzjbl7WBuB7AohdBoZOdZ24WlN1lVIeh8v1K4krB8xgKvRU8kgFrEn_a 982 1rZgN5TiysnmzTROF869lQ. 983 AxY8DCtDaGlsbGljb3RoZQ. 984 MKOle7UQrG6nSxTLX6Mqwt0orbHvAKeWnDYvpIAeZ72deHxz3roJDXQyhxx0wKaM 985 HDjUEOKIwrtkHthpqEanSBNYHZgmNOV7sln1Eu9g3J8. 986 fiK51VwhsxJ-siBMR-YFiA 988 A.2. Example Nested JWT 990 This example shows how a JWT can be used as the payload of a JWE or 991 JWS to create a Nested JWT. In this case, the JWT Claims Set is 992 first signed, and then encrypted. 994 The inner signed JWT is identical to the example in Appendix A.2 of 995 [JWS]. Therefore, its computation is not repeated here. This 996 example then encrypts this inner JWT to the recipient using RSAES- 997 PKCS1-V1_5 and AES_128_CBC_HMAC_SHA_256. 999 The following example JWE Header (with line breaks for display 1000 purposes only) declares that: 1002 o the Content Encryption Key is encrypted to the recipient using the 1003 RSAES-PKCS1-V1_5 algorithm to produce the JWE Encrypted Key, 1005 o the Plaintext is encrypted using the AES_128_CBC_HMAC_SHA_256 1006 algorithm to produce the Ciphertext, and 1008 o the Plaintext is itself a JWT. 1010 {"alg":"RSA1_5","enc":"A128CBC-HS256","cty":"JWT"} 1012 Base64url encoding the octets of the UTF-8 representation of the JWE 1013 Header yields this encoded JWE Header value: 1015 eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5IjoiSldUIn0 1017 The computation of this JWT is identical to the computation of the 1018 JWE in Appendix A.2 of [JWE], other than that different JWE Header, 1019 Plaintext, Initialization Vector, and Content Encryption Key values 1020 are used. (The RSA key used is the same.) 1022 The Payload used is the octets of the ASCII representation of the JWT 1023 at the end of Appendix Section A.2.1 of [JWS] (with all whitespace 1024 and line breaks removed), which is a sequence of 458 octets. 1026 The Initialization Vector value used is: 1028 [82, 101, 100, 109, 111, 110, 100, 32, 87, 65, 32, 57, 56, 48, 53, 1029 50] 1031 This example uses the Content Encryption Key represented in JSON Web 1032 Key [JWK] format below: 1034 {"kty":"oct", 1035 "k":"GawgguFyGrWKav7AX4VKUg" 1036 } 1038 The final result for this Nested JWT (with line breaks for display 1039 purposes only) is: 1041 eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5IjoiSldU 1042 In0. 1043 g_hEwksO1Ax8Qn7HoN-BVeBoa8FXe0kpyk_XdcSmxvcM5_P296JXXtoHISr_DD_M 1044 qewaQSH4dZOQHoUgKLeFly-9RI11TG-_Ge1bZFazBPwKC5lJ6OLANLMd0QSL4fYE 1045 b9ERe-epKYE3xb2jfY1AltHqBO-PM6j23Guj2yDKnFv6WO72tteVzm_2n17SBFvh 1046 DuR9a2nHTE67pe0XGBUS_TK7ecA-iVq5COeVdJR4U4VZGGlxRGPLRHvolVLEHx6D 1047 YyLpw30Ay9R6d68YCLi9FYTq3hIXPK_-dmPlOUlKvPr1GgJzRoeC9G5qCvdcHWsq 1048 JGTO_z3Wfo5zsqwkxruxwA. 1049 UmVkbW9uZCBXQSA5ODA1Mg. 1050 VwHERHPvCNcHHpTjkoigx3_ExK0Qc71RMEParpatm0X_qpg-w8kozSjfNIPPXiTB 1051 BLXR65CIPkFqz4l1Ae9w_uowKiwyi9acgVztAi-pSL8GQSXnaamh9kX1mdh3M_TT 1052 -FZGQFQsFhu0Z72gJKGdfGE-OE7hS1zuBD5oEUfk0Dmb0VzWEzpxxiSSBbBAzP10 1053 l56pPfAtrjEYw-7ygeMkwBl6Z_mLS6w6xUgKlvW6ULmkV-uLC4FUiyKECK4e3WZY 1054 Kw1bpgIqGYsw2v_grHjszJZ-_I5uM-9RA8ycX9KqPRp9gc6pXmoU_-27ATs9XCvr 1055 ZXUtK2902AUzqpeEUJYjWWxSNsS-r1TJ1I-FMJ4XyAiGrfmo9hQPcNBYxPz3GQb2 1056 8Y5CLSQfNgKSGt0A4isp1hBUXBHAndgtcslt7ZoQJaKe_nNJgNliWtWpJ_ebuOpE 1057 l8jdhehdccnRMIwAmU1n7SPkmhIl1HlSOpvcvDfhUN5wuqU955vOBvfkBOh5A11U 1058 zBuo2WlgZ6hYi9-e3w29bR0C2-pp3jbqxEDw3iWaf2dc5b-LnR0FEYXvI_tYk5rd 1059 _J9N0mg0tQ6RbpxNEMNoA9QWk5lgdPvbh9BaO195abQ. 1060 AVO9iT5AV4CzvDJCdhSFlQ 1062 Appendix B. Relationship of JWTs to SAML Assertions 1064 SAML 2.0 [OASIS.saml-core-2.0-os] provides a standard for creating 1065 security tokens with greater expressivity and more security options 1066 than supported by JWTs. However, the cost of this flexibility and 1067 expressiveness is both size and complexity. SAML's use of XML 1068 [W3C.CR-xml11-20021015] and XML DSIG [RFC3275] contributes to the 1069 size of SAML assertions; its use of XML and especially XML 1070 Canonicalization [W3C.REC-xml-c14n-20010315] contributes to their 1071 complexity. 1073 JWTs are intended to provide a simple security token format that is 1074 small enough to fit into HTTP headers and query arguments in URIs. 1075 It does this by supporting a much simpler token model than SAML and 1076 using the JSON [RFC4627] object encoding syntax. It also supports 1077 securing tokens using Message Authentication Codes (MACs) and digital 1078 signatures using a smaller (and less flexible) format than XML DSIG. 1080 Therefore, while JWTs can do some of the things SAML assertions do, 1081 JWTs are not intended as a full replacement for SAML assertions, but 1082 rather as a token format to be used when ease of implementation or 1083 compactness are considerations. 1085 SAML Assertions are always statements made by an entity about a 1086 subject. JWTs are often used in the same manner, with the entity 1087 making the statements being represented by the "iss" (issuer) claim, 1088 and the subject being represented by the "sub" (subject) claim. 1089 However, with these claims being optional, other uses of the JWT 1090 format are also permitted. 1092 Appendix C. Relationship of JWTs to Simple Web Tokens (SWTs) 1094 Both JWTs and Simple Web Tokens SWT [SWT], at their core, enable sets 1095 of claims to be communicated between applications. For SWTs, both 1096 the claim names and claim values are strings. For JWTs, while claim 1097 names are strings, claim values can be any JSON type. Both token 1098 types offer cryptographic protection of their content: SWTs with HMAC 1099 SHA-256 and JWTs with a choice of algorithms, including signature, 1100 MAC, and encryption algorithms. 1102 Appendix D. Acknowledgements 1104 The authors acknowledge that the design of JWTs was intentionally 1105 influenced by the design and simplicity of Simple Web Tokens [SWT] 1106 and ideas for JSON tokens that Dick Hardt discussed within the OpenID 1107 community. 1109 Solutions for signing JSON content were previously explored by Magic 1110 Signatures [MagicSignatures], JSON Simple Sign [JSS], and Canvas 1111 Applications [CanvasApp], all of which influenced this draft. 1113 This specification is the work of the OAuth Working Group, which 1114 includes dozens of active and dedicated participants. In particular, 1115 the following individuals contributed ideas, feedback, and wording 1116 that influenced this specification: 1118 Dirk Balfanz, Richard Barnes, Brian Campbell, Breno de Medeiros, Dick 1119 Hardt, Joe Hildebrand, Jeff Hodges, Edmund Jay, Yaron Y. Goland, Ben 1120 Laurie, James Manger, Prateek Mishra, Tony Nadalin, Axel Nennker, 1121 John Panzer, Emmanuel Raviart, David Recordon, Eric Rescorla, Jim 1122 Schaad, Paul Tarjan, Hannes Tschofenig, and Sean Turner. 1124 Hannes Tschofenig and Derek Atkins chaired the OAuth working group 1125 and Sean Turner and Stephen Farrell served as Security area directors 1126 during the creation of this specification. 1128 Appendix E. Document History 1130 [[ to be removed by the RFC Editor before publication as an RFC ]] 1132 -12 1133 o Tracked the JOSE change refining the "typ" and "cty" definitions 1134 to always be MIME Media Types, with the omission of "application/" 1135 prefixes recommended for brevity. For compatibility with legacy 1136 implementations, it is RECOMMENDED that "JWT" always be spelled 1137 using uppercase characters when used as a "typ" or "cty" value. 1138 As side effects, this change removed the "typ" Claim definition 1139 and narrowed the uses of the URI 1140 "urn:ietf:params:oauth:token-type:jwt". 1142 o Updated base64url definition to match JOSE definition. 1144 o Changed terminology from "Reserved Claim Name" to "Registered 1145 Claim Name" to match JOSE terminology change. 1147 o Applied other editorial changes to track parallel JOSE changes. 1149 o Clarified that the subject value may be scoped to be locally 1150 unique in the context of the issuer or may be globally unique. 1152 -11 1154 o Added a Nested JWT example. 1156 o Added "sub" to the list of Claims registered for use as Header 1157 Parameter values when an unencrypted representation is required in 1158 an encrypted JWT. 1160 -10 1162 o Allowed Claims to be replicated as Header Parameters in encrypted 1163 JWTs as needed by applications that require an unencrypted 1164 representation of specific Claims. 1166 -09 1168 o Clarified that the "typ" header parameter is used in an 1169 application-specific manner and has no effect upon the JWT 1170 processing. 1172 o Stated that recipients MUST either reject JWTs with duplicate 1173 Header Parameter Names or with duplicate Claim Names or use a JSON 1174 parser that returns only the lexically last duplicate member name. 1176 -08 1178 o Tracked a change to how JWEs are computed (which only affected the 1179 example encrypted JWT value). 1181 -07 1183 o Defined that the default action for claims that are not understood 1184 is to ignore them unless otherwise specified by applications. 1186 o Changed from using the term "byte" to "octet" when referring to 8 1187 bit values. 1189 o Tracked encryption computation changes in the JWE specification. 1191 -06 1193 o Changed the name of the "prn" claim to "sub" (subject) both to 1194 more closely align with SAML name usage and to use a more 1195 intuitive name. 1197 o Allow JWTs to have multiple audiences. 1199 o Applied editorial improvements suggested by Jeff Hodges, Prateek 1200 Mishra, and Hannes Tschofenig. Many of these simplified the 1201 terminology used. 1203 o Explained why Nested JWTs should be signed and then encrypted. 1205 o Clarified statements of the form "This claim is OPTIONAL" to "Use 1206 of this claim is OPTIONAL". 1208 o Referenced String Comparison Rules in JWS. 1210 o Added seriesInfo information to Internet Draft references. 1212 -05 1214 o Updated values for example AES CBC calculations. 1216 -04 1218 o Promoted Initialization Vector from being a header parameter to 1219 being a top-level JWE element. This saves approximately 16 bytes 1220 in the compact serialization, which is a significant savings for 1221 some use cases. Promoting the Initialization Vector out of the 1222 header also avoids repeating this shared value in the JSON 1223 serialization. 1225 o Applied changes made by the RFC Editor to RFC 6749's registry 1226 language to this specification. 1228 o Reference RFC 6755 -- An IETF URN Sub-Namespace for OAuth. 1230 -03 1232 o Added statement that "StringOrURI values are compared as case- 1233 sensitive strings with no transformations or canonicalizations 1234 applied". 1236 o Indented artwork elements to better distinguish them from the body 1237 text. 1239 -02 1241 o Added an example of an encrypted JWT. 1243 o Added this language to Registration Templates: "This name is case 1244 sensitive. Names that match other registered names in a case 1245 insensitive manner SHOULD NOT be accepted." 1247 o Applied editorial suggestions. 1249 -01 1251 o Added the "cty" (content type) header parameter for declaring type 1252 information about the secured content, as opposed to the "typ" 1253 (type) header parameter, which declares type information about 1254 this object. This significantly simplified nested JWTs. 1256 o Moved description of how to determine whether a header is for a 1257 JWS or a JWE from the JWT spec to the JWE spec. 1259 o Changed registration requirements from RFC Required to 1260 Specification Required with Expert Review. 1262 o Added Registration Template sections for defined registries. 1264 o Added Registry Contents sections to populate registry values. 1266 o Added "Collision Resistant Namespace" to the terminology section. 1268 o Numerous editorial improvements. 1270 -00 1272 o Created the initial IETF draft based upon 1273 draft-jones-json-web-token-10 with no normative changes. 1275 Authors' Addresses 1277 Michael B. Jones 1278 Microsoft 1280 Email: mbj@microsoft.com 1281 URI: http://self-issued.info/ 1283 John Bradley 1284 Ping Identity 1286 Email: ve7jtb@ve7jtb.com 1288 Nat Sakimura 1289 Nomura Research Institute 1291 Email: n-sakimura@nri.co.jp