<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='http://xml.resource.org/authoring/rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc category="exp" docName="openid-connect-http-redirect-1_0"
     ipr="trust200902">
  <?rfc toc="yes" ?>

  <?rfc tocdepth="3" ?>

  <?rfc symrefs="yes" ?>

  <?rfc sortrefs="yes"?>

  <?rfc strict="yes" ?>

  <?rfc iprnotified="no" ?>

  <?rfc private="Draft" ?>

  <front>
    <title abbrev="OpenID Connect HTTP Binding 1.0 - draft 04">OpenID Connect HTTP Redirect Binding 1.0 - draft 04</title>

    <author fullname="Nat Sakimura" initials="N." role="editor"
            surname="Sakimura">
      <organization abbrev="NRI">Nomura Research Institute,
      Ltd.</organization>

      <address>
        <email>n-sakimura@nri.co.jp</email>
      </address>
    </author>

    <author fullname="John Bradley" initials="J." surname="Bradley">
      <organization abbrev="Protiviti">Protiviti Government
      Services</organization>

      <address>
        <email>jbradley@mac.com</email>
      </address>
    </author>

    <author fullname="Breno de Medeiros" initials="B." surname="de Medeiros">
      <organization abbrev="Google">Google</organization>

      <address>
        <email>breno@google.com</email>
      </address>
    </author>

    <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
      <organization abbrev="Microsoft">Microsoft Corporation</organization>

      <address>
        <email>mbj@microsoft.com</email>
      </address>
    </author>

    <author fullname="Edmund Jay" initials="E." surname="Jay">
      <organization abbrev="MGI1">MGI1</organization>

      <address>
        <email>ejay@mgi1.com</email>
      </address>
    </author>

    <date day="11" month="July" year="2011" />

    <abstract>
      <t>OpenID Connect HTTP Redirect Binding 1.0 is a HTTP protocol binding
      of OpenID Connect Core 1.0 and OpenID Framework 1.0 request and response
      messages.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="rnc" title="Requirements Notation and 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"></xref> .</t>

      <t>Throughout this document, values are quoted to indicate that they are
      to be taken literally. When using these values in protocol messages, the
      quotes MUST NOT be used as part of the value.</t>
    </section>

    <section anchor="terminology" title="Terminology">
      <t>Followings are the additional terminology defined in this
      specification in addition to those defined in <xref
      target="OpenID.Core">OpenID Connect Core 1.0</xref> and <xref
      target="OAuth.2.0">OAuth 2.0</xref>.</t>

      <t><list style="hanging">
          <t hangText="Artifact">A small string that acts as a reference to
          the larger body of data.</t>

          <t hangText="Request File">A JSON structure that captures the <xref
          target="OpenID.Framework">OpenID Connect Framework 1.0</xref>
          Authorization Request parameters that can be pointed by a URL that
          is reachable by the Authorization Server.</t>

          <t hangText="Request URI">A URL that points to the Request File. It
          MUST be accessible by the Authorization Server.</t>

          <t hangText="Request Registration Endpoint">An HTTPS Endpoint URL
          provided by the Authorization Server so that the Client MAY register
          the Request File to obtain the Request URI.</t>
        </list></t>
    </section>

    <section title="Protocol Flows">
      <t>Authorization requests follow two paths, the authorization code flow
      and the implicit grant flow. The authorization code flow is suitable for
      clients that can securely maintain client state between itself and the
      authorization server whereas the implicit grant flow is suitable for
      clients that cannot.</t>

      <section anchor="protocol_flows" title="Authorization Code Flow">
        <t>The authorization code protocol flow goes through the following
        steps.</t>

        <t><list style="numbers">
            <t>Client prepares an Authorization Request containing the desired
            request parameters.</t>

            <t>Client sends a request to the Authorization Server.</t>

            <t>Authorization Server Authenticates the End-User</t>

            <t>Authorization Server Obtains the End-User
            Consent/Authorization</t>

            <t>Authorization Server Sends the End-User back to the Client with
            an Authorization Code</t>

            <t>Client requests Assertion using the Authorization Code</t>

            <t>Client receives Assertion in the response body</t>

            <t>(OPTIONAL) Client accesses the UserInfo endpoint <xref
            target="OpenID.UserInfo">OpenID Connect UserInfo 1.0</xref></t>

            <t>(OPTIONAL) Client receives UserInfo Response</t>
          </list>Note that in each step, the party that receives message MUST
        verify it according to the verification rule set in <xref
        target="OpenID.Core">OpenID Connect Core 1.0</xref> and <xref
        target="OpenID.Framework">OpenID Connect Framework 1.0</xref>.</t>

        <section anchor="rf_prep"
                 title="Client prepares an Authorization Request">
          <t>When the user wishes to access a Protected Resource, and the
          End-User Authorization has not yet been obtained, the Client
          prepares an Authorization Request to the authorization endpoint.</t>

          <t>The scheme used in the Authorization URL MUST be HTTPS.</t>

          <t>This binding further constrains the following request
          parameters</t>

          <t><list style="hanging">
              <t hangText="response_type">It MUST include <spanx style="verb">code</spanx>.</t>
            </list></t>

          <t>Other required parameters in the request include the
          following:</t>

          <t><list style="hanging">
              <t hangText="client_id">The client identifier.</t>

              <t hangText="scope">It MUST include <spanx style="verb">openid</spanx>
              as one of the strings.</t>

              <t hangText="redirect_uri">A redirection URI where the response
              will be sent.</t>
            </list></t>

          <t>The request can contain the following optional parameters:</t>

          <t><list style="hanging">
              <t hangText="state">An opaque value used to maintain state
              between the request and the callback.</t>

              <t hangText="request">A <xref target="JWT">JWT</xref> encoded
              <eref
              target="http://openid.net/specs/openid-connect-framework-1_0.html#OpenIDReq">OpenID
              Request Object</eref>.</t>

              <t hangText="request_uri">A URL that points to an <eref
              target="http://openid.net/specs/openid-connect-framework-1_0.html#OpenIDReq">OpenID
              Request Object</eref>.</t>

              <t hangText="display">A string value that can be none, popup, or
              mobile.</t>

              <t hangText="prompt">A space delimited list that can contain
              <spanx style="verb">login</spanx>, <spanx style="verb">consent</spanx>,
              and <spanx style="verb">select_account</spanx>.</t>

              <t hangText="nonce">A random, unique string value.</t>

              <t hangText="id_token_audience">The identifier of the target
              audience for an ID token.</t>
            </list></t>

          <t>There are three methods to send the request to the authorization
          endpoint: a) query parameters method b) request parameter method,
          and c) request file method.</t>

          <t>Authorization servers MUST support the use of the HTTP "GET"
          method as define in <xref target="RFC2616">RFC 2616</xref> and MAY
          support the "POST" method at the authorization endpoint.</t>

          <t>If using the HTTP "GET" method, the parameters are serialized
          using URI query string serialization as defined in <xref
          target="OpenID.Core">OpenID Connect Core 1.0</xref>. If using the
          HTTP "POST" method, the request parameters are added to the HTTP
          request entity-body using "application/x-www-form-urlencoded"
          format.</t>

          <section title="Query Parameters Method">
            <t>The Client prepares an Authorization Request to the
            Authorization endpoint using the appropriate HTTP parameters
            serialization.</t>

            <t><figure>
                <preamble>The following is a non-normative example of an
                Authorization Request URL. Note that the line wraps within the
                values are for display purpose only:</preamble>

                <artwork><![CDATA[https://server.com/op/authorize?
response_type=code
&client_id=s6BhdRkqt3
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
&scope=openid
&state=af0ifjsldkj]]></artwork>
              </figure></t>

            <section anchor="norm_req"
                     title="Client sends a request to the Authorization Server">
              <t>Having constructed the URL, the client sends the End-User to
              the HTTPS End-User Authorization Endpoint using the URL. This
              MAY happen via HTTPS redirect, hyperlinking, or any other means
              of directing the User-Agent to the URL.</t>

              <t>The Client SHOULD send the request using the HTTP GET method,
              but MAY send it via the HTTP POST if the authorization server
              supports it as defined in <xref
              target="W3C.REC-html401-19991224"></xref></t>

              <t>Following is a non-normative example using HTTP redirect.
              Note: Line wraps are for display purpose only.</t>

              <figure>
                <artwork><![CDATA[HTTP/1.1 302 Found
Location: https://server.com/op/authorize?
response_type=code
&client_id=s6BhdRkqt3
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
&scope=openid
&state=af0ifjsldkj
]]></artwork>
              </figure>
            </section>
          </section>

          <section title="Request Parameter Method">
            <t>The Client prepares an Authorization Request to the
            Authorization endpoint using the appropriate HTTP parameters
            serialization. The request parameters MUST include the <spanx
            style="verb">request</spanx> parameter defined in the <xref
            target="rf_prep">Client Prepares an Authorization Request</xref>
            section. The <spanx style="verb">request</spanx> parameter is a
            <xref target="JWT">JWT</xref> encoded <eref
            target="http://openid.net/specs/openid-connect-framework-1_0.html#OpenIDReq">OpenID
            Request Object</eref> which specifies the content and format of
            the response returned from the <xref
            target="OpenID.UserInfo">UserInfo endpoint </xref>. The JWT object
            MAY be signed or signed and encrypted via <xref
            target="JWS">JWS</xref> and <xref target="JWE">JWE</xref>
            respectively, thereby providing authentication, integrity,
            non-repudiation and/or confidentiality.</t>

            <t>Request parameters in the <eref
            target="http://openid.net/specs/openid-connect-framework-1_0.html#OpenIDReq">OpenID
            Request Object</eref> takes precedence over query parameters.</t>

            <t><figure>
                <preamble>The following is a non-normative example of an
                OpenID Request Object. Note that the line wraps within the
                values are for display purpose only:</preamble>

                <artwork><![CDATA[{
 "userinfo":
   {
     "claims":
       {
         "name": null,
         "nickname": {"optional": true},
         "email": null,
         "verified": null,
         "picture": {"optional": true},
       },
     "format": "signed"
   }
 "id_token":
   {
     "max_age": 86400,
     "iso29115": "2"
   }
}]]></artwork>
              </figure> <figure>
                <preamble>The following is a non-normative example of a <xref
                target="JWT">JWT</xref> encoded OpenID Request Object. Note
                that the line wraps within the values are for display purpose
                only:</preamble>

                <artwork><![CDATA[// replace with JWT string
jwt_header.jwt_payload.jwt_crypto]]></artwork>
              </figure></t>

            <t><figure>
                <preamble>The following is a non-normative example of an
                Authorization Request URL. Note that the line wraps within the
                values are for display purpose only:</preamble>

                <artwork><![CDATA[https://server.com/op/authorize?
response_type=code
&client_id=s6BhdRkqt3
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
&scope=openid
&state=af0ifjsldkj
&request=jwt_header.jwt_payload.jwt_crypto]]></artwork>
              </figure></t>

            <section anchor="request_req"
                     title="Client Sends a Request to the Authorization Server">
              <t>Having constructed the URL, the client sends the End-User to
              the HTTPS End-User Authorization Endpoint using the URL. This
              MAY happen via HTTPS redirect, hyperlinking, or any other means
              of directing the User-Agent to the URL.</t>

              <t>The Client MAY send the request using the HTTP GET method,
              but MUST send it via the HTTP POST if the authorization server
              supports it as defined in <xref
              target="W3C.REC-html401-19991224"></xref></t>

              <t>Following is a non-normative example using HTTP redirect.
              Note: Line wraps are for display purpose only.</t>

              <figure>
                <artwork><![CDATA[HTTP/1.1 302 Found
Location: https://server.com/op/authorize?
response_type=code
&client_id=s6BhdRkqt3
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
&scope=openid
&state=af0ifjsldkj&
request=jwt_header.jwt_payload.jwt_crypto
]]></artwork>
              </figure>
            </section>
          </section>

          <section title="Request File Method">
            <t>The request file method differs from the other methods in that
            it uses a request file which contains all the authorization
            request parameters. It sends the request file URL to the
            authorization endpoint instead of the request parameters.</t>

            <t>The Client prepares a file with a JSON serialized Authorization
            Request described in <xref target="OpenID.Core">OpenID Connect
            Core 1.0</xref> with a globally reachable URL. Optionally, the
            request may contain other extension parameters. It MAY be signed
            or signed and encrypted as in <xref target="JWT"></xref>. If it is
            signed with an asymmetric key, then it may be possible to provide
            non-repudiation capability of the request. For signing, <xref
            target="JWS">JWS</xref> MUST be used. For encryption, <xref
            target="JWE">JWE</xref> MUST be used.</t>

            <t><figure>
                <preamble>Following is a non-normative example of a Request
                File. Note that the line wraps within the values are for
                display purpose only:</preamble>

                <artwork><![CDATA[{
    "response_type": "code",
    "client_id": "s6BhdRkqt3",
    "redirect_uri": "https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb",
    "scope": "openid",
    "state": "af0ifjsldkj"
}]]></artwork>
              </figure></t>

            <section anchor="rurl_create"
                     title="Client Obtains the URL of the Request File">
              <t>The Client then records the Request File either locally or
              remotely and obtains the Request URI, <spanx style="verb">"request_uri"</spanx>.</t>

              <t>Optionally, the Authorization Server may provide the Request
              File registration service at the Request Registration Endpoint,
              which allows the Client to register the Request File and obtain
              the URL for it in exchange. This is especially useful for the
              cases when the RP is behind the firewall or lives on a client
              device that cannot be accessed from the Authorization
              Server.</t>
            </section>

            <section anchor="art_req"
                     title="Client Sends a Request to Authorization Server via HTTPS Redirect">
              <t>The Client sends the user to the HTTPS End-User Authorization
              Endpoint through the HTTP 302 redirect with the following
              parameters</t>

              <t><list style="hanging">
                  <t hangText="response_type">REQUIRED. <spanx style="verb">"code".</spanx></t>

                  <t hangText="client_id">REQUIRED. The Client Identifier.</t>

                  <t hangText="request_uri">REQUIRED. The Request URI.</t>

                  <t hangText="state">OPTIONAL. An opaque value used by the
                  Client to maintain state between the request and callback.
                  If provided, the Authorization Server MUST include this
                  value when redirecting the user-agent back to the Client.
                  Clients are strongly advised to use this variable to relate
                  the request and response.</t>
                </list></t>

              <t>The entire URL MUST NOT exceed 512 bytes.</t>

              <t>The Client SHOULD send the request using the HTTP GET method,
              but MAY send it via the HTTP POST if the authorization server
              supports it as defined in <xref
              target="W3C.REC-html401-19991224"></xref></t>

              <figure>
                <preamble>Following is a non-normative example. Note: Line
                wraps are for display purpose only:</preamble>

                <artwork><![CDATA[HTTP/1.1 302 Found
Location: https://rp.example.com/rp.php?response_type=code&cliend_id=ab1
&request_uri=https://rp.example.com/rf.js%23Qfsoe2F
&state=A02FB8C]]></artwork>
              </figure>
            </section>

            <section title="Authorization Server Fetches the Request File">
              <t>Upon receipt of the Request, the Authorization Server MUST
              send a GET request to the <spanx style="verb">request_uri</spanx>
              to retrieve the content unless it is already cached and parse it
              to recreate the authorization request parameters.</t>

              <figure>
                <preamble>Following is a non-normative example of this fetch
                process. Note: Line wraps are for display purpose
                only:</preamble>

                <artwork><![CDATA[GET /rf.js HTTP/1.1
Host:rp.example.com]]></artwork>
              </figure>
            </section>
          </section>
        </section>

        <section title="Authorization Server Authenticates the End-User">
          <t>The Authorization Server validates the request to ensure all
          required parameters are present and valid. If the request is valid,
          the authorization server MUST authenticate the End-User. The way in
          which the authorization server authenticates the End-User (e.g.
          username and password login, session cookies) is beyond the scope of
          this specification.</t>
        </section>

        <section title="Authorization Server Obtains the End-User Consent/Authorization">
          <t>Once the user is authenticated, the Authorization Server MUST
          obtain an authorization decision. This MAY be done by presenting the
          user with a dialogue that allows the user to recognize what he is
          consenting to and obtain his consent or by establishing approval via
          other means ( for example, via previous administrative approval
          )</t>
        </section>

        <section anchor="art_res"
                 title="Authorization Server Sends the End-User Back to the Client ">
          <t>Once the authorization is determined, the Authorization Server
          returns a positive or negative response.</t>

          <section anchor="art_res_ok" title="End-User Grants Authorization">
            <t>If the resource owner grants the access request, the
            authorization server issues an Authorization code and delivers it
            to the client by adding the following parameters to the query
            component of the redirection URI using the
            "application/x-www-form-urlencoded" format:<list style="hanging">
                <t hangText="code">REQUIRED. The Authorization Code.</t>

                <t hangText="state">REQUIRED if the <spanx style="verb">"state"</spanx>
                parameter in the request. Set to the exact value of the <spanx
                style="verb">"state"</spanx> parameter received from the
                client.</t>
              </list></t>

            <t>No other parameter SHOULD be returned. The entire URL MUST NOT
            exceed 512 bytes.</t>

            <figure>
              <preamble>The following is a non-normative example. Line wraps
              after the second line is for the display purpose
              only:</preamble>

              <artwork><![CDATA[HTTP/1.1 302 Found
Location: https://client.com/rp?
code=Qcb0Orv1zh30vL1MPRsbm-diHiMwcLyZvn1arpZv-Jxf_11jnpEX3Tgfvk
&state=af0ifjsldkj]]></artwork>
            </figure>
          </section>

          <section anchor="authz_error"
                   title="End-User Denies Authorization or Invalid Request">
            <t>If the user denies the authorization or the user authentication
            fails, the server MUST return the negative authorization response
            as defined in <xref target="OpenID.Core">OpenID Connect Core
            1.0</xref>. No other parameter SHOULD be returned.</t>

            <t><figure>
                <preamble>The following is a non-normative example. Line wraps
                after the second line is for the display purpose
                only:</preamble>

                <artwork><![CDATA[HTTP/1.1 302 Found
Location: https://client.com/rp?
error=invalid_request
&error_description=the%20request%20is%20not%20valid%20or%20malformed
&state=af0ifjsldkj]]></artwork>
              </figure></t>
          </section>
        </section>

        <section title="Client Requests Assertion Using the &quot;code&quot;">
          <t>Upon receipt of the <spanx style="verb">"code"</spanx>, the
          Client requests an Assertion that includes the <spanx style="verb">"access_token"</spanx>
          and other variables. To obtain the assertion, the client send the
          following parameters via HTTPS POST to the token endpoint using
          <spanx style="verb">application/x-www-form-urlencoded</spanx> format
          in the HTTP request entity-body:</t>

          <t><list style="hanging">
              <t hangText="grant_type">REQUIRED. A string
              "authorization_code".</t>

              <t hangText="code">REQUIRED. The authorization code received
              from the authorization server.</t>

              <t hangText="client_id">REQUIRED. The client_id of the RP.</t>

              <t hangText="secret_type">OPTIONAL. Specifies the client
              authentication type which determines how the <spanx
              style="verb">client_secret</spanx> parameter is interpreted. It
              can be one of <spanx style="verb">"basic"</spanx> or <spanx
              style="verb">"JWT"</spanx>. Defaults to <spanx style="verb">"basic"</spanx>.</t>

              <t hangText="client_secret">OPTIONAL. Client Secret. If the
              secret_type is <spanx style="verb">"basic"</spanx>, send the
              pre-shared secret. If the secret_type is <spanx style="verb">"JWT"</spanx>,
              send the compact serialization of the <xref
              target="JWT">JWT</xref> Signature over the 'code'.</t>
            </list></t>

          <t>TODO - we shouldn't constrain the authentication options here,
          but rather defer to OAuth 2.0 and applicable extensions.</t>

          <figure>
            <preamble>The following is a non-normative example. Line wraps
            after line 4 are for display purpose only:</preamble>

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

