Skip to main content

JSON Web Token (JWT)
draft-ietf-oauth-json-web-token-23

The information below is for an old version of the document.
Document Type
This is an older version of an Internet-Draft that was ultimately published as RFC 7519.
Authors Michael B. Jones , John Bradley , Nat Sakimura
Last updated 2014-07-01 (Latest revision 2014-06-20)
Replaces draft-jones-json-web-token
RFC stream Internet Engineering Task Force (IETF)
Formats
Reviews
Additional resources Mailing list discussion
Stream WG state Submitted to IESG for Publication
Document shepherd Hannes Tschofenig
Shepherd write-up Show Last changed 2014-05-08
IESG IESG state Became RFC 7519 (Proposed Standard)
Consensus boilerplate Unknown
Telechat date (None)
Responsible AD Kathleen Moriarty
Send notices to oauth-chairs@tools.ietf.org, draft-ietf-oauth-json-web-token@tools.ietf.org
draft-ietf-oauth-json-web-token-23
quot; in the new JOSE Header
       created in that step.

   6.  Otherwise, let the resulting JWT be the JWS or JWE.

   When validating a JWT, the following steps MUST be taken.  The order
   of the steps is not significant in cases where there are no
   dependencies between the inputs and outputs of the steps.  If any of
   the listed steps fails then the JWT MUST be rejected for processing.

Jones, et al.           Expires December 22, 2014              [Page 13]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   1.   The JWT MUST contain at least one period ('.') character.

   2.   Let the Encoded JOSE Header be the portion of the JWT before the
        first period ('.') character.

   3.   The Encoded JOSE Header MUST be successfully base64url decoded
        following the restriction given in this specification that no
        padding characters have been used.

   4.   The resulting JOSE Header MUST be completely valid JSON syntax
        conforming to [RFC7159].

   5.   The resulting JOSE Header MUST be validated to only include
        parameters and values whose syntax and semantics are both
        understood and supported or that are specified as being ignored
        when not understood.

   6.   Determine whether the JWT is a JWS or a JWE using any of the
        methods described in Section 9 of [JWE].

   7.   Depending upon whether the JWT is a JWS or JWE, there are two
        cases:

        *  If the JWT is a JWS, all steps specified in [JWS] for
           validating a JWS MUST be followed.  Let the Message be the
           result of base64url decoding the JWS Payload.

        *  Else, if the JWT is a JWE, all steps specified in [JWE] for
           validating a JWE MUST be followed.  Let the Message be the
           JWE Plaintext.

   8.   If the JOSE Header contains a "cty" (content type) value of
        "JWT", then the Message is a JWT that was the subject of nested
        signing or encryption operations.  In this case, return to Step
        1, using the Message as the JWT.

   9.   Otherwise, let the JWT Claims Set be the Message.

   10.  The JWT Claims Set MUST be completely valid JSON syntax
        conforming to [RFC7159].

7.1.  String Comparison Rules

   Processing a JWT inevitably requires comparing known strings to
   values in JSON objects.  For example, in checking what the algorithm
   is, the Unicode string encoding "alg" will be checked against the
   member names in the JOSE Header to see if there is a matching Header
   Parameter name.

Jones, et al.           Expires December 22, 2014              [Page 14]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   Comparisons between JSON strings and other Unicode strings MUST be
   performed by comparing Unicode code points without normalization, as
   specified in the String Comparison Rules in Section 5.3 of [JWS].

