<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
   <!ENTITY rfc2119 SYSTEM 'http://xml.resourge.org/public/rfc/bibxml/reference.RFC.2119.xml'>
   <!ENTITY rfc4287 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4287.xml'>
   <!ENTITY rfc4288 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4288.xml'>
   <!ENTITY rfc3864 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3864.xml'>
   <!ENTITY rfc2396 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2396.xml'>
   <!ENTITY rfc2616 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml'>
   <!ENTITY rfc2617 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2617.xml'>
   <!ENTITY rfc2246 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2246.xml'>
   <!ENTITY rfc2818 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2818.xml'>
   <!ENTITY rfc3023 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3023.xml'>
   <!ENTITY rfc3339 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3339.xml'>
   <!ENTITY rfc3629 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3629.xml'>
   <!ENTITY rfc4346 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4346.xml'>
   <!ENTITY rfc3986 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml'>
   <!ENTITY rfc3987 SYSTEM 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3987.xml'>
   <!ENTITY RFC5246 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
   <!ENTITY RFC4301 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4301.xml">
   ]>
   <?rfc toc="yes" ?>
   <?rfc symrefs="yes" ?>
   <?rfc sortrefs="yes"?>
   <?rfc iprnotified="yes" ?>
   <?rfc strict="yes" ?>
   <?rfc compact="no" ?>
   <?rfc comments="yes" ?>
   <?rfc inline="yes" ?>
   <?rfc tocdepth="3" ?>

   <rfc category="std" ipr="trust200902" docName="draft-dehora-farrell-oauth-accesstoken-creds-01.txt">
       <front>
           <title>OAuth Access Tokens using credentials</title>
           <author initials='B.' surname="de hOra" fullname='Bill de hOra' >
             <organization></organization>
               <address>
                   <email>bill@dehora.net</email>
                   <uri>http://dehora.net/</uri>
               </address>
           </author>

           <author initials='S.' surname="Farrell" fullname='Stephen Farrell' >
             <organization>NewBay Software</organization>
               <address>
                   <email>sfarrell@newbay.com</email>
                   <uri>http://www.newbay.com</uri>
               </address>
           </author>

           <date day="09" month="March" year="2009"/>
           <abstract>

               <t>OAuth Access Tokens using credentials is a technique for allowing user agents
               to obtain an OAuth access token on behalf of a user without
               requiring user intervention or HTTP redirection to a
               browser. OAuth itself is documented in the OAuth Core 1.0
               Specification.
               </t>

           </abstract>

           <note title="Editorial Note">
               <t>To provide feedback on this Internet-Draft, email the authors.
               </t>
           </note>
       </front>

       <middle>

           <section title="Introduction">

               <t>
               The <xref target="OAUTH"/> Specification is a protocol that enables
               websites or applications to access protected web resources via an
               API, without requiring users to disclose their credentials. This
               draft defines a technique for allowing a user to provide their
               crendentials in cases where HTTP redirection to a browser is
               unavailable or unsuitable, such as intermediary aggregators and
               mobile or settop devices.
               </t>

           </section>


           <section title="Terminology" anchor="terminology">


               <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>
                 <list style="symbols">

                   <t>Access Token - As defined by <xref target="OAUTH"/>, a value used
                   by the Consumer to gain access to the Protected Resources on
                   behalf of the User, instead of using the User’s Service
                   Provider credentials. </t>

                   <t>Service Provider -As defined by <xref target="OAUTH"/>, a web
                   application that allows access via OAuth. </t>
                   
                   <t>User - As defined by <xref target="OAUTH"/>, an individual who has
                   an account with the Service Provider. </t>
                   
                   <t>Consumer - As defined by <xref target="OAUTH"/>, a website or
                   application that uses OAuth to access the Service Provider on
                   behalf of the User. </t>
                   
                   <t>Protected Resource(s) - As defined by <xref target="OAUTH"/>, data
                   controlled by the Service Provider, which the Consumer can
                   access through authentication .</t>
                   
                   <t>Consumer Key - As defined by <xref target="OAUTH"/>, a value used
                   by the Consumer to identify itself to the Service
                   Provider. </t>
                   
                   <t>Consumer Secret -As defined by <xref target="OAUTH"/>, a secret
                   used by the Consumer to establish ownership of the Consumer
                   Key. </t>
                   
                   <t>Request Token -As defined by <xref target="OAUTH"/>, a value used
                   by the Consumer to obtain authorization from the User, and
                   exchanged for an Access Token. </t>
                   
                   <t> Token Secret - A secret used by the Consumer to establish
                   ownership of a given Token. </t>
                   <t>OAuth Protocol Parameters - Parameters with names
                   beginning with oauth. </t>

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

	   <section title="Applicability">

		<t>This scheme is intended for use where one or both of the
		following situations apply:</t>

		<t>- the User is using a device that cannot play the HTTP
		re-direct game normally played in the "3-legged" OAuth
		model</t>

		<t>- the Consumer is an aggregator that will in any case, be
		presented with the credentials of the end-user</t>

		<t>If neither of the above apply, then this specification SHOULD NOT be used.</t>

		<t>In addition, the security considerations below MUST be
		followed, in particular the requirement that communications
		between the Consumer and Service Provider that contain the
		user's credentials MUST be sent via a confidential and mutually
		authenticated channel. That channel can be provided either via
		mutally-authenticated transport layer security or a virtual
		private network providing equivalent security functionality.
		See the security considerations section below for details.</t>

		<t>Once the Access Token has been acquired by the Consumer, then
		the security requirements of standard OAuth apply.</t>

	   </section>