grant_type=authorization_code
&code=Qcb0Orv1zh30vL1MPRsbm-diHiMwcLyZvn1arpZv-Jxf_11jnpEX3Tgfvk
&client_id=s6BhdRkqt3
&client_secret=1234qwer
&secret_type=basic]]></artwork>
          </figure>
        </section>

        <section title="Client Receives Assertion in the Response Body">
          <t>Upon receipt of the Token Request, the Server MUST return either
          Positive or Negative Assertion that corresponds to the received
          authorization code.</t>

          <section title="Positive Assertion">
            <t>A Positive Assertion response returns the "application/json"
            media type and the response body is the Access Token Response of
            the <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>.</t>

            <t>The assertion is a JSON structure which MUST contain the
            following values:</t>

            <t><list style="hanging">
                <t hangText="access_token">The access token.</t>

                <t hangText="token_type">Specifies the access token type. This
                specification defines the "JWT" type for a JWT token.</t>
              </list>

	      In addition, it can contain the optional <spanx
	      style="verb">refresh_token</spanx>, <spanx
	      style="verb">expires_in</spanx>, <spanx
	      style="verb">scope</spanx>, and <spanx
	      style="verb">id_token</spanx> values.</t>

            <t>The authorization server MUST include a HTTP <spanx
            style="verb">Cache-Control</spanx> response header field with a
            value of <spanx style="verb">no-store</spanx> in any response
            containing tokens, secrets, or other sensitive information.</t>

            <figure>
              <preamble>Following is a non-normative example of the Positive
              Assertion:</preamble>

              <artwork><![CDATA[HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store

{
    "access_token": "SlAV32hkKG",
    "token_type": "JWT",
    "refresh_token": "8xLOxBtZp8",
    "user_id": "http://op.example.com/alice#1234",
    "domain": "op.example.com",
    "expires_in": 3600,
    "id_token":"jwt_header.jwt_payload.jwt_crypto"
}]]></artwork>
            </figure>
          </section>

          <section title="Error Response">
            <t>If the Token Request is invalid or unauthorized, the
            Authorization Server constructs the response by returning the
            Token Error Response defined in <xref target="OpenID.Core">OpenID
            Connect Core 1.0</xref> in the entity body of the HTTP response
            using the <spanx style="verb">application/json</spanx> media type
            with HTTP response code 400.</t>

            <figure>
              <preamble>Following is a non-normative example:</preamble>

              <artwork><![CDATA[HTTP/1.1 400 Bad Request
Content-Type: application/json
Cache-Control: no-store

{
  "error":"invalid_request"
}]]></artwork>
            </figure>
          </section>
        </section>

        <section anchor="id_req" title="Accessing UserInfo Endpoint">
          <t>To obtain the additional attributes and tokens/assertions, the
          client makes a GET or POST request to the UserInfo Endpoint <xref
          target="OpenID.UserInfo">OpenID Connect UserInfo 1.0</xref> as in
          <xref target="OpenID.Core">OpenID Connect Core 1.0</xref> and <xref
          target="OpenID.Framework">OpenID Connect Framework 1.0</xref>.</t>

          <section title="Requesting UserInfo">
            <t>Client SHOULD send the UserInfo request defined in section
            4.3.1 of the <xref target="OpenID.Core">OpenID Connect Core
            1.0</xref> either in HTTP GET or POST request.</t>

            <figure>
              <preamble>The following is a non-normative example. Line wraps
              are for display purpose only:</preamble>

              <artwork><![CDATA[POST /userinfo HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded

access_token=SlAV32hkKG]]></artwork>
            </figure>
          </section>
        </section>

        <section anchor="id_res" title="RP Receives UserInfo response">
          <t>Upon receipt of the UserInfo request, the UserInfo endpoint MUST
          return the JSON Serialization of the UserInfo response as in <xref
          target="OpenID.Core"></xref> in the HTTP response body.</t>

          <figure>
            <preamble>Following is a non-normative example of such
            response:</preamble>

            <artwork><![CDATA[{
 "name": "Jane Doe"
 "given_name": "Jane",
 "family_name": "Doe",
 "email": "janedoe@example.com",
 "picture": "http://example.com/janedoe/me.jpg"
}]]></artwork>
          </figure>

          <section title="Error Response">
            <t>When some error condition arises, the UserInfo endpoint returns
            the Error Response defined in section 4.3.3 of the <xref
            target="OpenID.Core">OpenID Connect Core</xref></t>
          </section>
        </section>
      </section>

      <section title="Implicit Flow">
        <t>The implicit grant flow follows the following steps:</t>

        <t><list style="numbers">
            <t>Client prepares an Authorization Request containing the desired
            request parameters.</t>

            <t>Client sends a request to the Authorization Server.</t>

            <t>Authorization Server Authenticates the End-User</t>

            <t>Authorization Server Obtains the End-User
            Consent/Authorization</t>

            <t>Authorization Server Sends the End-User back to the Client with
            an Access Token</t>
          </list></t>

        <section anchor="implicit_prep"
                 title="Client Prepares an Authorization Request URL ">
          <t>When the user wishes to access a Protected Resource, and the
          End-User Authorization has not yet been obtained, the Client
          prepares an Authorization Request URL using URI query string
          serialization as defined in <xref target="OpenID.Core">OpenID
          Connect Core 1.0</xref>.</t>

          <t>The scheme used in the Authorization URL MUST be HTTPS.</t>

          <t>This binding further constrains the following request
          parameters</t>

          <t><list style="hanging">
              <t hangText="response_type">It MUST include <spanx style="verb">token</spanx>.</t>
            </list></t>

          <t>The request MUST contain the other required parameters and MAY
          contain optional parameters as defined in the <xref
          target="rf_prep">preparing an authorization request</xref>
          section.</t>
        </section>

        <section anchor="implicit_req"
                 title="Client Sends a Request to the Authorization Server">
          <t>Having constructed the URL, the client sends the End-User to the
          HTTPS End-User Authorization Endpoint using the URL. This MAY happen
          via HTTPS redirect, hyperlinking, or any other means of directing
          the User-Agent to the URL.</t>

          <t>Following is a non-normative example using HTTP redirect. Note:
          Line wraps are for display purpose only.</t>

          <figure>
            <artwork><![CDATA[HTTP/1.1 302 Found
Location: https://server.com/op/authorize?
response_type=token
&client_id=s6BhdRkqt3
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
&state=af0ifjsldkj
]]></artwork>
          </figure>
        </section>

        <section title="Authorization Server Authenticates the End-User">
          <t>The Authorization Server validates the request to ensure all
          required parameters are present and valid. If the request is valid,
          the authorization server MUST authenticate the End-User. The way in
          which the authorization server authenticates the End-User (e.g.
          username and password login, session cookies) is beyond the scope of
          this specification.</t>
        </section>

        <section title="Authorization Server Obtains the End-User Consent/Authorization">
          <t>Once the user is authenticated, the Authorization Server MUST
          obtain an authorization decision. This MAY be done by presenting the
          user with a dialogue that allows the user to recognize what he is
          consenting to and obtain his consent or by establishing approval via
          other means ( for example, via previous administrative approval
          )</t>
        </section>

        <section anchor="implicit_res"
                 title="Authorization Server Sends the End-User Back to the Client ">
          <t>Once the authorization is determined, the Authorization Server
          returns a positive or negative response.</t>

          <section anchor="implicit_ok" title="End-User Grants Authorization">
            <t>If the resource owner grants the access request, the
            authorization server issues an access token and delivers it to the
            client by adding the following parameters to the query component
            of the redirection URI using the
            "application/x-www-form-urlencoded" format:<list style="hanging">
                <t hangText="access_token">REQUIRED. The AccessToken</t>

                <t hangText="state">REQUIRED if the <spanx style="verb">"state"</spanx>
                parameter in the request. Set to the exact value of the <spanx
                style="verb">"state"</spanx> parameter received from the
                client.</t>

                <t hangText="id_token">REQUIRED if the <spanx style="verb">response_type</spanx>
                parameter in the request included the <spanx style="verb">id_token</spanx>
                value.</t>
              </list></t>

            <t>The client can then use the Access Token to access protected
            resources at resource servers.</t>

            <figure>
              <preamble>The following is a non-normative example. Line wraps
              after the second line is for the display purpose
              only:</preamble>

              <artwork><![CDATA[HTTP/1.1 302 Found
Location: https://client.com/rp#
access_token=jwt_header.jwt_payload.jwt_crypto&
token_type=JWT&
expires_in=3600&
&state=af0ifjsldkj]]></artwork>
            </figure>
          </section>

          <section anchor="implicit_authz_error"
                   title="End-User Denies Authorization or Invalid Request">
            <t>If the user denies the authorization or the user authentication
            fails, the server MUST return the negative authorization response
            as defined in <xref target="OpenID.Core">OpenID Connect Core
            1.0</xref>. No other parameter SHOULD be returned.</t>
          </section>
        </section>
      </section>
    </section>

    <section anchor="security_considerations" title="Security Considerations">
      <t>Followings are the list of attack vectors and remedies that were
      considered for this specification.</t>

      <t>For details of the attack vector, see <xref
      target="SP800-63"></xref>.</t>

      <section anchor="assertion_manufacture"
               title="Assertion Manufacture/Modification">
        <t>To mitigate this attack, there are two ways to mitigate it.</t>

        <t><list style="numbers">
            <t>The assertion may be digitally signed by the OP. The Relying
            Party SHOULD check the digital signature to verify that it was
            issued by a legitimate OP.</t>

            <t>The assertion may be sent over a protected channel such as
            TLS/SSL. In order to protect the integrity of assertions from
            malicious attack, the OP MUST be authenticated. In this
            specification, the assertion is always sent over TLS/SSL protected
            channel.</t>
          </list></t>
      </section>

      <section anchor="assertion_disclosure" title="Assertion Disclosure">
        <t>The Assertion disclosure can be mitigated in the following two
        ways.</t>

        <t><list style="numbers">
            <t>Assertion is sent over TLS/SSL protected channel, where RP is
            authenticated by "client_id" and "client_secret".</t>

            <t>Signed Assertion is encrypted by the RP's public key.</t>
          </list></t>
      </section>

      <section anchor="assertion_repudiation" title="Assertion Repudiation">
        <t>To mitigate this threat, the assertion may be digitally signed by
        the OP using a key that supports non-repudiation. The RP SHOULD check
        the digital signature to verify that it was issued by a legitimate
        OP.</t>
      </section>

      <section anchor="assertion_redirect" title="Assertion Redirect">
        <t>To mitigate this threat, the assertion includes the identity of the
        RP for whom it was generated as "client_id". The RP verifies that
        incoming assertions include its identity as the recipient of the
        assertion.</t>
      </section>

      <section anchor="assertion_reuse" title="Assertion Reuse">
        <t>The assertion includes a timestamp and a short lifetime of
        validity. The Relying Party checks the timestamp and lifetime values
        to ensure that the assertion is currently valid.</t>
      </section>

      <section anchor="artifact_manufacture"
               title="Secondary Authenticator Manufacture">
        <t>Due to the large entropy requirement of the Artifact ("code") and
        short life nature of its validity, the success probability of this
        attack is extremely low.</t>
      </section>

      <section anchor="artifact_capture"
               title="Secondary Authenticator Capture">
        <t>Secondary authenticator (="code") is transmitted only through
        HTTPS, thus it is protected between the OP and the User-Agent, and
        User-Agent and the RP.</t>

        <t>Only the place it can be captured is the User-Agent where the TLS
        session is terminated, and is possible if the User-Agent is infested
        by malwares. However, it renders no usefulness as long as the profile
        in use either RP authentication or assertion encryption.</t>
      </section>

      <section anchor="assertion_substitution" title="Assertion Substitution">
        <t>Responses to assertion requests is bound to the corresponding
        requests by message order in HTTP, as both assertions and requests are
        protected by TLS that can detect and disallow malicious reordering of
        packets.</t>
      </section>

      <section anchor="auth_req_disclosure"
               title="Authentication Request Disclosure">
        <t>If the authentication request is POSTed directly through a
        protected channel, it is not possible to disclose the authentication
        request.</t>

        <t>If the Request File is encrypted by the OP's public key, the
        authentication request will not be disclosed unless OP's private key
        gets compromised or the encryption algorithm becomes vulnerable.</t>
      </section>

      <section title="Timing Attack">
        <t>Timing attack can be used to reduce the effective key length of the
        signature if the time required to return the response in case of a
        signature error and a correct signature differs. Care should be taken
        in the implementation to avoid this attack.</t>
      </section>

      <section anchor="authn_proc_threats"
               title="Authentication Process Threats">
        <t>In the category of Authentication Process Threats, following
        threats exists.</t>

        <t><list style="symbols">
            <t>Online guessing</t>

            <t>Phishing</t>

            <t>Pharming</t>

            <t>Eavesdropping</t>

            <t>Replay</t>

            <t>Session hijack</t>

            <t>Man-in-the-middle</t>
          </list>Authentication process per se as described in NIST
        SP800-63-rev1 is out of scope for this protocol, but care SHOULD be
        taken to achieve appropriate protection.</t>
      </section>

      <section title="Implicit Grant Flow Threats">
        <t>In the implicit grant flow, the access token is returned in the
        fragment part of the client's redirect_uri through HTTPS, thus it is
        protected between the OP and the User-Agent, and User-Agent and the
        RP. The only the place it can be captured is the User-Agent where the
        TLS session is terminated, and is possible if the User-Agent is
        infested by malware.</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document makes no request of IANA.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119"?>

      <?rfc include='http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-html401-19991224.xml' ?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616"?>

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

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft
            Corporation</organization>
          </author>

          <author fullname="Dirk Balfanz" initials="D." surname="Balfanz">
            <organization abbrev="goog">Google</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="pgs">rotivity Government
            Service</organization>
          </author>

          <author fullname="Yaron Goland" initials="Y." surname="Goland">
            <organization abbrev="msft">Microsoft</organization>
          </author>

          <author fullname="John Panzer" initials="J." surname="Panzer">
            <organization abbrev="goog">Google</organization>
          </author>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="nri">Nomura Research Institute,
            Ltd.</organization>
          </author>

          <author fullname="Paul Tarjan" initials="P." surname="Tarjan">
            <organization abbrev="fb">Facebook</organization>
          </author>

          <date day="30" month="March" year="2011" />
        </front>

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

      <reference anchor="JWS">
        <front>
          <title>JSON Web Signatures</title>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft
            Corporation</organization>
          </author>

          <author fullname="Dirk Balfanz" initials="D." surname="Balfanz">
            <organization abbrev="goog">Google</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="pgs">rotivity Government
            Service</organization>
          </author>

          <author fullname="Yaron Goland" initials="Y." surname="Goland">
            <organization abbrev="msft">Microsoft</organization>
          </author>

          <author fullname="John Panzer" initials="J." surname="Panzer">
            <organization abbrev="goog">Google</organization>
          </author>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="nri">Nomura Research Institute,
            Ltd.</organization>
          </author>

          <author fullname="Paul Tarjan" initials="P." surname="Tarjan">
            <organization abbrev="fb">Facebook</organization>
          </author>

          <date day="29" month="April" year="2011" />
        </front>

        <format target="http://tools.ietf.org/html/draft-jones-json-web-signature"
                type="HTML" />
      </reference>

      <reference anchor="JWE">
        <front>
          <title>JSON Web Encryption</title>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft
            Corporation</organization>
          </author>

          <author fullname="Dirk Balfanz" initials="D." surname="Balfanz">
            <organization abbrev="goog">Google</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="pgs">rotivity Government
            Service</organization>
          </author>

          <author fullname="Yaron Goland" initials="Y." surname="Goland">
            <organization abbrev="msft">Microsoft</organization>
          </author>

          <author fullname="John Panzer" initials="J." surname="Panzer">
            <organization abbrev="goog">Google</organization>
          </author>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="nri">Nomura Research Institute,
            Ltd.</organization>
          </author>

          <author fullname="Paul Tarjan" initials="P." surname="Tarjan">
            <organization abbrev="fb">Facebook</organization>
          </author>

          <date day="28" month="March" year="2011" />
        </front>

        <format target="http://self-issued.info/docs/draft-jones-json-web-encryption.html"
                type="HTML" />
      </reference>

      <reference anchor="OpenID.Core">
        <front>
          <title>OpenID Connect Core 1.0</title>

          <author fullname="David Recordon" initials="D." surname="Recordon">
            <organization abbrev="">Facebook</organization>
          </author>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute,
            Ltd.</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Protiviti">Protiviti Government
            Services</organization>
          </author>

          <author fullname="Breno de Medeiros" initials="B."
                  surname="de Medeiros">
            <organization abbrev="Google">Google</organization>
          </author>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft
            Corporation</organization>
          </author>

          <author fullname="Edmund" initials="E." surname="Jay">
            <organization abbrev="">MGI1</organization>
          </author>

          <date day="11" month="July" year="2011" />
        </front>

        <format target="http://openid.net/specs/openid-connect-core-1_0.html"
                type="HTML" />
      </reference>

      <reference anchor="OpenID.Framework">
        <front>
          <title abbrev="Abbreviated-Title">OpenID Connect Framework
          1.0</title>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute,
            Ltd.</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Protiviti">Protiviti Government
            Services</organization>
          </author>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft
            Corporation</organization>
          </author>

          <author fullname="Breno de Medeiros" initials="B."
                  surname="de Medeiros">
            <organization abbrev="">Google</organization>
          </author>

          <author fullname="Chuck Mortimore" initials="C." surname="Mortimore">
            <organization abbrev="Salesforce">Salesforce</organization>
          </author>

          <author fullname="Edmund Jay" initials="E." surname="Jay">
            <organization abbrev="MGI1">MGI1</organization>
          </author>

          <date day="11" month="July" year="2011" />
        </front>

        <format target="http://openid.net/specs/openid-connect-framework-1_0.html"
                type="HTML" />
      </reference>

      <reference anchor="OpenID.UserInfo">
        <front>
          <title>OpenID Connect UserInfo 1.0</title>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute,
            Ltd.</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Protiviti">Protiviti Government
            Services</organization>
          </author>

          <author fullname="Breno de Medeiros" initials="B."
                  surname="de Medeiros">
            <organization abbrev="Google">Google</organization>
          </author>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft
            Corporation</organization>
          </author>

          <date day="11" month="July" year="2011" />
        </front>

        <format target="http://openid.net/specs/openid-connect-userinfo-1_0.html"
                type="HTML" />
      </reference>

      <reference anchor="SP800-63">
        <front>
          <title>NIST SP800-63rev.1: Electronic Authentication
          Guideline</title>

          <author>
            <organization>National Institute of Standards and
            Technology</organization>
          </author>
        </front>

        <seriesInfo name="NIST" value="SP800-63" />

        <format target="http://csrc.nist.gov/publications/drafts/800-63-rev1/SP800-63-Rev1_Dec2008.pdf"
                type="PDF" />

        <!-- <annotation>Defines LoA</annotation> -->
      </reference>

      <reference anchor="OAuth.2.0">
        <front>
          <title>OAuth 2.0 Authorization Protocol</title>

          <author fullname="Eran Hammer-Lahav" initials="E." role="editor"
                  surname="Hammer-Lahav">
            <organization abbrev="">Yahoo</organization>
          </author>

          <author fullname="David Recordon" initials="D." surname="Recordon">
            <organization abbrev="">Facebook</organization>
          </author>

          <author fullname="Dick Hardt" initials="D." surname="Hardt">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <date day="19" month="May" year="2011" />
        </front>

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

    <!-- <references title="Informative References"> -->

    <!-- </references> -->

    <section title="Footnotes">
      <t></t>

      <section title="Example JWT Values">
        <t>The JWT values used in the non-normative examples of this
        specification are only place holders for actual JWT values. The
        examples use "jwt_header.jwt_payload.jwt_crypto" as the place holder
        value. For an example of an actual JWT, refer to the <xref
        target="JWT">JWT</xref> specification.</t>
      </section>
    </section>

    <section title="Acknowledgements">
      <t>The OpenID Community would like to thank the following people for the
      work they've done in the drafting and editing of this specification.</t>

      <t><list style="empty">
          <t>Axel Nennker (axel.nennker@telekom.de), Deutsche Telekom</t>

          <t>Breno de Medeiros (breno@gmail.com), Google</t>

          <t>George Fletcher (gffletch@aol.com), AOL</t>

          <t>Hideki Nara (hideki.nara@gmail.com), Takt Communications</t>

          <t>John Bradley (jbradely@mac.com), Protiviti Government
          Services</t>

          <t>Nat Sakimura (n-sakimura@nri.co.jp)), Nomura Research Institute,
          Ltd.</t>

          <t>Ryo Itou (ritou@yahoo-corp.jp), Yahoo! Japan</t>
        </list></t>
    </section>

    <section title="Document History">
      <t>[[ To be removed from the final specification ]]</t>

      <t>-04 <list style="symbols">
          <t>Correct issues raised by Pam Dingle and discussed on the
          ML after 11-Jul-11 working group call. Adopted long_names.</t>
        </list></t>

      <t>-03 <list style="symbols">
          <t>Correct issues raised by Johnny Bufu and discussed on the
          7-Jul-11 working group call.</t>
        </list></t>

      <t>-02 <list style="symbols">
          <t>Consistency and cleanup pass, including removing unused
          references.</t>
        </list></t>

      <t>-01 <list style="symbols">
          <t>Initial draft</t>
        </list></t>
    </section>
  </back>
</rfc>
