<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" docName="draft-ietf-ace-oauth-params-16" number="9201" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" category="std" consensus="true" xml:lang="en" tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" version="3">

  <!-- xml2rfc v2v3 conversion 3.9.1 -->
  <front>
<title abbrev="OAuth Parameters for ACE">Additional OAuth Parameters for Authentication and Authorization for Constrained Environments (ACE)</title>
    <seriesInfo name="RFC" value="9201"/>
    <author fullname="Ludwig Seitz" initials="L." surname="Seitz">
      <organization>Combitech</organization>
      <address>
        <postal>
          <street>Djäknegatan 31</street>
          <code>211 35</code>
          <city>Malmö</city>
          <country>Sweden</country>
        </postal>
        <email>ludwig.seitz@combitech.com</email>
      </address>
    </author>
    <date year="2022" month="August"/>
    <area>Security</area>
    <workgroup>ACE</workgroup>

    <keyword>CoAP</keyword>
    <keyword>OAuth 2.0</keyword>
    <keyword>Access Control</keyword>
    <keyword>Authorization</keyword>
    <keyword>Internet of Things</keyword>

    <abstract>
      <t>This specification defines new parameters and encodings for the OAuth
      2.0 token and introspection endpoints when used with the framework for
      Authentication and Authorization for Constrained Environments (ACE).
      These are used to express the proof-of-possession (PoP) key the client
      wishes to use, the PoP key that the authorization server
      has selected, and the PoP key the resource server uses to authenticate
      to the client.</t>
    </abstract>
  </front>
  <middle>
<section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>The Authentication and Authorization for Constrained Environments (ACE)
  specification <xref target="RFC9200" format="default"/> requires some new
  parameters for interactions with the OAuth 2.0 <xref target="RFC6749" format="default"/> token
  and introspection endpoints, as well as some new claims to be used in access
  tokens.  These parameters and claims can also be used in other contexts
  and have therefore been put into a dedicated document to
  facilitate their use in a manner independent of
  <xref target="RFC9200" format="default"/>.</t>
      <t>Note that although all examples are shown in Concise Binary Object
  Representation (CBOR) <xref target="RFC8949" format="default"/>, JSON
  <xref target="RFC8259" format="default"/> <bcp14>MAY</bcp14> be used as an alternative for HTTP-based
  communications, as specified in <xref target="RFC9200" format="default"/>.</t>
    </section>
<section anchor="terminology" numbered="true" toc="default">
      <name>Terminology</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and
"<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP&nbsp;14 <xref target="RFC2119" format="default"/> <xref target="RFC8174" format="default"/> when, and only when, they appear in all capitals, as shown here.</t>
      <t>Readers are assumed to be familiar with the terminology from <xref target="RFC9200" format="default"/>, especially the terminology
  for entities in the architecture such as client (C), resource server (RS),
  and authorization server (AS).</t>
      <t>Terminology from <xref target="RFC8152" format="default"/> is used in the examples,
  especially COSE_Key, which is defined in <xref target="RFC8152" sectionFormat="of" section="7"/>.</t>
      <t>Note that the term "endpoint" is used here following its OAuth 2.0
      <xref target="RFC6749" format="default"/> definition, which is to denote resources
      such as token and introspection at the AS and authz-info at the RS.  The Constrained
      Application Protocol (CoAP) <xref target="RFC7252" format="default"/> definition,
      which is "[a]n entity participating in the CoAP protocol", is not used in this
      specification.</t>
    </section>
