<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc category="info" docName="draft-erdtman-oauth-rpcc-00" ipr="trust200902">
 <front>
   <title abbrev="draft-erdtman-oauth-rpcc">
     Raw-Public-Key and Pre-Shared-Key as OAuth client credentials
   </title>

   <author fullname="Ludwig Seitz" initials="L." surname="Seitz">
     <organization>RISE SICS</organization>
     <address>
       <postal>
         <street>Scheelevaegen 17</street>
         <code>223 70</code> <city>Lund</city>
         <country>SWEDEN</country>
       </postal>
       <email>ludwig.seitz@ri.se</email>
     </address>
   </author>

   <author fullname="Samuel Erdtman" initials="S." surname="Erdtman">
     <organization>Spotify AB</organization>
     <address>
       <postal>
         <street>Birger Jarlsgatan 61, 4tr</street>
         <code>113 56</code> <city>Stockholm</city>
         <country>Sweden</country>
       </postal>
       <email>erdtman@spotify.com</email>
     </address>
   </author>

   <author fullname="Marco Tiloca" initials="M." surname="Tiloca">
     <organization>RISE SICS AB</organization>
     <address>
       <postal>
         <street>Isafjordsgatan 22</street>
         <code>164 29</code> <city>Stockholm</city>
         <country>Sweden</country>
       </postal>
       <email>marco.tiloca@ri.se</email>
     </address>
   </author>

   <date year="2017" />

   <area>Security</area>

   <workgroup>Web Authorization Protocol</workgroup>

   <keyword>
     OAuth 2.0, Client Credentials, DTLS, TLS, Raw-Public-Key, Pre-Shared-Key
   </keyword>

   <abstract>
     <t>
       This document describes Transport Layer Security (TLS)
       authentication using Raw-Public-Key and Pre-Shared-Key as new mechanisms
       for OAuth client authentication. Although defined for TLS the mechanisms are
       equally applicable for DTLS.
     </t>
   </abstract>
 </front>

 <middle>
   <section title="Introduction">
     <t>
       This document describes Transport Layer Security (TLS)
       authentication using Raw-Public-Key and Pre-Shared-Key as the mechanism
       for OAuth client authentication.  Examples of endpoint requiring client
       authentication are token and introspection.
     </t>
     <t>
       The OAuth 2.0 Authorization Framework <xref target="RFC6749"/> defines a
       shared secret method of client authentication but also allows for the
       definition and use of additional client authentication mechanisms when
       interacting with the authorization server's token endpoint. This document
       describes two additional mechanisms of client authentication utilizing
       Raw-Public-Key <xref target="RFC7250"/> and Pre-Shared-Key TLS
       <xref target="RFC4279"/>, which provide better security characteristics
       than shared secrets.
     </t>

     <section title="Requirements Language">
       <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">RFC 2119</xref>.</t>
     </section>
   </section>

   <section anchor="pskClientAuth" title="Pre-Shared-Key for Client Authentication">
     <t>
       The following section defines, as an extension of
       <xref target="RFC6749">OAuth 2.0, Section 2.3</xref>, using
       Pre-Shared-Key with TLS <xref target="RFC4279"/> to authenticate
       the client.  This method is registered as 'tls_client_psk' in "OAuth
       Token Endpoint Authentication Methods" registry. If this method is
       to be used, the client and the Authorization Server MUST share a secret
       key, and they MUST agree on an identifier for this key.
     </t>
     <t>
       The (D)TLS handshake MUST be done according to <xref target="RFC4279" />,
       with the client indicating support for one or more Pre-Shared-Key cipher
       suites and authorization server selecting a Pre-Shared-Key cipher suite.
       In order to enable authorization server to select the correct
       pre-shared-key the client MUST send the key identifier in the
       psk-identity field of the ClientKeyExchange message. How the
       authorization server maps an identifier to a pre-shared-key, and
       to a client identity is out of scope for this specification.
     </t>
     <t>
       Note that the client identity MUST be 2^16 bytes or shorter, in order
       to fit into the psk-identity field.
     </t>
   </section>

   <section anchor="rpkClientAuth" title="Raw-Public-Key for Client Authentication">
     <t>
       The following section defines, as an extension of
       <xref target="RFC6749">OAuth 2.0, Section 2.3</xref>, the use of
       Raw-Public-Key with (D)TLS <xref target="RFC7250"/> to authenticate
       the client. This method is registered as 'tls_client_rpk' in "OAuth Token
       Endpoint Authentication Methods" registry.
     </t>
     <t>
       The (D)TLS handshake MUST be done according to <xref target="RFC7250"/>,
       with the client indicating support for Raw-Public-Key certificates and
       the authorization server asking client send its Raw Public Key
       certificate.  Since the client cannot send an explicit client identifier
       in the handshake, the authorization server MUST the derive a client
       identifier from RPK that the client uses.
     </t>
     <t>
       Note to implementers: Authorization servers can use the following method
       to map a Raw Public Key to a client identifier: The client identifier is
       generated from the Raw Public Key using the procedure specified in <xref
       target="RFC6920">section 3 of</xref>.  The digest is calculated on the
       Raw Public Key only (not on the SubjectPublicKeyInfo used in the
       handshake).

       An example is shown in <xref target="fig:knightsOfNi"/>.

       <figure align="center" anchor="fig:knightsOfNi"
               title="Example encoding of a raw public key in the Named
                      Information URI Format">
         <artwork align="left"><![CDATA[
         Raw Public Key (Base64 encoded):
         MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEtboxNKPgxEKV9JTNzy
         tUvAbxEfkCTVB9kOzheF5wRAoOz2NKP+ln+XLVAQSp1D6jfo09tppvN
         poQA1nnBNH6A==";

         Encoding:
         ni:///sha-256;xzLa24yOBeCkos3VFzD2gd83Urohr9TsXqY9nhdDN0
         ]]></artwork>
       </figure>
     </t>
   </section>

   <section anchor="Acknowledgements" title="Acknowledgements">
     <t>
       This document is highly inspired by <xref target="I-D.ietf-oauth-mtls"/>
       written by B. Campbell, J. Bradley, N. Sakimura and T. Lodderstedt.
     </t>
   </section>

   <section anchor="IANA" title="IANA Considerations">
     <section anchor="tls_client_authIANA" title="Token Endpoint Authentication Method Registration">
     <t>
       This specification requests registration of the following value
       in the IANA "OAuth Token Endpoint Authentication Methods" registry
       <xref target="IANA.OAuth.Parameters"/> established by <xref target="RFC7591"/>.
     </t>
       <section title="Registry Contents">
         <t>
           <?rfc subcompact="yes"?>
           <list style='symbols'>
             <t>Token Endpoint Authentication Method Name: <spanx style="verb">tls_client_rpk</spanx></t>
             <t>Change Controller: IESG</t>
             <t>Specification Document(s): [[ this specification ]]</t>
           </list>
           <?rfc subcompact="no"?>
         </t>
       </section>
       <section title="Registry Contents">
         <t>
           <?rfc subcompact="yes"?>
           <list style='symbols'>
             <t>Token Endpoint Authentication Method Name: <spanx style="verb">tls_client_psk</spanx></t>
             <t>Change Controller: IESG</t>
             <t>Specification Document(s): [[ this specification ]]</t>
           </list>
           <?rfc subcompact="no"?>
         </t>
       </section>
     </section>
   </section>

   <section anchor="Security" title="Security Considerations">
     <t>TBD</t>
   </section>
 </middle>

 <back>
   <references title="Normative References">
     <?rfc include='reference.RFC.2119'?>
     <?rfc include='reference.RFC.4279'?>
     <?rfc include='reference.RFC.6749'?>
     <?rfc include='reference.RFC.6920'?>
     <?rfc include='reference.RFC.7250'?>
     <?rfc include='reference.RFC.7591'?>
   </references>

   <references title="Informative References">
     <?rfc include='reference.I-D.ietf-oauth-mtls'?>

     <reference anchor="IANA.OAuth.Parameters" target="http://www.iana.org/assignments/oauth-parameters">
       <front>
         <title>OAuth Parameters</title>
         <author>
           <organization>IANA</organization>
         </author>
         <date/>
       </front>
     </reference>
   </references>
 </back>
</rfc>
