idnits 2.17.00 (12 Aug 2021) /tmp/idnits14545/draft-ietf-oauth-json-web-token-15.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 (January 20, 2014) is 3042 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-json-rfc4627bis has been published as RFC 7158 == 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 5226 (Obsoleted by RFC 8126) ** Downref: Normative reference to an Informational RFC: RFC 6755 Summary: 2 errors (**), 0 flaws (~~), 7 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: July 24, 2014 Ping Identity 6 N. Sakimura 7 NRI 8 January 20, 2014 10 JSON Web Token (JWT) 11 draft-ietf-oauth-json-web-token-15 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 July 24, 2014. 42 Copyright Notice 44 Copyright (c) 2014 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 . . . . . . . . . . . . . . . . . . . . . . . . . . 7 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 . . . . . . . . . . . . . . . . 8 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 . . . . . . . . . . . . . . . . . . . . 9 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 . . . . . . . . . . 10 78 5.3. Replicating Claims as Header Parameters . . . . . . . . . 11 79 6. Plaintext JWTs . . . . . . . . . . . . . . . . . . . . . . . . 11 80 6.1. Example Plaintext JWT . . . . . . . . . . . . . . . . . . 11 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) 116 [I-D.ietf-json-rfc4627bis] object that is used as the payload of a 117 JSON Web Signature (JWS) [JWS] structure or as the plaintext of a 118 JSON Web Encryption (JWE) [JWE] structure, enabling the claims to be 119 digitally signed or MACed and/or encrypted. JWTs are always 120 represented using the JWS Compact Serialization or the JWE Compact 121 Serialization. 123 The suggested pronunciation of JWT is the same as the English word 124 "jot". 126 1.1. Notational Conventions 128 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 129 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 130 document are to be interpreted as described in Key words for use in 131 RFCs to Indicate Requirement Levels [RFC2119]. If these words are 132 used without being spelled in uppercase then they are to be 133 interpreted with their normal natural language meanings. 135 2. Terminology 137 JSON Web Token (JWT) A string representing a set of claims as a JSON 138 object that is encoded in a JWS or JWE, enabling the claims to be 139 digitally signed or MACed and/or encrypted. 141 Base64url Encoding Base64 encoding using the URL- and filename-safe 142 character set defined in Section 5 of RFC 4648 [RFC4648], with all 143 trailing '=' characters omitted (as permitted by Section 3.2). 144 (See Appendix C of [JWS] for notes on implementing base64url 145 encoding without padding.) 147 JWT Header A JSON object that describes the cryptographic operations 148 applied to the JWT. When the JWT is digitally signed or MACed, 149 the JWT Header is a JWS Header. When the JWT is encrypted, the 150 JWT Header is a JWE Header. 152 Header Parameter A name/value pair that is member of the JWT Header. 154 Header Parameter Name The name of a member of the JWT Header. 156 Header Parameter Value The value of a member of the JWT Header. 158 JWT Claims Set A JSON object that contains the Claims conveyed by 159 the JWT. 161 Claim A piece of information asserted about a subject. A Claim is 162 represented as a name/value pair consisting of a Claim Name and a 163 Claim Value. 165 Claim Name The name portion of a Claim representation. A Claim Name 166 is always a string. 168 Claim Value The value portion of a Claim representation. A Claim 169 Value can be any JSON value. 171 Encoded JWT Header Base64url encoding of the JWT Header. 173 Nested JWT A JWT in which nested signing and/or encryption are 174 employed. In nested JWTs, a JWT is used as the payload or 175 plaintext value of an enclosing JWS or JWE structure, 176 respectively. 178 Plaintext JWT A JWT whose Claims are not integrity protected or 179 encrypted. 181 Collision-Resistant Name A name in a namespace that enables names to 182 be allocated in a manner such that they are highly unlikely to 183 collide with other names. Examples of collision-resistant 184 namespaces include: Domain Names, Object Identifiers (OIDs) as 185 defined in the ITU-T X.660 and X.670 Recommendation series, and 186 Universally Unique IDentifiers (UUIDs) [RFC4122]. When using an 187 administratively delegated namespace, the definer of a name needs 188 to take reasonable precautions to ensure they are in control of 189 the portion of the namespace they use to define the name. 191 StringOrURI A JSON string value, with the additional requirement 192 that while arbitrary string values MAY be used, any value 193 containing a ":" character MUST be a URI [RFC3986]. StringOrURI 194 values are compared as case-sensitive strings with no 195 transformations or canonicalizations applied. 197 IntDate A JSON numeric value representing the number of seconds from 198 1970-01-01T0:0:0Z UTC until the specified UTC date/time. See RFC 199 3339 [RFC3339] for details regarding date/times in general and UTC 200 in particular. 202 3. JSON Web Token (JWT) Overview 204 JWTs represent a set of claims as a JSON object that is encoded in a 205 JWS and/or JWE structure. This JSON object is the JWT Claims Set. As 206 per Section 4 of [I-D.ietf-json-rfc4627bis], the JSON object consists 207 of zero or more name/value pairs (or members), where the names are 208 strings and the values are arbitrary JSON values. These members are 209 the claims represented by the JWT. 211 The member names within the JWT Claims Set are referred to as Claim 212 Names. The corresponding values are referred to as Claim Values. 214 The contents of the JWT Header describe the cryptographic operations 215 applied to the JWT Claims Set. If the JWT Header is a JWS Header, the 216 JWT is represented as a JWS, and the claims are digitally signed or 217 MACed, with the JWT Claims Set being the JWS Payload. If the JWT 218 Header is a JWE Header, the JWT is represented as a JWE, and the 219 claims are encrypted, with the JWT Claims Set being the input 220 Plaintext. A JWT may be enclosed in another JWE or JWS structure to 221 create a Nested JWT, enabling nested signing and encryption to be 222 performed. 224 A JWT is represented as a sequence of URL-safe parts separated by 225 period ('.') characters. Each part contains a base64url encoded 226 value. The number of parts in the JWT is dependent upon the 227 representation of the resulting JWS or JWE object using the JWS 228 Compact Serialization or the JWE Compact Serialization. 230 3.1. Example JWT 232 The following example JWT Header declares that the encoded object is 233 a JSON Web Token (JWT) and the JWT is a JWS that is MACed using the 234 HMAC SHA-256 algorithm: 236 {"typ":"JWT", 237 "alg":"HS256"} 239 The following octet sequence is the UTF-8 representation of the JWT 240 Header/JWS Header above: 242 [123, 34, 116, 121, 112, 34, 58, 34, 74, 87, 84, 34, 44, 13, 10, 32, 243 34, 97, 108, 103, 34, 58, 34, 72, 83, 50, 53, 54, 34, 125] 245 Base64url encoding the octets of the UTF-8 representation of the JWT 246 Header yields this Encoded JWT Header value (which is also the 247 underlying encoded JWS Header value): 249 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 251 The following is an example of a JWT Claims Set: 253 {"iss":"joe", 254 "exp":1300819380, 255 "http://example.com/is_root":true} 257 The following octet sequence, which is the UTF-8 representation of 258 the JWT Claims Set above, is the JWS Payload: 260 [123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10, 261 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56, 262 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 263 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111, 264 111, 116, 34, 58, 116, 114, 117, 101, 125] 266 Base64url encoding the JWS Payload yields this encoded JWS Payload 267 (with line breaks for display purposes only): 269 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly 270 9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ 272 Computing the MAC of the encoded JWS Header and encoded JWS Payload 273 with the HMAC SHA-256 algorithm and base64url encoding the HMAC value 274 in the manner specified in [JWS], yields this encoded JWS Signature: 276 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 278 Concatenating these encoded parts in this order with period ('.') 279 characters between the parts yields this complete JWT (with line 280 breaks for display purposes only): 282 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 283 . 284 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 285 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 286 . 287 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 289 This computation is illustrated in more detail in Appendix A.1 of 290 [JWS]. See Appendix A.1 for an example of an encrypted JWT. 292 4. JWT Claims 294 The JWT Claims Set represents a JSON object whose members are the 295 claims conveyed by the JWT. The Claim Names within a JWT Claims Set 296 MUST be unique; recipients MUST either reject JWTs with duplicate 297 Claim Names or use a JSON parser that returns only the lexically last 298 duplicate member name, as specified in Section 15.12 (The JSON 299 Object) of ECMAScript 5.1 [ECMAScript]. 301 The set of claims that a JWT must contain to be considered valid is 302 context-dependent and is outside the scope of this specification. 303 Specific applications of JWTs will require implementations to 304 understand and process some claims in particular ways. However, in 305 the absence of such requirements, all claims that are not understood 306 by implementations SHOULD be ignored. 308 There are three classes of JWT Claim Names: Registered Claim Names, 309 Public Claim Names, and Private Claim Names. 311 4.1. Registered Claim Names 313 The following Claim Names are registered in the IANA JSON Web Token 314 Claims registry defined in Section 10.1. None of the claims defined 315 below are intended to be mandatory to use, but rather, provide a 316 starting point for a set of useful, interoperable claims. All the 317 names are short because a core goal of JWTs is for the representation 318 to be compact. 320 4.1.1. "iss" (Issuer) Claim 322 The "iss" (issuer) claim identifies the principal that issued the 323 JWT. The processing of this claim is generally application specific. 324 The "iss" value is a case-sensitive string containing a StringOrURI 325 value. Use of this claim is OPTIONAL. 327 4.1.2. "sub" (Subject) Claim 329 The "sub" (subject) claim identifies the principal that is the 330 subject of the JWT. The Claims in a JWT are normally statements 331 about the subject. The subject value MAY be scoped to be locally 332 unique in the context of the issuer or MAY be globally unique. The 333 processing of this claim is generally application specific. The 334 "sub" value is a case-sensitive string containing a StringOrURI 335 value. Use of this claim is OPTIONAL. 337 4.1.3. "aud" (Audience) Claim 339 The "aud" (audience) claim identifies the audiences that the JWT is 340 intended for. Each principal intended to process the JWT MUST 341 identify itself with a value in audience claim. If the principal 342 processing the claim does not identify itself with a value in the 343 "aud" claim, then the JWT MUST be rejected. In the general case, the 344 "aud" value is an array of case-sensitive strings, each containing a 345 StringOrURI value. In the special case when the JWT has one 346 audience, the "aud" value MAY be a single case-sensitive string 347 containing a StringOrURI value. The interpretation of audience 348 values is generally application specific. Use of this claim is 349 OPTIONAL. 351 4.1.4. "exp" (Expiration Time) Claim 353 The "exp" (expiration time) claim identifies the expiration time on 354 or after which the JWT MUST NOT be accepted for processing. The 355 processing of the "exp" claim requires that the current date/time 356 MUST be before the expiration date/time listed in the "exp" claim. 357 Implementers MAY provide for some small leeway, usually no more than 358 a few minutes, to account for clock skew. Its value MUST be a number 359 containing an IntDate value. Use of this claim is OPTIONAL. 361 4.1.5. "nbf" (Not Before) Claim 363 The "nbf" (not before) claim identifies the time before which the JWT 364 MUST NOT be accepted for processing. The processing of the "nbf" 365 claim requires that the current date/time MUST be after or equal to 366 the not-before date/time listed in the "nbf" claim. Implementers MAY 367 provide for some small leeway, usually no more than a few minutes, to 368 account for clock skew. Its value MUST be a number containing an 369 IntDate value. Use of this claim is OPTIONAL. 371 4.1.6. "iat" (Issued At) Claim 373 The "iat" (issued at) claim identifies the time at which the JWT was 374 issued. This claim can be used to determine the age of the JWT. Its 375 value MUST be a number containing an IntDate value. Use of this 376 claim is OPTIONAL. 378 4.1.7. "jti" (JWT ID) Claim 380 The "jti" (JWT ID) claim provides a unique identifier for the JWT. 381 The identifier value MUST be assigned in a manner that ensures that 382 there is a negligible probability that the same value will be 383 accidentally assigned to a different data object. The "jti" claim 384 can be used to prevent the JWT from being replayed. The "jti" value 385 is a case-sensitive string. Use of this claim is OPTIONAL. 387 4.2. Public Claim Names 389 Claim Names can be defined at will by those using JWTs. However, in 390 order to prevent collisions, any new Claim Name should either be 391 registered in the IANA JSON Web Token Claims registry defined in 392 Section 10.1 or be a Public Name: a value that contains a Collision- 393 Resistant Name. In each case, the definer of the name or value needs 394 to take reasonable precautions to make sure they are in control of 395 the part of the namespace they use to define the Claim Name. 397 4.3. Private Claim Names 399 A producer and consumer of a JWT MAY agree to use Claim Names that 400 are Private Names: names that are not Registered Claim Names 401 Section 4.1 or Public Claim Names Section 4.2. Unlike Public Claim 402 Names, Private Claim Names are subject to collision and should be 403 used with caution. 405 5. JWT Header 407 The members of the JSON object represented by the JWT Header describe 408 the cryptographic operations applied to the JWT and optionally, 409 additional properties of the JWT. The member names within the JWT 410 Header are referred to as Header Parameter Names. These names MUST 411 be unique; recipients MUST either reject JWTs with duplicate Header 412 Parameter Names or use a JSON parser that returns only the lexically 413 last duplicate member name, as specified in Section 15.12 (The JSON 414 Object) of ECMAScript 5.1 [ECMAScript]. The corresponding values are 415 referred to as Header Parameter Values. 417 JWS Header Parameters are defined by [JWS]. JWE Header Parameters 418 are defined by [JWE]. This specification further specifies the use 419 of the following Header Parameter in both the cases where the JWT is 420 a JWS and where it is a JWE. 422 5.1. "typ" (Type) Header Parameter 424 The "typ" (type) Header Parameter defined by [JWS] and [JWE] is used 425 to declare the MIME Media Type [IANA.MediaTypes] of this complete JWT 426 in contexts where this is useful to the application. This parameter 427 has no effect upon the JWT processing. If present, it is RECOMMENDED 428 that its value be "JWT" to indicate that this object is a JWT. While 429 media type names are not case-sensitive, it is RECOMMENDED that "JWT" 430 always be spelled using uppercase characters for compatibility with 431 legacy implementations. Use of this Header Parameter is OPTIONAL. 433 5.2. "cty" (Content Type) Header Parameter 435 The "cty" (content type) Header Parameter defined by [JWS] and [JWE] 436 is used by this specification to convey structural information about 437 the JWT. 439 In the normal case where nested signing or encryption operations are 440 not employed, the use of this Header Parameter is NOT RECOMMENDED. 442 In the case that nested signing or encryption is employed, this 443 Header Parameter MUST be present; in this case, the value MUST be 444 "JWT", to indicate that a Nested JWT is carried in this JWT. While 445 media type names are not case-sensitive, it is RECOMMENDED that "JWT" 446 always be spelled using uppercase characters for compatibility with 447 legacy implementations. See Appendix A.2 for an example of a Nested 448 JWT. 450 5.3. Replicating Claims as Header Parameters 452 In some applications using encrypted JWTs, it is useful to have an 453 unencrypted representation of some Claims. This might be used, for 454 instance, in application processing rules to determine whether and 455 how to process the JWT before it is decrypted. 457 This specification allows Claims present in the JWT Claims Set to be 458 replicated as Header Parameters in a JWT that is a JWE, as needed by 459 the application. If such replicated Claims are present, the 460 application receiving them SHOULD verify that their values are 461 identical. It is the responsibility of the application to ensure 462 that only claims that are safe to be transmitted in an unencrypted 463 manner are replicated as Header Parameter Values in the JWT. 465 This specification registers the "iss" (issuer), "sub" (subject), and 466 "aud" (audience) Header Parameter Names for the purpose of providing 467 unencrypted replicas of these Claims in encrypted JWTs for 468 applications that need them. Other specifications MAY similarly 469 register other names that are registered Claim Names as Header 470 Parameter Names, as needed. 472 6. Plaintext JWTs 474 To support use cases where the JWT content is secured by a means 475 other than a signature and/or encryption contained within the JWT 476 (such as a signature on a data structure containing the JWT), JWTs 477 MAY also be created without a signature or encryption. A plaintext 478 JWT is a JWS using the "none" JWS "alg" Header Parameter Value 479 defined in JSON Web Algorithms (JWA) [JWA]; it is a JWS with the 480 empty string for its JWS Signature value. 482 6.1. Example Plaintext JWT 484 The following example JWT Header declares that the encoded object is 485 a Plaintext JWT: 487 {"alg":"none"} 489 Base64url encoding the octets of the UTF-8 representation of the JWT 490 Header yields this Encoded JWT Header: 492 eyJhbGciOiJub25lIn0 494 The following is an example of a JWT Claims Set: 496 {"iss":"joe", 497 "exp":1300819380, 498 "http://example.com/is_root":true} 500 Base64url encoding the octets of the UTF-8 representation of the JWT 501 Claims Set yields this encoded JWS Payload (with line breaks for 502 display purposes only): 504 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 505 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 507 The encoded JWS Signature is the empty string. 509 Concatenating these encoded parts in this order with period ('.') 510 characters between the parts yields this complete JWT (with line 511 breaks for display purposes only): 513 eyJhbGciOiJub25lIn0 514 . 515 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 516 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 517 . 519 7. Rules for Creating and Validating a JWT 521 To create a JWT, one MUST perform these steps. The order of the 522 steps is not significant in cases where there are no dependencies 523 between the inputs and outputs of the steps. 525 1. Create a JWT Claims Set containing the desired claims. Note that 526 white space is explicitly allowed in the representation and no 527 canonicalization need be performed before encoding. 529 2. Let the Message be the octets of the UTF-8 representation of the 530 JWT Claims Set. 532 3. Create a JWT Header containing the desired set of Header 533 Parameters. The JWT MUST conform to either the [JWS] or [JWE] 534 specifications. Note that white space is explicitly allowed in 535 the representation and no canonicalization need be performed 536 before encoding. 538 4. Base64url encode the octets of the UTF-8 representation of the 539 JWT Header. Let this be the Encoded JWT Header. 541 5. Depending upon whether the JWT is a JWS or JWE, there are two 542 cases: 544 * If the JWT is a JWS, create a JWS using the JWT Header as the 545 JWS Header and the Message as the JWS Payload; all steps 546 specified in [JWS] for creating a JWS MUST be followed. 548 * Else, if the JWT is a JWE, create a JWE using the JWT Header 549 as the JWE Header and the Message as the JWE Plaintext; all 550 steps specified in [JWE] for creating a JWE MUST be followed. 552 6. If a nested signing or encryption operation will be performed, 553 let the Message be the JWS or JWE, and return to Step 3, using a 554 "cty" (content type) value of "JWT" in the new JWT Header created 555 in that step. 557 7. Otherwise, let the resulting JWT be the JWS or JWE. 559 When validating a JWT the following steps MUST be taken. The order 560 of the steps is not significant in cases where there are no 561 dependencies between the inputs and outputs of the steps. If any of 562 the listed steps fails then the JWT MUST be rejected for processing. 564 1. The JWT MUST contain at least one period ('.') character. 566 2. Let the Encoded JWT Header be the portion of the JWT before the 567 first period ('.') character. 569 3. The Encoded JWT Header MUST be successfully base64url decoded 570 following the restriction given in this specification that no 571 padding characters have been used. 573 4. The resulting JWT Header MUST be completely valid JSON syntax 574 conforming to [I-D.ietf-json-rfc4627bis]. 576 5. The resulting JWT Header MUST be validated to only include 577 parameters and values whose syntax and semantics are both 578 understood and supported or that are specified as being ignored 579 when not understood. 581 6. Determine whether the JWT is a JWS or a JWE using any of the 582 methods described in Section 9 of [JWE]. 584 7. Depending upon whether the JWT is a JWS or JWE, there are two 585 cases: 587 * If the JWT is a JWS, all steps specified in [JWS] for 588 validating a JWS MUST be followed. Let the Message be the 589 result of base64url decoding the JWS Payload. 591 * Else, if the JWT is a JWE, all steps specified in [JWE] for 592 validating a JWE MUST be followed. Let the Message be the 593 JWE Plaintext. 595 8. If the JWT Header contains a "cty" (content type) value of 596 "JWT", then the Message is a JWT that was the subject of nested 597 signing or encryption operations. In this case, return to Step 598 1, using the Message as the JWT. 600 9. Otherwise, let the JWT Claims Set be the Message. 602 10. The JWT Claims Set MUST be completely valid JSON syntax 603 conforming to [I-D.ietf-json-rfc4627bis]. 605 7.1. String Comparison Rules 607 Processing a JWT inevitably requires comparing known strings to 608 values in JSON objects. For example, in checking what the algorithm 609 is, the Unicode string encoding "alg" will be checked against the 610 member names in the JWT Header to see if there is a matching Header 611 Parameter Name. 613 Comparisons between JSON strings and other Unicode strings MUST be 614 performed by comparing Unicode code points without normalization, as 615 specified in the String Comparison Rules in Section 5.3 of [JWS]. 617 8. Cryptographic Algorithms 619 JWTs use JSON Web Signature (JWS) [JWS] and JSON Web Encryption (JWE) 620 [JWE] to sign and/or encrypt the contents of the JWT. 622 Of the signature and MAC algorithms specified in JSON Web Algorithms 623 (JWA) [JWA], only HMAC SHA-256 ("HS256") and "none" MUST be 624 implemented by conforming JWT implementations. It is RECOMMENDED 625 that implementations also support RSASSA-PKCS1-V1_5 with the SHA-256 626 hash algorithm ("RS256") and ECDSA using the P-256 curve and the SHA- 627 256 hash algorithm ("ES256"). Support for other algorithms and key 628 sizes is OPTIONAL. 630 If an implementation provides encryption capabilities, of the 631 encryption algorithms specified in [JWA], only RSAES-PKCS1-V1_5 with 632 2048 bit keys ("RSA1_5"), AES Key Wrap with 128 and 256 bit keys 633 ("A128KW" and "A256KW"), and the composite authenticated encryption 634 algorithm using AES CBC and HMAC SHA-2 ("A128CBC-HS256" and 635 "A256CBC-HS512") MUST be implemented by conforming implementations. 636 It is RECOMMENDED that implementations also support using ECDH-ES to 637 agree upon a key used to wrap the Content Encryption Key 638 ("ECDH-ES+A128KW" and "ECDH-ES+A256KW") and AES in Galois/Counter 639 Mode (GCM) with 128 bit and 256 bit keys ("A128GCM" and "A256GCM"). 640 Support for other algorithms and key sizes is OPTIONAL. 642 9. URI for Declaring that Content is a JWT 644 This specification registers the URN 645 "urn:ietf:params:oauth:token-type:jwt" for use by applications that 646 declare content types using URIs (rather than, for instance, MIME 647 Media Types) to indicate that the content referred to is a JWT. 649 10. IANA Considerations 651 10.1. JSON Web Token Claims Registry 653 This specification establishes the IANA JSON Web Token Claims 654 registry for JWT Claim Names. The registry records the Claim Name 655 and a reference to the specification that defines it. This 656 specification registers the Claim Names defined in Section 4.1. 658 Values are registered with a Specification Required [RFC5226] after a 659 two-week review period on the [TBD]@ietf.org mailing list, on the 660 advice of one or more Designated Experts. However, to allow for the 661 allocation of values prior to publication, the Designated Expert(s) 662 may approve registration once they are satisfied that such a 663 specification will be published. 665 Registration requests must be sent to the [TBD]@ietf.org mailing list 666 for review and comment, with an appropriate subject (e.g., "Request 667 for access token type: example"). [[ Note to the RFC Editor: The name 668 of the mailing list should be determined in consultation with the 669 IESG and IANA. Suggested name: jwt-reg-review. ]] 671 Within the review period, the Designated Expert(s) will either 672 approve or deny the registration request, communicating this decision 673 to the review list and IANA. Denials should include an explanation 674 and, if applicable, suggestions as to how to make the request 675 successful. Registration requests that are undetermined for a period 676 longer than 21 days can be brought to the IESG's attention (using the 677 iesg@iesg.org mailing list) for resolution. 679 Criteria that should be applied by the Designated Expert(s) includes 680 determining whether the proposed registration duplicates existing 681 functionality, determining whether it is likely to be of general 682 applicability or whether it is useful only for a single application, 683 and whether the registration makes sense. 685 IANA must only accept registry updates from the Designated Expert(s) 686 and should direct all requests for registration to the review mailing 687 list. 689 It is suggested that multiple Designated Experts be appointed who are 690 able to represent the perspectives of different applications using 691 this specification, in order to enable broadly-informed review of 692 registration decisions. In cases where a registration decision could 693 be perceived as creating a conflict of interest for a particular 694 Expert, that Expert should defer to the judgment of the other 695 Expert(s). 697 10.1.1. Registration Template 699 Claim Name: 700 The name requested (e.g., "example"). Because a core goal of this 701 specification is for the resulting representations to be compact, 702 it is RECOMMENDED that the name be short -- not to exceed 8 703 characters without a compelling reason to do so. This name is 704 case-sensitive. Names may not match other registered names in a 705 case-insensitive manner unless the Designated Expert(s) state that 706 there is a compelling reason to allow an exception in this 707 particular case. 709 Claim Description: 710 Brief description of the Claim (e.g., "Example description"). 712 Change Controller: 713 For Standards Track RFCs, state "IESG". For others, give the name 714 of the responsible party. Other details (e.g., postal address, 715 email address, home page URI) may also be included. 717 Specification Document(s): 718 Reference to the document(s) that specify the parameter, 719 preferably including URI(s) that can be used to retrieve copies of 720 the document(s). An indication of the relevant sections may also 721 be included but is not required. 723 10.1.2. Initial Registry Contents 725 o Claim Name: "iss" 726 o Claim Description: Issuer 727 o Change Controller: IESG 728 o Specification Document(s): Section 4.1.1 of [[ this document ]] 730 o Claim Name: "sub" 731 o Claim Description: Subject 732 o Change Controller: IESG 733 o Specification Document(s): Section 4.1.2 of [[ this document ]] 735 o Claim Name: "aud" 736 o Claim Description: Audience 737 o Change Controller: IESG 738 o Specification Document(s): Section 4.1.3 of [[ this document ]] 740 o Claim Name: "exp" 741 o Claim Description: Expiration Time 742 o Change Controller: IESG 743 o Specification Document(s): Section 4.1.4 of [[ this document ]] 745 o Claim Name: "nbf" 746 o Claim Description: Not Before 747 o Change Controller: IESG 748 o Specification Document(s): Section 4.1.5 of [[ this document ]] 750 o Claim Name: "iat" 751 o Claim Description: Issued At 752 o Change Controller: IESG 753 o Specification Document(s): Section 4.1.6 of [[ this document ]] 755 o Claim Name: "jti" 756 o Claim Description: JWT ID 757 o Change Controller: IESG 758 o Specification Document(s): Section 4.1.7 of [[ this document ]] 760 10.2. Sub-Namespace Registration of 761 urn:ietf:params:oauth:token-type:jwt 763 10.2.1. Registry Contents 765 This specification registers the value "token-type:jwt" in the IANA 766 urn:ietf:params:oauth registry established in An IETF URN Sub- 767 Namespace for OAuth [RFC6755], which can be used to indicate that the 768 content is a JWT. 770 o URN: urn:ietf:params:oauth:token-type:jwt 771 o Common Name: JSON Web Token (JWT) Token Type 772 o Change Controller: IESG 773 o Specification Document(s): [[this document]] 775 10.3. Media Type Registration 777 10.3.1. Registry Contents 779 This specification registers the "application/jwt" Media Type 780 [RFC2046] in the MIME Media Types registry [IANA.MediaTypes], which 781 can be used to indicate that the content is a JWT. 783 o Type Name: application 784 o Subtype Name: jwt 785 o Required Parameters: n/a 786 o Optional Parameters: n/a 787 o Encoding considerations: 8bit; JWT values are encoded as a series 788 of base64url encoded values (some of which may be the empty 789 string) separated by period ('.') characters. 790 o Security Considerations: See the Security Considerations section 791 of [[ this document ]] 792 o Interoperability Considerations: n/a 793 o Published Specification: [[ this document ]] 794 o Applications that use this media type: OpenID Connect, Mozilla 795 Persona, Salesforce, Google, numerous others 796 o Additional Information: Magic number(s): n/a, File extension(s): 797 n/a, Macintosh file type code(s): n/a 798 o Person & email address to contact for further information: Michael 799 B. Jones, mbj@microsoft.com 800 o Intended Usage: COMMON 801 o Restrictions on Usage: none 802 o Author: Michael B. Jones, mbj@microsoft.com 803 o Change Controller: IESG 805 10.4. Registration of JWE Header Parameter Names 807 This specification registers specific Claim Names defined in 808 Section 4.1 in the IANA JSON Web Signature and Encryption Header 809 Parameters registry defined in [JWS] for use by Claims replicated as 810 Header Parameters, per Section 5.3. 812 10.4.1. Registry Contents 814 o Header Parameter Name: "iss" 815 o Header Parameter Description: Issuer 816 o Header Parameter Usage Location(s): JWE 817 o Change Controller: IESG 818 o Specification Document(s): Section 4.1.1 of [[ this document ]] 820 o Header Parameter Name: "sub" 821 o Header Parameter Description: Subject 822 o Header Parameter Usage Location(s): JWE 823 o Change Controller: IESG 824 o Specification Document(s): Section 4.1.2 of [[ this document ]] 826 o Header Parameter Name: "aud" 827 o Header Parameter Description: Audience 828 o Header Parameter Usage Location(s): JWE 829 o Change Controller: IESG 830 o Specification Document(s): Section 4.1.3 of [[ this document ]] 832 11. Security Considerations 834 All of the security issues faced by any cryptographic application 835 must be faced by a JWT/JWS/JWE/JWK agent. Among these issues are 836 protecting the user's private and symmetric keys, preventing various 837 attacks, and helping the user avoid mistakes such as inadvertently 838 encrypting a message for the wrong recipient. The entire list of 839 security considerations is beyond the scope of this document. 841 All the security considerations in the JWS specification also apply 842 to JWT, as do the JWE security considerations when encryption is 843 employed. In particular, the JWS JSON Security Considerations and 844 Unicode Comparison Security Considerations apply equally to the JWT 845 Claims Set in the same manner that they do to the JWS Header. 847 While syntactically, the signing and encryption operations for Nested 848 JWTs may be applied in any order, normally senders should sign the 849 message and then encrypt the result (thus encrypting the signature). 850 This prevents attacks in which the signature is stripped, leaving 851 just an encrypted message, as well as providing privacy for the 852 signer. Furthermore, signatures over encrypted text are not 853 considered valid in many jurisdictions. 855 Note that potential concerns about security issues related to the 856 order of signing and encryption operations are already addressed by 857 the underlying JWS and JWE specifications; in particular, because JWE 858 only supports the use of authenticated encryption algorithms, 859 cryptographic concerns about the potential need to sign after 860 encryption that apply in many contexts do not apply to this 861 specification. 863 12. References 865 12.1. Normative References 867 [ECMAScript] 868 Ecma International, "ECMAScript Language Specification, 869 5.1 Edition", ECMA 262, June 2011. 871 [I-D.ietf-json-rfc4627bis] 872 Bray, T., "The JSON Data Interchange Format", 873 draft-ietf-json-rfc4627bis-10 (work in progress), 874 December 2013. 876 [IANA.MediaTypes] 877 Internet Assigned Numbers Authority (IANA), "MIME Media 878 Types", 2005. 880 [JWA] Jones, M., "JSON Web Algorithms (JWA)", 881 draft-ietf-jose-json-web-algorithms (work in progress), 882 January 2014. 884 [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web 885 Encryption (JWE)", draft-ietf-jose-json-web-encryption 886 (work in progress), January 2014. 888 [JWK] Jones, M., "JSON Web Key (JWK)", 889 draft-ietf-jose-json-web-key (work in progress), 890 January 2014. 892 [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 893 Signature (JWS)", draft-ietf-jose-json-web-signature (work 894 in progress), January 2014. 896 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 897 Extensions (MIME) Part Two: Media Types", RFC 2046, 898 November 1996. 900 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 901 Requirement Levels", BCP 14, RFC 2119, March 1997. 903 [RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the 904 Internet: Timestamps", RFC 3339, July 2002. 906 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 907 Resource Identifier (URI): Generic Syntax", STD 66, 908 RFC 3986, January 2005. 910 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 911 Encodings", RFC 4648, October 2006. 913 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 914 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 915 May 2008. 917 [RFC6755] Campbell, B. and H. Tschofenig, "An IETF URN Sub-Namespace 918 for OAuth", RFC 6755, October 2012. 920 12.2. Informative References 922 [CanvasApp] 923 Facebook, "Canvas Applications", 2010. 925 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 926 September 2010. 928 [MagicSignatures] 929 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 930 Signatures", January 2011. 932 [OASIS.saml-core-2.0-os] 933 Cantor, S., Kemp, J., Philpott, R., and E. Maler, 934 "Assertions and Protocol for the OASIS Security Assertion 935 Markup Language (SAML) V2.0", OASIS Standard saml-core- 936 2.0-os, March 2005. 938 [RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup 939 Language) XML-Signature Syntax and Processing", RFC 3275, 940 March 2002. 942 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 943 Unique IDentifier (UUID) URN Namespace", RFC 4122, 944 July 2005. 946 [SWT] Hardt, D. and Y. Goland, "Simple Web Token (SWT)", 947 Version 0.9.5.1, November 2009. 949 [W3C.CR-xml11-20021015] 950 Cowan, J., "Extensible Markup Language (XML) 1.1", W3C 951 CR CR-xml11-20021015, October 2002. 953 [W3C.REC-xml-c14n-20010315] 954 Boyer, J., "Canonical XML Version 1.0", World Wide Web 955 Consortium Recommendation REC-xml-c14n-20010315, 956 March 2001, 957 . 959 Appendix A. JWT Examples 961 This section contains examples of JWTs. For other example JWTs, see 962 Section 6.1 and Appendices A.1, A.2, and A.3 of [JWS]. 964 A.1. Example Encrypted JWT 966 This example encrypts the same claims as used in Section 3.1 to the 967 recipient using RSAES-PKCS1-V1_5 and AES_128_CBC_HMAC_SHA_256. 969 The following example JWE Header (with line breaks for display 970 purposes only) declares that: 972 o the Content Encryption Key is encrypted to the recipient using the 973 RSAES-PKCS1-V1_5 algorithm to produce the JWE Encrypted Key and 975 o the Plaintext is encrypted using the AES_128_CBC_HMAC_SHA_256 976 algorithm to produce the Ciphertext. 978 {"alg":"RSA1_5","enc":"A128CBC-HS256"} 980 Other than using the octets of the UTF-8 representation of the JWT 981 Claims Set from Section 3.1 as the plaintext value, the computation 982 of this JWT is identical to the computation of the JWE in Appendix 983 A.2 of [JWE], including the keys used. 985 The final result in this example (with line breaks for display 986 purposes only) is: 988 eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0. 989 QR1Owv2ug2WyPBnbQrRARTeEk9kDO2w8qDcjiHnSJflSdv1iNqhWXaKH4MqAkQtM 990 oNfABIPJaZm0HaA415sv3aeuBWnD8J-Ui7Ah6cWafs3ZwwFKDFUUsWHSK-IPKxLG 991 TkND09XyjORj_CHAgOPJ-Sd8ONQRnJvWn_hXV1BNMHzUjPyYwEsRhDhzjAD26ima 992 sOTsgruobpYGoQcXUwFDn7moXPRfDE8-NoQX7N7ZYMmpUDkR-Cx9obNGwJQ3nM52 993 YCitxoQVPzjbl7WBuB7AohdBoZOdZ24WlN1lVIeh8v1K4krB8xgKvRU8kgFrEn_a 994 1rZgN5TiysnmzTROF869lQ. 995 AxY8DCtDaGlsbGljb3RoZQ. 996 MKOle7UQrG6nSxTLX6Mqwt0orbHvAKeWnDYvpIAeZ72deHxz3roJDXQyhxx0wKaM 997 HDjUEOKIwrtkHthpqEanSBNYHZgmNOV7sln1Eu9g3J8. 998 fiK51VwhsxJ-siBMR-YFiA 1000 A.2. Example Nested JWT 1002 This example shows how a JWT can be used as the payload of a JWE or 1003 JWS to create a Nested JWT. In this case, the JWT Claims Set is 1004 first signed, and then encrypted. 1006 The inner signed JWT is identical to the example in Appendix A.2 of 1007 [JWS]. Therefore, its computation is not repeated here. This 1008 example then encrypts this inner JWT to the recipient using RSAES- 1009 PKCS1-V1_5 and AES_128_CBC_HMAC_SHA_256. 1011 The following example JWE Header (with line breaks for display 1012 purposes only) declares that: 1014 o the Content Encryption Key is encrypted to the recipient using the 1015 RSAES-PKCS1-V1_5 algorithm to produce the JWE Encrypted Key, 1017 o the Plaintext is encrypted using the AES_128_CBC_HMAC_SHA_256 1018 algorithm to produce the Ciphertext, and 1020 o the Plaintext is itself a JWT. 1022 {"alg":"RSA1_5","enc":"A128CBC-HS256","cty":"JWT"} 1024 Base64url encoding the octets of the UTF-8 representation of the JWE 1025 Header yields this encoded JWE Header value: 1027 eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5IjoiSldUIn0 1029 The computation of this JWT is identical to the computation of the 1030 JWE in Appendix A.2 of [JWE], other than that different JWE Header, 1031 Plaintext, Initialization Vector, and Content Encryption Key values 1032 are used. (The RSA key used is the same.) 1034 The Payload used is the octets of the ASCII representation of the JWT 1035 at the end of Appendix Section A.2.1 of [JWS] (with all whitespace 1036 and line breaks removed), which is a sequence of 458 octets. 1038 The Initialization Vector value used is: 1040 [82, 101, 100, 109, 111, 110, 100, 32, 87, 65, 32, 57, 56, 48, 53, 1041 50] 1043 This example uses the Content Encryption Key represented in JSON Web 1044 Key [JWK] format below: 1046 {"kty":"oct", 1047 "k":"GawgguFyGrWKav7AX4VKUg" 1048 } 1050 The final result for this Nested JWT (with line breaks for display 1051 purposes only) is: 1053 eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5IjoiSldU 1054 In0. 1055 g_hEwksO1Ax8Qn7HoN-BVeBoa8FXe0kpyk_XdcSmxvcM5_P296JXXtoHISr_DD_M 1056 qewaQSH4dZOQHoUgKLeFly-9RI11TG-_Ge1bZFazBPwKC5lJ6OLANLMd0QSL4fYE 1057 b9ERe-epKYE3xb2jfY1AltHqBO-PM6j23Guj2yDKnFv6WO72tteVzm_2n17SBFvh 1058 DuR9a2nHTE67pe0XGBUS_TK7ecA-iVq5COeVdJR4U4VZGGlxRGPLRHvolVLEHx6D 1059 YyLpw30Ay9R6d68YCLi9FYTq3hIXPK_-dmPlOUlKvPr1GgJzRoeC9G5qCvdcHWsq 1060 JGTO_z3Wfo5zsqwkxruxwA. 1061 UmVkbW9uZCBXQSA5ODA1Mg. 1062 VwHERHPvCNcHHpTjkoigx3_ExK0Qc71RMEParpatm0X_qpg-w8kozSjfNIPPXiTB 1063 BLXR65CIPkFqz4l1Ae9w_uowKiwyi9acgVztAi-pSL8GQSXnaamh9kX1mdh3M_TT 1064 -FZGQFQsFhu0Z72gJKGdfGE-OE7hS1zuBD5oEUfk0Dmb0VzWEzpxxiSSBbBAzP10 1065 l56pPfAtrjEYw-7ygeMkwBl6Z_mLS6w6xUgKlvW6ULmkV-uLC4FUiyKECK4e3WZY 1066 Kw1bpgIqGYsw2v_grHjszJZ-_I5uM-9RA8ycX9KqPRp9gc6pXmoU_-27ATs9XCvr 1067 ZXUtK2902AUzqpeEUJYjWWxSNsS-r1TJ1I-FMJ4XyAiGrfmo9hQPcNBYxPz3GQb2 1068 8Y5CLSQfNgKSGt0A4isp1hBUXBHAndgtcslt7ZoQJaKe_nNJgNliWtWpJ_ebuOpE 1069 l8jdhehdccnRMIwAmU1n7SPkmhIl1HlSOpvcvDfhUN5wuqU955vOBvfkBOh5A11U 1070 zBuo2WlgZ6hYi9-e3w29bR0C2-pp3jbqxEDw3iWaf2dc5b-LnR0FEYXvI_tYk5rd 1071 _J9N0mg0tQ6RbpxNEMNoA9QWk5lgdPvbh9BaO195abQ. 1072 AVO9iT5AV4CzvDJCdhSFlQ 1074 Appendix B. Relationship of JWTs to SAML Assertions 1076 SAML 2.0 [OASIS.saml-core-2.0-os] provides a standard for creating 1077 security tokens with greater expressivity and more security options 1078 than supported by JWTs. However, the cost of this flexibility and 1079 expressiveness is both size and complexity. SAML's use of XML 1080 [W3C.CR-xml11-20021015] and XML DSIG [RFC3275] contributes to the 1081 size of SAML assertions; its use of XML and especially XML 1082 Canonicalization [W3C.REC-xml-c14n-20010315] contributes to their 1083 complexity. 1085 JWTs are intended to provide a simple security token format that is 1086 small enough to fit into HTTP headers and query arguments in URIs. 1087 It does this by supporting a much simpler token model than SAML and 1088 using the JSON [I-D.ietf-json-rfc4627bis] object encoding syntax. It 1089 also supports securing tokens using Message Authentication Codes 1090 (MACs) and digital signatures using a smaller (and less flexible) 1091 format than XML DSIG. 1093 Therefore, while JWTs can do some of the things SAML assertions do, 1094 JWTs are not intended as a full replacement for SAML assertions, but 1095 rather as a token format to be used when ease of implementation or 1096 compactness are considerations. 1098 SAML Assertions are always statements made by an entity about a 1099 subject. JWTs are often used in the same manner, with the entity 1100 making the statements being represented by the "iss" (issuer) claim, 1101 and the subject being represented by the "sub" (subject) claim. 1102 However, with these claims being optional, other uses of the JWT 1103 format are also permitted. 1105 Appendix C. Relationship of JWTs to Simple Web Tokens (SWTs) 1107 Both JWTs and Simple Web Tokens SWT [SWT], at their core, enable sets 1108 of claims to be communicated between applications. For SWTs, both 1109 the claim names and claim values are strings. For JWTs, while claim 1110 names are strings, claim values can be any JSON type. Both token 1111 types offer cryptographic protection of their content: SWTs with HMAC 1112 SHA-256 and JWTs with a choice of algorithms, including signature, 1113 MAC, and encryption algorithms. 1115 Appendix D. Acknowledgements 1117 The authors acknowledge that the design of JWTs was intentionally 1118 influenced by the design and simplicity of Simple Web Tokens [SWT] 1119 and ideas for JSON tokens that Dick Hardt discussed within the OpenID 1120 community. 1122 Solutions for signing JSON content were previously explored by Magic 1123 Signatures [MagicSignatures], JSON Simple Sign [JSS], and Canvas 1124 Applications [CanvasApp], all of which influenced this draft. 1126 This specification is the work of the OAuth Working Group, which 1127 includes dozens of active and dedicated participants. In particular, 1128 the following individuals contributed ideas, feedback, and wording 1129 that influenced this specification: 1131 Dirk Balfanz, Richard Barnes, Brian Campbell, Breno de Medeiros, Dick 1132 Hardt, Joe Hildebrand, Jeff Hodges, Edmund Jay, Yaron Y. Goland, Ben 1133 Laurie, James Manger, Prateek Mishra, Tony Nadalin, Axel Nennker, 1134 John Panzer, Emmanuel Raviart, David Recordon, Eric Rescorla, Jim 1135 Schaad, Paul Tarjan, Hannes Tschofenig, and Sean Turner. 1137 Hannes Tschofenig and Derek Atkins chaired the OAuth working group 1138 and Sean Turner and Stephen Farrell served as Security area directors 1139 during the creation of this specification. 1141 Appendix E. Document History 1143 [[ to be removed by the RFC Editor before publication as an RFC ]] 1144 -15 1146 o Replaced references to RFC 4627 with draft-ietf-json-rfc4627bis. 1148 -14 1150 o Referenced the JWE section on Distinguishing between JWS and JWE 1151 Objects. 1153 -13 1155 o Added Claim Description registry field. 1157 o Used Header Parameter Description registry field. 1159 o Removed the phrases "JWA signing algorithms" and "JWA encryption 1160 algorithms". 1162 o Removed the term JSON Text Object. 1164 -12 1166 o Tracked the JOSE change refining the "typ" and "cty" definitions 1167 to always be MIME Media Types, with the omission of "application/" 1168 prefixes recommended for brevity. For compatibility with legacy 1169 implementations, it is RECOMMENDED that "JWT" always be spelled 1170 using uppercase characters when used as a "typ" or "cty" value. 1171 As side effects, this change removed the "typ" Claim definition 1172 and narrowed the uses of the URI 1173 "urn:ietf:params:oauth:token-type:jwt". 1175 o Updated base64url definition to match JOSE definition. 1177 o Changed terminology from "Reserved Claim Name" to "Registered 1178 Claim Name" to match JOSE terminology change. 1180 o Applied other editorial changes to track parallel JOSE changes. 1182 o Clarified that the subject value may be scoped to be locally 1183 unique in the context of the issuer or may be globally unique. 1185 -11 1187 o Added a Nested JWT example. 1189 o Added "sub" to the list of Claims registered for use as Header 1190 Parameter values when an unencrypted representation is required in 1191 an encrypted JWT. 1193 -10 1195 o Allowed Claims to be replicated as Header Parameters in encrypted 1196 JWTs as needed by applications that require an unencrypted 1197 representation of specific Claims. 1199 -09 1201 o Clarified that the "typ" header parameter is used in an 1202 application-specific manner and has no effect upon the JWT 1203 processing. 1205 o Stated that recipients MUST either reject JWTs with duplicate 1206 Header Parameter Names or with duplicate Claim Names or use a JSON 1207 parser that returns only the lexically last duplicate member name. 1209 -08 1211 o Tracked a change to how JWEs are computed (which only affected the 1212 example encrypted JWT value). 1214 -07 1216 o Defined that the default action for claims that are not understood 1217 is to ignore them unless otherwise specified by applications. 1219 o Changed from using the term "byte" to "octet" when referring to 8 1220 bit values. 1222 o Tracked encryption computation changes in the JWE specification. 1224 -06 1226 o Changed the name of the "prn" claim to "sub" (subject) both to 1227 more closely align with SAML name usage and to use a more 1228 intuitive name. 1230 o Allow JWTs to have multiple audiences. 1232 o Applied editorial improvements suggested by Jeff Hodges, Prateek 1233 Mishra, and Hannes Tschofenig. Many of these simplified the 1234 terminology used. 1236 o Explained why Nested JWTs should be signed and then encrypted. 1238 o Clarified statements of the form "This claim is OPTIONAL" to "Use 1239 of this claim is OPTIONAL". 1241 o Referenced String Comparison Rules in JWS. 1243 o Added seriesInfo information to Internet Draft references. 1245 -05 1247 o Updated values for example AES CBC calculations. 1249 -04 1251 o Promoted Initialization Vector from being a header parameter to 1252 being a top-level JWE element. This saves approximately 16 bytes 1253 in the compact serialization, which is a significant savings for 1254 some use cases. Promoting the Initialization Vector out of the 1255 header also avoids repeating this shared value in the JSON 1256 serialization. 1258 o Applied changes made by the RFC Editor to RFC 6749's registry 1259 language to this specification. 1261 o Reference RFC 6755 -- An IETF URN Sub-Namespace for OAuth. 1263 -03 1265 o Added statement that "StringOrURI values are compared as case- 1266 sensitive strings with no transformations or canonicalizations 1267 applied". 1269 o Indented artwork elements to better distinguish them from the body 1270 text. 1272 -02 1274 o Added an example of an encrypted JWT. 1276 o Added this language to Registration Templates: "This name is case 1277 sensitive. Names that match other registered names in a case 1278 insensitive manner SHOULD NOT be accepted." 1280 o Applied editorial suggestions. 1282 -01 1284 o Added the "cty" (content type) header parameter for declaring type 1285 information about the secured content, as opposed to the "typ" 1286 (type) header parameter, which declares type information about 1287 this object. This significantly simplified nested JWTs. 1289 o Moved description of how to determine whether a header is for a 1290 JWS or a JWE from the JWT spec to the JWE spec. 1292 o Changed registration requirements from RFC Required to 1293 Specification Required with Expert Review. 1295 o Added Registration Template sections for defined registries. 1297 o Added Registry Contents sections to populate registry values. 1299 o Added "Collision Resistant Namespace" to the terminology section. 1301 o Numerous editorial improvements. 1303 -00 1305 o Created the initial IETF draft based upon 1306 draft-jones-json-web-token-10 with no normative changes. 1308 Authors' Addresses 1310 Michael B. Jones 1311 Microsoft 1313 Email: mbj@microsoft.com 1314 URI: http://self-issued.info/ 1316 John Bradley 1317 Ping Identity 1319 Email: ve7jtb@ve7jtb.com 1320 URI: http://www.thread-safe.com/ 1322 Nat Sakimura 1323 Nomura Research Institute 1325 Email: n-sakimura@nri.co.jp 1326 URI: http://nat.sakimura.org/