<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='http://xml.resource.org/authoring/rfc2629.xslt' ?>
<!DOCTYPE rfc PUBLIC "-//IETF//DTD RFC 2629//EN" "http://xml.resource.org/authoring/rfc2629.dtd">
<rfc category="exp" docName="oauth-v2-post-response-types-00">

  <?rfc toc="yes" ?>
  <?rfc tocdepth="4" ?>
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
  <?rfc strict="no" ?>
  <?rfc iprnotified="no" ?>
  <?rfc private="Draft" ?>

  <front>
    <title abbrev="OAuth 2.0 POST Response Types">
      OAuth 2.0 POST Response Types
    </title>

    <author fullname="Brian Campbell" initials="B." surname="Campbell">
      <organization abbrev="Ping Identity">Ping Identity Corp.</organization>

      <address>
        <email>bcampbell@pingidentity.com</email>
      </address>
    </author>


    <date day="13" month="May" year="2013" />

    <workgroup>Ping Identity Research and Development</workgroup>

    <abstract>
      <t>This document defines a form auto-submit POST encoding of responses to OAuth 2.0 Authorization
         Requests (including OpenID Connect requests) as well as several new response types to indicate
         when the POST encoding is to be used.</t>
    </abstract>
  </front>

  <middle>
    <section title='Introduction'>
      <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"/>.

    It would be really surprising if anyone reads this far in the section after
    all of the <xref target="RFC2119"/> words such as "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", etc., I know I never do.</t>

      </section>
    </section>

    <section title="OAuth Response Types">

      <t>Section 3.1.1 of <xref target="RFC6749">OAuth 2.0</xref> defines the <spanx style="verb">code</spanx> and <spanx style="verb">token</spanx>
        response types and section 8.4 defines an extension mechanism that allows for new response types to be defined and used.
        The <xref target="OAuth.Responses">OAuth 2.0 Multiple Response Type Encoding Practices</xref> document utilizes that extension mechanism
        and defines a number of new OAuth response types in support of a variety of use-cases including OpenID Connect SSO.
      </t>

      <t>This document builds on the aforementioned specifications to defines new response types and a new response type encoding using HTTP POST.</t>
    </section>

    <section title="POST Response Type">
      <t>This section defines the following new response type response-name in accordance
        with the ABNF in Section 8.4 of <xref target="RFC6749">OAuth 2.0</xref>.</t>

      <t><list style="hanging">
        <t hangText="x_post">The <spanx style="verb">x_post</spanx> response-name effectively adorns other
          response types or multiple-valued response type combinations and indicates that the client wants the response POSTed to it.
        The <spanx style="verb">x_post</spanx> response-name part SHOULD NOT be used alone but rather in conjunction with
        other established response-name parts to indicate that the response should be POSTed to the client.</t>
      </list></t>

      <t>These response types work by encoding the Access Token Response parameters into HTML
          form controls that are auto-submitted in the user-agent and thus are
          transmitted via the HTTP POST method to the client. The action attribute of the form MUST be the client's redirect URI. The
          method of the form attribute MUST be <spanx style="verb">POST</spanx>.</t>

      <t>Any technique supported by the user agent MAY be used to cause the submission of the form, and any
          form content necessary to support this MAY be included, such as submit controls and client-side scripting
          commands. However, the client MUST be able to process the message without regard for the
          mechanism by which the form submission is initiated.</t>
    </section>

    <section title="Registration of POST Adorned Multiple-Valued Response Type Combinations">
      <t>This section defines and registers combinations of the <spanx style="verb">x_post</spanx> response-name with
        other previously registered response types. Conceptually <spanx style="verb">x_post</spanx> only qualifies
        the response type to indicate that HTTP POST form encoding should be used but the nature of the response type
        extension mechanism mandates that each individual response type be explicitly defined. The following defines
        the subset of all potential combinations, which provide the most utility (in the ever humble opinion of the author anyway).
      </t>

      <t><list style="hanging">
        <t hangText="x_post id_token">When supplied as the value for the <spanx style="verb">response_type</spanx> parameter, a successful
                 response MUST include an ID Token as defined in <xref target="OpenID.Messages">OpenID Connect</xref>. Both successful and error responses SHOULD be form-encoded as described in this document.</t>
        <t hangText="x_post token">When supplied as the value for the <spanx style="verb">response_type</spanx> parameter, a successful
                 response MUST include an Access Token as defined in the OAuth 2.0 specification. Both successful and error responses SHOULD be form-encoded as described in this document.</t>
        <t hangText="x_post code id_token">When supplied as the value for the <spanx style="verb">response_type</spanx> parameter, a successful
                 response MUST include an Authorization Code and an ID Token. Both successful and error responses SHOULD be form-encoded as described in this document.</t>
        <t hangText="x_post id_token token">When supplied as the value for the <spanx style="verb">response_type</spanx> parameter, a successful
                 response MUST include an ID Token and an Access Token. Both successful and error responses SHOULD be form-encoded as described in this document.</t>
      </list></t>
    <t>Below is a non-normative request/response/request example as issued/received/issued by the User-Agent (with extra line breaks for display purposes
       only) demonstrating an auto-submit POST encoded response:</t>
      <t>Authorization Request to the token endpoint at the AS:</t>
            <t>
          <figure>
            <artwork>