<section anchor="tokenEndpoint" numbered="true" toc="default">
      <name>Parameters for the Token Endpoint</name>
      <t>This section defines additional parameters for the interactions with
  the token endpoint in the ACE framework <xref target="RFC9200" format="default"/>.</t>
      <section anchor="tokenRequest" numbered="true" toc="default">
        <name>Client-to-AS Request</name>
        <t>This section defines the <tt>req_cnf</tt> parameter allowing clients to
   request a specific PoP key in an access token from a token
   endpoint in the ACE framework <xref target="RFC9200" format="default"/>:
 
        </t>
        <dl newline="true" spacing="normal">
          <dt>req_cnf</dt>
          <dd>
	<bcp14>OPTIONAL</bcp14>.  This field contains information about the key the
	client would like to bind to the access token for proof of possession.
	It is <bcp14>RECOMMENDED</bcp14> that an AS rejects a request containing a symmetric
	key value in the <tt>req_cnf</tt> field (kty=Symmetric), since the AS is
	expected to be able to generate better symmetric keys than a
	constrained client. (Note: this does not apply to key identifiers
	referencing a symmetric key.) The AS <bcp14>MUST</bcp14> verify that the client
	really is in possession of the corresponding key.  Profiles of
	<xref target="RFC9200" format="default"/> using this specification
	<bcp14>MUST</bcp14>
	define the PoP method used by the AS if they allow
	clients to use this request parameter.  Values of this parameter follow
	the syntax and semantics of the <tt>cnf</tt> claim either from
	<xref target="RFC8747" sectionFormat="of" section="3.1"/> for CBOR-based
	interactions or from
	<xref target="RFC7800" sectionFormat="of" section="3.1"/> for JSON-based
	  interactions.</dd>
        </dl>
        <t><xref target="fig_symmATreq" format="default"/> shows a request for an access
	token using the <tt>req_cnf</tt> parameter to request a specific public key as a
	PoP key.  The content is displayed in CBOR diagnostic
	notation with line breaks for better readability.</t>
        <figure anchor="fig_symmATreq">
          <name>Example Request for an Access Token Bound to an Asymmetric Key</name>
          <sourcecode name="" type="cbor-diag"><![CDATA[
Header: POST (Code=0.02)
Uri-Host: "as.example.com"
Uri-Path: "token"
Content-Format: application/ace+cbor
Payload:
{
   / req_cnf / 4 : {
     / COSE_Key / 1 : {
     / kty /  1 : 2 /EC2/,
     / kid /  2 : h'11',
     / crv / -1 : 1 /P-256/,
     / x /   -2 : h'BAC5B11CAD8F99F9C72B05CF4B9E26D24
                  4DC189F745228255A219A86D6A09EFF',
     / y /   -3 : h'20138BF82DC1B6D562BE0FA54AB7804A3
                  A64B6D72CCFED6B6FB6ED28BBFC117E' 
      }
   }
 }
]]></sourcecode>
        </figure>
      </section>
  <section anchor="tokenResponse" numbered="true" toc="default">
        <name>AS-to-Client Response</name>
        <t>This section defines the following additional parameters for
    an AS response to a request to the token endpoint:

        </t>
        <dl newline="true" spacing="normal">
          <dt>cnf</dt>
          <dd>
	<bcp14>REQUIRED</bcp14> if the token type is "pop" and a symmetric key is used.
	<bcp14>MAY</bcp14> be present for asymmetric PoP keys.  This field
	contains the PoP key that the AS selected for the
	token. 	Values of this parameter follow the syntax and semantics of the
	<tt>cnf</tt> claim either from <xref target="RFC8747" sectionFormat="of" section="3.1"/>
	for
	CBOR-based interactions or from <xref target="RFC7800" sectionFormat="of"
	section="3.1"/>
	for JSON-based interactions.  See <xref target="paramCnf" format="default"/> for
	additional discussion of the usage of this parameter.
          </dd>
          <dt>rs_cnf</dt>
          <dd>
	<bcp14>OPTIONAL</bcp14> if the token type is "pop" and asymmetric keys are used.
	<bcp14>MUST NOT</bcp14> be present otherwise. This field contains information about
	the public key used by the RS to authenticate.  If this	parameter is
	absent, either the RS does not use a public key or the AS knows that
	the RS can authenticate itself to the client without additional
	information.  Values of this parameter follow the syntax and semantics
	of the <tt>cnf</tt> claim either from
	<xref target="RFC8747" sectionFormat="of" section="3.1"/> for CBOR-based
	interactions or from
	<xref target="RFC7800" sectionFormat="of" section="3.1"/> for JSON-based
	interactions.  See
	<xref target="paramCnf" format="default"/> for additional discussion of the usage
	of this	parameter. </dd>
        </dl>
        <t><xref target="fig_symmATres" format="default"/> shows an AS response containing
	a token and a <tt>cnf</tt> parameter with a symmetric PoP key.</t>
        <figure anchor="fig_symmATres">
          <name>Example AS Response with an Access Token Bound to a Symmetric Key</name>
          <sourcecode name="" type="cbor-diag"><![CDATA[
Header: Created (Code=2.01)
Content-Format: application/ace+cbor
Payload:
{
  / access_token / 1 : h'4A5015DF686428/...
   (remainder of CWT omitted for brevity;
   CWT contains COSE_Key in the "cnf" claim)/',
  / cnf / 8 : {
   / COSE_Key / 1 : {
      / kty / 1 : 4 / Symmetric /,
      / kid / 2 : h'DFD1AA97',
      / k /  -1 : h'849B5786457C1491BE3A76DCEA6C427108'
    }
  }
}
]]></sourcecode>
        </figure>
        <t><xref target="fig_asymmATres" format="default"/> shows an AS response containing
	a token bound to a previously requested asymmetric PoP key (not
	shown) and an <tt>rs_cnf</tt> parameter containing the public key of the RS.</t>
        <figure anchor="fig_asymmATres">
          <name>Example AS Response Including the RS's Public Key</name>
          <sourcecode name="" type="cbor-diag"><![CDATA[
Header: Created (Code=2.01)
Content-Format: application/ace+cbor
Payload:
{
  / access_token / 1 : h'D08343A1010AA1054D2A45DF6FBC5A5A/...
   (remainder of CWT omitted for brevity)/',
  / rs_cnf / 41 : {
    / COSE_Key / 1 : {
     / kty /  1 : 2 /EC2/,
     / kid /  2 : h'12',
     / crv / -1 : 1 /P-256/,
      / x /  -2 : h'BCEE7EAAC162F91E6F330F5771211E220
                  B8B546C96589B0AC4AD0FD24C77E1F1',
      / y /  -3 : h'C647B38C55EFBBC4E62E651720F002D5D
                  75B2E0C02CD1326E662BCA222B90416'
    }
  }
}
]]></sourcecode>
        </figure>
      </section>
