<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
    <!ENTITY rfc2119 PUBLIC ''
          'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
    <!ENTITY rfc3261 PUBLIC ''
          'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3261.xml'>
    <!ENTITY rfc4975 PUBLIC ''
          'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4975.xml'>
    <!ENTITY draftoauth PUBLIC ''
          'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-hammer-oauth-03.xml'>
]>

<rfc category="std" ipr="trust200902" docName="draft-beck-oauth-sip-eval-00.txt">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>

<front>
    <title abbrev="OAUTH suitability for SIP authentication">
Evaluating OAUTH's suitability for SIP authentication</title>
    <author initials='W.B' surname="Wolfgang" fullname='Wolfgang Beck'>
	<organization>Deutsche Telekom AG</organization>
	<address>
	  <postal>
	    <street>Heinrich-Hertz Str 4-7</street>
	    <city>Darmstadt</city>
	    <code>64295</code>
	    <country>Germany</country>
	  </postal>
	  <phone>+49 6151 628 0</phone>
	  <email>beckw@telekom.de</email>
	</address>
    </author>
    <date/>
    <abstract><t>The Open Authentication Protocol (OAUTH) provides a
    method for clients to access server resources on behalf of another
    party. This document evaluates OAUTH's suitability as an
    authentication mechanism for the Session Initiation Protocol (SIP)
    for use cases where web applications want to interact with SIP
    servers without sharing user credentials.</t></abstract>
</front>

