<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head><title>JSON Web Token (JWT)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="JSON Web Token (JWT)">
<meta name="keywords" content="RFC, Request for Comments, I-D, Internet-Draft, Assertion, Claim, Simple Web Token, Security Token, SWT, JavaScript Object Notation, JSON, JSON Web Token, JWT, JSON Web Signature, JWS, JSON Web Encryption, JWE, JSON Web Key, JWK, JSON Web Algorithms, JWA">
<meta name="generator" content="xml2rfc v1.36 (http://xml.resource.org/)">
<style type='text/css'><!--
        body {
                font-family: verdana, charcoal, helvetica, arial, sans-serif;
                font-size: small; color: #000; background-color: #FFF;
                margin: 2em;
        }
        h1, h2, h3, h4, h5, h6 {
                font-family: helvetica, monaco, "MS Sans Serif", arial, sans-serif;
                font-weight: bold; font-style: normal;
        }
        h1 { color: #900; background-color: transparent; text-align: right; }
        h3 { color: #333; background-color: transparent; }

        td.RFCbug {
                font-size: x-small; text-decoration: none;
                width: 30px; height: 30px; padding-top: 2px;
                text-align: justify; vertical-align: middle;
                background-color: #000;
        }
        td.RFCbug span.RFC {
                font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
                font-weight: bold; color: #666;
        }
        td.RFCbug span.hotText {
                font-family: charcoal, monaco, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
                font-weight: normal; text-align: center; color: #FFF;
        }

        table.TOCbug { width: 30px; height: 15px; }
        td.TOCbug {
                text-align: center; width: 30px; height: 15px;
                color: #FFF; background-color: #900;
        }
        td.TOCbug a {
                font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, sans-serif;
                font-weight: bold; font-size: x-small; text-decoration: none;
                color: #FFF; background-color: transparent;
        }

        td.header {
                font-family: arial, helvetica, sans-serif; font-size: x-small;
                vertical-align: top; width: 33%;
                color: #FFF; background-color: #666;
        }
        td.author { font-weight: bold; font-size: x-small; margin-left: 4em; }
        td.author-text { font-size: x-small; }

        /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
        a.info {
                /* This is the key. */
                position: relative;
                z-index: 24;
                text-decoration: none;
        }
        a.info:hover {
                z-index: 25;
                color: #FFF; background-color: #900;
        }
        a.info span { display: none; }
        a.info:hover span.info {
                /* The span will display just on :hover state. */
                display: block;
                position: absolute;
                font-size: smaller;
                top: 2em; left: -5em; width: 15em;
                padding: 2px; border: 1px solid #333;
                color: #900; background-color: #EEE;
                text-align: left;
        }

        a { font-weight: bold; }
        a:link    { color: #900; background-color: transparent; }
        a:visited { color: #633; background-color: transparent; }
        a:active  { color: #633; background-color: transparent; }

        p { margin-left: 2em; margin-right: 2em; }
        p.copyright { font-size: x-small; }
        p.toc { font-size: small; font-weight: bold; margin-left: 3em; }
        table.toc { margin: 0 0 0 3em; padding: 0; border: 0; vertical-align: text-top; }
        td.toc { font-size: small; font-weight: bold; vertical-align: text-top; }

        ol.text { margin-left: 2em; margin-right: 2em; }
        ul.text { margin-left: 2em; margin-right: 2em; }
        li      { margin-left: 3em; }

        /* RFC-2629 <spanx>s and <artwork>s. */
        em     { font-style: italic; }
        strong { font-weight: bold; }
        dfn    { font-weight: bold; font-style: normal; }
        cite   { font-weight: normal; font-style: normal; }
        tt     { color: #036; }
        tt, pre, pre dfn, pre em, pre cite, pre span {
                font-family: "Courier New", Courier, monospace; font-size: small;
        }
        pre {
                text-align: left; padding: 4px;
                color: #000; background-color: #CCC;
        }
        pre dfn  { color: #900; }
        pre em   { color: #66F; background-color: #FFC; font-weight: normal; }
        pre .key { color: #33C; font-weight: bold; }
        pre .id  { color: #900; }
        pre .str { color: #000; background-color: #CFF; }
        pre .val { color: #066; }
        pre .rep { color: #909; }
        pre .oth { color: #000; background-color: #FCF; }
        pre .err { background-color: #FCC; }

        /* RFC-2629 <texttable>s. */
        table.all, table.full, table.headers, table.none {
                font-size: small; text-align: center; border-width: 2px;
                vertical-align: top; border-collapse: collapse;
        }
        table.all, table.full { border-style: solid; border-color: black; }
        table.headers, table.none { border-style: none; }
        th {
                font-weight: bold; border-color: black;
                border-width: 2px 2px 3px 2px;
        }
        table.all th, table.full th { border-style: solid; }
        table.headers th { border-style: none none solid none; }
        table.none th { border-style: none; }
        table.all td {
                border-style: solid; border-color: #333;
                border-width: 1px 2px;
        }
        table.full td, table.headers td, table.none td { border-style: none; }

        hr { height: 1px; }
        hr.insert {
                width: 80%; border-style: none; border-width: 0;
                color: #CCC; background-color: #CCC;
        }
--></style>
</head>
<body>
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<table summary="layout" width="66%" border="0" cellpadding="0" cellspacing="0"><tr><td><table summary="layout" width="100%" border="0" cellpadding="2" cellspacing="1">
<tr><td class="header">OAuth Working Group</td><td class="header">M. Jones</td></tr>
<tr><td class="header">Internet-Draft</td><td class="header">Microsoft</td></tr>
<tr><td class="header">Intended status: Standards Track</td><td class="header">J. Bradley</td></tr>
<tr><td class="header">Expires: April 17, 2013</td><td class="header">Ping Identity</td></tr>
<tr><td class="header"> </td><td class="header">N. Sakimura</td></tr>
<tr><td class="header"> </td><td class="header">NRI</td></tr>
<tr><td class="header"> </td><td class="header">October 14, 2012</td></tr>
</table></td></tr></table>
<h1><br />JSON Web Token (JWT)<br />draft-ietf-oauth-json-web-token-04</h1>

<h3>Abstract</h3>

<p>
        JSON Web Token (JWT) is a means of representing claims to be
        transferred between two parties.  The claims in a JWT are
        encoded as a JavaScript Object Notation (JSON)
        object that is digitally signed or MACed using JSON
        Web Signature (JWS) and/or encrypted using JSON Web Encryption
        (JWE).
      
</p>
<p>
        The suggested pronunciation of JWT is the same as the English
        word "jot".
      
</p>
<h3>Status of this Memo</h3>
<p>
This Internet-Draft is submitted  in full
conformance with the provisions of BCP 78 and BCP 79.</p>
<p>
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF).  Note that other groups may also distribute
working documents as Internet-Drafts.  The list of current
Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>
<p>
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any time.
It is inappropriate to use Internet-Drafts as reference material or to cite
them other than as “work in progress.”</p>
<p>
This Internet-Draft will expire on April 17, 2013.</p>

<h3>Copyright Notice</h3>
<p>
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors.  All rights reserved.</p>
<p>
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document.  Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.</p>
<a name="toc"></a><br /><hr />
<h3>Table of Contents</h3>
<p class="toc">
<a href="#anchor1">1.</a> 
Introduction<br />
    <a href="#anchor2">1.1.</a> 
Notational Conventions<br />
<a href="#anchor3">2.</a> 
Terminology<br />
<a href="#anchor4">3.</a> 
JSON Web Token (JWT) Overview<br />
    <a href="#ExampleJWT">3.1.</a> 
Example JWT<br />
<a href="#anchor5">4.</a> 
JWT Claims<br />
    <a href="#ReservedClaimName">4.1.</a> 
Reserved Claim Names<br />
        <a href="#expDef">4.1.1.</a> 
"exp" (Expiration Time) Claim<br />
        <a href="#nbfDef">4.1.2.</a> 
"nbf" (Not Before) Claim<br />
        <a href="#iatDef">4.1.3.</a> 
"iat" (Issued At) Claim<br />
        <a href="#issDef">4.1.4.</a> 
"iss" (Issuer) Claim<br />
        <a href="#audDef">4.1.5.</a> 
"aud" (Audience) Claim<br />
        <a href="#prnDef">4.1.6.</a> 
"prn" (Principal) Claim<br />
        <a href="#jtiDef">4.1.7.</a> 
"jti" (JWT ID) Claim<br />
        <a href="#typDef">4.1.8.</a> 
"typ" (Type) Claim<br />
    <a href="#PublicClaimName">4.2.</a> 
Public Claim Names<br />
    <a href="#PrivateClaimName">4.3.</a> 
Private Claim Names<br />
<a href="#anchor6">5.</a> 
JWT Header<br />
    <a href="#typHdrDef">5.1.</a> 
"typ" (Type) Header Parameter<br />
    <a href="#ctyHdrDef">5.2.</a> 
"cty" (Content Type) Header Parameter<br />
<a href="#Plaintext">6.</a> 
Plaintext JWTs<br />
    <a href="#ExamplePlaintextJWT">6.1.</a> 
Example Plaintext JWT<br />
<a href="#anchor7">7.</a> 
Rules for Creating and Validating a JWT<br />
<a href="#Algorithms">8.</a> 
Cryptographic Algorithms<br />
<a href="#IANA">9.</a> 
IANA Considerations<br />
    <a href="#JWTClaimsReg">9.1.</a> 
JSON Web Token Claims Registry<br />
        <a href="#anchor8">9.1.1.</a> 
Registration Template<br />
        <a href="#anchor9">9.1.2.</a> 
Initial Registry Contents<br />
    <a href="#anchor10">9.2.</a> 
Sub-Namespace Registration of urn:ietf:params:oauth:token-type:jwt<br />
        <a href="#anchor11">9.2.1.</a> 
Registry Contents<br />
    <a href="#anchor12">9.3.</a> 
JSON Web Signature and Encryption Type Values Registration<br />
        <a href="#anchor13">9.3.1.</a> 
Registry Contents<br />
    <a href="#anchor14">9.4.</a> 
Media Type Registration<br />
        <a href="#anchor15">9.4.1.</a> 
Registry Contents<br />
<a href="#Security">10.</a> 
Security Considerations<br />
<a href="#rfc.references1">11.</a> 
References<br />
    <a href="#rfc.references1">11.1.</a> 
Normative References<br />
    <a href="#rfc.references2">11.2.</a> 
Informative References<br />
<a href="#EncryptedJWT">Appendix A.</a> 
Example Encrypted JWT<br />
<a href="#anchor18">Appendix B.</a> 
Relationship of JWTs to SAML Tokens<br />
<a href="#anchor19">Appendix C.</a> 
Relationship of JWTs to Simple Web Tokens (SWTs)<br />
<a href="#Acknowledgements">Appendix D.</a> 
Acknowledgements<br />
<a href="#TBD">Appendix E.</a> 
Open Issues<br />
<a href="#anchor20">Appendix F.</a> 
Document History<br />
<a href="#rfc.authors">§</a> 
Authors' Addresses<br />
</p>
<br clear="all" />

<a name="anchor1"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1"></a><h3>1. 
Introduction</h3>

<p>
        JSON Web Token (JWT) is a compact token format intended for
        space constrained environments such as HTTP Authorization
        headers and URI query parameters. JWTs encode claims to be
        transmitted as a
        JavaScript Object Notation (JSON) <a class='info' href='#RFC4627'>[RFC4627]<span> (</span><span class='info'>Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.</span><span>)</span></a>
        object that is base64url encoded
        and digitally signed or MACed and/or encrypted.  Signing and MACing is
        performed using JSON Web Signature (JWS) <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>.
        Encryption is performed using
        JSON Web Encryption (JWE) <a class='info' href='#JWE'>[JWE]<span> (</span><span class='info'>Jones, M., Rescorla, E., and J. Hildebrand, “JSON Web Encryption (JWE),” October 2012.</span><span>)</span></a>.
      
</p>
<p>
        The suggested pronunciation of JWT is the same as the English
        word "jot".
      
</p>
<a name="anchor2"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1.1"></a><h3>1.1. 
Notational Conventions</h3>

<p>
          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 <a class='info' href='#RFC2119'>[RFC2119]<span> (</span><span class='info'>Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.</span><span>)</span></a>.
        
</p>
<a name="anchor3"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2"></a><h3>2. 
Terminology</h3>

<p>
        </p>
<blockquote class="text"><dl>
<dt>JSON Web Token (JWT)</dt>
<dd>
            A string representing a set of claims as a JSON object that is
            digitally signed or MACed and/or encrypted.
            The string consists of multiple parts, the first being the
            Encoded JWT Header, plus additional parts depending upon
            the contents of the header, with the parts being separated
            by period ('.') characters, and each part containing
            base64url encoded content.
          
</dd>
<dt>Base64url Encoding</dt>
<dd>
            The URL- and filename-safe Base64 encoding
            described in <a class='info' href='#RFC4648'>RFC 4648<span> (</span><span class='info'>Josefsson, S., “The Base16, Base32, and Base64 Data Encodings,” October 2006.</span><span>)</span></a> [RFC4648],
            Section 5, with the (non URL-safe) '=' padding characters
            omitted, as permitted by Section 3.2.  (See Appendix C of
            <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> for notes on implementing base64url
            encoding without padding.)
          
</dd>
<dt>JWT Header</dt>
<dd>
            A string representing a JSON object that
            describes the cryptographic operations applied to the JWT.
            When the JWT is digitally signed or MACed, the JWT Header is a JWS Header.
            When the JWT is encrypted, the JWT Header is a JWE Header.
          
</dd>
<dt>Header Parameter Name</dt>
<dd>
            The name of a member of the JSON object representing a
            JWT Header.
          
</dd>
<dt>Header Parameter Value</dt>
<dd>
            The value of a member of the JSON object representing a
            JWT Header.
          
</dd>
<dt>JWT Claims Set</dt>
<dd>
            A string representing a JSON object that
            contains the 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 are base64url encoded to create the Encoded JWS Payload.
            When the JWT is encrypted, the bytes of the UTF-8 representation of the
            JWT Claims Set are used as the JWE Plaintext.
          
</dd>
<dt>Claim Name</dt>
<dd>
            The name of a member of the JSON object representing a
            JWT Claims Set.
          
</dd>
<dt>Claim Value</dt>
<dd>
            The value of a member of the JSON object representing a
            JWT Claims Set.
          
</dd>
<dt>Encoded JWT Header</dt>
<dd>
            Base64url encoding of the bytes of the
            UTF-8 <a class='info' href='#RFC3629'>[RFC3629]<span> (</span><span class='info'>Yergeau, F., “UTF-8, a transformation format of ISO 10646,” November 2003.</span><span>)</span></a>
            representation of the JWT Header.
          
</dd>
<dt>Collision Resistant Namespace</dt>
<dd>
            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)
            <a class='info' href='#RFC4122'>[RFC4122]<span> (</span><span class='info'>Leach, P., Mealling, M., and R. Salz, “A Universally Unique IDentifier (UUID) URN Namespace,” July 2005.</span><span>)</span></a>.
            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.
          
</dd>
<dt>StringOrURI</dt>
<dd>
            A JSON string value, with the additional requirement that
            while arbitrary string values MAY be used, any value
            containing a ":" character MUST be a URI
            <a class='info' href='#RFC3986'>[RFC3986]<span> (</span><span class='info'>Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.</span><span>)</span></a>.
            StringOrURI values are compared as case-sensitive strings
            with no transformations or canonicalizations applied.
          
</dd>
<dt>IntDate</dt>
<dd>
            A JSON numeric value representing the number of seconds
            from 1970-01-01T0:0:0Z UTC until the specified UTC date/time.
            See <a class='info' href='#RFC3339'>RFC 3339<span> (</span><span class='info'>Klyne, G., Ed. and C. Newman, “Date and Time on the Internet: Timestamps,” July 2002.</span><span>)</span></a> [RFC3339] for details
            regarding date/times in general and UTC in particular.
          
</dd>
</dl></blockquote><p>
      
</p>
<a name="anchor4"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3"></a><h3>3. 
JSON Web Token (JWT) Overview</h3>

<p>
        JWTs represent a set of claims as a JSON object that is
        base64url encoded and digitally signed or MACed and/or
        encrypted.  The JWT Claims Set represents this JSON object.
        As per <a class='info' href='#RFC4627'>RFC 4627<span> (</span><span class='info'>Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.</span><span>)</span></a> [RFC4627]
        Section 2.2, the JSON object consists of zero or more
        name/value pairs (or members), where the names are strings and
        the values are arbitrary JSON values.  These members are the
        claims represented by the JWT.
      
</p>
<p>
        The member names within the JWT Claims Set are
        referred to as Claim Names.  The
        corresponding values are referred to as Claim Values.
      
</p>
<p>
        The bytes of the UTF-8 representation of the JWT Claims Set
        are digitally signed or MACed in the manner described in JSON Web Signature (JWS)
        <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> and/or encrypted in the manner described
        in JSON Web Encryption (JWE) <a class='info' href='#JWE'>[JWE]<span> (</span><span class='info'>Jones, M., Rescorla, E., and J. Hildebrand, “JSON Web Encryption (JWE),” October 2012.</span><span>)</span></a>.
      
</p>
<p>
        The contents of the JWT Header describe the cryptographic
        operations applied to the JWT Claims Set.
        If the JWT Header is a JWS Header, the claims are digitally signed or MACed.
        If the JWT Header is a JWE Header, the claims are encrypted.
      
</p>
<p>
        A JWT is represented as a JWS or JWE.  The number of parts is
        dependent upon the representation of the resulting JWS or JWE.
      
</p>
<a name="ExampleJWT"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3.1"></a><h3>3.1. 
Example JWT</h3>

<p>
          The following example JWT Header declares that the
          encoded object is a JSON Web Token (JWT) and the JWT is
          MACed using the HMAC SHA-256 algorithm:
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  {"typ":"JWT",
   "alg":"HS256"}
</pre></div>
<p>
          Base64url encoding the bytes of the UTF-8 representation of
          the JWT Header yields this Encoded JWS Header value,
          which is used as the Encoded JWT Header:
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9
</pre></div>
<p>
          The following is an example of a JWT Claims Set:
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  {"iss":"joe",
   "exp":1300819380,
   "http://example.com/is_root":true}
</pre></div>
<p>
          Base64url encoding the bytes of the UTF-8 representation of
          the JSON Claims Set yields this Encoded JWS Payload
          (with line breaks for display purposes only):
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly
  9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ
</pre></div>
<p>
          Signing the Encoded JWS Header and Encoded JWS Payload with
          the HMAC SHA-256 algorithm and base64url encoding the
          signature in the manner specified in <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>,
          yields this Encoded JWS Signature:
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
</pre></div>
<p>
          Concatenating these parts in this order
          with period ('.') characters between the
          parts yields this complete JWT (with line breaks for
          display purposes only):
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9
  .
  eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt
  cGxlLmNvbS9pc19yb290Ijp0cnVlfQ
  .
  dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
</pre></div>
<p>
          This computation is illustrated in more detail in <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>, Appendix A.1.
          See <a class='info' href='#EncryptedJWT'>Appendix A<span> (</span><span class='info'>Example Encrypted JWT</span><span>)</span></a> for an example of
          an encrypted JWT.
        
</p>
<a name="anchor5"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4"></a><h3>4. 
JWT Claims</h3>

<p>
        The JWT Claims Set represents a JSON object whose members
        are the claims conveyed by the JWT.
        The Claim Names within this object MUST be unique;
        JWTs with duplicate Claim Names MUST be rejected.
        Note however, that the set of claims that a
        JWT must contain to be considered valid is context-dependent
        and is outside the scope of this specification.  When used in
        a security-related context, implementations MUST understand
        and support all of the claims present; otherwise, the JWT MUST
        be rejected for processing.
      
</p>
<p>
        There are three classes of JWT Claim Names: Reserved Claim
        Names, Public Claim Names, and Private Claim Names.
      
</p>
<a name="ReservedClaimName"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1"></a><h3>4.1. 
Reserved Claim Names</h3>

<p>
          The following claim names are reserved. None of the claims
          defined below are intended to be mandatory, but
          rather, provide a starting point for a set of useful,
          interoperable claims.  All the names are short because a
          core goal of JWTs is for the tokens to be compact.
          Additional reserved claim names MAY be defined via the
          IANA JSON Web Token Claims registry <a class='info' href='#JWTClaimsReg'>Section 9.1<span> (</span><span class='info'>JSON Web Token Claims Registry</span><span>)</span></a>.  
        
</p>
<a name="expDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.1"></a><h3>4.1.1. 
"exp" (Expiration Time) Claim</h3>

<p>
            The <tt>exp</tt> (expiration time)
            claim identifies the expiration time on or after which the
            token MUST NOT be accepted for processing.  The processing
            of the <tt>exp</tt> claim requires that
            the current date/time MUST be before the expiration
            date/time listed in the <tt>exp</tt>
            claim. Implementers MAY provide for some small leeway,
            usually no more than a few minutes, to account for clock skew.
            Its value MUST be a number containing an IntDate value.
            This claim is OPTIONAL.
          
</p>
<a name="nbfDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.2"></a><h3>4.1.2. 
"nbf" (Not Before) Claim</h3>

<p>
            The <tt>nbf</tt> (not before) claim
            identifies the time before which the token MUST NOT be
            accepted for processing.  The processing of the <tt>nbf</tt> claim requires that the current
            date/time MUST be after or equal to the not-before
            date/time listed in the <tt>nbf</tt>
            claim. Implementers MAY provide for some small leeway,
            usually no more than a few minutes, to account for clock skew.
            Its value MUST be a number containing an IntDate value.
            This claim is OPTIONAL.
          
</p>
<a name="iatDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.3"></a><h3>4.1.3. 
"iat" (Issued At) Claim</h3>

<p>
            The <tt>iat</tt> (issued at) claim
            identifies the time at which the JWT was issued.  This
            claim can be used to determine the age of the token.
            Its value MUST be a number containing an IntDate value.
            This claim is OPTIONAL.
          
</p>
<a name="issDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.4"></a><h3>4.1.4. 
"iss" (Issuer) Claim</h3>

<p>
            The <tt>iss</tt> (issuer) claim
            identifies the principal that issued the JWT.  The
            processing of this claim is generally application
            specific.
            The <tt>iss</tt> value is a case sensitive string
            containing a StringOrURI value.
            This claim is OPTIONAL.
          
</p>
<a name="audDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.5"></a><h3>4.1.5. 
"aud" (Audience) Claim</h3>

<p>
            The <tt>aud</tt> (audience) claim
            identifies the audience that the JWT is intended for.  The
            principal intended to process the JWT MUST be identified
            with the value of the audience claim. If the principal
            processing the claim does not identify itself with the
            identifier in the <tt>aud</tt> claim
            value then the JWT MUST be rejected.  The interpretation
            of the audience value is generally
            application specific.
            The <tt>aud</tt> value is a case sensitive string
            containing a StringOrURI value.
            This claim is OPTIONAL.
          
</p>
<a name="prnDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.6"></a><h3>4.1.6. 
"prn" (Principal) Claim</h3>

<p>
            The <tt>prn</tt> (principal) claim
            identifies the subject of the JWT.  The processing of this
            claim is generally application specific.
            The <tt>prn</tt> value is a case sensitive string
            containing a StringOrURI value.
            This claim is OPTIONAL.
          
</p>
<a name="jtiDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.7"></a><h3>4.1.7. 
"jti" (JWT ID) Claim</h3>

<p>
            The <tt>jti</tt> (JWT ID) claim
            provides a unique identifier for the JWT.  The identifier
            value MUST be assigned in a manner that ensures that there
            is a negligible probability that the same value will be
            accidentally assigned to a different data object.  The
            <tt>jti</tt> claim can be used to
            prevent the JWT from being replayed.
            The <tt>jti</tt> value is a case sensitive string.
            This claim is OPTIONAL.
          
</p>
<a name="typDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.8"></a><h3>4.1.8. 
"typ" (Type) Claim</h3>

<p>
            The <tt>typ</tt> (type) claim is used
            to declare a type for the contents of this JWT Claims Set.
            The <tt>typ</tt> value is a case sensitive string.
            This claim is OPTIONAL.
          
</p>
<p>
            The values used for the <tt>typ</tt>
            claim come from the same value space as the
            <tt>typ</tt> header parameter,
            with the same rules applying.
          
</p>
<a name="PublicClaimName"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2"></a><h3>4.2. 
Public Claim Names</h3>

<p>
          Claim names can be defined at will by those using
          JWTs. However, in order to prevent collisions, any new claim
          name SHOULD either be registered in the IANA
          JSON Web Token Claims registry <a class='info' href='#JWTClaimsReg'>Section 9.1<span> (</span><span class='info'>JSON Web Token Claims Registry</span><span>)</span></a> or be
          a URI that contains a Collision Resistant Namespace.
        
</p>
<a name="PrivateClaimName"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.3"></a><h3>4.3. 
Private Claim Names</h3>

<p>
           A producer and consumer of a JWT may agree to any claim
           name that is not a Reserved Name <a class='info' href='#ReservedClaimName'>Section 4.1<span> (</span><span class='info'>Reserved Claim Names</span><span>)</span></a> or a Public Name <a class='info' href='#PublicClaimName'>Section 4.2<span> (</span><span class='info'>Public Claim Names</span><span>)</span></a>. Unlike Public Names,
           these private names are subject to collision and should be
           used with caution.
         
</p>
<a name="anchor6"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5"></a><h3>5. 
JWT Header</h3>

<p>
        The members of the JSON object represented by the JWT Header
        describe the cryptographic operations applied to the JWT and
        optionally, additional properties of the JWT.
        The member names within the JWT Header are
        referred to as Header Parameter Names.
        These names MUST be unique;
        JWTs with duplicate Header Parameter Names MUST be rejected.
        The corresponding values are referred to as Header Parameter Values.
      
</p>
<p>
        Implementations MUST understand the entire contents of the
        header; otherwise, the JWT MUST be rejected for processing.
      
</p>
<p>
        JWS Header Parameters are defined by <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>.
        JWE Header Parameters are defined by <a class='info' href='#JWE'>[JWE]<span> (</span><span class='info'>Jones, M., Rescorla, E., and J. Hildebrand, “JSON Web Encryption (JWE),” October 2012.</span><span>)</span></a>.
        This specification further specifies the use of the following
        header parameter in both the cases where the JWT is a JWS and
        where it is a JWE.
      
</p>
<a name="typHdrDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.1"></a><h3>5.1. 
"typ" (Type) Header Parameter</h3>

<p>
          The <tt>typ</tt> (type) header parameter
          is used to declare the type of this object.
          If present, it is RECOMMENDED that its value be either "JWT" or
          "urn:ietf:params:oauth:token-type:jwt" to indicate that this object is a JWT.
          The <tt>typ</tt> value is a case sensitive string.
          This header parameter is OPTIONAL.
        
</p>
<a name="ctyHdrDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.2"></a><h3>5.2. 
"cty" (Content Type) Header Parameter</h3>

<p>
          The <tt>cty</tt> (content type) header parameter
          is used to declare structural information about the JWT.
          Its value MUST be a string.
        
</p>
<p>
          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.
        
</p>
<p>
          The values used for the <tt>cty</tt>
          header parameter come from the same value space as the
          <tt>typ</tt> header parameter,
          with the same rules applying.
        
</p>
<a name="Plaintext"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.6"></a><h3>6. 
Plaintext JWTs</h3>

<p>
        To support use cases where the JWT content is secured by a
        means other than a signature and/or encryption contained
        within the token (such as a signature on a data structure
        containing the token), JWTs MAY also be created without a
        signature or encryption.  A plaintext JWT is a JWS using the
        <tt>none</tt> JWS <tt>alg</tt> header parameter value defined in
        JSON Web Algorithms (JWA) <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a>; it is a
        JWS with an empty JWS Signature value.
      
</p>
<a name="ExamplePlaintextJWT"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.6.1"></a><h3>6.1. 
Example Plaintext JWT</h3>

<p>
          The following example JWT Header declares that the
          encoded object is a Plaintext JWT:
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  {"alg":"none"}
</pre></div>
<p>
          Base64url encoding the bytes of the UTF-8 representation of
          the JWT Header yields this Encoded JWT Header:
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  eyJhbGciOiJub25lIn0
</pre></div>
<p>
          The following is an example of a JWT Claims Set:
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  {"iss":"joe",
   "exp":1300819380,
   "http://example.com/is_root":true}
</pre></div>
<p>
          Base64url encoding the bytes of the UTF-8 representation of
          the JSON Claims Set yields this Encoded JWS Payload
          (with line breaks for display purposes only):
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt
  cGxlLmNvbS9pc19yb290Ijp0cnVlfQ
</pre></div>
<p>
          The Encoded JWS Signature is the empty string.
        
</p>
<p>
          Concatenating these parts in this order
          with period ('.') characters between the
          parts yields this complete JWT (with line breaks for
          display purposes only):
        
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  eyJhbGciOiJub25lIn0
  .
  eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt
  cGxlLmNvbS9pc19yb290Ijp0cnVlfQ
  .
</pre></div>
<a name="anchor7"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.7"></a><h3>7. 
Rules for Creating and Validating a JWT</h3>

<p>
        To create a JWT, one MUST perform these steps.  The order of
        the steps is not significant in cases where there are no
        dependencies between the inputs and outputs of the steps.

        </p>
<ol class="text">
<li>
            Create a JWT Claims Set containing the desired claims.
            Note that white space is explicitly allowed in the
            representation and no canonicalization is performed before
            encoding.
          
</li>
<li>
            Let the Message be the bytes of the UTF-8 representation
            of the JWT Claims Set.
          
</li>
<li>
            Create a JWT Header containing the desired set of header
            parameters.  The JWT
            MUST conform to either the <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> or <a class='info' href='#JWE'>[JWE]<span> (</span><span class='info'>Jones, M., Rescorla, E., and J. Hildebrand, “JSON Web Encryption (JWE),” October 2012.</span><span>)</span></a> specifications.
            Note that white
            space is explicitly allowed in the representation and no
            canonicalization is performed before encoding.
          
</li>
<li>
            Base64url encode the bytes of the UTF-8 representation of
            the JWT Header.  Let this be the Encoded JWT Header.
          
</li>
<li>
            Depending upon whether the JWT is a JWS or JWE,
            there are two cases:
            
<ul class="text">
<li>
                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 specified in <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>
                for creating a JWS MUST be followed.
              
</li>
<li>
                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 steps specified in <a class='info' href='#JWE'>[JWE]<span> (</span><span class='info'>Jones, M., Rescorla, E., and J. Hildebrand, “JSON Web Encryption (JWE),” October 2012.</span><span>)</span></a> for creating a JWE MUST be followed.
              
</li>
</ul>
          
</li>
<li>
            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 <tt>cty</tt> (content type)
            value of "JWT" in the new JWT Header created in that step.
          
</li>
<li>
            Otherwise, let the resulting JWT be the JWS or JWE.
          
</li>
</ol><p>
      
</p>
<p>
        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 token MUST be
        rejected for processing.
      
</p>
<p>
        </p>
<ol class="text">
<li>
            The JWT MUST contain at least one period ('.') character.
          
</li>
<li>
            Let the Encoded JWT Header be the portion of the JWT
            before the first period ('.') character.
          
</li>
<li>
            The Encoded JWT Header MUST be successfully base64url
            decoded following the restriction given in this
            specification that no padding characters have been used.
          
</li>
<li>
            The resulting JWT Header MUST be completely valid JSON syntax
            conforming to <a class='info' href='#RFC4627'>RFC 4627<span> (</span><span class='info'>Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.</span><span>)</span></a> [RFC4627].
          
</li>
<li>
            The resulting JWT Header MUST be validated to only include
            parameters and values whose syntax and semantics are both
            understood and supported.
          
</li>
<li>
            Determine whether the JWT is a JWS or a JWE by
            examining the <tt>alg</tt>
            (algorithm) header value and optionally, the <tt>enc</tt> (encryption method) header value,
            if present.
          
</li>
<li>
            Depending upon whether the JWT is a JWS or JWE,
            there are two cases:
            
<ul class="text">
<li>
                If the JWT is a JWS, all steps specified in <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> for validating a JWS MUST be followed.
                Let the Message be the result of base64url decoding
                the JWS Payload.
              
</li>
<li>
                Else, if the JWT is a JWE, all steps specified in <a class='info' href='#JWE'>[JWE]<span> (</span><span class='info'>Jones, M., Rescorla, E., and J. Hildebrand, “JSON Web Encryption (JWE),” October 2012.</span><span>)</span></a> for validating a JWE MUST be followed.
                Let the Message be the JWE Plaintext.
              
</li>
</ul>
          
</li>
<li>
            If the JWT Header contains a <tt>cty</tt> (content type)
            value of "JWT",
            then the Message contains 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.
          
</li>
<li>
            Otherwise, let the JWT Claims Set be the Message.
          
</li>
<li>
            The JWT Claims Set MUST be completely valid
            JSON syntax conforming to <a class='info' href='#RFC4627'>RFC
            4627<span> (</span><span class='info'>Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.</span><span>)</span></a> [RFC4627].
          
</li>
<li>
            When used in a security-related context, the
            JWT Claims Set MUST be validated to only include claims
            whose syntax and semantics are both understood and
            supported.
          
</li>
</ol><p>
      
</p>
<p>
        Processing a JWT inevitably requires comparing known strings
        to values in the token. For example, in checking what the
        algorithm is, the Unicode string encoding <tt>alg</tt> will be
        checked against the member names in the JWT Header
        to see if there is a matching header parameter
        name. A similar process occurs when determining if the value
        of the <tt>alg</tt> header parameter represents a supported
        algorithm.
      
</p>
<p>
        Comparisons between JSON strings and other Unicode strings
        MUST be performed as specified below:

        </p>
<ol class="text">
<li>
            Remove any JSON applied escaping to produce an array of
            Unicode code points.
          
</li>
<li>
            <a class='info' href='#USA15'>Unicode Normalization<span> (</span><span class='info'>Davis, M., Whistler, K., and M. Dürst, “Unicode Normalization Forms,” 09 2009.</span><span>)</span></a> [USA15] MUST NOT
            be applied at any point to either the JSON string or to
            the string it is to be compared against.
          
</li>
<li>
            Comparisons between the two strings MUST be performed as a
            Unicode code point to code point equality comparison.
          
</li>
</ol><p>
      
</p>
<a name="Algorithms"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.8"></a><h3>8. 
Cryptographic Algorithms</h3>

<p>
        JWTs use JSON Web Signature (JWS) <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> and
        JSON Web Encryption (JWE) <a class='info' href='#JWE'>[JWE]<span> (</span><span class='info'>Jones, M., Rescorla, E., and J. Hildebrand, “JSON Web Encryption (JWE),” October 2012.</span><span>)</span></a> to sign and/or
        encrypt the contents of the JWT.
      
</p>
<p>
        Of the JWS signing algorithms, only HMAC SHA-256 and <tt>none</tt> MUST be
        implemented by conforming JWT implementations.  It is
        RECOMMENDED that implementations also support the RSA SHA-256
        and ECDSA P-256 SHA-256 algorithms.  Support for other
        algorithms and key sizes is OPTIONAL.
      
</p>
<p>
        If an implementation provides encryption capabilities,
        of the JWE 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 by conforming
        implementations.  It is RECOMMENDED that implementations also
        support ECDH-ES with 256 bit keys, AES-128-GCM, and
        AES-256-GCM.  Support for other algorithms and key sizes is
        OPTIONAL.
      
</p>
<a name="IANA"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9"></a><h3>9. 
IANA Considerations</h3>

<a name="JWTClaimsReg"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.1"></a><h3>9.1. 
JSON Web Token Claims Registry</h3>

<p>
          This specification establishes the
          IANA JSON Web Token Claims registry
          for reserved JWT Claim Names.
          The registry records the reserved Claim Name
          and a reference to the specification that defines it.
          This specification registers the Claim Names
          defined in <a class='info' href='#ReservedClaimName'>Section 4.1<span> (</span><span class='info'>Reserved Claim Names</span><span>)</span></a>.
        
</p>
<p>
          Values are registered with a Specification Required
          <a class='info' href='#RFC5226'>[RFC5226]<span> (</span><span class='info'>Narten, T. and H. Alvestrand, “Guidelines for Writing an IANA Considerations Section in RFCs,” May 2008.</span><span>)</span></a> 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.
        
</p>
<p>
          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. ]]
        
</p>
<p>
          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.
        
</p>
<p>
          IANA must only accept registry updates from the Designated Expert(s), and should direct
          all requests for registration to the review mailing list.
        
</p>
<a name="anchor8"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.1.1"></a><h3>9.1.1. 
Registration Template</h3>

<p>
            </p>
<blockquote class="text"><dl>
<dt>Claim Name:</dt>
<dd>
                
                The name requested (e.g., "example").
                This name is case sensitive.  Names that match other registered names
                in a case insensitive manner SHOULD NOT be accepted.
              
</dd>
<dt>Change Controller:</dt>
<dd>
                
                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.
              
</dd>
<dt>Specification Document(s):</dt>
<dd>
                
                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.
              
</dd>
</dl></blockquote><p>
          
</p>
<a name="anchor9"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.1.2"></a><h3>9.1.2. 
Initial Registry Contents</h3>

<p>
            </p>
<ul class="text">
<li>
                Claim Name: <tt>exp</tt>
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#expDef'>Section 4.1.1<span> (</span><span class='info'>"exp" (Expiration Time) Claim</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
            </p>
<ul class="text">
<li>
                Claim Name: <tt>nbf</tt>
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#nbfDef'>Section 4.1.2<span> (</span><span class='info'>"nbf" (Not Before) Claim</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
            </p>
<ul class="text">
<li>
                Claim Name: <tt>iat</tt>
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#iatDef'>Section 4.1.3<span> (</span><span class='info'>"iat" (Issued At) Claim</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
            </p>
<ul class="text">
<li>
                Claim Name: <tt>iss</tt>
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#issDef'>Section 4.1.4<span> (</span><span class='info'>"iss" (Issuer) Claim</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
            </p>
<ul class="text">
<li>
                Claim Name: <tt>aud</tt>
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#audDef'>Section 4.1.5<span> (</span><span class='info'>"aud" (Audience) Claim</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
            </p>
<ul class="text">
<li>
                Claim Name: <tt>prn</tt>
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#prnDef'>Section 4.1.6<span> (</span><span class='info'>"prn" (Principal) Claim</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
            </p>
<ul class="text">
<li>
                Claim Name: <tt>jti</tt>
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#jtiDef'>Section 4.1.7<span> (</span><span class='info'>"jti" (JWT ID) Claim</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
            </p>
<ul class="text">
<li>
                Claim Name: <tt>typ</tt>
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#typDef'>Section 4.1.8<span> (</span><span class='info'>"typ" (Type) Claim</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
          
</p>
<a name="anchor10"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.2"></a><h3>9.2. 
Sub-Namespace Registration of urn:ietf:params:oauth:token-type:jwt</h3>

<a name="anchor11"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.2.1"></a><h3>9.2.1. 
Registry Contents</h3>

<p>
            This specification registers the value
            <tt>token-type:jwt</tt> in the
            IANA urn:ietf:params:oauth registry established in
            <a class='info' href='#I-D.ietf-oauth-urn-sub-ns'>An IETF URN Sub-Namespace for OAuth<span> (</span><span class='info'>Campbell, B. and H. Tschofenig, “An IETF URN Sub-Namespace for OAuth,” July 2012.</span><span>)</span></a> [I‑D.ietf‑oauth‑urn‑sub‑ns].

            </p>
<ul class="text">
<li>URN: urn:ietf:params:oauth:token-type:jwt
</li>
<li>Common Name: JSON Web Token (JWT) Token Type
</li>
<li>Change Controller: IETF
</li>
<li>Specification Document(s): [[this document]]
</li>
</ul><p>
          
</p>
<a name="anchor12"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.3"></a><h3>9.3. 
JSON Web Signature and Encryption Type Values Registration</h3>

<a name="anchor13"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.3.1"></a><h3>9.3.1. 
Registry Contents</h3>

<p>
            This specification registers the <tt>JWT</tt>
            type value in the
            IANA JSON Web Signature and Encryption Type Values registry <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>:

            </p>
<ul class="text">
<li>
                "typ" Header Parameter Value: <tt>JWT</tt>
              
</li>
<li>
                Abbreviation for MIME Type: application/jwt
              
</li>
<li>
                Change Controller: IETF
              
</li>
<li>
                Specification Document(s): <a class='info' href='#typHdrDef'>Section 5.1<span> (</span><span class='info'>"typ" (Type) Header Parameter</span><span>)</span></a> of [[ this document ]]
              
</li>
</ul><p>
          
</p>
<a name="anchor14"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.4"></a><h3>9.4. 
Media Type Registration</h3>

<a name="anchor15"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.4.1"></a><h3>9.4.1. 
Registry Contents</h3>

<p>
            This specification registers the <tt>application/jwt</tt> Media Type <a class='info' href='#RFC2046'>[RFC2046]<span> (</span><span class='info'>Freed, N. and N. Borenstein, “Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types,” November 1996.</span><span>)</span></a>
            in the MIME Media Type registry <a class='info' href='#RFC4288'>[RFC4288]<span> (</span><span class='info'>Freed, N. and J. Klensin, “Media Type Specifications and Registration Procedures,” December 2005.</span><span>)</span></a>
            to indicate that the content is a JWT.

            </p>
<ul class="text">
<li>
                Type Name: application
              
</li>
<li>
                Subtype Name: jwt
              
</li>
<li>
                Required Parameters: n/a
              
</li>
<li>
                Optional Parameters: n/a
              
</li>
<li>
                Encoding considerations: JWT values are encoded as a
                series of base64url encoded values (some of which may be the
                empty string) separated by period ('.') characters
              
</li>
<li>
                Security Considerations: See the Security Considerations section of this document
              
</li>
<li>
                Interoperability Considerations: n/a
              
</li>
<li>
                Published Specification: [[ this document ]]
              
</li>
<li>
                Applications that use this media type:
                OpenID Connect, Mozilla Browser ID, Salesforce, Google, numerous others
              
</li>
<li>
                Additional Information:
                Magic number(s): n/a,
                File extension(s): n/a,
                Macintosh file type code(s): n/a
              
</li>
<li>
                Person & email address to contact for further information:
                Michael B. Jones, mbj@microsoft.com
              
</li>
<li>
                Intended Usage: COMMON
              
</li>
<li>
                Restrictions on Usage: none
              
</li>
<li>
                Author: Michael B. Jones, mbj@microsoft.com
              
</li>
<li>
                Change Controller: IETF
              
</li>
</ul><p>
          
</p>
<a name="Security"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.10"></a><h3>10. 
Security Considerations</h3>

<p>
        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.
      
</p>
<p>
        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 JWS Header.
      
</p>
<a name="rfc.references"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.11"></a><h3>11. 
References</h3>

<a name="rfc.references1"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<h3>11.1. Normative References</h3>
<table width="99%" border="0">
<tr><td class="author-text" valign="top"><a name="I-D.ietf-oauth-urn-sub-ns">[I-D.ietf-oauth-urn-sub-ns]</a></td>
<td class="author-text">Campbell, B. and H. Tschofenig, “<a href="http://tools.ietf.org/html/draft-ietf-oauth-urn-sub-ns-06">An IETF URN Sub-Namespace for OAuth</a>,” draft-ietf-oauth-urn-sub-ns-06 (work in progress), July 2012 (<a href="http://www.ietf.org/internet-drafts/draft-ietf-oauth-urn-sub-ns-06.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="JWA">[JWA]</a></td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">Jones, M.</a>, “<a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms">JSON Web Algorithms (JWA)</a>,” October 2012.</td></tr>
<tr><td class="author-text" valign="top"><a name="JWE">[JWE]</a></td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">Jones, M.</a>, <a href="mailto:ekr@rtfm.com">Rescorla, E.</a>, and <a href="mailto:jhildebr@cisco.com">J. Hildebrand</a>, “<a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-encryption">JSON Web Encryption (JWE)</a>,” October 2012.</td></tr>
<tr><td class="author-text" valign="top"><a name="JWS">[JWS]</a></td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">Jones, M.</a>, <a href="mailto:ve7jtb@ve7jtb.com">Bradley, J.</a>, and <a href="mailto:n-sakimura@nri.co.jp">N. Sakimura</a>, “<a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-signature">JSON Web Signature (JWS)</a>,” October 2012.</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC2046">[RFC2046]</a></td>
<td class="author-text"><a href="mailto:ned@innosoft.com">Freed, N.</a> and <a href="mailto:nsb@nsb.fv.com">N. Borenstein</a>, “<a href="http://tools.ietf.org/html/rfc2046">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</a>,” RFC 2046, November 1996 (<a href="http://www.rfc-editor.org/rfc/rfc2046.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC2119">[RFC2119]</a></td>
<td class="author-text"><a href="mailto:sob@harvard.edu">Bradner, S.</a>, “<a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>,” BCP 14, RFC 2119, March 1997 (<a href="http://www.rfc-editor.org/rfc/rfc2119.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc2119.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc2119.xml">XML</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC3339">[RFC3339]</a></td>
<td class="author-text"><a href="mailto:GK@ACM.ORG">Klyne, G., Ed.</a> and <a href="mailto:chris.newman@sun.com">C. Newman</a>, “<a href="http://tools.ietf.org/html/rfc3339">Date and Time on the Internet: Timestamps</a>,” RFC 3339, July 2002 (<a href="http://www.rfc-editor.org/rfc/rfc3339.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc3339.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc3339.xml">XML</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC3629">[RFC3629]</a></td>
<td class="author-text">Yergeau, F., “<a href="http://tools.ietf.org/html/rfc3629">UTF-8, a transformation format of ISO 10646</a>,” STD 63, RFC 3629, November 2003 (<a href="http://www.rfc-editor.org/rfc/rfc3629.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC3986">[RFC3986]</a></td>
<td class="author-text"><a href="mailto:timbl@w3.org">Berners-Lee, T.</a>, <a href="mailto:fielding@gbiv.com">Fielding, R.</a>, and <a href="mailto:LMM@acm.org">L. Masinter</a>, “<a href="http://tools.ietf.org/html/rfc3986">Uniform Resource Identifier (URI): Generic Syntax</a>,” STD 66, RFC 3986, January 2005 (<a href="http://www.rfc-editor.org/rfc/rfc3986.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc3986.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc3986.xml">XML</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4288">[RFC4288]</a></td>
<td class="author-text">Freed, N. and J. Klensin, “<a href="http://tools.ietf.org/html/rfc4288">Media Type Specifications and Registration Procedures</a>,” BCP 13, RFC 4288, December 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4288.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4627">[RFC4627]</a></td>
<td class="author-text">Crockford, D., “<a href="http://tools.ietf.org/html/rfc4627">The application/json Media Type for JavaScript Object Notation (JSON)</a>,” RFC 4627, July 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4627.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4648">[RFC4648]</a></td>
<td class="author-text">Josefsson, S., “<a href="http://tools.ietf.org/html/rfc4648">The Base16, Base32, and Base64 Data Encodings</a>,” RFC 4648, October 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4648.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC5226">[RFC5226]</a></td>
<td class="author-text">Narten, T. and H. Alvestrand, “<a href="http://tools.ietf.org/html/rfc5226">Guidelines for Writing an IANA Considerations Section in RFCs</a>,” BCP 26, RFC 5226, May 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5226.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="USA15">[USA15]</a></td>
<td class="author-text"><a href="mailto:markdavis@google.com">Davis, M.</a>, <a href="mailto:ken@unicode.org">Whistler, K.</a>, and M. Dürst, “Unicode Normalization Forms,” Unicode Standard Annex 15, 09 2009.</td></tr>
</table>

<a name="rfc.references2"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<h3>11.2. Informative References</h3>
<table width="99%" border="0">
<tr><td class="author-text" valign="top"><a name="CanvasApp">[CanvasApp]</a></td>
<td class="author-text">Facebook, “<a href="http://developers.facebook.com/docs/authentication/canvas">Canvas Applications</a>,” 2010.</td></tr>
<tr><td class="author-text" valign="top"><a name="JSS">[JSS]</a></td>
<td class="author-text">Bradley, J. and N. Sakimura (editor), “<a href="http://jsonenc.info/jss/1.0/">JSON Simple Sign</a>,” September 2010.</td></tr>
<tr><td class="author-text" valign="top"><a name="MagicSignatures">[MagicSignatures]</a></td>
<td class="author-text">Panzer (editor), J., Laurie, B., and D. Balfanz, “<a href="http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-magicsig-01.html">Magic Signatures</a>,” January 2011.</td></tr>
<tr><td class="author-text" valign="top"><a name="OASIS.saml-core-2.0-os">[OASIS.saml-core-2.0-os]</a></td>
<td class="author-text"><a href="mailto:cantor.2@osu.edu">Cantor, S.</a>, <a href="mailto:John.Kemp@nokia.com">Kemp, J.</a>, <a href="mailto:rphilpott@rsasecurity.com">Philpott, R.</a>, and <a href="mailto:eve.maler@sun.com">E. Maler</a>, “<a href="http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf">Assertions and Protocol for the OASIS Security Assertion Markup Language
            (SAML) V2.0</a>,” OASIS Standard saml-core-2.0-os, March 2005.</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC3275">[RFC3275]</a></td>
<td class="author-text">Eastlake, D., Reagle, J., and D. Solo, “<a href="http://tools.ietf.org/html/rfc3275">(Extensible Markup Language) XML-Signature Syntax and Processing</a>,” RFC 3275, March 2002 (<a href="http://www.rfc-editor.org/rfc/rfc3275.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4122">[RFC4122]</a></td>
<td class="author-text"><a href="mailto:paulle@microsoft.com">Leach, P.</a>, <a href="mailto:michael@refactored-networks.com">Mealling, M.</a>, and <a href="mailto:rsalz@datapower.com">R. Salz</a>, “<a href="http://tools.ietf.org/html/rfc4122">A Universally Unique IDentifier (UUID) URN Namespace</a>,” RFC 4122, July 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4122.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc4122.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc4122.xml">XML</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="SWT">[SWT]</a></td>
<td class="author-text">Hardt, D. and Y. Goland, “<a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh781551.aspx">Simple Web Token (SWT)</a>,” Version 0.9.5.1, November 2009.</td></tr>
<tr><td class="author-text" valign="top"><a name="W3C.CR-xml11-20021015">[W3C.CR-xml11-20021015]</a></td>
<td class="author-text">Cowan, J., “<a href="http://www.w3.org/TR/2002/CR-xml11-20021015">Extensible Markup Language (XML) 1.1</a>,” W3C CR CR-xml11-20021015, October 2002.</td></tr>
</table>

<a name="EncryptedJWT"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A"></a><h3>Appendix A. 
Example Encrypted JWT</h3>

<p>
        This example encrypts the same claims as used in <a class='info' href='#ExampleJWT'>Section 3.1<span> (</span><span class='info'>Example JWT</span><span>)</span></a>
        to the recipient using RSAES-PKCS1-V1_5 and AES CBC.
        AES CBC does not have an integrated integrity check,
        so a separate integrity check calculation is performed using HMAC SHA-256,
        with separate encryption and integrity keys being derived from a master key
        using the Concat KDF with the SHA-256 digest function.
      
</p>
<p>
        The following example JWE Header (with line breaks for display purposes only) declares that:
        </p>
<ul class="text">
<li>
            the Content Master Key is encrypted to the recipient
            using the RSAES-PKCS1-V1_5 algorithm to produce the JWE
            Encrypted Key and
          
</li>
<li>
            the Plaintext is encrypted using the AES CBC
            algorithm with a 128 bit key to produce the Ciphertext,
            with the integrity of the
            Ciphertext and the parameters used to create it being
            computed with the HMAC SHA-256 algorithm.
          
</li>
</ul><p>
      
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  {"alg":"RSA1_5","enc":"A128CBC+HS256"}
</pre></div>
<p>
        Other than using the bytes of the UTF-8 representation of
        the JSON Claims Set from <a class='info' href='#ExampleJWT'>Section 3.1<span> (</span><span class='info'>Example JWT</span><span>)</span></a>
        as the plaintext value, the computation of this JWT is
        identical to the computation of the JWE in
        Appendix A.2 of <a class='info' href='#JWE'>[JWE]<span> (</span><span class='info'>Jones, M., Rescorla, E., and J. Hildebrand, “JSON Web Encryption (JWE),” October 2012.</span><span>)</span></a>,
        including the keys used.
      
</p>
<p>
        The final result in this example
        (with line breaks for display purposes only) is:
      
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDK0hTMjU2In0.
  W_LXELSzOoofu8FGRt4WwXiTGfvC50hiiSV4DcgkUIY1nOnkJ4tHW4LiioZFvvLD
  ohAnuHs1K_29TMx8VQl8kLCxFgn6xxg5q5-UZzbcASgJIAupo7r5mzENbIrjK3bx
  H8aXSKJQ0icN-sEC54M8rKz2VYdPjZTpGcTHCI2suobyhA0Jwr3OJ7JBZiDJ1GSN
  O310isBrQcZQXKsMC9ne8P5jJEZSD3IHcTag502P0Rp8BxFV0Ld5OdfU_NmS69RD
  DxCZC6nV8Zz_n97nLE9vFrSOjXMyJoyqeORdvWGsiXPmD7fkE8a6BOw3-efYqeCj
  5elo-kKrNcirBHxH96u-sw.
  AxY8DCtDaGlsbGljb3RoZQ.
  Wcyp1X4AaobxcNcVOqmLftbfg-t6yIy6yvxi0dNoWLroCbgUowHs8WeLWNj_ktrT
  lL3xL_cz3a2-DioHF5deqNmvyByjVR7Xc4QXBYcn0nE.
  tEkhyWYGI_VHL1WoDO23nPRC8w3LG53KaCm5HmavnA0
</pre></div>
<a name="anchor18"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.B"></a><h3>Appendix B. 
Relationship of JWTs to SAML Tokens</h3>

<p>
        <a class='info' href='#OASIS.saml-core-2.0-os'>SAML 2.0<span> (</span><span class='info'>Cantor, S., Kemp, J., Philpott, R., and E. Maler, “Assertions and Protocol for the OASIS Security Assertion Markup Language             (SAML) V2.0,” March 2005.</span><span>)</span></a> [OASIS.saml‑core‑2.0‑os] provides
        a standard for creating tokens with much greater expressivity
        and more security options than supported by JWTs. However, the
        cost of this flexibility and expressiveness is both size and
        complexity. In addition, SAML's use of <a class='info' href='#W3C.CR-xml11-20021015'>XML<span> (</span><span class='info'>Cowan, J., “Extensible Markup Language (XML) 1.1,” October 2002.</span><span>)</span></a> [W3C.CR‑xml11‑20021015] and <a class='info' href='#RFC3275'>XML DSIG<span> (</span><span class='info'>Eastlake, D., Reagle, J., and D. Solo, “(Extensible Markup Language) XML-Signature Syntax and Processing,” March 2002.</span><span>)</span></a> [RFC3275] only contributes to the size
        of SAML tokens.
      
</p>
<p>
        JWTs are intended to provide a simple 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 <a class='info' href='#RFC4627'>JSON<span> (</span><span class='info'>Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.</span><span>)</span></a> [RFC4627]
        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.
      
</p>
<p>
        Therefore, while JWTs can do some of the things SAML tokens
        do, JWTs are not intended as a full replacement for SAML
        tokens, but rather as a compromise token format to be used
        when space is at a premium.
      
</p>
<a name="anchor19"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.C"></a><h3>Appendix C. 
Relationship of JWTs to Simple Web Tokens (SWTs)</h3>

<p>
        Both JWTs and Simple Web Tokens <a class='info' href='#SWT'>SWT<span> (</span><span class='info'>Hardt, D. and Y. Goland, “Simple Web Token (SWT),” November 2009.</span><span>)</span></a> [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
        HMAC SHA-256, RSA SHA-256, and ECDSA P-256 SHA-256.
      
</p>
<a name="Acknowledgements"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.D"></a><h3>Appendix D. 
Acknowledgements</h3>

<p>
        The authors acknowledge that the design of JWTs was
        intentionally influenced by the design and simplicity of <a class='info' href='#SWT'>Simple Web Tokens<span> (</span><span class='info'>Hardt, D. and Y. Goland, “Simple Web Token (SWT),” November 2009.</span><span>)</span></a> [SWT] and ideas for JSON
        tokens that Dick Hardt discussed within the OpenID community.
      
</p>
<p>
        Solutions for signing JSON content were previously explored by
        <a class='info' href='#MagicSignatures'>Magic Signatures<span> (</span><span class='info'>Panzer (editor), J., Laurie, B., and D. Balfanz, “Magic Signatures,” January 2011.</span><span>)</span></a> [MagicSignatures], <a class='info' href='#JSS'>JSON Simple Sign<span> (</span><span class='info'>Bradley, J. and N. Sakimura (editor), “JSON Simple Sign,” September 2010.</span><span>)</span></a> [JSS], and <a class='info' href='#CanvasApp'>Canvas Applications<span> (</span><span class='info'>Facebook, “Canvas Applications,” 2010.</span><span>)</span></a> [CanvasApp], all of which
        influenced this draft.
        Dirk Balfanz, Yaron Y. Goland, John Panzer, and Paul Tarjan
        all made significant contributions to the design of this
        specification.
      
</p>
<p>
        Hannes Tschofenig and Derek Atkins chaired the OAuth working group and
        Sean Turner and Stephen Farrell served as Security area directors
        during the creation of this specification.
      
</p>
<a name="TBD"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.E"></a><h3>Appendix E. 
Open Issues</h3>

<p>
        [[ to be removed by the RFC editor before publication as an RFC ]]
      
</p>
<p>
        The following items remain to be considered or done in this draft:

        </p>
<ul class="text">
<li>
            Track changes to the underlying JOSE specifications.
          
</li>
</ul><p>
      
</p>
<a name="anchor20"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.F"></a><h3>Appendix F. 
Document History</h3>

<p>
        [[ to be removed by the RFC editor before publication as an RFC ]]
      
</p>
<p>
        -04
        </p>
<ul class="text">
<li>
            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.
          
</li>
</ul><p>
      
</p>
<p>
        -03
        </p>
<ul class="text">
<li>
            Added statement that
            "StringOrURI values are compared as case-sensitive strings
            with no transformations or canonicalizations applied".
          
</li>
<li>
            Indented artwork elements to better distinguish them from the body text.
          
</li>
</ul><p>
      
</p>
<p>
        -02
        </p>
<ul class="text">
<li>
            Added an example of an encrypted JWT.
          
</li>
<li>
            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."
          
</li>
<li>
            Applied editorial suggestions.
          
</li>
</ul><p>
      
</p>
<p>
        -01
        </p>
<ul class="text">
<li>
            Added the <tt>cty</tt> (content type) header parameter
            for declaring type information about the secured content,
            as opposed to the <tt>typ</tt> (type) header parameter,
            which declares type information about this object.
            This significantly simplified nested JWTs.
          
</li>
<li>
            Moved description of how to determine whether a header is
            for a JWS or a JWE from the JWT spec to the JWE spec.
          
</li>
<li>
            Changed registration requirements from RFC Required to
            Specification Required with Expert Review.
          
</li>
<li>
            Added Registration Template sections for defined registries.
          
</li>
<li>
            Added Registry Contents sections to populate registry values.
          
</li>
<li>
            Added "Collision Resistant Namespace" to the terminology section.
          
</li>
<li>
            Numerous editorial improvements.
          
</li>
</ul><p>
      
</p>
<p>
        -00
        </p>
<ul class="text">
<li>
            Created the initial IETF draft based upon
            draft-jones-json-web-token-10 with no normative
            changes.
          
</li>
</ul><p>
      
</p>
<a name="rfc.authors"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<h3>Authors' Addresses</h3>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="author-text"> </td>
<td class="author-text">Michael B. Jones</td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">Microsoft</td></tr>
<tr><td class="author" align="right">Email: </td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">mbj@microsoft.com</a></td></tr>
<tr><td class="author" align="right">URI: </td>
<td class="author-text"><a href="http://self-issued.info/">http://self-issued.info/</a></td></tr>
<tr cellpadding="3"><td> </td><td> </td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">John Bradley</td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">Ping Identity</td></tr>
<tr><td class="author" align="right">Email: </td>
<td class="author-text"><a href="mailto:ve7jtb@ve7jtb.com">ve7jtb@ve7jtb.com</a></td></tr>
<tr cellpadding="3"><td> </td><td> </td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">Nat Sakimura</td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">Nomura Research Institute</td></tr>
<tr><td class="author" align="right">Email: </td>
<td class="author-text"><a href="mailto:n-sakimura@nri.co.jp">n-sakimura@nri.co.jp</a></td></tr>
</table>
</body></html>