</section>
<section anchor="introsp" numbered="true" toc="default">
      <name>Parameters for the Introspection Endpoint</name>
      <t>This section defines the use of CBOR instead of JSON for the <tt>cnf</tt>
      introspection response parameter specified in <xref target="RFC8705"
      sectionFormat="of" section="9.4"/>.</t>
      <t>If CBOR is used instead of JSON in an interaction with the introspection
      endpoint, the AS <bcp14>MUST</bcp14> use the parameter mapping specified in <xref
      target="fig_cborParameters" format="default"/> and the value must follow the syntax
      of <tt>cnf</tt> claim values from <xref target="RFC8747" sectionFormat="of"
      section="3.1"/>.</t>
      <t><xref target="fig_introRes" format="default"/> shows an AS response to an introspection
  request including the <tt>cnf</tt> parameter to indicate the PoP key bound to the token.</t>
      <figure anchor="fig_introRes">
        <name>Example Introspection Response</name>
        <sourcecode name="" type="cbor-diag"><![CDATA[
Header: Created (Code=2.01)
Content-Format: application/ace+cbor
Payload:
{
  / active / 10 : true,
  / scope / 9 : "read",
  / aud / 3 : "tempSensor4711",
  / cnf / 8 : {
    / COSE_Key / 1 : {
      / kty /  1 : 2 /EC2/,
      / kid /  2 : h'11',
      / crv / -1 : 1 /P-256/,
      / x /   -2 : h'BAC5B11CAD8F99F9C72B05CF4B9E26D24
                   4DC189F745228255A219A86D6A09EFF',
      / y /   -3 : h'20138BF82DC1B6D562BE0FA54AB7804A3
                   A64B6D72CCFED6B6FB6ED28BBFC117E'
    }
  }
}
]]></sourcecode>
      </figure>
    </section>
