<?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="info" docName="openid-artifact-binding-1_0" ipr="trust200902">
  <?rfc toc="yes" ?>

  <?rfc tocdepth="2" ?>

  <?rfc symrefs="yes" ?>

  <?rfc sortrefs="yes"?>

  <?rfc strict="yes" ?>

  <?rfc iprnotified="no" ?>

  <?rfc private="Draft" ?>

  <front>
    <title>OpenID Artifact Binding 1.0 - RC3</title>

    <author fullname="openid-specs-ab@openid.net" initials=""
            surname="openid-specs-ab@openid.net">
      <organization></organization>
    </author>

    <date day="2" month="November" year="2010" />

    <abstract>
      <t>OpenID Authentication 2.0 defines the method to move Authentication
      and associated extension requests among the User, Relying Party, and the
      OpenID provider through HTTP POST or GET, i.e., it defines the POST and
      GET binding for OpenID messaging. This specification defines the
      Artifact Binding that sends the OpenID message directly from the Relying
      Party to the OpenID Provider and passes only a small reference data
      called Artifact through the browser so that large payload can be moved
      between the Relying Party and the OpenID Provider without hitting the
      browser URL and HTTP header size limitation. It also has value that it
      is more secure. In addition, by requiring HTTPS for the direct
      communication, it removed the requirement for symmetric signature on the
      assertion as well as the DIffie-Hellman association that are required in
      OpenID Authentication 2.0 (POST/GET binding) making it dramatically
      simpler to implement. As higher security options, it introduces
      asymmetric signature and a variable to hold public key of the user so
      that it can also be used to send holder-of-key assertion. It also
      optionally encrypts the assertion for end-to-end security which is not
      always granted by SSL. If the relying party desires, it may also request
      other type of assertion.</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" />
      .</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>In addition to the terminology used in <xref
      target="OpenID.authentication-2.0" /> , following terms are used.</t>

      <t>
        <list style="hanging">
          <t hangText="Artifact">An Artifact is a small text associated with
          the larger payload that identifies the payload.</t>

          <t hangText="Base64url">Base 64 Encoding <xref target="RFC3548" />
          with URL and Filename Safe Alphabet without padding</t>

          <t hangText="client identifier">An unique identifier that the client
          to identify itself to the authorization server.</t>

          <t hangText="client secret">A shared secret established between the
          authorization server and client.</t>

          <t hangText="end-user endpoint ">The authorization server's HTTP
          endpoint capable of authenticating the end-user and obtaining
          authorization.</t>

          <t hangText="token endpoint">The authorization server's HTTP
          endpoint capable of issuing tokens.</t>

          <t hangText="OP Endpoints">end-user endpoint and token endpoint.</t>

          <t hangText="RP Endpoints">The endpoint to which the OP responses
          are returned through redirect.</t>

          <t hangText="client registration endpoint">The authorization
          server's HTTP endpoint capable of issuing client identifiers and
          optional client secrets.</t>

          <t hangText="request registration endpoint">The authorization
          server's HTTP endpoint capable of registering the request file and
          return request_uri.</t>

          <t hangText="user info endpoint">A protected resource that when
          presented with a token by the client returns authorized information
          about the current user.</t>

          <t hangText="Compact Serialization">Compact Serialization defined in
          <xref target="json_sig">JSON Simple Sign</xref>.</t>
        </list>
      </t>
    </section>

    <section anchor="overview" title="Protocol Overview">
      <t>
        <list style="numbers">
          <t>The Relying Party (RP) learns the OpenID Provider Endpoints (OP
          Endpoints) either out-of-band or through the discovery process
          defined elsewhere such as <xref
          target="OpenID.authentication-2.0" /> . Exact mechanism for the
          discovery is out of scope of this specification.</t>

          <t>The relying party prepares a file that contains all the request
          parameters and registered at a 'request_uri'. OP may provide the
          service that allows the RP to register the file and obtain a OP
          accessible 'request_uri' for the request. If the RP is not
          registered with the OP by then, the RP may register with the OP and
          obtain 'client_secret'.</t>

          <t>The Relying Party redirects the end user's User-Agent to the
          end-user endpoint with the 'request_uri' to obtain the end-user
          authorization.</t>

          <t>The OP establishes whether the end user is authorized to perform
          OpenID Authentication and wishes to do so. The manner in which the
          end user authenticates to their OP and any policies surrounding such
          authentication is out of scope for this document.</t>

          <t>The OP redirects the end user's User-Agent back to the RP with
          'code' which stands for an Artifact of the Assertion.</t>

          <t>The RP requests the assertion from the token endpoint through
          direct communication (Direct Assertion Request and Response) through
          HTTP POST.</t>

          <t>The Relying Party verifies the information received from the OP.
          If the assertion is signed, the signature MUST be checked first. If
          the verified claimed_id belongs to the OP's domain, the assertion is
          deemed valid. Otherwise, a discovery MUST be performed at the
          'claimed_id' to make sure that the OP really is delegated
          authoritatively.</t>
        </list>
      </t>

      <t>Note that this specification does not use <xref
      target="OpenID.authentication-2.0" /> type signature. The message
      integrity that <xref target="OpenID.authentication-2.0" /> provides are
      provided by the TLS/SSL. Thus, in the most basic case, the assertion
      does not have to be signed at all. On the other hand, the messages MAY
      be signed using the OP's signing key that supports non-repudiation to
      mitigate the assertion-repudiation attack.</t>
    </section>

    <section anchor="parameters" title="Parameters">
      <t>Followings are parameters used in this specification. Most of them
      are specific to a particular profile and optional.</t>

      <t />

      <t>
        <list style="symbols">
          <t>ns <list style="empty">
              <t>Value: "http://openid.net/specs/ab/1.0". Discovery of the
              Artifact Binding service is achieved via the mechanism described
              in <xref target="OpenID.authentication-2.0" />. This namespace
              SHOULD be listed as an &lt;xrd:Type&gt; child element of the
              &lt;xrd:Service&gt; element in the XRDS discovery document.</t>
            </list></t>

          <t>type <list style="empty">
              <t>Value: The URI that expresses the class of the JSON
              message.</t>
            </list></t>

          <t>id <list style="empty">
              <t>Value: Value of type xs:string that identifies the instance
              of the JSON message.</t>
            </list></t>

          <t>mode <list style="empty">
              <t>Signifies the mode of this request / response.</t>

              <t>Value: "direct_assertion_req" / "direct_req" / "id_res" /
              "art_req" / "art_res" / "client_associate" / "req_reg" /
              "req_reg_res"</t>
            </list></t>

          <t>request_uri <list style="empty">
              <t>Value: (OPTIONAL) URL <xref target="RFC3986" /> of the
              Request File. Optionally, one can put the SHA256 <xref
              target="FIPS180-2" />hash of the file after "#". "#" MUST be
              escaped.</t>
            </list></t>

          <t>refresh_uri <list style="empty">
              <t>Value: (OPTIONAL) Array of URL <xref target="RFC3986" /> of
              the Assertion Refresh Endpoint, from which client can obtain the
              refreshed assertion. The presence of this parameter in the
              assertion indicates that the permission was granted by the user
              to refresh the assertion.</t>
            </list></t>

          <t>code <list style="empty">
              <t>Value: A unique short string less than 400 characters, also
              known as "Artifact".</t>
            </list></t>
        </list>
      </t>

      <t>
        <list style="symbols">
          <t>op_endpoint <list style="empty">
              <t>Value: The OP Endpoint URL.</t>
            </list></t>
        </list>
      </t>

      <t>
        <list style="symbols">
          <t>claimed_id <list style="empty">
              <t>Value: An URI that corresponds to the user in question. The
              value in the request is either user supplied identifier or the
              string "http://specs.openid.net/auth/2.0/identifier_select"
              which tells the OP to chose the identifier that belongs to the
              user.</t>

              <t>Type: A String of type xs:AnyURI.</t>
            </list></t>

          <t>identity <list style="empty">
              <t>Value: The OP-Local Identifier, an identifier that
              corresponds to the user's Local Identifier at the OP. If a
              different OP-Local Identifier is not specified, the claimed
              identifier MUST be used as the value for identity. </t>

              <t>Type: xs:String. </t>
            </list></t>

          <t>user_id <list style="empty">
              <t>Value: A locally unique and never reassigned identifier for
              the user. </t>

              <t>Type xs:String. </t>
            </list></t>

          <t>redirect_uri <list style="empty">
              <t>Value: URL to which the OP SHOULD return the User-Agent with
              the response indicating the status of the art_res.</t>

              <t>If this value is not sent in the request it signifies that
              the Relying Party does not wish for the end user to be returned.
              It used to be "return_to" in the OpenID 2.0. "return_to" MUST
              NOT be used.</t>

              <t>Type xs:AnyURI</t>
            </list></t>

          <t>client_id <list style="empty">
              <t>Value: A unique identifier issued to the client to identify
              itself. </t>

              <t>Type: xs:String</t>
            </list></t>

          <t>server_id <list style="empty">
              <t>Value: A unique identifier that identifies the OP. </t>

              <t>Type: xs:String</t>
            </list></t>

          <t>client_secret <list style="empty">
              <t>Value: A token that can be used by the OP to identify and
              authenticate the RP.</t>

              <t>Type: xs:String </t>
            </list></t>

          <t>immediate <list style="empty">
              <t>Value: (OPTIONAL) "true" or "false". If set to "true", the
              authorization server MUST NOT prompt the end-user to process the
              request. If the OP does not support an immediate check or if it
              is unable to establish the end-user's identity or approval
              status, it MUST deny the request without prompting the end-user.
              Defaults to "false" if omitted. It overrides what was expressed
              in the request file.</t>
            </list></t>

          <t>pubkey <list style="empty">
              <t>Value: Base64url encoded DER format X.509 Certificate without
              private key. (<xref target="RFC1421">RFC1421</xref> - <xref
              target="RFC1424">RFC1424</xref>) Format.</t>
            </list></t>

          <t>certs_uri <list style="empty">
              <t>Value: A URL from which one can retrieve PEM format X.509
              certificate. One may add the sha256 hash of the content as a
              fragment to signify if the file has changed.</t>
            </list></t>

          <t>certs_uri_alt <list style="empty">
              <t>Value: Alternative 'certs_uri'. If it is specified, this URL
              SHOULD be checked in the event of certs_uri failing.</t>
            </list></t>

          <t>state <list style="empty">
              <t>Value: (OPTIONAL) An opaque value used by the RP to maintain
              state between the request and callback. The OP includes this
              value when redirecting the user-agent back to the client.</t>
            </list></t>

          <t>code <list style="empty">
              <t>Value: The Artifact value corresponding to the Assertion
              created. The Artifact value MUST include the string constructed
              from a cryptographically strong random or pseudorandom number
              sequence <xref target="RFC1750">RFC1750</xref> generated by the
              OP.</t>
            </list></t>

          <t>atype <list style="empty">
              <t>Value: Type of assertion to be returned at the end. Values
              are one of the following: <list style="symbols">
                  <t>openid2json : (Default) OpenID Artifact Binding's default
                  assertion format, which is JSON.</t>

                  <t>openid2jsonp : openid2json wrapped in "openidjsonp();" so
                  that it will be a JSONP format.</t>

                  <t>openid2json-enc: openid2json assertion encrypted.</t>

                  <t>saml2: SAML ver.2 assertion.</t>

                  <t>wss : WS-Security assertion.</t>
                </list></t>
            </list></t>

          <t>proofkey <list style="empty">
              <t>Value: X.509 public key certificate presented by the user to
              the OP during authentication.</t>
            </list></t>
        </list>
      </t>

      <t>
        <list style="symbols">
          <t>response_type <list style="empty">
              <t>Value: The requested response: an access token, an
              authorization code, or both. The parameter value MUST be set to
              "<spanx style="verb">token</spanx>" for requesting an access
              token, "<spanx style="verb">code</spanx>" for requesting an
              authorization code, or "<spanx
              style="verb">code_and_token</spanx>" to request both. The
              authorization server MAY decline to provide one or more of these
              response types.</t>
            </list></t>

          <t>grant_type <list style="empty">
              <t>Value: The access grant type included in the request. Value
              MUST be one of "authorization_code", "password", "assertion",
              "refresh_token", or "none".</t>
            </list></t>

          <t>access_token <list style="empty">
              <t>Value: The access token issued by the OP. The Authorization
              header field uses the framework defined by <xref
              target="RFC2617">RFC2617</xref></t>
            </list></t>

          <t>access_token_secret <list style="empty">
              <t>Value: The corresponding access token secret as requested by
              the client.</t>
            </list></t>

          <t>issued_at <list style="empty">
              <t>Value: A unix timestamp of when this signature was
              created.</t>
            </list></t>

          <t>expires_in <list style="empty">
              <t>Value: The duration in seconds of the access token
              lifetime.</t>
            </list></t>

          <t>refresh_token <list style="empty">
              <t>Value: The refresh token used to obtain new access tokens
              using the same end user access grant as described in Section
              4.</t>
            </list></t>

          <t>oauth_token <list style="empty">
              <t>Value: The access_token obtained or the Compact Serialization
              of the Assertion obtained, suitably signed.</t>
            </list></t>

          <t>token_type <list style="empty">
              <t>Value: Used in conjunction with oauth_token when oauth_token
              is a Compact Serialization of the Assertion obtained. "openid"
              if it is not signed by the client, and "openid+sig" if it is
              signed by the client. </t>
            </list></t>
        </list>
      </t>
    </section>

    <section title="Data Formats">
      <t />

      <section anchor="oje" title="OpenID JSON Encoding">
        <t>Key-Value form encoding is a special file format defined in defined
        in <xref target="OpenID.authentication-2.0" /> section 4. It is used
        as a direct response in this specification. It SHOULD only contain the
        OpenID parameters. OpenID JSON Encoding is the embodiment of Key-Value
        form encoding parameters in JSON. The parameters are serialized into a
        JSON object as a sequence of name/value pairs. The JSON object is
        represented as the value of the "openid" name.</t>

        <t>Following is a non-normative example. <figure>
            <artwork><![CDATA[{
    "openid": {
        "type": "http://openid.net/specs/ab/1.0#req",
        "mode": "direct_req",
        "redirect_uri": "https://example.com/rp/endpoint_url"
    }
}
]]></artwork>
          </figure></t>
      </section>

      <section anchor="rpf" title="Request File">
        <t>Request File is a UTF-8<xref target="RFC3629" /> <xref
        target="RFC4627">JSON</xref> format file that captures the parameters
        that the RP would like to send to the OP to obtain an artifact.</t>

        <t>Following is the list of OpenID variables are to be sent under the
        key "openid":</t>

        <t><list style="symbols">
            <t>type - "http://openid.net/specs/ab/1.0#req"</t>

            <t>immediate - (OPTIONAL) "True" or "False". Default is
            "False".</t>

            <t>claimed_id - (OPTIONAL) The claimed_id as in <xref
            target="OpenID.authentication-2.0">OpenID 2.0</xref></t>

            <t>identity - (OPTIONAL) The local id as in OpenID 2.0.</t>

            <t>server_id - (OPTIONAL) The intended recipient of this
            request.</t>

            <t>pubkey - (OPTIONAL) The base64url encoded DER format X.509
            certificate of the RP.</t>
          </list>Note that these are to be serialized into JSON and then
        represented as a value of the key "openid".</t>

        <t>Following is the list of variables to be sent as the top level
        keys:</t>

        <t>
          <list style="symbols">
            <t>response_type - value: "code".</t>

            <t>client_id - The client identifier recognized by the
            authorization server.</t>

            <t>redirect_uri - The absolute URI to which the OP asks the
            User-Agent to come back with an artifact ("code").</t>

            <t>scope - value: "openid".</t>

            <t>state - OPTIONAL.</t>
          </list>
        </t>

        <t>Following is a non-normative example.</t>

        <t>
          <figure>
            <artwork><![CDATA[{
  "type": "http://openid.net/specs/ab/1.0#env,
  "openid": {
    "type": "http://openid.net/specs/ab/1.0#req",
    "server_id": "http://example.com/op/",
    "immediate": "true",
    "claimed_id":"http://specs.openid.net/auth/2.0/identifier_select", 
    "identity": "http://specs.openid.net/auth/2.0/identifier_select", 
    "ns.ax": "http://openid.net/srv/ax/1.0",
    "ax.mode": "fetch_request",
    "ax.type.fname": "http://example.com/schema/fullname",
    "ax.type.gender": "http://example.com/schema/gender",
    "ax.required": "fname,gender"
  },
  "redirect_uri": "https://example.com/rp/endpoint_url",
  "response_type":"code",
  "cliend_id": "http://example.com/rp/",
  "scope": "openid",
  "state": "af0ifjsldkj"
}
]]></artwork>
          </figure>
        </t>
      </section>

      <section anchor="pa" title="Positive Assertion">
        <t>Positive Assertion is a set of data that an OP sends out to the RP
        on successful Authentication. The default format is the <xref
        target="oje" /> .</t>

        <t>Following is the list of variables to be included under the key
        "openid".</t>

        <t><list style="symbols">
            <t>type - "http://openid.net/specs/ab/1.0#id_res"</t>

            <t>mode - "id_res"</t>

            <t>op_endpoint - OP Endpoint URL from which this assertion was
            returned.</t>

            <t>cilent_id - The RP's unique identifier.</t>

            <t>server_id - The Server's unique identifier</t>

            <t>claimed_id - The verified identifier of this user.</t>

            <t>identity - The Local ID that this user was verified
            against.</t>

            <t>user_id - (OPTIONAL) A unique HTTPS URI of the currently signed
            in user.</t>

            <t>issued_at - A unix timestamp of when this signature was
            created.</t>

            <t>refresh_uri - An array of the assertion refresh endpoint URLs.
            </t>
          </list>Any other extension and other variables can be included.</t>

        <t>Following is the list of variables to be included at the top
        level.</t>

        <t>
          <list style="symbols">
            <t>access_token - The access token issued by the authorization
            server.</t>

            <t>state - REQUIRED if the state parameter was present in the
            client authorization request. Set to the exact value received from
            the client.</t>
          </list>
        </t>

        <t>Following is a non-normative example.</t>

        <t>
          <figure>
            <artwork><![CDATA[{
  "openid": {
    "type": "http://openid.net/specs/ab/1.0#id_res",
    "mode": "id_res",
    "op_endpoint": "https://op.example.com/op_endpoint",
    "client_id": "http://rp.example.com/",
    "server_id": "http://op.example.com/",
    "claimed_id": "https://example.com/alice#1234",
    "identity": "alice",
    "issued_at": 1274889460,
    "ax.mode": "fetch_response",
    "ax.type.fname": "http://example.com/schema/fullname",
    "ax.fanme.value": "John Doe",
    "ax.type.gender": "http://example.com/schema/gender",
    "ax.gender.value": "M",
    "ax.required": "fname,gender", 
    "refresh_uri":["http://example.com/refresh_uri"]
  },
  "access_token":"SlAV32hkKG",
  "expires_in":3600,
  "refresh_token":"8xLOxBtZp8"
}
]]></artwork>
          </figure>
        </t>
      </section>

      <section anchor="signed_format" title="Signed Format">
        <t>Artifact Binding does not use symmetric signature as it adds no
        value over the mandatory TLS connection to the OP.</t>

        <t>To mitigate assertion repudiation attack, the assertion may be
        digitally signed by the OP using a key that supports non-repudiation
        as in <xref target="json_sig">JSON Simple Sign</xref> where parameters
        are as follows.</t>

        <t>
          <list style="empty">
            <t>"type":"http://openid.net/specs/ab/1.0#signed_format"</t>

            <t>"data_type":"application/json"</t>

            <t>"data":base64url encoded JSON representation of the
            assertion.</t>

            <t>"algorithm":"RSA-SHA256"</t>
          </list>
        </t>

        <t>Following is the non-normative illustration of a signed response.
        (Note: Line wraps in the values are only for the display purpose. New
        lines MUST be escaped in JSON values.)<figure>
            <artwork><![CDATA[{
    "type": "http://openid.net/specs/ab/1.0#signed_format",
    "data_type": "application/json",
    "data": "eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsIjAiOiJwYXlsb2FkIn0",
    "sigs": [
        {
            "signature": "vlXgu64BQGFSQrY0ZcJBZASMvYvTHu9GQ0YM9rjPSso",
            "certs_uri": "https://example.com/mycerts.pem" 
        }
    ]
}
]]></artwork>
          </figure></t>
      </section>

      <section anchor="encrypted_format" title="Encryption">
        <t>In the response, the payload may be encrypted by RP's public key
        for additional security. If it is encrypted, the data is formatted as
        <xref target="json_enc">JSON Encryption Envelope</xref>. The following
        parameter MUST be set as follows:</t>

        <t><list style="symbols">
            <t>data_type -
            "http://openid.net/specs/ab/1.0#openid2json-enc"</t>
          </list>Following is a non-normative example of encrypted
        payload.</t>

        <t>
          <figure>
            <artwork><![CDATA[{
    "type":"http://jsonenc.info/json-encryption/1.0/",
    "data_type":"http://openid.net/specs/ab/1.0#openid2json-enc",
    "enc_data":"b5guwzFgvrIUd7XcXI0bAFrg-....O69VKhY",
    "enc_type_asy":"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p",
    "enc_type":"http://www.w3.org/2001/04/xmlenc#aes256-cbc",
    "enc_key":"mHM2ongmZlPVexe....2lsBNdw",
    "enc_iv":"_b4INfYIRwLPZdxB2L7wJg",
    "enc_ref":"https://rp.example.com/certs.pem",
    "enc_thumbprint":"511e7a9cfe5eda16fa70f553c2dfa3c473e06423"
}
]]></artwork>
          </figure>
        </t>
      </section>
    </section>

    <section title="Communication Types">
      <t>Communication Types are the same as in <xref
      target="OpenID.authentication-2.0" /> section 5 apart from the fact that
      we call "indirect" in the above as "redirect" to avoid confusion in the
      terminology used at NIST SP800-63. In addition to those defined, the
      Artifact Binding uses Direct Communication for sending and receiving
      authentication message. All Direct Communication MUST be over SSL/TLS
      encrypted channel.</t>
    </section>

    <section title="Common Processing">
      <t>There are certain processing that are common to all usage patterns,
      namely, Initiation, Normalization, and Discovery. Steps are as
      follows:</t>

      <t>
        <figure>
          <artwork><![CDATA[User->UA: Click Login 
UA->RP: Login with identifier 
RP->RP: Normalize identifier
RP->OP: Get XRDS 
RP->RP: Find OP Endpoint  ]]></artwork>
        </figure>
      </t>

      <section anchor="initiation" title="Initiation">
        <t>Initiation is done as in <xref
        target="OpenID.authentication-2.0" /></t>

        <t>Following is the non-normative explanation of the process.</t>

        <t>To initiate OpenID Authentication, the Relying Party SHOULD present
        the end user with a form that has a field for entering a User-Supplied
        Identifier.</t>

        <t>The form field's "name" attribute SHOULD have the value
        "openid_identifier", so that User-Agents can automatically determine
        that this is an OpenID form. Browser extensions or other software that
        support OpenID Authentication may not detect a Relying Party's support
        if this attribute is not set appropriately.</t>
      </section>

      <section anchor="normalization" title="Normalization">
        <t>Normalization is done as in <xref
        target="OpenID.authentication-2.0" /> Following is a non-normative,
        simplified explanation of the Normalization process.</t>

        <t>
          <list style="numbers">
            <t>If the user supplied identifier string starts with "xri://",
            strip it.</t>

            <t>If the user supplied identifier string starts with "=", "@",
            "+", "$", "!", or "(", add https://xri.net/ to the string.</t>

            <t>If the user supplied identifier string does not start yet with
            "http://" or "https://", add "http://".</t>

            <t>If the user supplied identifier starts with http:// or https://
            do nothing.</t>
          </list>
        </t>
      </section>

      <section anchor="discovery" title="Discovery">
        <t>Discovery is the process where the Relying Party uses the
        Identifier to look up ("discover") the necessary information for
        initiating requests, especially the OP Endpoint. When OP Endpoint and
        other meta-data is known out of band, discovery is unnecessary.
        Discovery should be performed as in Section 7.3 of <xref
        target="OpenID.authentication-2.0">OpenID Authentication 2.0</xref>
        .</t>

        <t>Optionally, if the RP does not wish to use RSA signature to
        authenticate itself, RP may obtain the secret dynamically in the
        following manner.</t>
      </section>

      <section anchor="association" title="Association">
        <t>In Artifact Binding, the OP endpoint MUST be HTTPS endpoint.
        Therefore, the symmetric signature between the servers that were used
        in <xref target="OpenID.authentication-2.0">OpenID Authentication 2.0
        (POST/GET binding) </xref> is unnecessary. Instead, for the RP
        authentication against the OP, 'client_secret' is used. The
        'client_secret' is either the bearer token assigned by the OP or the
        RSA signature, which will be discussed later.</t>

        <section anchor="bearer_secret"
                 title="Obtaining bearer token 'client_secret'">
          <t>If the RP opted for the bearer token (note: in this mode, there
          will be no possibility of non-repudiation of the request), then RP
          must somehow obtain the secret. This can be achieved in the
          following manner.</t>

          <t>Issue HTTPS "POST" <xref target="RFC2616" />request to the Client
          Regsitration Endpoint with the following REQUIRED parameters:</t>

          <t>
            <list style="symbols">
              <t>type - "push"</t>

              <t>client_name - A human-readable name of the client.</t>

              <t>client_uri - The URL of the homepage of the client.</t>

              <t>client_desc - A text description of the client.</t>

              <t>client_icon - OPTIONAL. A URL for an icon for the client. As
              Most OP will display an AuthN/AuthZ page on HTTPS, the
              client_icon which RP registers should have HTTPS URL.</t>

              <t>redirect_uri - The URL to which the OP should send its
              response.</t>
            </list>
          </t>

          <t>The client MAY include additional metadata in the request and the
          authorization server MAY ignore this additional information.</t>

          <t>
            <figure>
              <preamble>Following is a non-normative example of such
              request.</preamble>

              <artwork><![CDATA[    POST /register HTTP/1.1
    Host: server.example.com
    Content-Type: application/json

    {
      type: "push",
      client_name: "Online Photo Gallery",
      client_uri:  "http://onlinephotogallery.com",
      client_desc: "Not only uploading, but also editing capabilities!",
      client_icon: "http://onlinephotogallery.com/icon.png",
      redirect_uri: "https://onlinephotogallery.com/client_reg"
    }
]]></artwork>

              <postamble />
            </figure>
          </t>

          <t>If the redirect_uri was not pre-registered out-of-band, then he
          server should issue the following response parameters in JSON
          format.</t>

          <t><list style="symbols">
              <t>client_id</t>

              <t>client_secret</t>

              <t>server_id - OPTIONAL. Server's unique identifier.</t>

              <t>issued_at - OPTIONAL. Specifies the timestamp when the
              identifier was issued. The timestamp value MUST be a positive
              integer. The value is expressed in the number of seconds since
              January 1, 1970 00:00:00 GMT.</t>

              <t>expires_in - OPTIONAL; if supplied, the issued_at parameter
              is REQUIRED. Specifies the valid lifetime, in seconds, of the
              identifier. The value is represented in base 10 ASCII.</t>
            </list>The parameters are included in the entity body of the HTTP
          response using the "application/json" media type as defined by <xref
          target="RFC4627">JSON</xref>. The parameters are serialized into a
          JSON structure by adding each parameter at the highest structure
          level. Parameter names and string values are included as JSON
          strings.</t>

          <t>The authorization server MUST include the HTTP Cache-Control
          response header field with a value of no-store in any response
          containing client_secret.</t>

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

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

    {
      client_id: "5UO9XcL4TQTa",
      client_secret: "WdRKN3zeTc20"
    }
]]></artwork>
            </figure>
          </t>

          <t>If the request for registration is invalid or unauthorized, the
          authorization server constructs the response by adding the following
          parameters to the entity body of the HTTP response with a 400 status
          code (Bad Request) using the &ldquo;application/json&rdquo; media
          type:</t>

          <t>
            <list style="symbols">
              <t>error</t>

              <t>description - OPTIONAL.</t>
            </list>

            <figure>
              <preamble>Following is a non-normative example of such response.
              Note that the line wraps are for display purpose
              only.</preamble>

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

    {
    "error": "unauthorized_client",
    "description": "This client is not on the
      white list of this Authorization Server"
    }]]></artwork>
            </figure>
          </t>

          <t />
        </section>

        <section anchor="pubkey_exchange" title="Exchanging the public key">
          <t>If the OP desires evidential quality / non-repudiation
          possibility of the request from the RP through public key
          cryptography, then it MUST use the RSA signature mode or EC-DSA
          signature mode. Unless the OP has the public key by some out-of-band
          mechanism, the RP MUST send its Public Key as described in <xref
          target="json_sig">JSON Simple Sign</xref>.</t>

          <t>If the RP desires evidential quality / non-repudiation
          possibility of the response from the OP thorugh public key
          cryptography, then it MUST use the RSA signature mode or EC-DSA
          signature mode. Unless the RP has the public key of the OP by some
          out-of-band mechanism, the OP MUST send its Public Key as described
          in <xref target="json_sig">JSON Simple Sign</xref>.</t>

          <t />
        </section>
      </section>
    </section>

    <section anchor="protocol_flows" title="Protocol Flows">
      <t>All steps in the following profiles are preceded by the common
      processing. The assertion returned may vary in the following five ways
      depending on the security characteristics that RP wishes to have.</t>

      <t>
        <list style="numbers">
          <t>Plain Text Assertion.</t>

          <t>Signed Assertion.</t>

          <t>Signed and Encrypted Assertion.</t>

          <t>Holder of Key</t>

          <t>Other Assertion Types</t>
        </list>
      </t>

      <section anchor="rf_prep" title="RP prepares an Request File">
        <t>The RP prepares a static file with a globally reachable URL.
        Optionally, it may contain other extension parameters. It MAY be
        signed as in <xref target="signed_format" /></t>
      </section>

      <section anchor="rurl_create"
               title="RP Obtains the URL of the Request File">
        <t>RP then records the Request File either locally or remotely and
        obtains the URL, "request_uri". The URL MUST be accessible from the
        OP.</t>

        <t>Optionally, an OP may provide the Request File registration service
        at the request registration endpoint. This is especially useful for
        the cases such as the RP is behind the firewall or lives on a client
        device that cannot be accessed from the OP.</t>

        <t>When an OP provides the Request File registration service, it
        SHOULD publish the registration endpoint in the XRDS where the
        &lt;Type&gt; is "http://openid.net/specs/ab/1.0#request_regist" or in
        the XRD where "rel" is
        "http://openid.net/specs/ab/1.0#request_regist".</t>

        <t>To register the Request File, the following parameters are sent as
        HTTPS POST request to the request registration endpoint as query
        parameters.</t>

        <t>
          <list style="symbols">
            <t>request - The Base64url encoded JSON request file.</t>

            <t>client_secret - (OPTIONAL) client secret assigned to the
            RP.</t>
          </list>
        </t>

        <t>Following is a non-normative example of such request.</t>

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