8.  Implementation Requirements

   This section defines which algorithms and features of this
   specification are mandatory to implement.  Applications using this
   specification can impose additional requirements upon implementations
   that they use.  For instance, an application might require support
   for encrypted JWTs and Nested JWTs; another might require support for
   signing JWTs with ECDSA using the P-256 curve and the SHA-256 hash
   algorithm ("ES256").

   Of the signature and MAC algorithms specified in JSON Web Algorithms
   (JWA) [JWA], only HMAC SHA-256 ("HS256") and "none" MUST be
   implemented by conforming JWT implementations.  It is RECOMMENDED
   that implementations also support RSASSA-PKCS1-V1_5 with the SHA-256
   hash algorithm ("RS256") and ECDSA using the P-256 curve and the SHA-
   256 hash algorithm ("ES256").  Support for other algorithms and key
   sizes is OPTIONAL.

   Support for encrypted JWTs is OPTIONAL.  If an implementation
   provides encryption capabilities, of the encryption algorithms
   specified in [JWA], only RSAES-PKCS1-V1_5 with 2048 bit keys
   ("RSA1_5"), AES Key Wrap with 128 and 256 bit keys ("A128KW" and
   "A256KW"), and the composite authenticated encryption algorithm using
   AES CBC and HMAC SHA-2 ("A128CBC-HS256" and "A256CBC-HS512") MUST be
   implemented by conforming implementations.  It is RECOMMENDED that
   implementations also support using ECDH-ES to agree upon a key used
   to wrap the Content Encryption Key ("ECDH-ES+A128KW" and
   "ECDH-ES+A256KW") and AES in Galois/Counter Mode (GCM) with 128 bit
   and 256 bit keys ("A128GCM" and "A256GCM").  Support for other
   algorithms and key sizes is OPTIONAL.

   Support for Nested JWTs is OPTIONAL.

9.  URI for Declaring that Content is a JWT

   This specification registers the URN
   "urn:ietf:params:oauth:token-type:jwt" for use by applications that
   declare content types using URIs (rather than, for instance, MIME
   Media Types) to indicate that the content referred to is a JWT.

Jones, et al.           Expires December 22, 2014              [Page 15]
Internet-Draft            JSON Web Token (JWT)                 June 2014

10.  IANA Considerations

10.1.  JSON Web Token Claims Registry

   This specification establishes the IANA JSON Web Token Claims
   registry for JWT Claim Names.  The registry records the Claim Name
   and a reference to the specification that defines it.  This
   specification registers the Claim Names defined in 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 the RFC Editor: The name
   of the mailing list should be determined in consultation with the
   IESG and IANA.  Suggested name: jwt-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.  Registration requests that are undetermined for a period
   longer than 21 days can be brought to the IESG's attention (using the
   iesg@iesg.org mailing list) for resolution.

   Criteria that should be applied by the Designated Expert(s) includes
   determining whether the proposed registration duplicates existing
   functionality, determining whether it is likely to be of general
   applicability or whether it is useful only for a single application,
   and whether the registration makes sense.

   IANA must only accept registry updates from the Designated Expert(s)
   and should direct all requests for registration to the review mailing
   list.

   It is suggested that multiple Designated Experts be appointed who are
   able to represent the perspectives of different applications using
   this specification, in order to enable broadly-informed review of
   registration decisions.  In cases where a registration decision could
   be perceived as creating a conflict of interest for a particular
   Expert, that Expert should defer to the judgment of the other
   Expert(s).

Jones, et al.           Expires December 22, 2014              [Page 16]
Internet-Draft            JSON Web Token (JWT)                 June 2014

10.1.1.  Registration Template

   Claim Name:
      The name requested (e.g., "example").  Because a core goal of this
      specification is for the resulting representations to be compact,
      it is RECOMMENDED that the name be short -- not to exceed 8
      characters without a compelling reason to do so.  This name is
      case-sensitive.  Names may not match other registered names in a
      case-insensitive manner unless the Designated Expert(s) state that
      there is a compelling reason to allow an exception in this
      particular case.

   Claim Description:
      Brief description of the Claim (e.g., "Example description").

   Change Controller:
      For Standards Track RFCs, state "IESG".  For others, give the name
      of the responsible party.  Other details (e.g., postal address,
      email address, home page URI) may also be included.

   Specification Document(s):
      Reference to the document(s) that specify the parameter,
      preferably including URI(s) that can be used to retrieve copies of
      the document(s).  An indication of the relevant sections may also
      be included but is not required.

10.1.2.  Initial Registry Contents

   o  Claim Name: "iss"
   o  Claim Description: Issuer
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.1 of [[ this document ]]

   o  Claim Name: "sub"
   o  Claim Description: Subject
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.2 of [[ this document ]]

   o  Claim Name: "aud"
   o  Claim Description: Audience
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.3 of [[ this document ]]

   o  Claim Name: "exp"
   o  Claim Description: Expiration Time
   o  Change Controller: IESG