<![CDATA[GET /as/authorization.oauth2?response_type=x_post%20id_token
 &client_id=some_client
 &scope=openid
 &redirect_uri=https%3A%2F%2Fclient.example.org%2Fcallback
 &state=DcP7csa3hMlvybERqcieLHrRzKBra
 &nonce=2T1AgaeRTGTMAJyeDMN9IJbgiUG HTTP/1.1
Host: server.example.com]]></artwork></figure>
        </t>
      <t>After authentication and approval by the end-user, the AS issues the Authorization Response:</t>
      <t>
          <figure>
<artwork><![CDATA[HTTP/1.1 200 OK
Content-Type: text/html;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache

<html>
 <head><title>Submit This Form</title></head>
 <body onload="javascript:document.forms[0].submit()">
  <form method="post" action="https://client.example.org/callback">
    <input type="hidden" name="state" value="DcP7csa3hMlvybERqcieLHrRzKBra"/>
    <input type="hidden" name="id_token" value="eyJhbGciOiJSUzI1NiIsImtpZCI6I
     jEifQ.eyJzdWIiOiJqb2huIiwiYXVkIjoiZmZzMiIsImp0aSI6ImhwQUI3RDBNbEo0c2YzVF
     R2cllxUkIiLCJpc3MiOiJodHRwczpcL1wvbG9jYWxob3N0OjkwMzEiLCJpYXQiOjEzNjM5MD
     MxMTMsImV4cCI6MTM2MzkwMzcxMywibm9uY2UiOiIyVDFBZ2FlUlRHVE1BSnllRE1OOUlKYm
     dpVUciLCJhY3IiOiJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YWM6Y2xhc3NlczpQYX
     Nzd29yZCIsImF1dGhfdGltZSI6MTM2MzkwMDg5NH0.c9emvFayy-YJnO0kxUNQqeAoYu7sjl
     yulRSNrru1ySZs2qwqqwwq-Qk7LFd3iGYeUWrfjZkmyXeKKs_OtZ2tI2QQqJpcfrpAuiNuEH
     II-_fkIufbGNT_rfHUcY3tGGKxcvZO9uvgKgX9Vs1v04UaCOUfxRjSVlumE6fWGcqXVEKhtP
     adj1elk3r4zkoNt9vjUQt9NGdm1OvaZ2ONprCErBbXf1eJb4NW_hnrQ5IKXuNsQ1g9ccT5DM
     tZSwgDFwsHMDWMPFGax5Lw6ogjwJ4AQDrhzNCFc0uVAwBBb772-86HpAkGWAKOK-wTC6ErRT
     cESRdNRe0iKb47XRXaoz5acA"/>
  </form>
 </body>
</html>
]]></artwork>
          </figure>
      </t>
    <t>Which results in an HTTP POST to the client:</t>
    <t>
        <figure>
          <artwork>
