One document matched: draft-ietf-oauth-jwt-bearer-02.xml


<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
<?xml-stylesheet type='text/xsl' 'rfc2629.xslt ?>

<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->                                                                                         
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->

<rfc category="std" ipr="trust200902" docName="draft-ietf-oauth-jwt-bearer-02">

    <!-- category values: std, bcp, info, exp, and historic
ipr values: full3667, noModification3667, noDerivatives3667
you can add the attributes updates="NNNN" and obsoletes="NNNN"
they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the
 full title is longer than 39 characters -->

    <title abbrev="OAuth JWT Bearer Token Profiles">JSON Web Token (JWT) Bearer Token Profiles for OAuth 2.0</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->
    <author fullname="Michael B. Jones" surname="Jones" initials="M.B."> <!-- role="editor" -->
      <organization>Microsoft</organization>
      <address>
        <email>mbj@microsoft.com</email>
        <uri>http://self-issued.info/</uri>
      </address>
    </author>

    <author fullname="Brian Campbell" initials="B." surname="Campbell">
      <organization abbrev="Ping Identity">Ping Identity Corp.</organization>
      <address>
        <email>brian.d.campbell@gmail.com</email>
      </address>
    </author>

    <author fullname="Chuck Mortimore" initials="C." surname="Mortimore">
      <organization abbrev="Salesforce">Salesforce</organization>
      <address>
        <email>cmortimore@salesforce.com</email>
      </address>
    </author>

    <date day="14" month="September" year="2012"/>

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill
      in the current day for you. If only the current year is specified, xml2rfc will fill
    in the current day and month for you. If the year is not the current one, it is
    necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the
    purpose of calculating the expiry date). With drafts it is normally sufficient to
    specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>Security</area>
    <workgroup>OAuth Working Group</workgroup>

    <!-- WG name at the upperleft corner of the doc,
IETF is fine for individual submissions.
If this element is not present, the default is "Network Working Group",
which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>OAuth</keyword>
    <keyword>JWT</keyword>
    <keyword>Assertion</keyword>
    <keyword>Token</keyword>
    <keyword>Security Token</keyword>

    <!-- Keywords will be incorporated into HTML output