Jones, et al.           Expires December 22, 2014              [Page 17]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   o  Specification Document(s): Section 4.1.4 of [[ this document ]]

   o  Claim Name: "nbf"
   o  Claim Description: Not Before
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.5 of [[ this document ]]

   o  Claim Name: "iat"
   o  Claim Description: Issued At
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.6 of [[ this document ]]

   o  Claim Name: "jti"
   o  Claim Description: JWT ID
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.7 of [[ this document ]]

10.2.  Sub-Namespace Registration of
       urn:ietf:params:oauth:token-type:jwt

10.2.1.  Registry Contents

   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 [RFC6755], which can be used to indicate that the
   content is a JWT.

   o  URN: urn:ietf:params:oauth:token-type:jwt
   o  Common Name: JSON Web Token (JWT) Token Type
   o  Change Controller: IESG
   o  Specification Document(s): [[this document]]

10.3.  Media Type Registration

10.3.1.  Registry Contents

   This specification registers the "application/jwt" Media Type
   [RFC2046] in the MIME Media Types registry [IANA.MediaTypes], which
   can be used to indicate that the content is a JWT.

   o  Type Name: application
   o  Subtype Name: jwt
   o  Required Parameters: n/a
   o  Optional Parameters: n/a
   o  Encoding considerations: 8bit; JWT values are encoded as a series
      of base64url encoded values (some of which may be the empty
      string) separated by period ('.') characters.

Jones, et al.           Expires December 22, 2014              [Page 18]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   o  Security Considerations: See the Security Considerations section
      of [[ this document ]]
   o  Interoperability Considerations: n/a
   o  Published Specification: [[ this document ]]
   o  Applications that use this media type: OpenID Connect, Mozilla
      Persona, Salesforce, Google, numerous others
   o  Additional Information: Magic number(s): n/a, File extension(s):
      n/a, Macintosh file type code(s): n/a
   o  Person & email address to contact for further information: Michael
      B. Jones, mbj@microsoft.com
   o  Intended Usage: COMMON
   o  Restrictions on Usage: none
   o  Author: Michael B. Jones, mbj@microsoft.com
   o  Change Controller: IESG

10.4.  Header Parameter Names Registration

   This specification registers specific Claim Names defined in
   Section 4.1 in the IANA JSON Web Signature and Encryption Header
   Parameters registry defined in [JWS] for use by Claims replicated as
   Header Parameters in JWE objects, per Section 5.3.

10.4.1.  Registry Contents

   o  Header Parameter Name: "iss"
   o  Header Parameter Description: Issuer
   o  Header Parameter Usage Location(s): JWE
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.1 of [[ this document ]]

   o  Header Parameter Name: "sub"
   o  Header Parameter Description: Subject
   o  Header Parameter Usage Location(s): JWE
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.2 of [[ this document ]]

   o  Header Parameter Name: "aud"
   o  Header Parameter Description: Audience
   o  Header Parameter Usage Location(s): JWE
   o  Change Controller: IESG
   o  Specification Document(s): Section 4.1.3 of [[ this document ]]

11.  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 asymmetric private and symmetric secret keys,

Jones, et al.           Expires December 22, 2014              [Page 19]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   preventing various attacks, and helping avoid mistakes such as
   inadvertently encrypting a message to the wrong recipient.  The
   entire list of security considerations is beyond the scope of this
   document.

   All the security considerations in the JWS specification also apply
   to JWT, as do the JWE security considerations when encryption is
   employed.  In particular, the JWS JSON Security Considerations and
   Unicode Comparison Security Considerations apply equally to the JWT
   Claims Set in the same manner that they do to the JOSE Header.

11.1.  Trust Decisions

   The contents of a JWT cannot be relied upon in a trust decision
   unless its contents have been cryptographically secured and bound to
   the context necessary for the trust decision.  In particular, the
   key(s) used to sign and/or encrypt the JWT will typically need to
   verifiably be under the control of the party identified as the issuer
   of the JWT.

11.2.  Signing and Encryption Order

   While syntactically, the signing and encryption operations for Nested
   JWTs may be applied in any order, normally senders should sign the
   message and then encrypt the result (thus encrypting the signature).
   This prevents attacks in which the signature is stripped, leaving
   just an encrypted message, as well as providing privacy for the
   signer.  Furthermore, signatures over encrypted text are not
   considered valid in many jurisdictions.

   Note that potential concerns about security issues related to the
   order of signing and encryption operations are already addressed by
   the underlying JWS and JWE specifications; in particular, because JWE
   only supports the use of authenticated encryption algorithms,
   cryptographic concerns about the potential need to sign after
   encryption that apply in many contexts do not apply to this
   specification.