<section anchor="paramCnf" numbered="true" toc="default">
      <name>Confirmation Method Parameters</name>
      <t>The confirmation method parameters are used in
  <xref target="RFC9200" format="default"/> as follows:
      </t>
      <ul spacing="normal">
        <li><tt>req_cnf</tt> in the access token request C -&gt; AS, <bcp14>OPTIONAL</bcp14> to
	indicate the  client's raw public key or the key identifier of a previously
	established key between the C and RS that the client wishes to use
	for proof of possession of the access token.</li>
        <li><tt>cnf</tt> in the token response AS -&gt; C, <bcp14>OPTIONAL</bcp14> if using an
	asymmetric key or a key that the client requested via a key identifier
	in the request. <bcp14>REQUIRED</bcp14> if the client didn't specify a <tt>req_cnf</tt> and
	symmetric keys are used.  Used to indicate the symmetric key generated
	by the AS for proof of possession of the access token.</li>
        <li><tt>cnf</tt> in the introspection response AS -&gt; RS, <bcp14>REQUIRED</bcp14> if the
	access token that was subject to introspection is a PoP
	token, absent otherwise.  Indicates the PoP key bound
	to the access token.</li>
        <li><tt>rs_cnf</tt> in the token response AS -&gt; C, <bcp14>OPTIONAL</bcp14> to indicate
	the public key of the RS if it uses one to authenticate itself to the client
	and the binding between the key and RS identity is not established through
	other means.</li>
      </ul>
      <t>Note that the COSE_Key structure in a confirmation claim or parameter
      may contain an <tt>alg</tt> or <tt>key_ops</tt> parameter.  If such parameters are
      present, a client <bcp14>MUST NOT</bcp14> use a key that is incompatible with
      the profile or PoP algorithm according to those
      parameters. An RS <bcp14>MUST</bcp14> reject a proof of possession using such a key
      with a response code equivalent to the CoAP code 4.00 (Bad Request).
      </t>
      <t>If an access token is issued for an audience that includes several RSs,
  the <tt>rs_cnf</tt> parameter <bcp14>MUST NOT</bcp14> be used, since the client cannot
  determine for which RS the key applies.  This document recommends to
  specify a different endpoint that the client can use to acquire RS
  authentication keys in such cases.  The specification of such an endpoint
  is out of scope for this document.</t>
    </section>
    <section anchor="paramsCbor" numbered="true" toc="default">
      <name>CBOR Mappings</name>
      <t>If CBOR is used, the new parameters and claims defined in this document
  <bcp14>MUST</bcp14> be mapped to CBOR types, as specified in <xref target="fig_cborParameters" format="default"/>, using the given integer abbreviation for the
  map key.</t>
      <table anchor="fig_cborParameters" align="left">
        <name>CBOR Mappings for New Parameters and Claims</name>
	<thead>
	  <tr>
	    <th>Name</th>
	    <th>CBOR Key</th>
	    <th>Value Type</th>
	    <th>Usage</th>
	  </tr>
	</thead>
	<tbody>
	  <tr>
	    <td>req_cnf</td>
	    <td>4</td>
	    <td>map</td>
            <td>token request</td>
	  </tr>
	  <tr>
	    <td>cnf</td>
	    <td>8</td>
	    <td>map</td>
            <td>token response</td>
	  </tr>
	  <tr>
	    <td>cnf</td>
	    <td>8</td>
	    <td>map</td>
            <td>introspection response</td>
	  </tr>
	  <tr>
	    <td>rs_cnf</td>
	    <td>41</td>
	    <td>map</td>
            <td>token response</td>
	  </tr>
	</tbody>
      </table>
    </section>
    <section anchor="asymmReq" numbered="true" toc="default">
      <name>Requirements When Using Asymmetric Keys</name>
      <t>An RS using asymmetric keys to authenticate to the client <bcp14>MUST NOT</bcp14>
      hold several different asymmetric key pairs applicable to the same
      authentication algorithm.  For example, when using DTLS, the RS <bcp14>MUST
      NOT</bcp14> hold several asymmetric key pairs applicable to the same cipher suite.
      The reason for this restriction is that the RS has no way of determining
      which key to use before the client's identity is established.  Therefore,
      authentication attempts by the RS could randomly fail based on which key the
      RS selects, unless the algorithm negotiation produces a unique choice of key pair
      for the RS.</t>
    </section>
    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>This document is an extension to <xref target="RFC9200" format="default"/>. All
      security considerations from that document apply here as well.</t>
    </section>
    <section anchor="privacy" numbered="true" toc="default">
      <name>Privacy Considerations</name>
      <t>This document is an extension to <xref target="RFC9200" format="default"/>. All
      privacy considerations from that document apply here as well.</t>
    </section>
    <section anchor="iana" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="IANAOAuthParameter" numbered="true" toc="default">
        <name>OAuth Parameter Registration</name>
        <t>This section registers the following parameters in the "OAuth
	Parameters" registry <xref target="IANA.OAuthParameters" format="default"/>:</t>
        <dl newline="false" spacing="compact">
          <dt>Name:</dt>
	  <dd><tt>req_cnf</tt></dd>
          <dt>Parameter Usage Location:</dt>
	  <dd>token request</dd>
          <dt>Change Controller:</dt>
	  <dd>IETF</dd>
          <dt>Reference:</dt>
	  <dd><xref target="paramCnf" format="default"/> of RFC 9201</dd>
        </dl>
        <dl newline="false" spacing="compact">
          <dt>Name:</dt>
	  <dd><tt>rs_cnf</tt></dd>
          <dt>Parameter Usage Location:</dt>
	  <dd>token response</dd>
          <dt>Change Controller:</dt>
	  <dd>IETF</dd>
          <dt>Reference:</dt>
	  <dd><xref target="paramCnf" format="default"/> of RFC 9201</dd>
        </dl>
        <dl newline="false" spacing="compact">
          <dt>Name:</dt> 
	  <dd><tt>cnf</tt></dd>
          <dt>Parameter Usage Location:</dt>
	  <dd>token response</dd>
          <dt>Change Controller:</dt>
	  <dd>IETF</dd>
          <dt>Reference:</dt>
	  <dd><xref target="paramCnf" format="default"/> of RFC 9201</dd>
        </dl>
      </section>
      <section anchor="IANATokenCBORMappingRegistration" numbered="true" toc="default">
        <name>OAuth Parameters CBOR Mappings Registration</name>
        <t>This section registers the following parameter mappings
	in the "OAuth Parameters CBOR Mappings" registry established in
	<xref target="RFC9200" sectionFormat="of" section="8.10"/>.</t>
        <dl newline="false" spacing="compact">
          <dt>Name:</dt>
	  <dd><tt>req_cnf</tt></dd>
          <dt>CBOR Key:</dt>
	  <dd>4</dd>
	  <dt>Value Type:</dt>
	  <dd>map</dd>
          <dt>Reference:</dt>
	  <dd><xref target="tokenRequest" format="default"/> of RFC 9201</dd>
	  <dt>Original Specification:</dt>
	  <dd>RFC 9201</dd>
        </dl>
        <dl newline="false" spacing="compact">
          <dt>Name:</dt>
	  <dd><tt>cnf</tt></dd>
          <dt>CBOR Key:</dt>
	  <dd>8</dd>
          <dt>Value Type:</dt>
	  <dd>map</dd>
          <dt>Reference:</dt>
	  <dd><xref target="tokenResponse" format="default"/> of RFC 9201</dd>
	  <dt>Original Specification:</dt>
	  <dd>RFC 9201</dd>
        </dl>
        <dl newline="false" spacing="compact">
          <dt>Name:</dt>
	  <dd><tt>rs_cnf</tt></dd>
          <dt>CBOR Key:</dt>
	  <dd>41</dd>
          <dt>Value Type:</dt>
	  <dd>map</dd>
          <dt>Reference:</dt>
	  <dd><xref target="tokenResponse" format="default"/> of RFC 9201</dd>
	  <dt>Original Specification:</dt>
	  <dd>RFC 9201</dd>
        </dl>
      </section>
      <section anchor="IANAIntrospectCBORMappingRegistration" numbered="true" toc="default">
        <name>OAuth Token Introspection Response CBOR Mappings Registration</name>
        <t>This section registers the following parameter mapping
	in the "OAuth Token Introspection Response CBOR Mappings" registry
	established in <xref target="RFC9200" sectionFormat="of" section="8.12"/>.</t>
        <dl newline="false" spacing="compact">
          <dt>Name:</dt>
	  <dd><tt>cnf</tt></dd>
          <dt>CBOR Key:</dt>
	  <dd>8</dd>
          <dt>Value Type:</dt>
	  <dd>map</dd>
          <dt>Reference:</dt>
	  <dd><xref target="introsp" format="default"/> of RFC 9201</dd>
	  <dt>Original Specification:</dt>
	  <dd><xref target="RFC8705" format="default"/></dd>
        </dl>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

