| < draft-ietf-oauth-json-web-token-00.txt | draft-ietf-oauth-json-web-token-01.txt > | |||
|---|---|---|---|---|
| OAuth Working Group M. Jones | OAuth Working Group M. Jones | |||
| Internet-Draft Microsoft | Internet-Draft Microsoft | |||
| Intended status: Standards Track J. Bradley | Intended status: Standards Track J. Bradley | |||
| Expires: November 23, 2012 Ping Identity | Expires: January 7, 2013 Ping Identity | |||
| N. Sakimura | N. Sakimura | |||
| NRI | NRI | |||
| May 22, 2012 | July 6, 2012 | |||
| JSON Web Token (JWT) | JSON Web Token (JWT) | |||
| draft-ietf-oauth-json-web-token-00 | draft-ietf-oauth-json-web-token-01 | |||
| Abstract | Abstract | |||
| JSON Web Token (JWT) is a means of representing claims to be | JSON Web Token (JWT) is a means of representing claims to be | |||
| transferred between two parties. The claims in a JWT are encoded as | transferred between two parties. The claims in a JWT are encoded as | |||
| a JSON object that is digitally signed or MACed using JSON Web | a JavaScript Object Notation (JSON) object that is digitally signed | |||
| Signature (JWS) and/or encrypted using JSON Web Encryption (JWE). | or MACed using JSON Web Signature (JWS) and/or encrypted using JSON | |||
| Web Encryption (JWE). | ||||
| The suggested pronunciation of JWT is the same as the English word | The suggested pronunciation of JWT is the same as the English word | |||
| "jot". | "jot". | |||
| Requirements Language | ||||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | ||||
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | ||||
| document are to be interpreted as described in RFC 2119 [RFC2119]. | ||||
| Status of this Memo | Status of this Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at http://datatracker.ietf.org/drafts/current/. | Drafts is at http://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on November 23, 2012. | This Internet-Draft will expire on January 7, 2013. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2012 IETF Trust and the persons identified as the | Copyright (c) 2012 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (http://trustee.ietf.org/license-info) in effect on the date of | (http://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
| to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
| include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
| the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
| described in the Simplified BSD License. | described in the Simplified BSD License. | |||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
| 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 4 | ||||
| 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 | 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
| 3. JSON Web Token (JWT) Overview . . . . . . . . . . . . . . . . 5 | 3. JSON Web Token (JWT) Overview . . . . . . . . . . . . . . . . 5 | |||
| 3.1. Example JWT . . . . . . . . . . . . . . . . . . . . . . . 6 | 3.1. Example JWT . . . . . . . . . . . . . . . . . . . . . . . 6 | |||
| 4. JWT Claims . . . . . . . . . . . . . . . . . . . . . . . . . . 6 | 4. JWT Claims . . . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 4.1. Reserved Claim Names . . . . . . . . . . . . . . . . . . . 7 | 4.1. Reserved Claim Names . . . . . . . . . . . . . . . . . . . 7 | |||
| 4.1.1. "exp" (Expiration Time) Claim . . . . . . . . . . . . 7 | 4.1.1. "exp" (Expiration Time) Claim . . . . . . . . . . . . 7 | |||
| 4.1.2. "nbf" (Not Before) Claim . . . . . . . . . . . . . . . 7 | 4.1.2. "nbf" (Not Before) Claim . . . . . . . . . . . . . . . 7 | |||
| 4.1.3. "iat" (Issued At) Claim . . . . . . . . . . . . . . . 7 | 4.1.3. "iat" (Issued At) Claim . . . . . . . . . . . . . . . 8 | |||
| 4.1.4. "iss" (Issuer) Claim . . . . . . . . . . . . . . . . . 8 | 4.1.4. "iss" (Issuer) Claim . . . . . . . . . . . . . . . . . 8 | |||
| 4.1.5. "aud" (Audience) Claim . . . . . . . . . . . . . . . . 8 | 4.1.5. "aud" (Audience) Claim . . . . . . . . . . . . . . . . 8 | |||
| 4.1.6. "prn" (Principal) Claim . . . . . . . . . . . . . . . 8 | 4.1.6. "prn" (Principal) Claim . . . . . . . . . . . . . . . 8 | |||
| 4.1.7. "jti" (JWT ID) Claim . . . . . . . . . . . . . . . . . 8 | 4.1.7. "jti" (JWT ID) Claim . . . . . . . . . . . . . . . . . 8 | |||
| 4.1.8. "typ" (Type) Claim . . . . . . . . . . . . . . . . . . 8 | 4.1.8. "typ" (Type) Claim . . . . . . . . . . . . . . . . . . 9 | |||
| 4.2. Public Claim Names . . . . . . . . . . . . . . . . . . . . 8 | 4.2. Public Claim Names . . . . . . . . . . . . . . . . . . . . 9 | |||
| 4.3. Private Claim Names . . . . . . . . . . . . . . . . . . . 9 | 4.3. Private Claim Names . . . . . . . . . . . . . . . . . . . 9 | |||
| 5. JWT Header . . . . . . . . . . . . . . . . . . . . . . . . . . 9 | 5. JWT Header . . . . . . . . . . . . . . . . . . . . . . . . . . 9 | |||
| 5.1. "typ" (Type) Header Parameter . . . . . . . . . . . . . . 10 | 5.1. "typ" (Type) Header Parameter . . . . . . . . . . . . . . 9 | |||
| 5.2. "cty" (Content Type) Header Parameter . . . . . . . . . . 10 | ||||
| 6. Plaintext JWTs . . . . . . . . . . . . . . . . . . . . . . . . 10 | 6. Plaintext JWTs . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 6.1. Example Plaintext JWT . . . . . . . . . . . . . . . . . . 10 | 6.1. Example Plaintext JWT . . . . . . . . . . . . . . . . . . 10 | |||
| 7. Rules for Creating and Validating a JWT . . . . . . . . . . . 11 | 7. Rules for Creating and Validating a JWT . . . . . . . . . . . 11 | |||
| 8. Cryptographic Algorithms . . . . . . . . . . . . . . . . . . . 13 | 8. Cryptographic Algorithms . . . . . . . . . . . . . . . . . . . 13 | |||
| 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 | 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 9.1. JSON Web Token Claims Registry . . . . . . . . . . . . . . 14 | 9.1. JSON Web Token Claims Registry . . . . . . . . . . . . . . 14 | |||
| 9.1.1. Registration Template . . . . . . . . . . . . . . . . 14 | ||||
| 9.1.2. Initial Registry Contents . . . . . . . . . . . . . . 15 | ||||
| 9.2. Sub-Namespace Registration of | 9.2. Sub-Namespace Registration of | |||
| urn:ietf:params:oauth:token-type:jwt . . . . . . . . . . . 14 | urn:ietf:params:oauth:token-type:jwt . . . . . . . . . . . 16 | |||
| 9.3. Registration of application/jwt MIME Media Type . . . . . 14 | 9.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 16 | |||
| 9.4. Registration of "JWT" Type Value . . . . . . . . . . . . . 15 | 9.3. JSON Web Signature and Encryption Type Values | |||
| 10. Security Considerations . . . . . . . . . . . . . . . . . . . 16 | Registration . . . . . . . . . . . . . . . . . . . . . . . 16 | |||
| 11. Open Issues and Things To Be Done (TBD) . . . . . . . . . . . 16 | 9.3.1. Registry Contents . . . . . . . . . . . . . . . . . . 16 | |||
| 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 16 | 9.4. Media Type Registration . . . . . . . . . . . . . . . . . 16 | |||
| 12.1. Normative References . . . . . . . . . . . . . . . . . . . 16 | 9.4.1. Registry Contents . . . . . . . . . . . . . . . . . . 16 | |||
| 12.2. Informative References . . . . . . . . . . . . . . . . . . 17 | 10. Security Considerations . . . . . . . . . . . . . . . . . . . 17 | |||
| Appendix A. Relationship of JWTs to SAML Tokens . . . . . . . . . 18 | 11. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 18 | |||
| Appendix B. Relationship of JWTs to Simple Web Tokens (SWTs) . . 18 | 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18 | |||
| Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 18 | 12.1. Normative References . . . . . . . . . . . . . . . . . . . 18 | |||
| Appendix D. Document History . . . . . . . . . . . . . . . . . . 19 | 12.2. Informative References . . . . . . . . . . . . . . . . . . 19 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 19 | Appendix A. Relationship of JWTs to SAML Tokens . . . . . . . . . 19 | |||
| Appendix B. Relationship of JWTs to Simple Web Tokens (SWTs) . . 20 | ||||
| Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 20 | ||||
| Appendix D. Document History . . . . . . . . . . . . . . . . . . 20 | ||||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 21 | ||||
| 1. Introduction | 1. Introduction | |||
| JSON Web Token (JWT) is a compact token format intended for space | JSON Web Token (JWT) is a compact token format intended for space | |||
| constrained environments such as HTTP Authorization headers and URI | constrained environments such as HTTP Authorization headers and URI | |||
| query parameters. JWTs encode claims to be transmitted as a JSON | query parameters. JWTs encode claims to be transmitted as a | |||
| object (as defined in RFC 4627 [RFC4627]) that is base64url encoded | JavaScript Object Notation (JSON) [RFC4627] object that is base64url | |||
| and digitally signed or MACed and/or encrypted. Signing and MACing | encoded and digitally signed or MACed and/or encrypted. Signing and | |||
| is performed using JSON Web Signature (JWS) [JWS]. Encryption is | MACing is performed using JSON Web Signature (JWS) [JWS]. Encryption | |||
| performed using JSON Web Encryption (JWE) [JWE]. | is performed using JSON Web Encryption (JWE) [JWE]. | |||
| The suggested pronunciation of JWT is the same as the English word | The suggested pronunciation of JWT is the same as the English word | |||
| "jot". | "jot". | |||
| 1.1. Notational Conventions | ||||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | ||||
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | ||||
| document are to be interpreted as described in Key words for use in | ||||
| RFCs to Indicate Requirement Levels [RFC2119]. | ||||
| 2. Terminology | 2. Terminology | |||
| JSON Web Token (JWT) A string consisting of multiple parts, the | JSON Web Token (JWT) A string consisting of multiple parts, the | |||
| first being the Encoded JWT Header, plus additional parts | first being the Encoded JWT Header, plus additional parts | |||
| depending upon the contents of the header, with the parts being | depending upon the contents of the header, with the parts being | |||
| separated by period ('.') characters, and each part containing | separated by period ('.') characters, and each part containing | |||
| base64url encoded content. | base64url encoded content. | |||
| JWT Header A string representing a JSON object that describes the | JWT Header A string representing a JSON object that describes the | |||
| cryptographic operations applied to the JWT. When the JWT is | cryptographic operations applied to the JWT. When the JWT is | |||
| digitally signed or MACed, the JWT Header is a JWS Header. When | digitally signed or MACed, the JWT Header is a JWS Header. When | |||
| the JWT is encrypted, the JWT Header is a JWE Header. | the JWT is encrypted, the JWT Header is a JWE Header. | |||
| Header Parameter Names The names of the members within the JWT | Header Parameter Name The name of a member of the JSON object | |||
| Header. | representing a JWT Header. | |||
| Header Parameter Values The values of the members within the JWT | Header Parameter Value The value of a member of the JSON object | |||
| Header. | representing a JWT Header. | |||
| JWT Claims Set A string representing a JSON object that contains the | JWT Claims Set A string representing a JSON object that contains the | |||
| claims conveyed by the JWT. When the JWT is digitally signed or | claims conveyed by the JWT. When the JWT is digitally signed or | |||
| MACed, the bytes of the UTF-8 representation of the JWT Claims Set | MACed, the bytes of the UTF-8 representation of the JWT Claims Set | |||
| are base64url encoded to create the Encoded JWS Payload. When the | are base64url encoded to create the Encoded JWS Payload. When the | |||
| JWT is encrypted, the bytes of the UTF-8 representation of the JWT | JWT is encrypted, the bytes of the UTF-8 representation of the JWT | |||
| Claims Set are used as the JWE Plaintext. | Claims Set are used as the JWE Plaintext. | |||
| Claim Names The names of the members of the JSON object represented | Claim Name The name of a member of the JSON object representing a | |||
| by the JWT Claims Set. | JWT Claims Set. | |||
| Claim Values The values of the members of the JSON object | Claim Value The value of a member of the JSON object representing a | |||
| represented by the JWT Claims Set. | JWT Claims Set. | |||
| Encoded JWT Header Base64url encoding of the bytes of the UTF-8 RFC | Encoded JWT Header Base64url encoding of the bytes of the UTF-8 | |||
| 3629 [RFC3629] representation of the JWT Header. | [RFC3629] representation of the JWT Header. | |||
| Base64url Encoding For the purposes of this specification, this term | Base64url Encoding For the purposes of this specification, this term | |||
| always refers to the URL- and filename-safe Base64 encoding | always refers to the URL- and filename-safe Base64 encoding | |||
| described in RFC 4648 [RFC4648], Section 5, with the (non URL- | described in RFC 4648 [RFC4648], Section 5, with the (non URL- | |||
| safe) '=' padding characters omitted, as permitted by Section 3.2. | safe) '=' padding characters omitted, as permitted by Section 3.2. | |||
| (See Appendix C of [JWS] for notes on implementing base64url | (See Appendix C of [JWS] for notes on implementing base64url | |||
| encoding without padding.) | encoding without padding.) | |||
| Collision Resistant Namespace A namespace that allows names to be | ||||
| allocated in a manner such that they are highly unlikely to | ||||
| collide with other names. For instance, collision resistance can | ||||
| be achieved through administrative delegation of portions of the | ||||
| namespace or through use of collision-resistant name allocation | ||||
| functions. Examples of Collision Resistant Namespaces include: | ||||
| Domain Names, Object Identifiers (OIDs) as defined in the ITU-T | ||||
| X.660 and X.670 Recommendation series, and Universally Unique | ||||
| IDentifiers (UUIDs) [RFC4122]. When using an administratively | ||||
| delegated namespace, the definer of a name needs to take | ||||
| reasonable precautions to ensure they are in control of the | ||||
| portion of the namespace they use to define the name. | ||||
| StringOrURI A JSON string value, with the additional requirement | StringOrURI A JSON string value, with the additional requirement | |||
| that while arbitrary string values MAY be used, any value | that while arbitrary string values MAY be used, any value | |||
| containing a ":" character MUST be a URI as defined in RFC 3986 | containing a ":" character MUST be a URI [RFC3986]. | |||
| [RFC3986]. | ||||
| IntDate A JSON numeric value representing the number of seconds from | IntDate A JSON numeric value representing the number of seconds from | |||
| 1970-01-01T0:0:0Z UTC until the specified UTC date/time. See RFC | 1970-01-01T0:0:0Z UTC until the specified UTC date/time. See RFC | |||
| 3339 [RFC3339] for details regarding date/times in general and UTC | 3339 [RFC3339] for details regarding date/times in general and UTC | |||
| in particular. | in particular. | |||
| 3. JSON Web Token (JWT) Overview | 3. JSON Web Token (JWT) Overview | |||
| JWTs represent a set of claims as a JSON object that is base64url | JWTs represent a set of claims as a JSON object that is base64url | |||
| encoded and digitally signed or MACed and/or encrypted. The JWT | encoded and digitally signed or MACed and/or encrypted. The JWT | |||
| skipping to change at page 8, line 46 ¶ | skipping to change at page 9, line 11 ¶ | |||
| can be used to prevent the JWT from being replayed. The "jti" value | can be used to prevent the JWT from being replayed. The "jti" value | |||
| is case sensitive. Its value MUST be a string. This claim is | is case sensitive. Its value MUST be a string. This claim is | |||
| OPTIONAL. | OPTIONAL. | |||
| 4.1.8. "typ" (Type) Claim | 4.1.8. "typ" (Type) Claim | |||
| The "typ" (type) claim is used to declare a type for the contents of | The "typ" (type) claim is used to declare a type for the contents of | |||
| this JWT Claims Set. The "typ" value is case sensitive. Its value | this JWT Claims Set. The "typ" value is case sensitive. Its value | |||
| MUST be a string. This claim is OPTIONAL. | MUST be a string. This claim is OPTIONAL. | |||
| The values used for the "typ" claim SHOULD come from the same value | The values used for the "typ" claim come from the same value space as | |||
| space as the "typ" header parameter, with the same rules applying. | the "typ" header parameter, with the same rules applying. | |||
| 4.2. Public Claim Names | 4.2. Public Claim Names | |||
| Claim names can be defined at will by those using JWTs. However, in | Claim names can be defined at will by those using JWTs. However, in | |||
| order to prevent collisions, any new claim name SHOULD either be | order to prevent collisions, any new claim name SHOULD either be | |||
| defined in the IANA JSON Web Token Claims registry Section 9.1 or be | registered in the IANA JSON Web Token Claims registry Section 9.1 or | |||
| a URI that contains a collision resistant namespace. Examples of | be a URI that contains a Collision Resistant Namespace. | |||
| collision resistant namespaces include: | ||||
| o Domain Names, | ||||
| o Object Identifiers (OIDs) as defined in the ITU-T X.660 and X.670 | ||||
| Recommendation series, or | ||||
| o Universally Unique IDentifier (UUID) as defined in RFC 4122 | ||||
| [RFC4122]. | ||||
| In each case, the definer of the name or value needs to take | ||||
| reasonable precautions to make sure they are in control of the part | ||||
| of the namespace they use to define the claim name. | ||||
| 4.3. Private Claim Names | 4.3. Private Claim Names | |||
| A producer and consumer of a JWT may agree to any claim name that is | A producer and consumer of a JWT may agree to any claim name that is | |||
| not a Reserved Name Section 4.1 or a Public Name Section 4.2. Unlike | not a Reserved Name Section 4.1 or a Public Name Section 4.2. Unlike | |||
| Public Names, these private names are subject to collision and should | Public Names, these private names are subject to collision and should | |||
| be used with caution. | be used with caution. | |||
| 5. JWT Header | 5. JWT Header | |||
| skipping to change at page 9, line 40 ¶ | skipping to change at page 9, line 41 ¶ | |||
| the cryptographic operations applied to the JWT and optionally, | the cryptographic operations applied to the JWT and optionally, | |||
| additional properties of the JWT. The member names within the JWT | additional properties of the JWT. The member names within the JWT | |||
| Header are referred to as Header Parameter Names. These names MUST | Header are referred to as Header Parameter Names. These names MUST | |||
| be unique; JWTs with duplicate Header Parameter Names MUST be | be unique; JWTs with duplicate Header Parameter Names MUST be | |||
| rejected. The corresponding values are referred to as Header | rejected. The corresponding values are referred to as Header | |||
| Parameter Values. | Parameter Values. | |||
| Implementations MUST understand the entire contents of the header; | Implementations MUST understand the entire contents of the header; | |||
| otherwise, the JWT MUST be rejected for processing. | otherwise, the JWT MUST be rejected for processing. | |||
| There are two ways of distinguishing whether the JWT is a JWS or JWE. | ||||
| The first is by examining the "alg" (algorithm) header value. If the | ||||
| value represents a signature algorithm, the JWT is a JWS; if it | ||||
| represents an encryption algorithm, the JWT is a JWE. A second | ||||
| method is determining whether an "enc" (encryption method) member | ||||
| exists. If the "enc" member exists, the JWT is a JWE; otherwise, the | ||||
| JWT is a JWS. Both methods will yield the same result. | ||||
| JWS Header Parameters are defined by [JWS]. JWE Header Parameters | JWS Header Parameters are defined by [JWS]. JWE Header Parameters | |||
| are defined by [JWE]. This specification further specifies the use | are defined by [JWE]. This specification further specifies the use | |||
| of the following header parameters in both the cases where the JWT is | of the following header parameter in both the cases where the JWT is | |||
| a JWS and where it is a JWE. | a JWS and where it is a JWE. | |||
| 5.1. "typ" (Type) Header Parameter | 5.1. "typ" (Type) Header Parameter | |||
| The "typ" (type) header parameter is used to declare structural | The "typ" (type) header parameter is used to declare the type of this | |||
| information about the JWT. In the normal case where nested signing | object. If present, it is RECOMMENDED that its value be either "JWT" | |||
| or encryption operations are not employed, the use of this header | or "urn:ietf:params:oauth:token-type:jwt" to indicate that this | |||
| parameter is OPTIONAL, and if present, it is RECOMMENDED that its | object is a JWT. The "typ" value is case sensitive. Its value MUST | |||
| value be either "JWT" or "urn:ietf:params:oauth:token-type:jwt". In | be a string. This header parameter is OPTIONAL. | |||
| the case that nested signing or encryption steps are employed, the | ||||
| use of this header parameter is REQUIRED; in this case, the value | 5.2. "cty" (Content Type) Header Parameter | |||
| MUST either be "JWS", to indicate that a nested digitally signed or | ||||
| MACed JWT is carried in this JWT or "JWE", to indicate that a nested | The "cty" (content type) header parameter is used to declare | |||
| encrypted JWT is carried in this JWT. | structural information about the JWT. Its value MUST be a string. | |||
| In the normal case where nested signing or encryption operations are | ||||
| not employed, the use of this header parameter is NOT RECOMMENDED. | ||||
| In the case that nested signing or encryption is employed, the use of | ||||
| this header parameter is REQUIRED; in this case, the value MUST be | ||||
| "JWT", to indicate that a nested JWT is carried in this JWT. | ||||
| The values used for the "cty" header parameter come from the same | ||||
| value space as the "typ" header parameter, with the same rules | ||||
| applying. | ||||
| 6. Plaintext JWTs | 6. Plaintext JWTs | |||
| To support use cases where the JWT content is secured by a means | To support use cases where the JWT content is secured by a means | |||
| other than a signature and/or encryption contained within the token | other than a signature and/or encryption contained within the token | |||
| (such as a signature on a data structure containing the token), JWTs | (such as a signature on a data structure containing the token), JWTs | |||
| MAY also be created without a signature or encryption. A plaintext | MAY also be created without a signature or encryption. A plaintext | |||
| JWT is a JWS using the "none" JWS "alg" header parameter value | JWT is a JWS using the "none" JWS "alg" header parameter value | |||
| defined in JSON Web Algorithms (JWA) [JWA]; it is a JWS with an empty | defined in JSON Web Algorithms (JWA) [JWA]; it is a JWS with an empty | |||
| JWS Signature value. | JWS Signature value. | |||
| skipping to change at page 11, line 49 ¶ | skipping to change at page 11, line 50 ¶ | |||
| * If the JWT is a JWS, create a JWS using the JWT Header as the | * If the JWT is a JWS, create a JWS using the JWT Header as the | |||
| JWS Header and the Message as the JWS Payload; all steps | JWS Header and the Message as the JWS Payload; all steps | |||
| specified in [JWS] for creating a JWS MUST be followed. | specified in [JWS] for creating a JWS MUST be followed. | |||
| * Else, if the JWT is a JWE, create a JWE using the JWT Header | * Else, if the JWT is a JWE, create a JWE using the JWT Header | |||
| as the JWE Header and the Message as the JWE Plaintext; all | as the JWE Header and the Message as the JWE Plaintext; all | |||
| steps specified in [JWE] for creating a JWE MUST be followed. | steps specified in [JWE] for creating a JWE MUST be followed. | |||
| 6. If a nested signing or encryption operation will be performed, | 6. If a nested signing or encryption operation will be performed, | |||
| let the Message be the JWS or JWE, and return to Step 3, using a | let the Message be the JWS or JWE, and return to Step 3, using a | |||
| "typ" value of either "JWS" or "JWE" respectively in the new JWT | "cty" (content type) value of "JWT" in the new JWT Header created | |||
| Header created in that step. | in that step. | |||
| 7. Otherwise, let the resulting JWT be the JWS or JWE. | 7. Otherwise, let the resulting JWT be the JWS or JWE. | |||
| When validating a JWT the following steps MUST be taken. The order | When validating a JWT the following steps MUST be taken. The order | |||
| of the steps is not significant in cases where there are no | of the steps is not significant in cases where there are no | |||
| dependencies between the inputs and outputs of the steps. If any of | dependencies between the inputs and outputs of the steps. If any of | |||
| the listed steps fails then the token MUST be rejected for | the listed steps fails then the token MUST be rejected for | |||
| processing. | processing. | |||
| 1. The JWT MUST contain at least one period character. | 1. The JWT MUST contain at least one period character. | |||
| skipping to change at page 12, line 44 ¶ | skipping to change at page 12, line 45 ¶ | |||
| cases: | cases: | |||
| * If the JWT is a JWS, all steps specified in [JWS] for | * If the JWT is a JWS, all steps specified in [JWS] for | |||
| validating a JWS MUST be followed. Let the Message be the | validating a JWS MUST be followed. Let the Message be the | |||
| result of base64url decoding the JWS Payload. | result of base64url decoding the JWS Payload. | |||
| * Else, if the JWT is a JWE, all steps specified in [JWE] for | * Else, if the JWT is a JWE, all steps specified in [JWE] for | |||
| validating a JWE MUST be followed. Let the Message be the | validating a JWE MUST be followed. Let the Message be the | |||
| JWE Plaintext. | JWE Plaintext. | |||
| 8. If the JWT Header contains a "typ" value of either "JWS" or | 8. If the JWT Header contains a "cty" (content type) value of | |||
| "JWE", then the Message contains a JWT that was the subject of | "JWT", then the Message contains a JWT that was the subject of | |||
| nested signing or encryption operations, respectively. In this | nested signing or encryption operations. In this case, return | |||
| case, return to Step 1, using the Message as the JWT. | to Step 1, using the Message as the JWT. | |||
| 9. Otherwise, let the JWT Claims Set be the Message. | 9. Otherwise, let the JWT Claims Set be the Message. | |||
| 10. The JWT Claims Set MUST be completely valid JSON syntax | 10. The JWT Claims Set MUST be completely valid JSON syntax | |||
| conforming to RFC 4627 [RFC4627]. | conforming to RFC 4627 [RFC4627]. | |||
| 11. When used in a security-related context, the JWT Claims Set MUST | 11. When used in a security-related context, the JWT Claims Set MUST | |||
| be validated to only include claims whose syntax and semantics | be validated to only include claims whose syntax and semantics | |||
| are both understood and supported. | are both understood and supported. | |||
| skipping to change at page 14, line 4 ¶ | skipping to change at page 14, line 6 ¶ | |||
| If an implementation provides encryption capabilities, of the JWE | If an implementation provides encryption capabilities, of the JWE | |||
| encryption algorithms, only RSA-PKCS1-1.5 with 2048 bit keys, AES- | encryption algorithms, only RSA-PKCS1-1.5 with 2048 bit keys, AES- | |||
| 128-KW, AES-256-KW, AES-128-CBC, and AES-256-CBC MUST be implemented | 128-KW, AES-256-KW, AES-128-CBC, and AES-256-CBC MUST be implemented | |||
| by conforming implementations. It is RECOMMENDED that | by conforming implementations. It is RECOMMENDED that | |||
| implementations also support ECDH-ES with 256 bit keys, AES-128-GCM, | implementations also support ECDH-ES with 256 bit keys, AES-128-GCM, | |||
| and AES-256-GCM. Support for other algorithms and key sizes is | and AES-256-GCM. Support for other algorithms and key sizes is | |||
| OPTIONAL. | OPTIONAL. | |||
| 9. IANA Considerations | 9. IANA Considerations | |||
| 9.1. JSON Web Token Claims Registry | 9.1. JSON Web Token Claims Registry | |||
| This specification establishes the IANA JSON Web Token Claims | This specification establishes the IANA JSON Web Token Claims | |||
| registry for reserved JWT claim names. Inclusion in the registry is | registry for reserved JWT Claim Names. The registry records the | |||
| RFC Required in the RFC 5226 [RFC5226] sense. The registry records | reserved Claim Name and a reference to the specification that defines | |||
| the reserved claim name and a reference to the RFC that defines it. | it. This specification registers the Claim Names defined in | |||
| This specification registers the claim names defined in Section 4.1. | Section 4.1. | |||
| Values are registered with a Specification Required [RFC5226] after a | ||||
| two week review period on the [TBD]@ietf.org mailing list, on the | ||||
| advice of one or more Designated Experts. However, to allow for the | ||||
| allocation of values prior to publication, the Designated Expert(s) | ||||
| may approve registration once they are satisfied that such a | ||||
| specification will be published. | ||||
| Registration requests must be sent to the [TBD]@ietf.org mailing list | ||||
| for review and comment, with an appropriate subject (e.g., "Request | ||||
| for access token type: example"). [[ Note to RFC-EDITOR: The name of | ||||
| the mailing list should be determined in consultation with the IESG | ||||
| and IANA. Suggested name: claims-reg-review. ]] | ||||
| Within the review period, the Designated Expert(s) will either | ||||
| approve or deny the registration request, communicating this decision | ||||
| to the review list and IANA. Denials should include an explanation | ||||
| and, if applicable, suggestions as to how to make the request | ||||
| successful. | ||||
| IANA must only accept registry updates from the Designated Expert(s), | ||||
| and should direct all requests for registration to the review mailing | ||||
| list. | ||||
| 9.1.1. Registration Template | ||||
| Claim Name: | ||||
| The name requested (e.g., "example"). | ||||
| Change Controller: | ||||
| For standards-track RFCs, state "IETF". For others, give the name | ||||
| of the responsible party. Other details (e.g., postal address, | ||||
| e-mail address, home page URI) may also be included. | ||||
| Specification Document(s): | ||||
| Reference to the document that specifies the parameter, preferably | ||||
| including a URI that can be used to retrieve a copy of the | ||||
| document. An indication of the relevant sections may also be | ||||
| included, but is not required. | ||||
| 9.1.2. Initial Registry Contents | ||||
| o Claim Name: "exp" | ||||
| o Change Controller: IETF | ||||
| o Specification Document(s): Section 4.1.1 of [[ this document ]] | ||||
| o Claim Name: "nbf" | ||||
| o Change Controller: IETF | ||||
| o Specification Document(s): Section 4.1.2 of [[ this document ]] | ||||
| o Claim Name: "iat" | ||||
| o Change Controller: IETF | ||||
| o Specification Document(s): Section 4.1.3 of [[ this document ]] | ||||
| o Claim Name: "iss" | ||||
| o Change Controller: IETF | ||||
| o Specification Document(s): Section 4.1.4 of [[ this document ]] | ||||
| o Claim Name: "aud" | ||||
| o Change Controller: IETF | ||||
| o Specification Document(s): Section 4.1.5 of [[ this document ]] | ||||
| o Claim Name: "prn" | ||||
| o Change Controller: IETF | ||||
| o Specification Document(s): Section 4.1.6 of [[ this document ]] | ||||
| o Claim Name: "jti" | ||||
| o Change Controller: IETF | ||||
| o Specification Document(s): Section 4.1.7 of [[ this document ]] | ||||
| o Claim Name: "typ" | ||||
| o Change Controller: IETF | ||||
| o Specification Document(s): Section 4.1.8 of [[ this document ]] | ||||
| 9.2. Sub-Namespace Registration of urn:ietf:params:oauth:token-type:jwt | 9.2. Sub-Namespace Registration of urn:ietf:params:oauth:token-type:jwt | |||
| This specification registers the value "token-type:jwt" in the | 9.2.1. Registry Contents | |||
| registry urn:ietf:params:oauth established in An IETF URN Sub- | ||||
| This specification registers the value "token-type:jwt" in the IANA | ||||
| urn:ietf:params:oauth registry established in An IETF URN Sub- | ||||
| Namespace for OAuth [I-D.ietf-oauth-urn-sub-ns]. | Namespace for OAuth [I-D.ietf-oauth-urn-sub-ns]. | |||
| o URN: urn:ietf:params:oauth:token-type:jwt | o URN: urn:ietf:params:oauth:token-type:jwt | |||
| o Common Name: JSON Web Token (JWT) Token Type | o Common Name: JSON Web Token (JWT) Token Type | |||
| o Change controller: IETF | o Change Controller: IETF | |||
| o Description: [[this document]] | o Specification Document(s): [[this document]] | |||
| 9.3. Registration of application/jwt MIME Media Type | 9.3. JSON Web Signature and Encryption Type Values Registration | |||
| This specification registers the "application/jwt" MIME Media Type | 9.3.1. Registry Contents | |||
| RFC 2045 [RFC2045]. | ||||
| Type name: | This specification registers the "JWT" type value in the IANA JSON | |||
| application | Web Signature and Encryption Type Values registry [JWS]: | |||
| Subtype name: | o "typ" Header Parameter Value: "JWT" | |||
| jwt | ||||
| Required parameters: | o Abbreviation for MIME Type: application/jwt | |||
| n/a | ||||
| Optional parameters: | o Change Controller: IETF | |||
| n/a | ||||
| Encoding considerations: | o Specification Document(s): Section 5.1 of [[ this document ]] | |||
| n/a | ||||
| Security considerations: | 9.4. Media Type Registration | |||
| See the Security Considerations section of this document | ||||
| Interoperability considerations: | 9.4.1. Registry Contents | |||
| n/a | ||||
| Published specification: | This specification registers the "application/jwt" Media Type | |||
| [[ this document ]] | [RFC2046] in the MIME Media Type registry [RFC4288] to indicate that | |||
| the content is a JWT. | ||||
| Applications that use this media type: | o Type Name: application | |||
| OpenID Connect, Mozilla Browser ID, Salesforce, Google, numerous | ||||
| others | ||||
| Additional information: | o Subtype Name: jwt | |||
| Magic number(s): n/a | ||||
| File extension(s): n/a | ||||
| Macintosh file type code(s): n/a | ||||
| Person & email address to contact for further information: | o Required Parameters: n/a | |||
| Michael B. Jones | o Optional Parameters: n/a | |||
| mbj@microsoft.com | ||||
| Intended usage: | o Encoding considerations: JWT values are encoded as a series of | |||
| COMMON | base64url encoded values (some of which may be the empty string) | |||
| separated by period ('.') characters | ||||
| Restrictions on usage: | o Security Considerations: See the Security Considerations section | |||
| none | of this document | |||
| Author: | o Interoperability Considerations: n/a | |||
| Michael B. Jones | ||||
| mbj@microsoft.com | ||||
| Change controller: | o Published Specification: [[ this document ]] | |||
| IETF | ||||
| 9.4. Registration of "JWT" Type Value | o Applications that use this media type: OpenID Connect, Mozilla | |||
| Browser ID, Salesforce, Google, numerous others | ||||
| This specification registers the following "typ" header parameter | o Additional Information: Magic number(s): n/a, File extension(s): | |||
| value in the JSON Web Signature and Encryption "typ" Values registry | n/a, Macintosh file type code(s): n/a | |||
| established by the JSON Web Algorithms (JWA) [JWA] specification: | ||||
| "typ" header parameter value: | o Person & email address to contact for further information: Michael | |||
| "JWT" | B. Jones, mbj@microsoft.com | |||
| Abbreviation for MIME type: | o Intended Usage: COMMON | |||
| application/jwt | ||||
| Change controller: | o Restrictions on Usage: none | |||
| IETF | ||||
| Description: | o Author: Michael B. Jones, mbj@microsoft.com | |||
| [[ this document ]] | ||||
| o Change Controller: IETF | ||||
| 10. Security Considerations | 10. Security Considerations | |||
| All of the security issues faced by any cryptographic application | ||||
| must be faced by a JWT/JWS/JWE/JWK agent. Among these issues are | ||||
| protecting the user's private key, preventing various attacks, and | ||||
| helping the user avoid mistakes such as inadvertently encrypting a | ||||
| message for the wrong recipient. The entire list of security | ||||
| considerations is beyond the scope of this document, but some | ||||
| significant concerns are listed here. | ||||
| All the security considerations in the JWS specification also apply | All the security considerations in the JWS specification also apply | |||
| to JWT, as do the JWE security considerations when encryption is | to JWT, as do the JWE security considerations when encryption is | |||
| employed. In particular, the JWS JSON Security Considerations and | employed. In particular, the JWS JSON Security Considerations and | |||
| Unicode Comparison Security Considerations apply equally to the JWT | Unicode Comparison Security Considerations apply equally to the JWT | |||
| Claims Set in the same manner that they do to the JWS Header. | Claims Set in the same manner that they do to the JWS Header. | |||
| 11. Open Issues and Things To Be Done (TBD) | 11. Open Issues | |||
| The following items remain to be done in this draft: | [[ to be removed by the RFC editor before publication as an RFC ]] | |||
| The following items remain to be considered or done in this draft: | ||||
| o Provide an example of an encrypted JWT. | o Provide an example of an encrypted JWT. | |||
| 12. References | 12. References | |||
| 12.1. Normative References | 12.1. Normative References | |||
| [I-D.ietf-oauth-urn-sub-ns] | [I-D.ietf-oauth-urn-sub-ns] | |||
| Tschofenig, H., "An IETF URN Sub-Namespace for OAuth", | Campbell, B. and H. Tschofenig, "An IETF URN Sub-Namespace | |||
| draft-ietf-oauth-urn-sub-ns-02 (work in progress), | for OAuth", draft-ietf-oauth-urn-sub-ns-05 (work in | |||
| January 2012. | progress), June 2012. | |||
| [JWA] Jones, M., "JSON Web Algorithms (JWA)", May 2012. | [JWA] Jones, M., "JSON Web Algorithms (JWA)", July 2012. | |||
| [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web | [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web | |||
| Encryption (JWE)", May 2012. | Encryption (JWE)", July 2012. | |||
| [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web | [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web | |||
| Signature (JWS)", May 2012. | Signature (JWS)", July 2012. | |||
| [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail | [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail | |||
| Extensions (MIME) Part One: Format of Internet Message | Extensions (MIME) Part Two: Media Types", RFC 2046, | |||
| Bodies", RFC 2045, November 1996. | November 1996. | |||
| [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
| Requirement Levels", BCP 14, RFC 2119, March 1997. | Requirement Levels", BCP 14, RFC 2119, March 1997. | |||
| [RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the | [RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the | |||
| Internet: Timestamps", RFC 3339, July 2002. | Internet: Timestamps", RFC 3339, July 2002. | |||
| [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO | [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO | |||
| 10646", STD 63, RFC 3629, November 2003. | 10646", STD 63, RFC 3629, November 2003. | |||
| [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform | [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform | |||
| Resource Identifier (URI): Generic Syntax", STD 66, | Resource Identifier (URI): Generic Syntax", STD 66, | |||
| RFC 3986, January 2005. | RFC 3986, January 2005. | |||
| [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and | ||||
| Registration Procedures", BCP 13, RFC 4288, December 2005. | ||||
| [RFC4627] Crockford, D., "The application/json Media Type for | [RFC4627] Crockford, D., "The application/json Media Type for | |||
| JavaScript Object Notation (JSON)", RFC 4627, July 2006. | JavaScript Object Notation (JSON)", RFC 4627, July 2006. | |||
| [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data | [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data | |||
| Encodings", RFC 4648, October 2006. | Encodings", RFC 4648, October 2006. | |||
| [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an | [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an | |||
| IANA Considerations Section in RFCs", BCP 26, RFC 5226, | IANA Considerations Section in RFCs", BCP 26, RFC 5226, | |||
| May 2008. | May 2008. | |||
| skipping to change at page 19, line 10 ¶ | skipping to change at page 20, line 47 ¶ | |||
| Solutions for signing JSON content were previously explored by Magic | Solutions for signing JSON content were previously explored by Magic | |||
| Signatures [MagicSignatures], JSON Simple Sign [JSS], and Canvas | Signatures [MagicSignatures], JSON Simple Sign [JSS], and Canvas | |||
| Applications [CanvasApp], all of which influenced this draft. Dirk | Applications [CanvasApp], all of which influenced this draft. Dirk | |||
| Balfanz, Yaron Y. Goland, John Panzer, and Paul Tarjan all made | Balfanz, Yaron Y. Goland, John Panzer, and Paul Tarjan all made | |||
| significant contributions to the design of this specification. | significant contributions to the design of this specification. | |||
| Appendix D. Document History | Appendix D. Document History | |||
| [[ to be removed by the RFC editor before publication as an RFC ]] | [[ to be removed by the RFC editor before publication as an RFC ]] | |||
| -01 | ||||
| o Added the "cty" (content type) header parameter for declaring type | ||||
| information about the secured content, as opposed to the "typ" | ||||
| (type) header parameter, which declares type information about | ||||
| this object. This significantly simplified nested JWTs. | ||||
| o Moved description of how to determine whether a header is for a | ||||
| JWS or a JWE from the JWT spec to the JWE spec. | ||||
| o Changed registration requirements from RFC Required to | ||||
| Specification Required with Expert Review. | ||||
| o Added Registration Template sections for defined registries. | ||||
| o Added Registry Contents sections to populate registry values. | ||||
| o Added "Collision Resistant Namespace" to the terminology section. | ||||
| o Numerous editorial improvements. | ||||
| -00 | -00 | |||
| o Created the initial IETF draft based upon | o Created the initial IETF draft based upon | |||
| draft-jones-json-web-token-10 with no normative changes. | draft-jones-json-web-token-10 with no normative changes. | |||
| Authors' Addresses | Authors' Addresses | |||
| Michael B. Jones | Michael B. Jones | |||
| Microsoft | Microsoft | |||
| End of changes. 68 change blocks. | ||||
| 159 lines changed or deleted | 279 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||