12.  References

12.1.  Normative References

   [ECMAScript]
              Ecma International, "ECMAScript Language Specification,
              5.1 Edition", ECMA 262, June 2011.

   [IANA.MediaTypes]

Jones, et al.           Expires December 22, 2014              [Page 20]
Internet-Draft            JSON Web Token (JWT)                 June 2014

              Internet Assigned Numbers Authority (IANA), "MIME Media
              Types", 2005.

   [JWA]      Jones, M., "JSON Web Algorithms (JWA)",
              draft-ietf-jose-json-web-algorithms (work in progress),
              June 2014.

   [JWE]      Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)",
              draft-ietf-jose-json-web-encryption (work in progress),
              June 2014.

   [JWS]      Jones, M., Bradley, J., and N. Sakimura, "JSON Web
              Signature (JWS)", draft-ietf-jose-json-web-signature (work
              in progress), June 2014.

   [RFC2046]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
              Extensions (MIME) Part Two: Media Types", RFC 2046,
              November 1996.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC3986]  Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
              Resource Identifier (URI): Generic Syntax", STD 66,
              RFC 3986, January 2005.

   [RFC4648]  Josefsson, S., "The Base16, Base32, and Base64 Data
              Encodings", RFC 4648, October 2006.

   [RFC6755]  Campbell, B. and H. Tschofenig, "An IETF URN Sub-Namespace
              for OAuth", RFC 6755, October 2012.

   [RFC7159]  Bray, T., "The JavaScript Object Notation (JSON) Data
              Interchange Format", RFC 7159, March 2014.

12.2.  Informative References

   [CanvasApp]
              Facebook, "Canvas Applications", 2010.

   [JSS]      Bradley, J. and N. Sakimura (editor), "JSON Simple Sign",
              September 2010.

   [MagicSignatures]
              Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic
              Signatures", January 2011.

   [OASIS.saml-core-2.0-os]

Jones, et al.           Expires December 22, 2014              [Page 21]
Internet-Draft            JSON Web Token (JWT)                 June 2014

              Cantor, S., Kemp, J., Philpott, R., and E. Maler,
              "Assertions and Protocol for the OASIS Security Assertion
              Markup Language (SAML) V2.0", OASIS Standard saml-core-
              2.0-os, March 2005.

   [RFC3275]  Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup
              Language) XML-Signature Syntax and Processing", RFC 3275,
              March 2002.

   [RFC3339]  Klyne, G., Ed. and C. Newman, "Date and Time on the
              Internet: Timestamps", RFC 3339, July 2002.

   [RFC4122]  Leach, P., Mealling, M., and R. Salz, "A Universally
              Unique IDentifier (UUID) URN Namespace", RFC 4122,
              July 2005.

   [RFC5226]  Narten, T. and H. Alvestrand, "Guidelines for Writing an
              IANA Considerations Section in RFCs", BCP 26, RFC 5226,
              May 2008.

   [SWT]      Hardt, D. and Y. Goland, "Simple Web Token (SWT)",
              Version 0.9.5.1, November 2009.

   [W3C.CR-xml11-20021015]
              Cowan, J., "Extensible Markup Language (XML) 1.1", W3C
              CR CR-xml11-20021015, October 2002.

   [W3C.REC-xml-c14n-20010315]
              Boyer, J., "Canonical XML Version 1.0", World Wide Web
              Consortium Recommendation REC-xml-c14n-20010315,
              March 2001,
              <http://www.w3.org/TR/2001/REC-xml-c14n-20010315>.

Appendix A.  JWT Examples

   This section contains examples of JWTs.  For other example JWTs, see
   Section 6.1 and Appendices A.1, A.2, and A.3 of [JWS].

A.1.  Example Encrypted JWT

   This example encrypts the same claims as used in Section 3.1 to the
   recipient using RSAES-PKCS1-V1_5 and AES_128_CBC_HMAC_SHA_256.

   The following example JOSE Header declares that:

   o  the Content Encryption Key is encrypted to the recipient using the
      RSAES-PKCS1-V1_5 algorithm to produce the JWE Encrypted Key and