<middle>
  <section title="Requirements notation">
    <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>
  </section>
  <section title="Introduction">

    <t>OAUTH is an authentication delegation protocol, that allows a
    client to access resources on a server on behalf of a resource
    owner. An example would be a printing service -- OAUTH client --
    that wants to access photos on a photo sharing site -- OAUTH
    server -- on behalf of a user -- OAUTH resource owner. The
    resource owner does not need to reveal her credentials to the
    OAUTH client.
    </t>
    <t>In a first phase, the client obtains token credentials from the
    server. Using these token credentials, the client can access
    resources on the server. Currently, this is only defined for HTTP
    requests.
    </t>
    <t><xref target="RFC3261">SIP</xref> offers some resources that
    could be accessed by OAUTH clients as well:
    <list style="symbols">
      <t>The resource owner's identity can be used to make calls,
      change presence states, or send messages from a web
      application.
      </t>
      <t>The presence state of the resource owner's contacts can be
      retrieved, displayed, or used in a web application.
      </t>
    </list>
    The resource protected by OAUTH is the resource owner's SIP
    account and its associated data.  While it would be possible to
    use SIP as a way to obtain temporary OAUTH credentials and to
    authenticate a resource owner, this document focuses on the access
    of SIP resources.
    </t>
    <section title="Architectural Overview">
    <figure anchor="overview">
      <artwork><![CDATA[

       	       	       	       	       	       _OAUTH_
					      /       \

				   +---------+	       +---------+
     +------------+		   |         +--HTTP-->|         |
     |            |<-----HTTP----->| client  |	       |         |
     | resource   |		   |         +--SIP--->| server  |
     | owner      |		   +---------+	       |         |
     |            |<-----HTTP------------------------->|         |
     +------------+                      	       +----+----+
						       	    |
							    | SIP
							    |
							    v

						    other SIP systems



      ]]></artwork>
      <postamble>SIP and OAUTH</postamble>
    </figure>
    <t><xref target="overview" /> shows the intended
    architecture. Triggered by the resource owner, the client acquires
    token credentials from the server. In the course of this, the
    server authenticates the resource owner and asks her for
    authorization of the client's request. Using the token
    credentials, the client then sends a SIP request to the
    server. The server checks the credentials and forwards the SIP
    request.
    </t>
   </section>
   <section title="Use Cases">
     <section title="Establishment of an MSRP session">
       <t>Some web sites implement text chat using asynchronous HTTP
       requests (AJAX). To connect such web sites to SIP environments
       with SIP/MSRP (see <xref target="RFC4975" />) clients, a
       gateway can use OAUTH.
       <list style="numbers">
	 <t>The user logs into a web site and the browser loads the
	 embedded javascript code.
	 </t>
	 <t>The web site's OAUTH client initiates an
	 OAUTH exchange with the user's preferred SIP provider.
	 </t>
	 <t>The web site redirects the user's browser to the
	 authentication web page of the SIP provider's OAUTH server.
	 </t>
	 <t>The user enters her credentials. The OAUTH server
	 redirects her to the web site.
	 </t>
	 <t>The web site translates the text chat-related HTTP
	 requests into SIP and MSRP. It adds OAUTH token credentials
	 to the SIP requests it sends towards the user's preferred SIP
	 provider.
	 </t>
       </list>
       After this, the OAUTH server checks the token credentials for
       validity and checks if the SIP request complies to the policy
       the user has granted for this kind of transaction. If the SIP
       request passes all checks, the OAUTH server forwards it to the
       subsequent SIP nodes.
       </t>
     </section>
     <section title="Gateway for browser-based VoIP applets">
       <t>A number of technologies exist to implement VoIP clients as
       browser applets. To keep applet loading times low, vendors
       don't implement standard SIP, but use stripped-down variants or
       proprietary technology.
       <list style="numbers">
	 <t>The user logs into a web site and the browser loads the
	 embedded VoIP applet.
	 </t>
	 <t>The web site's OAUTH client initiates an
	 OAUTH exchange with the user's preferred SIP provider.
	 </t>
	 <t>The web site redirects the user's browser to the
	 authentication web page of the SIP provider's OAUTH server.
	 </t>
	 <t>The user enters her credentials. The OAUTH server
	 redirects her to the web site.
	 </t>
	 <t>The web site translates the web applets messages into
	 SIP and RTP. It adds OAUTH token credentials to the SIP requests it
	 sends towards the user's preferred SIP provider.
	 </t>
       </list>
       After this, the OAUTH server checks the token credentials for
       validity and checks if the SIP request complies to the policy
       the user has granted for this kind of transaction. If the SIP
       request passes all checks, the OAUTH server forwards it to the
       subsequent SIP nodes.
       </t>
     </section>
   </section>
  </section>
  <section title="Resource Access Policies">
    <t>In HTTP, the access to a resource is basically defined by the
    request method and the request URI. In SIP, the information that
    determines the action that needs to be policed is scattered all
    over the request. 
    </t>
    <t>OAUTH -- like HTTP digest -- only signs the request method and
    request URI. Any OAUTH extension for SIP would have to define how
    to protect the relevant parts of a SIP request. The OAUTH server
    MUST be able to check if a request matches the resource owner's
    authorization.
    </t>
    <section title="Use Cases">
      <section title="SIP MESSAGE" anchor="sip-message">
	<t>In this use case, the resource owner wants to be sure that
	the OAUTH client is only able to send a SIP MESSAGE request, but
	not able to establish calls.</t>
	<t>The OAUTH client redirects the resource owner's browser to
	the OAUTH server's login page. After the resource owner
	successfully logged in, the OAUTH server asks: 'OAUTH client
	xy wants to send a SIP Instant Message Allow? Yes / No'
	</t>
	<t>The OAUTH client receives token credentials that are only
	valid for sending a SIP MESSAGE request</t>
	<t>The OAUTH server checks the SIP request and the token credentials
	it carries. If the request matches the policy associated with the
	token credential, it forwards the request</t>
      </section>
      <section title="MSRP Call">
	<t>In this use case, the resource owner wants to be sure, that
	the OAUTH client will only be able to make an MSRP call</t>
	<t>When the OAUTH client redirects the resource owner's
	browser to the OAUTH server's login page, the OAUTH server
	checks her credentials and asks: 'OAUTH client xy wants to
	establish an MSRP session with sip:xy@example.com. Allow?
	Yes/No'</t>
	<t>The OAUTH client receives token credentials that are only
	valid for an MSRP call to sip:xy@example.com</t>
	<t>The OAUTH server checks the SIP request and the token
	credentials it carries. If the request matches the policy
	associated with the token credential, it forwards the
	request. If the OAUTH client tries to use the token
	credentials for a voice call, it rejects it.</t>
      </section>
    </section>
    <section title="Requirements" anchor="policy-reqs">
      <t>It is desirable to keep SIP extensions as close as possible
      to the original specification.
	<list style="symbols">
	  <t>OAUTH needs to define how to use SIP URIs in OAUTH signatures</t>
	  <t>The OAUTH server needs a signed piece of information in
	  the SIP request that tells what policy the resource owner
	  wants it to apply.</t>
	</list>
	For the use cases in this document, it is sufficient to have
	pre-defined policies between OAUTH client and OAUTH
	server. The policies can be part of the OAUTH server's API
	description. Dynamic negotiation of policies is not required.</t>
    </section>
  </section>
  <section title="Security Considerations">
    <t>With a SIP extension for OAUTH, the OAUTH server MUST be able
    to display to the resource owner what kind of SIP action the OAUTH
    client is intending to do. The OAUTH server MUST be able to check
    whether the SIP request matches the policy associated with the
    token credential it carries.
    </t>
    <t>For general security considerations of OAUTH, see <xref
    target="I-D.hammer-oauth">the OAUTH base document</xref>.
    </t>
  </section>
  <section title="IANA Considerations">
    <t>None.</t>
  </section>
</middle>

<back>
    <references title='Informative References'>
&rfc4975;
&rfc3261;
&rfc2119;
&draftoauth;
</references>
   
</back>

</rfc>