<section title="Client request to obtain an Access token" anchor="creq">


<section title="Request" anchor="areq">

  <t>
   To request an Access Token in this model, the Consumer makes an HTTP request
   to the Service Provider's Access Token URL. The authentication request
   contains the following parameters:
   </t>
  
   <t>
     <list style="symbols">
       <t>x_auth_username - the login credential of the User the client is obtaining a token on behalf of.</t>
       <t>x_auth_password - the pass credential of the User the client is obtaining a token on behalf of.</t>
       <t>x_auth_mode - this value must "client_auth" (referring to the process described here)</t>
       <t>oauth_consumer_key - as defined by <xref target="OAUTH"/>.</t>
       <t>oauth_signature_method - as defined by <xref target="OAUTH"/>.</t>
       <t>oauth_signature - as defined by <xref target="OAUTH"/></t>
       <t>oauth_timestamp - as defined by <xref target="OAUTH"/></t>
       <t>oauth_nonce - as defined by <xref target="OAUTH"/></t>  
       <t>oauth_version - the client MAY send this parameter. If present, value
       MUST be 1.0 . Service Providers MUST assume the protocol version to be
       1.0 if this parameter is not present. </t>
     </list>
   </t>

  <t>The above parameters are contained in the HTTP Authorisation header or as
  URL parameters. Parameter names and values must be "percent-encoded" to handle
  characters in different character sets. The request SHOULD use HTTP POST.
  </t>   

</section>

<section title="Response" anchor="ares">
  <t>
    To grant an access token, the Service Provider MUST ensure that:
  </t>
  <t>
    <list style="symbols">
      <t>The request signature has been successfully verified as per <xref target="OAUTH"/>.</t>
      <t>A request with the supplied timestamp and nonce has never been received before.</t>
      <t>The supplied username and password match a User's credentials.</t>
    </list>
  </t>

  <t>
    If successful, the Service Provider generates an Access Token and Token
    Secret using a 200 Ok response and returns them in the HTTP response
    body. The response contains the following parameters:
  </t>
  <t>
    <list style="symbols">
      <t> oauth_token - The Access Token. </t>
      <t> oauth_token_secret - The Token Secret. </t>
      <t> x_auth_expires - a timestamp, in seconds since 1970-01-01T00:00, at
      which the Access Token expires, or 0 if no expiry is specified. </t>
      <t> Additional parameters- Any additional parameters, as defined by the
      Service Provider. </t>
    </list>
  </t>


</section>