Jones, et al.           Expires December 22, 2014              [Page 22]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   o  the Plaintext is encrypted using the AES_128_CBC_HMAC_SHA_256
      algorithm to produce the JWE Ciphertext.

     {"alg":"RSA1_5","enc":"A128CBC-HS256"}

   Other than using the octets of the UTF-8 representation of the JWT
   Claims Set from Section 3.1 as the plaintext value, the computation
   of this JWT is identical to the computation of the JWE in Appendix
   A.2 of [JWE], including the keys used.

   The final result in this example (with line breaks for display
   purposes only) is:

     eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0.
     QR1Owv2ug2WyPBnbQrRARTeEk9kDO2w8qDcjiHnSJflSdv1iNqhWXaKH4MqAkQtM
     oNfABIPJaZm0HaA415sv3aeuBWnD8J-Ui7Ah6cWafs3ZwwFKDFUUsWHSK-IPKxLG
     TkND09XyjORj_CHAgOPJ-Sd8ONQRnJvWn_hXV1BNMHzUjPyYwEsRhDhzjAD26ima
     sOTsgruobpYGoQcXUwFDn7moXPRfDE8-NoQX7N7ZYMmpUDkR-Cx9obNGwJQ3nM52
     YCitxoQVPzjbl7WBuB7AohdBoZOdZ24WlN1lVIeh8v1K4krB8xgKvRU8kgFrEn_a
     1rZgN5TiysnmzTROF869lQ.
     AxY8DCtDaGlsbGljb3RoZQ.
     MKOle7UQrG6nSxTLX6Mqwt0orbHvAKeWnDYvpIAeZ72deHxz3roJDXQyhxx0wKaM
     HDjUEOKIwrtkHthpqEanSBNYHZgmNOV7sln1Eu9g3J8.
     fiK51VwhsxJ-siBMR-YFiA

A.2.  Example Nested JWT

   This example shows how a JWT can be used as the payload of a JWE or
   JWS to create a Nested JWT.  In this case, the JWT Claims Set is
   first signed, and then encrypted.

   The inner signed JWT is identical to the example in Appendix A.2 of
   [JWS].  Therefore, its computation is not repeated here.  This
   example then encrypts this inner JWT to the recipient using RSAES-
   PKCS1-V1_5 and AES_128_CBC_HMAC_SHA_256.

   The following example JOSE Header declares that:

   o  the Content Encryption Key is encrypted to the recipient using the
      RSAES-PKCS1-V1_5 algorithm to produce the JWE Encrypted Key,

   o  the Plaintext is encrypted using the AES_128_CBC_HMAC_SHA_256
      algorithm to produce the JWE Ciphertext, and

   o  the Plaintext is itself a JWT.

Jones, et al.           Expires December 22, 2014              [Page 23]
Internet-Draft            JSON Web Token (JWT)                 June 2014

     {"alg":"RSA1_5","enc":"A128CBC-HS256","cty":"JWT"}

   Base64url encoding the octets of the UTF-8 representation of the JOSE
   Header yields this encoded JOSE Header value:

     eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5IjoiSldUIn0

   The computation of this JWT is identical to the computation of the
   JWE in Appendix A.2 of [JWE], other than that different JOSE Header,
   Plaintext, JWE Initialization Vector, and Content Encryption Key
   values are used.  (The RSA key used is the same.)

   The Payload used is the octets of the ASCII representation of the JWT
   at the end of Appendix A.2.1 of [JWS] (with all whitespace and line
   breaks removed), which is a sequence of 458 octets.

   The JWE Initialization Vector value used (using JSON array notation)
   is:

   [82, 101, 100, 109, 111, 110, 100, 32, 87, 65, 32, 57, 56, 48, 53,
   50]

   This example uses the Content Encryption Key represented by the
   base64url encoded value below:

     GawgguFyGrWKav7AX4VKUg

   The final result for this Nested JWT (with line breaks for display
   purposes only) is:

Jones, et al.           Expires December 22, 2014              [Page 24]
Internet-Draft            JSON Web Token (JWT)                 June 2014

     eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5IjoiSldU
     In0.
     g_hEwksO1Ax8Qn7HoN-BVeBoa8FXe0kpyk_XdcSmxvcM5_P296JXXtoHISr_DD_M
     qewaQSH4dZOQHoUgKLeFly-9RI11TG-_Ge1bZFazBPwKC5lJ6OLANLMd0QSL4fYE
     b9ERe-epKYE3xb2jfY1AltHqBO-PM6j23Guj2yDKnFv6WO72tteVzm_2n17SBFvh
     DuR9a2nHTE67pe0XGBUS_TK7ecA-iVq5COeVdJR4U4VZGGlxRGPLRHvolVLEHx6D
     YyLpw30Ay9R6d68YCLi9FYTq3hIXPK_-dmPlOUlKvPr1GgJzRoeC9G5qCvdcHWsq
     JGTO_z3Wfo5zsqwkxruxwA.
     UmVkbW9uZCBXQSA5ODA1Mg.
     VwHERHPvCNcHHpTjkoigx3_ExK0Qc71RMEParpatm0X_qpg-w8kozSjfNIPPXiTB
     BLXR65CIPkFqz4l1Ae9w_uowKiwyi9acgVztAi-pSL8GQSXnaamh9kX1mdh3M_TT
     -FZGQFQsFhu0Z72gJKGdfGE-OE7hS1zuBD5oEUfk0Dmb0VzWEzpxxiSSBbBAzP10
     l56pPfAtrjEYw-7ygeMkwBl6Z_mLS6w6xUgKlvW6ULmkV-uLC4FUiyKECK4e3WZY
     Kw1bpgIqGYsw2v_grHjszJZ-_I5uM-9RA8ycX9KqPRp9gc6pXmoU_-27ATs9XCvr
     ZXUtK2902AUzqpeEUJYjWWxSNsS-r1TJ1I-FMJ4XyAiGrfmo9hQPcNBYxPz3GQb2
     8Y5CLSQfNgKSGt0A4isp1hBUXBHAndgtcslt7ZoQJaKe_nNJgNliWtWpJ_ebuOpE
     l8jdhehdccnRMIwAmU1n7SPkmhIl1HlSOpvcvDfhUN5wuqU955vOBvfkBOh5A11U
     zBuo2WlgZ6hYi9-e3w29bR0C2-pp3jbqxEDw3iWaf2dc5b-LnR0FEYXvI_tYk5rd
     _J9N0mg0tQ6RbpxNEMNoA9QWk5lgdPvbh9BaO195abQ.
     AVO9iT5AV4CzvDJCdhSFlQ

Appendix B.  Relationship of JWTs to SAML Assertions

   SAML 2.0 [OASIS.saml-core-2.0-os] provides a standard for creating
   security tokens with greater expressivity and more security options
   than supported by JWTs.  However, the cost of this flexibility and
   expressiveness is both size and complexity.  SAML's use of XML
   [W3C.CR-xml11-20021015] and XML DSIG [RFC3275] contributes to the
   size of SAML assertions; its use of XML and especially XML
   Canonicalization [W3C.REC-xml-c14n-20010315] contributes to their
   complexity.

   JWTs are intended to provide a simple security token format that is
   small enough to fit into HTTP headers and query arguments in URIs.
   It does this by supporting a much simpler token model than SAML and
   using the JSON [RFC7159] object encoding syntax.  It also supports
   securing tokens using Message Authentication Codes (MACs) and digital
   signatures using a smaller (and less flexible) format than XML DSIG.

   Therefore, while JWTs can do some of the things SAML assertions do,
   JWTs are not intended as a full replacement for SAML assertions, but
   rather as a token format to be used when ease of implementation or
   compactness are considerations.

   SAML Assertions are always statements made by an entity about a
   subject.  JWTs are often used in the same manner, with the entity
   making the statements being represented by the "iss" (issuer) claim,

Jones, et al.           Expires December 22, 2014              [Page 25]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   and the subject being represented by the "sub" (subject) claim.
   However, with these claims being optional, other uses of the JWT
   format are also permitted.

Appendix C.  Relationship of JWTs to Simple Web Tokens (SWTs)

   Both JWTs and Simple Web Tokens SWT [SWT], at their core, enable sets
   of claims to be communicated between applications.  For SWTs, both
   the claim names and claim values are strings.  For JWTs, while claim
   names are strings, claim values can be any JSON type.  Both token
   types offer cryptographic protection of their content: SWTs with HMAC
   SHA-256 and JWTs with a choice of algorithms, including signature,
   MAC, and encryption algorithms.