files in a meta tag but they have no effect on text or nroff
output. If you submit your draft to the RFC Editor, the
keywords will be used for the search engine. -->

    <abstract>
      <t>This specification defines the use of a JSON Web Token (JWT) Bearer Token as a means for requesting an OAuth 2.0 access
        token as well as for use as a means of client authentication.
      </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>
	<xref target="JWT">JSON Web Token (JWT)</xref>
	is a JavaScript Object Notation (JSON) <xref target="RFC4627"/>
	based security token encoding that enables
	identity and security information to be shared across security
	domains.
        A security token is generally issued by an identity provider
        and consumed by a relying party that relies on its content to
        identify the token's subject for security related purposes.
      </t>

      <t>
        <xref target="I-D.ietf-oauth-v2">The OAuth 2.0 Authorization Framework</xref>
        provides
        a method for making authenticated HTTP requests to a resource using an access token.
        Access tokens are issued to third-party clients by an
        authorization server (AS) with the (sometimes implicit) approval of the resource owner.
        In OAuth, an authorization grant is an abstract term used to describe
        intermediate credentials that represent the resource owner
        authorization.  An authorization grant is used by the client to obtain an access token.
        Several authorization grant types are defined to support a wide range
        of client types and user experiences.
        OAuth also allows for the definition of new extension grant types
        to support additional clients or to provide a bridge between OAuth and other trust frameworks.
        Finally, OAuth allows the definition of additional authentication mechanisms to be used by clients when interacting with the authorization server.
      </t>

      <t>The <xref target="I-D.ietf-oauth-assertions">Assertion Framework for OAuth 2.0</xref> is an abstract extension to OAuth 2.0 that provides a general
        framework for the use of Assertions (a.k.a. Security Tokens) as client credentials and/or authorization grants with OAuth 2.0.
        This specification profiles the <xref target="I-D.ietf-oauth-assertions">Assertion Framework for OAuth 2.0</xref> to define an extension grant type that uses a JSON Web Token (JWT) Bearer Token to
        request an OAuth 2.0 access token as well as for use as client credentials.
        The format and processing rules for the JWT defined in this specification are intentionally similar,
        though not identical, to those in the closely related
	<xref target="I-D.ietf-oauth-saml2-bearer">SAML 2.0 Bearer Assertion Profiles for OAuth 2.0</xref>.
      </t>

      <t>This document defines how a JSON Web Token (JWT) Bearer Token can be used to request an access token when a client wishes to utilize an existing trust
        relationship, expressed through the semantics of (and digital signature calculated over) the JWT,
        without a direct user approval step at the authorization server.  It also defines how a JWT can be used as a client authentication mechanism.
        The use of a security token for client
        authentication is orthogonal to and separable from using a security token as an
        authorization grant.  They can be used either in combination or separately.
        Client authentication using a JWT is nothing more than an alternative way for a client to authenticate
        to the token endpoint and must be used in conjunction with some grant type to form a complete and
        meaningful protocol request. JWT authorization grants may be used with or without client authentication
        or identification. Whether or not client authentication is needed in conjunction with a JWT authorization
        grant, as well as the supported types of client authentication, are policy decisions at the discretion of the authorization server.
      </t>
      <t>The process by which the client obtains the JWT, prior to exchanging it with the authorization server or using it for client authentication, is out of scope.</t>

      <section title="Notational Conventions">
        <t>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 <xref target="RFC2119">RFC 2119</xref>.
        </t>
        <t>
          Unless otherwise noted, all the protocol parameter names and values are case sensitive.
        </t>
      </section>

      <section title='Terminology'>
        <t>
          All terms are as defined in
	  <xref target="I-D.ietf-oauth-v2">The OAuth 2.0 Authorization Framework</xref>,
	  <xref target="I-D.ietf-oauth-assertions">Assertion Framework for OAuth 2.0</xref>, and
	  <xref target="JWT">JSON Web Token (JWT)</xref>.
        </t>
      </section>

    </section>

    <section title="HTTP Parameter Bindings for Transporting Assertions">
      <t>
	The <xref target="I-D.ietf-oauth-assertions">Assertion Framework for OAuth 2.0</xref> defines generic HTTP parameters for transporting Assertions (a.k.a. Security Tokens) during interactions with a token endpoint.
       This section defines the values of those parameters for use with JWT Bearer Tokens.  
      </t>
      <section title="Using JWTs as Authorization Grants">
	<t>To use a JWT Bearer Token as an authorization grant, use the following parameter values and encodings.</t>
	<t>The value of the <spanx style='verb'>grant_type</spanx> parameter MUST be
	<spanx style='verb'>urn:ietf:params:oauth:grant-type:jwt-bearer</spanx>.</t>
	<t>
	  The value of the <spanx style='verb'>assertion</spanx> parameter
	  MUST contain a single JWT.
	</t>

  <t>The following non-normative example demonstrates an Access Token Request with a JWT as an authorization grant
	(with extra line breaks for display purposes only):</t>

        <figure>
          <artwork><![CDATA[
  POST /token.oauth2 HTTP/1.1
  Host: as.example.com
  Content-Type: application/x-www-form-urlencoded

  grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer
  &assertion=eyJhbGciOiJFUzI1NiJ9.
  eyJpc3Mi[...omitted for brevity...].
  J9l-ZhwP[...omitted for brevity...]
]]></artwork>
        </figure>

      </section>
      <section title="Using JWTs for Client Authentication">
	<t>To use a JWT Bearer Token for client authentication grant, use the following parameter values and encodings.</t>
	<t>The value of the <spanx style='verb'>client_assertion_type</spanx> parameter MUST be
	<spanx style='verb'>urn:ietf:params:oauth:client-assertion-type:jwt-bearer</spanx>.</t>
	<t>
	  The value of the <spanx style='verb'>client_assertion</spanx> parameter
	  MUST contain a single JWT.
	</t>

  <t>The following non-normative example demonstrates client
     authentication using a JWT during the presentation of an authorization code grant in an
     Access Token Request
     (with extra line breaks for display purposes only):</t>

        <figure>
          <artwork><![CDATA[
  POST /token.oauth2 HTTP/1.1
  Host: as.example.com
  Content-Type: application/x-www-form-urlencoded

  grant_type=authorization_code&
  code=vAZEIHjQTHuGgaSvyW9hO0RpusLzkvTOww3trZBxZpo&
  client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3A
  client-assertion-type%3Ajwt-bearer&
  client_assertion=eyJhbGciOiJSUzI1NiJ9.
  eyJpc3Mi[...omitted for brevity...].
  cC4hiUPo[...omitted for brevity...]
]]></artwork>
        </figure>

      </section>
    </section>

    <section anchor="JWT_reqs" title="JWT Format and Processing Requirements">
      <t>
	In order to issue an access token response as described in
	<xref target="I-D.ietf-oauth-v2">The OAuth 2.0 Authorization Framework</xref>
	or to rely on a JWT for client authentication,
	the authorization server MUST validate the JWT according to the criteria below.
	Application of additional restrictions and policy are at the discretion of the authorization server.
      </t>
      <t>
	<list style="symbols">

	  <t>
	    The JWT MUST contain an <spanx style="verb">iss</spanx>
	    (issuer) claim that contains a unique identifier for the
	    entity that issued the JWT.
	  </t>
	  <t>
	    The JWT MUST contain a <spanx style="verb">prn</spanx>
	    (principal) claim identifying the subject of the transaction.
	    The principal MAY identify the resource owner for
	    whom the access token is being requested.
	    For client authentication, the principal MUST be the <spanx style='verb'>client_id</spanx> of the OAuth client.  When using
	    a JWT as an authorization grant, the principal SHOULD identify
	    an authorized accessor for whom the access token is being requested (typically the resource owner, or an authorized delegate).
	  </t>
	  <t>
	    The JWT MUST contain an <spanx style="verb">aud</spanx>
	    (audience) claim containing a URI reference that
	    identifies the
	    authorization server, or the service provider principal entity of its controlling domain, as an
	    intended audience.  The token endpoint URL of the authorization server MAY be used as an
	    acceptable value for an <spanx style="verb">aud</spanx> element.
	    The authorization server MUST verify that it is an intended audience for
	    the JWT.
	  </t>
	  <t>
	    The JWT MUST contain an <spanx style="verb">exp</spanx>
	    (expiration) claim that limits the time window during
	    which the JWT can be used.  The authorization server
	    MUST verify that the expiration time has not passed,
	    subject to allowable clock skew between systems.  The
	    authorization server MAY reject JWTs with an <spanx
	    style="verb">exp</spanx> claim value that is
	    unreasonably far in the future.
	  </t>
	  <t>
	    The JWT MAY contain an <spanx style="verb">nbf</spanx>
	    (not before) claim that identifies the time before which
	    the token MUST NOT be accepted for processing.
	  </t>
	  <t>
	    The JWT MAY contain an <spanx style="verb">iat</spanx>
	    (issued at) claim that identifies the time at which the
	    JWT was issued.  The authorization server MAY reject JWTs
	    with an <spanx style="verb">iat</spanx> claim value that is
	    unreasonably far in the past.
	  </t>
	  <t>
	    The JWT MAY contain a <spanx style="verb">jti</spanx>
	    (JWT ID) claim that provides a unique identifier for
	    the token.
	    The authorization server MAY ensure that JWTs are not
	    replayed by maintaining the set of used
	    <spanx style="verb">jti</spanx> values for the length of
	    time for which the JWT would be considered valid based
	    on the applicable <spanx style="verb">exp</spanx> instant.
	  </t>
	  <!-- No equivalent to SubjectConfirmation Method "urn:oasis:names:tc:SAML:2.0:cm:bearer at present -->
	  <!-- No equivalent to SubjectConfirmationData Recipient at present -->
	  <!-- No equivalent to SubjectConfirmationData Address at present -->
	  <!-- No equivalent to AuthnStatement at present -->
	  <t>
	    The JWT MAY contain other claims.
	  </t>
	  <t>
	    The JWT MUST be digitally signed by the issuer and the
	    authorization server MUST verify the signature.
	  </t>
	  <t>
	    The authorization server MUST verify that the JWT is
	    valid in all other respects per
	    <xref target="JWT">JSON Web Token (JWT)</xref>.
	  </t>
	</list>
      </t>
      <section title="Authorization Grant Processing">
	<t>If present, the authorization server MUST also validate the client credentials.</t>  
	<t>If the JWT is not valid, or the current time is not within the token's valid time window for use, the
	authorization server MUST construct an error response as defined in
	<xref target="I-D.ietf-oauth-v2">OAuth 2.0</xref>.
	The value of the <spanx style='verb'>error</spanx> parameter MUST be the
	<spanx style='verb'>invalid_grant</spanx> error code.  The authorization server
	MAY include additional information regarding the reasons the JWT was considered invalid using the
	<spanx style='verb'>error_description</spanx> or <spanx style='verb'>error_uri</spanx> parameters.
	<figure>
	  <preamble>For example:</preamble>
	  <artwork><![CDATA[
  HTTP/1.1 400 Bad Request
  Content-Type: application/json
  Cache-Control: no-store

  {
   "error":"invalid_grant",
   "error_description":"Audience validation failed"
  }
]]></artwork>
	</figure>
	</t>
      </section>
      <section title="Client Authentication Processing">

	<t>If the client JWT is not valid, or its subject confirmation requirements cannot be met, the
	authorization server MUST construct an error response as defined in
	<xref target="I-D.ietf-oauth-v2">OAuth 2.0</xref>.
	The value of the <spanx style='verb'>error</spanx> parameter MUST be the
	<spanx style='verb'>invalid_client</spanx> error code.  The authorization server
	MAY include additional information regarding the reasons the JWT was considered invalid using the
	<spanx style='verb'>error_description</spanx> or <spanx style='verb'>error_uri</spanx> parameters.
	</t>
      </section>
    </section>

    <section anchor="example" title="Authorization Grant Example">
      <t>Though non-normative, the following examples illustrate what a conforming JWT and access token request would look like.
      </t>

      <figure>
	<preamble>
	  Below is an example JSON object that could be encoded to
	  produce the JWT Claims Object for a JWT:
	</preamble>
	<artwork><![CDATA[
  {"iss":"https://jwt-idp.example.com",
   "prn":"mailto:mike@example.com",
   "aud":"https://jwt-rp.example.net",
   "nbf":1300815780,
   "exp":1300819380,
   "http://claims.example.com/member":true}
]]></artwork>
      </figure>

      <figure>
	<preamble>
	  The following example JSON object, used as the header of a
	  JWT, declares that the JWT is signed with the ECDSA P-256
	  SHA-256 algorithm.
	</preamble>
	<artwork><![CDATA[
  {"alg":"ES256"}
]]></artwork>
      </figure>

      <figure>
	<preamble>
	  To present the JWT with the claims and header shown in the previous example as part of an access token request, for example,
	  the client might make the following HTTPS request
	  (with extra line breaks for display purposes only):
	</preamble>
	<artwork><![CDATA[
  POST /token.oauth2 HTTP/1.1
  Host: authz.example.net
  Content-Type: application/x-www-form-urlencoded

  grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer
  &assertion=eyJhbGciOiJFUzI1NiJ9.
  eyJpc3Mi[...omitted for brevity...].
  J9l-ZhwP[...omitted for brevity...]
]]></artwork>
      </figure>
    </section>

    <section anchor="Security" title="Security Considerations">
      <!--<t>All drafts are required to have a security considerations section.
	  See
	  <xref target="RFC3552">RFC 3552</xref>
	  for a guide.
	  </t>  -->
      <t>
	No additional security considerations apply beyond those described within
	<xref target="I-D.ietf-oauth-v2">The OAuth 2.0 Authorization Framework</xref>,
	the <xref target="I-D.ietf-oauth-assertions">Assertion Framework for OAuth 2.0</xref>,
	and the <xref target="JWT">JSON Web Token (JWT)</xref> specification.
      </t>
      <!-- "8. Security considerations - you could probably just refer to the core
	   OAuth spec and to the SAML spec here, but see RFC 3552 for insights." - Peter Saint-Andre -->
    </section>

    <section title='IANA Considerations'>
      <section title='Sub-Namespace Registration of urn:ietf:params:oauth:grant-type:jwt-bearer'>
	<t>
	  This specification registers the value
	  <spanx style='verb'>grant-type:jwt-bearer</spanx> in the
	  IANA urn:ietf:params:oauth registry established in
	  <xref target="I-D.ietf-oauth-urn-sub-ns">An IETF URN Sub-Namespace for OAuth</xref>.

	  <list style='symbols'>
	    <t>URN: urn:ietf:params:oauth:grant-type:jwt-bearer</t>
	    <t>Common Name: JWT Bearer Token Grant Type Profile for OAuth 2.0</t>
	    <t>Change controller: IETF</t>
	    <t>Specification Document: [[this document]]</t>
	  </list>
	</t>
      </section>
      <section title='Sub-Namespace Registration of urn:ietf:params:oauth:client-assertion-type:jwt-bearer'>
	<t>
	  This specification registers the value
	  <spanx style='verb'>client-assertion-type:jwt-bearer</spanx> in the
	  IANA urn:ietf:params:oauth registry established in
	  <xref target="I-D.ietf-oauth-urn-sub-ns">An IETF URN Sub-Namespace for OAuth</xref>.

	  <list style='symbols'>
	    <t>URN: urn:ietf:params:oauth:client-assertion-type:jwt-bearer</t>
	    <t>Common Name: JWT Bearer Token Profile for OAuth 2.0 Client Authentication </t>
	    <t>Change controller: IETF</t>
	    <t>Specification Document: [[this document]]</t>
	  </list>
	</t>
      </section>
    </section>
  </middle>                                              

  <!-- *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- see http://www.rfc-editor.org/policy.html#policy.refs -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
 (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

Both are cited textually in the same manner: by using xref elements.
If you use the PI option, xml2rfc will, by default, try to find included files in the same
directory as the including file. You can also define the XML_LIBRARY environment variable
with a value containing a set of directories to search. These can be either in the local
filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">

      <?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml' ?>
      <?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.4627.xml' ?>
      <?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-oauth-v2-28.xml' ?>
      <?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-oauth-assertions-04.xml' ?>
      <?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-oauth-urn-sub-ns-05.xml' ?>

      <reference anchor="JWT">
        <front>
          <title>JSON Web Token (JWT)</title>

	  <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
	    <organization>Microsoft</organization>
	    <address>
	      <email>mbj@microsoft.com</email>
	      <uri>http://self-issued.info/</uri>
	    </address>
	  </author>

	  <author fullname="John Bradley" initials="J." surname="Bradley">
	    <organization abbrev="Ping Identity">Ping Identity</organization>
	    <address>
	      <email>ve7jtb@ve7jtb.com</email>
	    </address>
	  </author>

	  <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
	    <organization abbrev="NRI">Nomura Research Institute</organization>
	    <address>
	      <email>n-sakimura@nri.co.jp</email>
	    </address>
	  </author>

	  <date day="6" month="July" year="2012" />

        </front>
        <format target="http://tools.ietf.org/html/draft-ietf-oauth-json-web-token" type="HTML" />
      </reference>
    </references>

    <references title="Informative References">

      <?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-oauth-saml2-bearer-13.xml' ?>

    </references>

    <section title='Acknowledgements'>
      <t>
	This profile was derived from
	<xref target="I-D.ietf-oauth-saml2-bearer">SAML 2.0 Bearer Assertion Profiles for OAuth 2.0</xref>
	by Brian Campbell and Chuck Mortimore.
      </t>
    </section>

    <section title='Document History'>
      <t>
	[[ to be removed by the RFC editor before publication as an RFC ]]
      </t>
      <t>
	-02
	<list style='symbols'>
	  <t>Add more text to intro explaining that an assertion/JWT grant type can be used with or without client
	  authentication/identification and that client assertion/JWT authentication is nothing more than an alternative way for a client to authenticate to the token endpoint</t>
	  <t>Add examples to Sections 2.1 and 2.2</t>
	  <t>Update references</t>
	</list>
      </t>
      <t>
	-01
	<list style='symbols'>
	  <t>
	    Tracked specification name changes:
	    "The OAuth 2.0 Authorization Protocol" to "The OAuth 2.0 Authorization Framework" and
	    "OAuth 2.0 Assertion Profile" to "Assertion Framework for OAuth 2.0".
	  </t>
          <t>
	    Merged in changes between draft-ietf-oauth-saml2-bearer-11
	    and draft-ietf-oauth-saml2-bearer-13.
	    All changes were strictly editorial.
          </t>
	</list>
      </t>
      <t>
	-00
	<list style='symbols'>
          <t>
            Created the initial IETF draft based upon
            draft-jones-oauth-jwt-bearer-04 with no normative
            changes.
          </t>
	</list>
      </t>
    </section>

  </back>
</rfc>

PAFTECH AB 2003-20262026-04-23 10:59:25