<![CDATA[POST /callback HTTP/1.1
Host: client.example.org
Content-Type: application/x-www-form-urlencoded

id_token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJzdWIiOiJqb2huIiwiYXVkIjoiZmZzM
iIsImp0aSI6ImhwQUI3RDBNbEo0c2YzVFR2cllxUkIiLCJpc3MiOiJodHRwczpcL1wvbG9jYWxob3
N0OjkwMzEiLCJpYXQiOjEzNjM5MDMxMTMsImV4cCI6MTM2MzkwMzcxMywibm9uY2UiOiIyVDFBZ2F
lUlRHVE1BSnllRE1OOUlKYmdpVUciLCJhY3IiOiJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6
YWM6Y2xhc3NlczpQYXNzd29yZCIsImF1dGhfdGltZSI6MTM2MzkwMDg5NH0.c9emvFayy-YJnO0kx
UNQqeAoYu7sjlyulRSNrru1ySZs2qwqqwwq-Qk7LFd3iGYeUWrfjZkmyXeKKs_OtZ2tI2QQqJpcfr
pAuiNuEHII-_fkIufbGNT_rfHUcY3tGGKxcvZO9uvgKgX9Vs1v04UaCOUfxRjSVlumE6fWGcqXVEK
htPadj1elk3r4zkoNt9vjUQt9NGdm1OvaZ2ONprCErBbXf1eJb4NW_hnrQ5IKXuNsQ1g9ccT5DMtZ
SwgDFwsHMDWMPFGax5Lw6ogjwJ4AQDrhzNCFc0uVAwBBb772-86HpAkGWAKOK-wTC6ErRTcESRdNR
e0iKb47XRXaoz5acA&state=DcP7csa3hMlvybERqcieLHrRzKBra

]]></artwork></figure>
    </t>
  </section>

  <section anchor="IANA" title="IANA Considerations">
    <t>
      This section would register the <spanx style="verb">response_type</spanx>
      values defined by this specification in the IANA
      OAuth Authorization Endpoint Response Types registry
      <xref target="RFC6749" />, if this document is ever considered for standardization.
    </t>

    <section title='Registry Contents'>
      <t> <?rfc subcompact="yes"?>
        <list style='symbols'>
          <t>Response Type Name: <spanx style="verb">x_post id_token</spanx></t>
          <t>Change Controller: [[ me ]]</t>
          <t>Specification Document(s):  [[ this one ]]</t>
        </list>
        <list style='symbols'>
          <t>Response Type Name: <spanx style="verb">x_post token</spanx></t>
          <t>Change Controller: [[ me ]]</t>
          <t>Specification Document(s):  [[ this one ]]</t>
        </list>
        <list style='symbols'>
          <t>Response Type Name: <spanx style="verb">x_post code id_token</spanx></t>
          <t>Change Controller: [[ me ]]</t>
          <t>Specification Document(s):  [[ this one ]]</t>
        </list>
        <list style='symbols'>
          <t>Response Type Name: <spanx style="verb">x_post id_token token</spanx></t>
          <t>Change Controller: [[ me ]]</t>
          <t>Specification Document(s):  [[ this one ]]</t>
        </list>
      </t>
    </section>
    <?rfc subcompact="no"?>

  </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/bibxml/reference.RFC.6749"?>
    <reference anchor="OAuth.Responses">
      <front>
         <title>OAuth 2.0 Multiple Response Type Encoding Practices</title>

         <author fullname="Breno" initials="B." surname="de Medeiros">
           <organization abbrev="Google">Google</organization>
         </author>

         <author fullname="Marius" initials="M." surname="Scurtescu">
           <organization abbrev="Google">Google</organization>
         </author>

         <author fullname="Paul" initials="P." surname="Tarjan">
           <organization abbrev="Facebook"> Facebook</organization>
         </author>

         <date day="19" month="November" year="2012"/>
      </front>
      <format target="http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html" type="HTML" />
    </reference>
    <reference anchor="OpenID.Messages">
      <front>
        <title>OpenID Connect Messages 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="Ping Identity">Ping Identity</organization>
        </author>

        <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
          <organization abbrev="Microsoft">Microsoft</organization>
        </author>

        <author fullname="Breno de Medeiros" initials="B." surname="de Medeiros">
          <organization abbrev="Google">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="Illumila">Illumila</organization>
        </author>

        <date day="30" month="January" year="2013"/>
      </front>

      <format target="http://openid.net/specs/openid-connect-messages-1_0.html" type="HTML" />
    </reference>
  </references>
  <section title="Acknowledgements">
    <t>Folks. Lots of folks. But definitely not Paul Madsen.</t>
  </section>

  <section title="Document History">
    <t>[[ To be removed from the final specification ]]</t>

    <t>-00 <list style="symbols">
        <t>Initial draft</t>
      </list></t>
  </section>
</back>
</rfc>