Appendix D.  Acknowledgements

   The authors acknowledge that the design of JWTs was intentionally
   influenced by the design and simplicity of Simple Web Tokens [SWT]
   and ideas for JSON tokens that Dick Hardt discussed within the OpenID
   community.

   Solutions for signing JSON content were previously explored by Magic
   Signatures [MagicSignatures], JSON Simple Sign [JSS], and Canvas
   Applications [CanvasApp], all of which influenced this draft.

   This specification is the work of the OAuth Working Group, which
   includes dozens of active and dedicated participants.  In particular,
   the following individuals contributed ideas, feedback, and wording
   that influenced this specification:

   Dirk Balfanz, Richard Barnes, Brian Campbell, Breno de Medeiros, Dick
   Hardt, Joe Hildebrand, Jeff Hodges, Edmund Jay, Yaron Y. Goland, Ben
   Laurie, James Manger, Prateek Mishra, Tony Nadalin, Axel Nennker,
   John Panzer, Emmanuel Raviart, David Recordon, Eric Rescorla, Jim
   Schaad, Paul Tarjan, Hannes Tschofenig, and Sean Turner.

   Hannes Tschofenig and Derek Atkins chaired the OAuth working group
   and Sean Turner, Stephen Farrell, and Kathleen Moriarty served as
   Security area directors during the creation of this specification.

Appendix E.  Document History

   [[ to be removed by the RFC Editor before publication as an RFC ]]

   -23

Jones, et al.           Expires December 22, 2014              [Page 26]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   o  Replaced the terms JWS Header, JWE Header, and JWT Header with a
      single JOSE Header term defined in the JWS specification.  This
      also enabled a single Header Parameter definition to be used and
      reduced other areas of duplication between specifications.

   -22

   o  Revised the introduction to the Security Considerations section.
      Also introduced subsection headings for security considerations
      items.

   o  Added text about when applications typically would and would not
      use the "typ" header parameter.

   -21

   o  Removed unnecessary informative JWK spec reference.

   -20

   o  Changed the RFC 6755 reference to be normative.

   o  Changed the JWK reference to be informative.

   o  Described potential sources of ambiguity in representing the JSON
      objects used in the examples.  The octets of the actual UTF-8
      representations of the JSON objects used in the examples are
      included to remove these ambiguities.

   o  Noted that octet sequences are depicted using JSON array notation.

   -19

   o  Specified that support for Nested JWTs is optional and that
      applications using this specification can impose additional
      requirements upon implementations that they use.

   o  Updated the JSON reference to RFC 7159.

   -18

   o  Clarified that the base64url encoding includes no line breaks,
      white space, or other additional characters.

   o  Removed circularity in the audience claim definition.

   o  Clarified that it is entirely up to applications which claims to
      use.

Jones, et al.           Expires December 22, 2014              [Page 27]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   o  Changed "SHOULD" to "MUST" in "in the absence of such
      requirements, all claims that are not understood by
      implementations MUST be ignored".

   o  Clarified that applications can define their own processing rules
      for claims replicated in header parameters, rather than always
      requiring that they be identical in the JWT Header and JWT Claims
      Set.

   o  Removed a JWT creation step that duplicated a step in the
      underlying JWS or JWE creation.

   o  Added security considerations about using JWTs in trust decisions.

   -17

   o  Corrected RFC 2119 terminology usage.

   o  Replaced references to draft-ietf-json-rfc4627bis with RFC 7158.

   -16

   o  Changed some references from being normative to informative, per
      JOSE issue #90.

   -15

   o  Replaced references to RFC 4627 with draft-ietf-json-rfc4627bis.

   -14

   o  Referenced the JWE section on Distinguishing between JWS and JWE
      Objects.

   -13

   o  Added Claim Description registry field.

   o  Used Header Parameter Description registry field.

   o  Removed the phrases "JWA signing algorithms" and "JWA encryption
      algorithms".

   o  Removed the term JSON Text Object.

   -12