request=wfjsil2wjf...awQfs_w&client_secret=very_secure_secret]]></artwork>
          </figure>
        </t>

        <t>If the request is valid, the OP returns the following variables as
        the OpenID JSON in the HTTP response body using the
        &ldquo;application/json&rdquo; media type:</t>

        <t>
          <list style="symbols">
            <t>type - "http://openid.net/specs/ab/1.0#req_req_res"</t>

            <t>request_uri - The request URL that corresponds to the request
            file.</t>
          </list>
        </t>

        <t>It should be noted that if the Request File includes user's
        attribute values, it MUST NOT be revealed to anybody but the OP before
        the user's authentication and authorization. As such, the request_uri
        MUST have larger entropy than the user authentication credential.</t>

        <t>Following is a non-normative example of the response.</t>

        <t>
          <figure>
            <artwork><![CDATA[{
    "type":"http://openid.net/specs/ab/1.0#req_req_res",
    "request_uri":"http://example.com/op/request_uri_wfjdokaosidu"
}
]]></artwork>
          </figure>
        </t>
      </section>

      <section anchor="art_req" title="RP sends a request to OP via redirect">
        <t>When the user wishes to access an RP resource, and the user is not
        yet authorized to do so, the RP sends the user to the OP Endpoint
        through the HTTP 302 redirect with the following parameters. The
        entire URL MUST NOT exceed 512 bytes.</t>

        <t><list style="symbols">
            <t>response_type - "code"</t>

            <t>request_uri - The URL of the Request File.</t>

            <t>immediate - (OPTIONAL) "true" or "false". Used to override what
            was written in the Request File.</t>

            <t>claimed_id - (OPTIONAL) claimed_id MAY be sent as flow
            parameter to override what is written in the Request File.</t>

            <t>state - (OPTIONAL) An opaque value used by the RP to maintain
            state between the request and callback. If provided, the OP MUST
            include this value when redirecting the user-agent back to the RP.
            RPs are strongly advised to use this variable to relate the
            request and response.</t>
          </list>Following is a non-normative example. Note: Line wraps are
        for display purpose only.</t>

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

      <section title="OP fetches the Request File">
        <t>Upon receipt of the Request, the OP SHOULD send a GET request to
        the 'request_uri' to retrieve the content unless it is already cached
        and parse it to recreate the request parameters. </t>
      </section>

      <section anchor="art_res" title="OP Sends the user back to the RP ">
        <t>Once this is done, the OP MUST determine that an authorized end
        user wishes to complete the authentication in the manner described in
        Section 10 of the <xref target="OpenID.authentication-2.0" /> . Once
        it is determined, the OP creates either positive or negative assertion
        and associated artifact and returns the response to the RP Endpoint
        specified in "redirect_uri" URL specified in <xref target="rpf" />
        with following parameters respectively in the follwing cases:</t>

        <section anchor="authz_ok" title="End-user Grants Authorization">
          <t><list style="symbols">
              <t>code - The artifact Value.</t>

              <t>state - Set to the exact value received from the RP.</t>

              <t>server_id - The Server Identifier.</t>
            </list>No other parameter SHOULD be returned. The entire URL MUST
          NOT exceed 512 bytes.</t>

          <t>Following is a non-normative example. Line wraps after the second
          line is for the display purpose only.</t>

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

        <section anchor="authz_error"
                 title="End-user Denies Authorization or Invalid Request FIle">
          <t><list style="symbols">
              <t>error - A single error code as described below.</t>

              <t>request_uri - Set to the exact value received from the
              RP.</t>

              <t>state - Set to the exact value received from the RP.</t>
            </list>No other parameter SHOULD be returned. The entire URL MUST
          NOT exceed 512 bytes.</t>

          <t>Error codes are as follows:</t>

          <t><list style="symbols">
              <t>invalid_request - The request is missing a required
              parameter, includes an unsupported parameter or parameter value,
              or is otherwise malformed.</t>

              <t>invalid_client - The client identifier provided is invalid.
              unauthorized_client The client is not authorized to use the
              requested response type.</t>

              <t>redirect_uri_mismatch - The redirection URI provided does not
              match a pre-registered value.</t>

              <t>access_denied - The end-user or authorization server denied
              the request.</t>

              <t>unsupported_response_type - The requested response type is
              not supported by the authorization server.</t>

              <t>invalid_scope - The requested scope is invalid, unknown, or
              malformed.</t>

              <t>setup_needed - "immediate" request denied so that the user
              interaction was required.</t>
            </list>Following is a non-normative example. Line wraps after the
          second line is for the display purpose only.</t>

          <t>
            <figure>
              <artwork><![CDATA[HTTP/1.1 302 Found
Location: https://openid4.us/rp/rp.php?
&error=setup_needed
&request_uri=https%3A%2F%2Frp.example.com%2Frpf.json]]></artwork>
            </figure>
          </t>
        </section>
      </section>

      <section anchor="id_req"
               title="RP requests Assertion directly to the OP">
        <t>To obtain the assertion, the RP makes a direct request to the Token
        Endpoint. The RP may authenticate against the OP depending on the
        level of assurance desired. There are two ways of authentication,
        namely:</t>

        <t><list style="numbers">
            <t>Through the use of client_secret</t>

            <t>Through the use of asymmetric signature</t>
          </list>Added benefit of using asymmetric signature are as
        follows:</t>

        <t>
          <list style="numbers">
            <t>One can achieve the non-repudiation of the request</t>

            <t>One do not need to have association or dynamic association</t>

            <t>OP does not need to keep the state on each and every RP</t>
          </list>
        </t>

        <t>The asymmetric signature based "client_secret" can be created as
        follows:</t>

        <t>
          <list style="numbers">
            <t>Apply JSON Simple Sign to 'code'. Use Comapct
            Serialization.</t>
          </list>
        </t>

        <section title="Requesting Assertion using the Artifact">
          <t>To obtain the assertion, send the following parameters via HTTPS
          POST to the token endpoint using the
          application/x-www-form-urlencoded format in the HTTP request
          entity-body:</t>

          <t><list style="symbols">
              <t>grant_type - "authorization_code"</t>

              <t>code - The artifact received</t>

              <t>client_id - The client_id of the RP</t>

              <t>client_secret - (OPTIONAL) If the secret_type is "shared",
              send the pre-shared secret. If the secret_type is "jsst", send
              the Web Token serealization of the JSON Simple Sign over the
              'code'.</t>

              <t>secret_type - (OPTIONAL) "shared" or "jsst". Required if
              "client_secret" was used.</t>
            </list>The following is a non-normative example. Line wraps are
          for display purpose only.</t>

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