<section title="Accessing Protected Resources" anchor="apr">
  <t>
    After successfully receiving the Access Token and Token Secret, the Consumer
    is able to access the Protected Resources on behalf of the User as per
    section 7 of <xref target="OAUTH"/>. In other words the Access Token
    obtained here is no different in capability to the Access Token specified by
    <xref target="OAUTH"/>. Once authenticated using the above process, the
    Consumer will sign all subsequent requests for the User's Protected
    Resources using the returned Token Secret.
  </t>
</section>

</section>





    <section title="Security Considerations">
        <t>
            The authentication technique described here is based on HTTP and
            thus subject to the security considerations found in Section 15 of
            <xref target="RFC2616"/>.
        </t>
        <t>
          Sending a user name and password pair is contrary to the idea in <xref
          target="OAUTH"/> that a Consumer will not know the User's
          credentials. However without some way to transmit the credentials,
          there is no way to utilise <xref target="OAUTH"/> in scenarios where
          redirects to the Service Provider cannot be performed dynamically.
        </t>

	<t>
	When acquiring an Access Token via this scheme, the relevant communications
	between the Consumer and Service Provider MUST be strongly protected via a
	mutually authenticated and confidential channel. Such a channel can be provided
	via the use of mutually authenticated Transport Layer Security (TLS) <xref target="RFC5246"/>
	or an equivalent lower layer virtual private network (VPN), for example a 
	tunnel-mode VPN based on IPsec. <xref target="RFC4301"/>
	</t>

	<t>When HTTP is used over TLS, the conventions in <xref target="RFC2818"/>
	MUST be followed.</t>


        <t>
          Service Providers are advised to respond to unauthorized or
          unauthenticated requests using an appropriate 4xx HTTP response code
          (e.g., 401 "Unauthorized" or 403 "Forbidden") in accordance with <xref
          target="RFC2617"/>.
        </t>

    </section>



    <section title="IANA Considerations" anchor="iana">
      <t>No IANA actions are required by this document.</t>
    </section>
    

  </middle>
  <back>


    <references title='Normative References'>

      &rfc2119;
      &rfc2616;
      &rfc2617; 
      &rfc2818; 
      &RFC4301;
      &RFC5246;

<reference anchor="OAUTH" 
           target="http://oauth.net/core/1.0">
           <front>           
               <title>OAuth Core 1.0</title>
               <author initials="M." surname="Atwood" fullname="Mark Atwood">
                   <organization/>
               </author>
               <author initials="R.M." surname="Conlan" fullname="Richard M. Conlan">
                   <organization/>
               </author>
               <author initials="B." surname="Cook" fullname="Blaine Cook">
                   <organization/>
               </author>
               <author initials="K." surname="Elliott-McCrea" fullname="Kellan Elliott-McCrea">
                   <organization/>
               </author>
               <author initials="L." surname="Halff" fullname="Larry Halff">
                   <organization/>
               </author>
               <author initials="E." surname="Hammer-Lahav" fullname="Eran Hammer-Lahav">
                   <organization/>
               </author>
               <author initials="B." surname="Laurie" fullname="Ben Laurie">
                   <organization/>
               </author>
               <author initials="C." surname="Messina" fullname="Chris Messina">
                   <organization/>
               </author>
               <author initials="J." surname="Panzer" fullname="John Panzer">
                   <organization/>
               </author>
               <author initials="S." surname="Quigley" fullname="Sam Quigley">
                   <organization/>
               </author>     
               <author initials="D." surname="Recordon" fullname="David Recordon">
                   <organization/>
               </author>  
               <author initials="E." surname="Sandler" fullname="Eran Sandler">
                   <organization/> 
               </author>
               <author initials="J." surname="Sergent" fullname="Jonathan Sergent">
                   <organization/>
               </author>     
               <author initials="T." surname="Sieling" fullname="Todd Sieling">
                   <organization/>
               </author>  
               <author initials="B." surname="Slesinsky" fullname="Brian Slesinsky">
                   <organization/> 
               </author>               
               <author initials="A." surname="Smith" fullname="Andy Smith">
                   <organization/> 
               </author>                              
               <date month="December" year="2007" />
           </front>     
</reference>

    </references>



           <section title="Revision History">
               <t>version-00: initial draft. </t>
	       <t>version-01: added applicability statement and increased level of security required</t>

            </section>

    </back>
</rfc>