Jones, et al.           Expires December 22, 2014              [Page 28]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   o  Tracked the JOSE change refining the "typ" and "cty" definitions
      to always be MIME Media Types, with the omission of "application/"
      prefixes recommended for brevity.  For compatibility with legacy
      implementations, it is RECOMMENDED that "JWT" always be spelled
      using uppercase characters when used as a "typ" or "cty" value.
      As side effects, this change removed the "typ" Claim definition
      and narrowed the uses of the URI
      "urn:ietf:params:oauth:token-type:jwt".

   o  Updated base64url definition to match JOSE definition.

   o  Changed terminology from "Reserved Claim Name" to "Registered
      Claim Name" to match JOSE terminology change.

   o  Applied other editorial changes to track parallel JOSE changes.

   o  Clarified that the subject value may be scoped to be locally
      unique in the context of the issuer or may be globally unique.

   -11

   o  Added a Nested JWT example.

   o  Added "sub" to the list of Claims registered for use as Header
      Parameter values when an unencrypted representation is required in
      an encrypted JWT.

   -10

   o  Allowed Claims to be replicated as Header Parameters in encrypted
      JWTs as needed by applications that require an unencrypted
      representation of specific Claims.

   -09

   o  Clarified that the "typ" header parameter is used in an
      application-specific manner and has no effect upon the JWT
      processing.

   o  Stated that recipients MUST either reject JWTs with duplicate
      Header Parameter Names or with duplicate Claim Names or use a JSON
      parser that returns only the lexically last duplicate member name.

   -08

   o  Tracked a change to how JWEs are computed (which only affected the
      example encrypted JWT value).

Jones, et al.           Expires December 22, 2014              [Page 29]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   -07

   o  Defined that the default action for claims that are not understood
      is to ignore them unless otherwise specified by applications.

   o  Changed from using the term "byte" to "octet" when referring to 8
      bit values.

   o  Tracked encryption computation changes in the JWE specification.

   -06

   o  Changed the name of the "prn" claim to "sub" (subject) both to
      more closely align with SAML name usage and to use a more
      intuitive name.

   o  Allow JWTs to have multiple audiences.

   o  Applied editorial improvements suggested by Jeff Hodges, Prateek
      Mishra, and Hannes Tschofenig.  Many of these simplified the
      terminology used.

   o  Explained why Nested JWTs should be signed and then encrypted.

   o  Clarified statements of the form "This claim is OPTIONAL" to "Use
      of this claim is OPTIONAL".

   o  Referenced String Comparison Rules in JWS.

   o  Added seriesInfo information to Internet Draft references.

   -05

   o  Updated values for example AES CBC calculations.

   -04

   o  Promoted Initialization Vector from being a header parameter to
      being a top-level JWE element.  This saves approximately 16 bytes
      in the compact serialization, which is a significant savings for
      some use cases.  Promoting the Initialization Vector out of the
      header also avoids repeating this shared value in the JSON
      serialization.

   o  Applied changes made by the RFC Editor to RFC 6749's registry
      language to this specification.

Jones, et al.           Expires December 22, 2014              [Page 30]
Internet-Draft            JSON Web Token (JWT)                 June 2014

   o  Reference RFC 6755 -- An IETF URN Sub-Namespace for OAuth.

   -03

   o  Added statement that "StringOrURI values are compared as case-
      sensitive strings with no transformations or canonicalizations
      applied".

   o  Indented artwork elements to better distinguish them from the body
      text.

   -02

   o  Added an example of an encrypted JWT.

   o  Added this language to Registration Templates: "This name is case
      sensitive.  Names that match other registered names in a case
      insensitive manner SHOULD NOT be accepted."

   o  Applied editorial suggestions.

   -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

   o  Created the initial IETF draft based upon
      draft-jones-json-web-token-10 with no normative changes.

Jones, et al.           Expires December 22, 2014              [Page 31]
Internet-Draft            JSON Web Token (JWT)                 June 2014

Authors' Addresses

   Michael B. Jones
   Microsoft

   Email: mbj@microsoft.com
   URI:   http://self-issued.info/

   John Bradley
   Ping Identity

   Email: ve7jtb@ve7jtb.com
   URI:   http://www.thread-safe.com/

   Nat Sakimura
   Nomura Research Institute

   Email: n-sakimura@nri.co.jp
   URI:   http://nat.sakimura.org/

Jones, et al.           Expires December 22, 2014              [Page 32]