grant_type=authorization_code
&code=_artifact_received_
&client_id=https%3A%2F%2Frp.example.com%2Frpf.json
&client_secret=1234qwer&secret_type=shared]]></artwork>
            </figure>
          </t>
        </section>
      </section>

      <section anchor="id_res"
               title="RP receives Assertion in the response body">
        <t>Upon receipt of the Direct Assertion Request, OP MUST return either
        Positive or Negative Assertion that corresponds to the received
        Artifact "code".</t>

        <section title="Positive Assertion">
          <t>Positive Assertion can only be returned once for the artifact and
          contains the following variables under the key "openid".</t>

          <t><list style="symbols">
              <t>type - "http://openid.net/specs/ab/1.0#id_res"</t>

              <t>server_id - The identifier of the OP.</t>

              <t>pubkey - OPTIONAL. The OP's X.509 certificate in DER format
              which is base64url encoded.</t>

              <t>client_certs - OPTIONAL. The client's X.509 certificate in
              DER format which is base64url encoded.</t>

              <t>client_certs_uri - OPTIONAL. The URL of the client's X.509
              certificate in PEM format.</t>

              <t>request_uri - The exact request_uri URL that the OP received
              from the RP.</t>

              <t>op_endpoint - The OP Endpoint URL.</t>

              <t>claimed_id - The claimed_id that the OP recognizes as linked
              to the Local ID, "identity".</t>

              <t>identity - The Local ID that was verified by the OP.</t>

              <t>cileint_id - The identifier of the requesting RP that OP
              recognized.</t>

              <t>user_id - A unique persistent HTTPS URI of the currently
              signed in user. e.g. "https://op.example.com/a3flsjeow1234"</t>

              <t>issued_at - A unix timestamp of when this signature was
              created.</t>

              <t>refresh_uri - OPTIONAL. An array of the URLs to which this
              assertion can be sent to obtain the refreshed assertion later.
              </t>
            </list>Any other variables can be added.</t>

          <t>Following variables are returned as the top level variables.</t>

          <t><list style="symbols">
              <t>access_token - The access token issued by the authorization
              server.</t>

              <t>expires_in - OPTIONAL. The duration in seconds of the access
              token lifetime. For example, the value 3600 denotes that the
              access token will expire in one hour from the time the response
              was generated by the authorization server.</t>

              <t>refresh_token - OPTIONAL. The refresh token used to obtain
              new access tokens.</t>
            </list>It MUST be formatted in the JSON or JSONP format depending
          on the atype in the request.</t>

          <t>Following is an example of an assertion.</t>

          <t>
            <figure>
              <artwork><![CDATA[{
    "openid": {
        "type": "http://openid.net/specs/ab/1.0#id_res",
        "server_id": "https://op.example.com/",
        "pubkey": "CSqGSIb3DQEBBQ...22WLTnPvcztaqovGW2gaidAyq6",
        "request_uri": "https://rp.example.com/rf.js%23Qfsoe2F",
        "op_endpoint": "https://op.example.com/op_endpoint",
        "claimed_id": "https://example.com/alice#1234",
        "identity": "alice",
        "user_id": "https://op.example.com/a3flsjeow1234",
        "issued_at": 1280217103,
        "client_id": "https://rp.example.com/",
        "refresh_uri": [
            "https://op.example.com/refr",
            "https://data.example.org/data_api" 
        ] 
    },
    "access_token": "SlAV32hkKG",
    "expires_in": 3600,
    "refresh_token": "8xLOxBtZp8"
}]]></artwork>
            </figure>
          </t>

          <t>There are cases where the assertion is presented to different
          server than the originator. If such use is expected of the
          assertion, the original authorization assertion MUST NOT include the
          value to the user attributes except "claimed_id" and "identity".
          Such assertion MAY be presented to each refresh_uri so that the
          server can return the attributes that it is authoritative to.</t>
        </section>

        <section title="Negative Assertion">
          <t>If the assertion request is invalid or unauthorized, the
          authorization server constructs the response by adding the following
          parameter to the entity body of the HTTP response using the
          "application/json" media type:</t>

          <t><list style="symbols">
              <t>error - REQUIRED. A single error code as described below.</t>

              <t>error_description - OPTIONAL. A human-readable text providing
              additional information, used to assist in the understanding and
              resolution of the error occurred.</t>

              <t>error_uri - OPTIONAL. A URI identifying a human-readable web
              page with information about the error, used to provide the
              end-user with additional information about the error.</t>
            </list>The error code is as follows:</t>

          <t>
            <list style="symbols">
              <t>invalid_request - The request is missing a required
              parameter, includes an unsupported parameter or parameter value,
              repeats a parameter, includes multiple credentials, utilizes
              more than one mechanism for authenticating the client, or is
              otherwise malformed.</t>

              <t>invalid_client - The client identifier provided is invalid,
              the client failed to authenticate, the client did not include
              its credentials, provided multiple client credentials, or used
              unsupported credentials type.</t>

              <t>unauthorized_client - The authenticated client is not
              authorized to use the access grant type provided.</t>

              <t>invalid_grant - The provided access grant is invalid,
              expired, or revoked (e.g. invalid assertion, expired
              authorization token, bad end-user password credentials, or
              mismatching authorization code and redirection URI).</t>

              <t>unsupported_grant_type - The access grant included - its type
              or another attribute - is not supported by the authorization
              server.</t>

              <t>invalid_scope - The requested scope is invalid, unknown,
              malformed, or exceeds the previously granted scope.</t>
            </list>
          </t>

          <t />
        </section>
      </section>

      <section anchor="veri" title="Verifying Assertion">
        <t>Upon receipt of the JSON formatted positive assertion, the RP
        SHOULD parse it to obtain the openid parameters.</t>

        <t>Then, the RP SHOULD perform the verification as follows:</t>

        <t>
          <list style="numbers">
            <t>Check that OP that it connected was really the intended OP
            through TLS/SSL server certificate check.</t>

            <t>Check if "type" is "http://openid.net/specs/ab/1.0#id_res".</t>

            <t>Check if the current time is after "issued_at" and before
            "issued_at" + "expires_in".</t>

            <t>If "claimed_id" was not sent in the request or different than
            what was sent, perform the discovery on the "claimed_id" in the
            assertion.</t>

            <t>Compare "claimed_id", "identity", "op_endpoint" to the
            discovered or "out-of-band known" values.</t>
          </list>
        </t>
      </section>

      <section title="Signed Assertion">
        <t>To mitigate Assertion-repudiation attack, 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>

        <t>In this case, the Assertion will be encoded as described in <xref
        target="signed_format" /> .</t>

        <t>Public key of the OP MUST be included in the assertion as
        'certs_uri' or 'pubkey'.</t>

        <t>If the Assertion is signed, the signature validation MUST be
        performed before other verifications specified in <xref
        target="veri" /></t>
      </section>

      <section anchor="enc_ass" title="Encrypted Assertion">
        <t>Further, the signed assertion MAY optionally be encrypted based on
        the RP's public key of the intended recipient to achieve end-to-end
        encryption and to increase the assurance level of the information
        protection in the assertion through audience restriction. This is
        especially useful when the assertion is passed through a medium where
        the SSL is terminated one or more times, such as an active client.</t>

        <t>To achieve this, in the Request File <xref target="rpf" />, it MUST
        contain "enc_key", "enc_type" in addition.</t>

        <t>The assertion will be returned in the format discribed in
        Encryption <xref target="encrypted_format" /> using the received
        "enc_key" and "enc_type". Encryption SHOULD be the last process before
        the OP returning the assertion.</t>
      </section>

      <section anchor="hok" title="Holder of Key">
        <t>To achieve the highest level of assurance, the assertion MAY
        optionally include "proofkey" as one of the field, which can be
        subsequently used at the RP to further authenticate the user.</t>
      </section>

      <section anchor="oth_atypes" title="Other assertion types">
        <t>When RP wishes to obtain other type of assertion than OpenID, it
        MAY request one by specifying "atype" in the <xref
        target="rpf">Request File</xref> or as a request parameter in an
        Artifact Request.</t>
      </section>
    </section>

    <section title="Requesting Assertion using the Assertion">
      <t>Client may use the assertion obtained to refresh the assertion. To do
      so, the client may send the following parameters via HTTPS POST to the
      refresh_uri using the application/x-www-form-urlencoded format in the
      HTTP request entity-body:</t>

      <t><list style="symbols">
          <t>grant_type - "assertion"</t>

          <t>assertion_type - "http://openid.net/specs/ab/1.0/"</t>

          <t>assertion - Comapct Serialization of the signed assertion
          previously received. For higher security, the client should add its
          signature to the assertion.</t>
        </list>The following is a non-normative example. Line wraps are for
      display purpose only.</t>

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