<reference anchor='RFC9200' target='https://www.rfc-editor.org/info/rfc9200'>
<front>
<title>Authentication and Authorization for Constrained Environments (ACE) Using the OAuth 2.0 Framework (ACE-OAuth)</title>
<author initials='L' surname='Seitz' fullname='Ludwig Seitz'>
<organization />
</author>
<author initials='G' surname='Selander' fullname='Göran Selander'>
<organization />
</author>
<author initials='E' surname='Wahlstroem' fullname='Erik Wahlstroem'>
<organization />
</author>
<author initials='S' surname='Erdtman' fullname='Samuel Erdtman'>
<organization />
</author>
<author initials='H' surname='Tschofenig' fullname='Hannes Tschofenig'>
<organization />
</author>
<date year='2022' month='August'/>
</front>
<seriesInfo name="RFC" value="9200"/>
<seriesInfo name="DOI" value="10.17487/RFC9200"/>
</reference>


        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6749.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7800.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8152.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8259.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8705.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8747.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8949.xml"/>

        <reference anchor="IANA.OAuthParameters" target="https://www.iana.org/assignments/oauth-parameters">
          <front>
            <title>OAuth Parameters</title>
            <author>
              <organization>IANA</organization>
            </author>
          </front>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7252.xml"/>
      </references>
    </references>
<section anchor="Acknowledgments" numbered="false" toc="default">
      <name>Acknowledgments</name>
      <t>This document is a product of the ACE Working Group of the IETF.
      Special thanks to <contact fullname="Brian Campbell"/> for his thorough review of
      this document.</t>
      <t><contact fullname="Ludwig Seitz"/> worked on this document as part of the
      CelticNext projects CyberWI and CRITISEC with funding from Vinnova.</t>
    </section>
  </back>
</rfc>