grant_type=assertion&
assertion_type=http%3A%2F%2Fopenid.net%2Fspecs%2Fab%2F1.0%2F&
assertion=PHNhbWxwOl...[omitted for brevity]...ZT4%3D
]]></artwork>
        </figure>
      </t>

      <t>Upon receipt of the request, the server MUST verify the validity of
      the signatures. Note that the server_id must be itself or the OP that
      the receiving server trust as the user's authorization endpoint. If the
      client added its signature, the server MUST verify that the signature is
      that of the client with "client_id" stated in the assertion.</t>
    </section>

    <section anchor="data_req" title="Accessing the Protected Resource">
      <t>Clients MAY access protected resources by presenting an access token
      to the resource server. </t>

      <t>Access Token MAY be sent as either the access_token received or
      Comapct Serializationn of the signed assertion. If higher security level
      is sought, the client SHOULD add its signature to the assertion so that
      the server can authenticate the client. </t>

      <t>If the Comapct Serialization of the Signed OpenID Assertion is used,
      the following parameter SHOULD be sent with the API request. </t>

      <t>
        <list style="symbols">
          <t>token_type - The value: "openid" or "openid+sig"</t>
        </list>
      </t>

      <t><figure>
          <preamble>Following is a non-normative example of such an API
          access. </preamble>

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

token_type=openid&oauth_token=PHNhbWxwOl...[omitted for brevity]...ZT4%3D]]></artwork>

          <postamble />
        </figure>How the resource is being actually accessed is out-of-scope
      of this specification. However, the resource server MUST verify the
      validity of the access_token before granting access. The verification of
      the access_token when token_type is "openid" or "openid+sig" is
      performed in the following steps. </t>

      <t><list style="symbols">
          <t>If token_type is "openid+sig", verify the client signature. </t>

          <t>Verify the server signature. </t>

          <t>Verify the validity period of the assertion. </t>
        </list>Other application specific verification SHOULD be performed on
      top of it. </t>
    </section>

    <section anchor="extensions" title="Extensions">
      <t>Extensions are as defined in Section 12 of <xref
      target="OpenID.authentication-2.0" /> . In addition, this specification
      adds following list to the disallowed aliases.</t>

      <t>request_uri, refresh_uri, op_endpoint, user_id, redirect_uri,
      client_id, server_id, client_secret, immediate, pubkey, certs_uri,
      state, code, atype, proofkey, enc_data, enc_key, enc_iv, enc_type,
      enc_ref, access_token, access_token_secret, issued_at, expires_in,
      refresh_token.</t>

      <t />
    </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" />.</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 effctive key length of the
        signature if the time required to return the response in case of
        signature error and correct signature exists. 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>

    <section anchor="iana" title="IANA Considerations">
      <section anchor="oauth_params" title="OAuth Parameters Registry">
        <t>The following is the parameter registration request for the "scope"
        parameter as defined in this specification:</t>

        <t>Parameter name: openid</t>

        <t>Parameter usage location: The end-user authorization endpoint
        request, the end-user authorization endpoint response, the token
        endpoint request, the token endpoint response, and the
        "WWW-Authenticate" header field.</t>

        <t>Change controller: IETF</t>

        <t>Specification document(s): [[ this document ]]</t>

        <t>Related information: None</t>
      </section>
    </section>

    <appendix title="Acknowledgements">
      <t>As a binding of OpenID Authentication, this specification heavily
      relies on OpenID Authentication 2.0. Please refer to Appendix C of
      OpenID Authentication 2.0 for the full list of the contributors for
      OpenID Authentication 2.0.</t>

      <t>In addition, 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>Breno de Medeiros (breno@gmail.com)</t>

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

          <t>John Bradley (jbradely@mac.com) &lt;author&gt;</t>

          <t>Nat Sakimura (n-sakimura@nri.co.jp) &lt;author/editor&gt;</t>

          <t>Ryo Itou (ritou@yahoo-corp.jp)</t>
        </list>
      </t>
    </appendix>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.3986"?>

      <?rfc include="reference.RFC.2119"?>

      <?rfc include='reference.RFC.2617'?>

      <?rfc include="reference.RFC.1421"?>

      <?rfc include='reference.RFC.1422'?>

      <?rfc include='reference.RFC.1423'?>

      <?rfc include='reference.RFC.1424'?>

      <?rfc include="reference.RFC.3629"?>

      <?rfc include="reference.RFC.2616"?>

      <?rfc include="reference.RFC.1750"?>

      <?rfc include="reference.RFC.3548"?>

      <?rfc include="reference.RFC.4627"?>

      <reference anchor="OpenID.authentication-2.0">
        <front>
          <title>OpenID Authentication 2.0</title>

          <author fullname="specs@openid.net" initials=""
                  surname="specs@openid.net">
            <organization abbrev="oidf"></organization>
          </author>

          <date year="2007" />
        </front>

        <format target="http://www.openid.net/specs/openid-authentication-2_0.txt"
                type="TXT" />

        <format target="http://www.openid.net/specs/openid-authentication-2_0.html"
                type="HTML" />
      </reference>

      <reference anchor="json_enc">
        <front>
          <title>JSON Simple Encryption</title>

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

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

          <date day="29" month="September" year="2010" />
        </front>

        <format target="http://jsonenc.info/1.0/" type="HTML" />
      </reference>

      <reference anchor="json_sig">
        <front>
          <title>JSON Simple Sign</title>

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

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

          <date day="29" month="September" year="2010" />
        </front>

        <format target="http://jsonenc.info/sig/1.0/" type="HTML" />
      </reference>

      <reference anchor="FIPS180-2">
        <front>
          <title>Secure Hash Signature Standard</title>

          <author>
            <organization>U.S. Department of Commerce</organization>
          </author>

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

        <seriesInfo name="FIPS" value="180-2" />

        <format target="http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf"
                type="PDF" />

        <annotation>Defines Secure Hash Algorithm 256 (SHA256)</annotation>
      </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>
    </references>
  </back>
</rfc>