<del> If the request from the client is successful (i.e. correct and authorized), the AS returns an access token and optionally a refresh token (note that only certain grant types support refresh tokens).  It can also return additional parameters, referred to as "Access Information".  In addition to the response parameters defined by OAuth 2.0 and the PoP access token extension, this framework defines parameters that can be used to inform the client about capabilities of the RS, e.g.  the profile the RS supports. More information about these parameters can be found in tokenParams. </del>  the AS.  Established keying material between the AS and the RS allows the AS to apply cryptographic protection to the access token to ensure that its content cannot be modified, and if needed, that the <del> content is confidentiality protected. </del>  The keying material necessary for establishing communication security between C and RS is dynamically established as part of the protocol In constrained environments it cannot be assumed that the client <del> and RS are part of a common key infrastructure.  Therefore the AS provisions credentials or associated information to allow mutual authentication between client and RS.  The resulting security association between client and RS may then also be used to bind these credentials to the access tokens the client uses. </del>  The message can also contain the following OPTIONAL parameters: <del> A "audience" element containing a suggested audience that the client should request at the AS (see audience for a discussion of this parameter). </del>  A "kid" element containing the key identifier of a key used in an existing security association between the client and the RS.  The In the example above, the response parameter "AS" points the receiver of this message to the URI "coaps://as.example.com/token" to request <del> access tokens.  The RS sending this response (i.e., RS) uses an internal clock that is not synchronized with the clock of the AS. Therefore it can not reliably verify the expiration time of access tokens it receives.  To ensure a certain level of access token freshness nevertheless, the RS has included a "cnonce" parameter (see cnonceParam) in the response. </del>  fig:as-info-cbor illustrates the mandatory to use binary encoding of the message payload shown in fig:as-info-payload. If HTTPS is used, JSON or CBOR payloads may be supported.  If JSON payloads are used, the semantics of Sections 4.1.3 and 4.1.4 of the OAuth 2.0 specification MUST be followed (with additions as described <del> below).  If CBOR payload is supported, the semantics described in this section MUST be followed. </del>  For the AS to be able to issue a token, the client MUST be authenticated and present a valid grant for the scopes requested. client and how the communication between client and AS is protected, fulfilling the requirements specified in oauthProfile. <del> The default name of this endpoint in an url-path is '/token', however implementations are not required to use this name and can define their own instead. </del>  The figures of this section use CBOR diagnostic notation without the integer abbreviations for the parameters or their values for

This terminology decision was made in early days of OAuth = long time ago. Done. Done. Changed. I added a note that this confidentiality protection of the access token happens on top of the protection offered by the underlying communication security protocol. Text added. >-- Section 5 -- Text changed. >-- Section 5.1.1 -- >Could the word "unprotected" be better defined in "received on an unprotected channel" ? E.g., is it only about TLS ? Else, I like the implicit lack of trust. Text changed to "unsecured channel" >-- Section 5.1.2 -- I assume you mean "Section 5.3". Text added. >-- Section 5.5 -- >In "Since it requires the use of a user agent (i.e., browser)" is it "i.e." or "e.g." ? I cannot find this text in the document. >-- Section 5.6 -- OK OK. >-- Section 5.6.4.1 -- >In figure 11, would you mind adding the section ID in addition to RFC 6749 ? I failed to spot them in RFC 6749. Done. >-- Section 5.7.2 -- >It is a little unclear to me which profile must be used as 'profile' is optionnial? Should a default or any profile be used ? I cannot find this text. >-- Section 5.8.1 -- >Suggest to use the BCP14 "SHOULD" in the text "The default name of this endpoint in an url-path is '/authz-info'" Changed. >-- Section 10.2 -- >Is RFC 7049 really an informative reference as CBOR appears as the default encoding ? Changed to a normative reference and updated reference. All nits below have been addressed.
Comments addressed in this PR: URL
Merged

<ins> If the request from the client has been successfully verified, authenticated, and authorized, the AS returns an access token and optionally a refresh token.  Note that only certain grant types support refresh tokens.  The AS can also return additional parameters, referred to as "Access Information".  In addition to the response parameters defined by OAuth 2.0 and the PoP access token extension, this framework defines parameters that can be used to inform the client about capabilities of the RS, e.g.  the profile the RS supports.  More information about these parameters can be found in tokenParams. </ins> the AS.  Established keying material between the AS and the RS allows the AS to apply cryptographic protection to the access token to ensure that its content cannot be modified, and if needed, that the  <ins> content is confidentiality protected.  Confidentiality protection of the access token content would be provided on top of confidentiality protection via a communication security protocol. </ins> The keying material necessary for establishing communication security between C and RS is dynamically established as part of the protocol In constrained environments it cannot be assumed that the client  <ins> and the RS are part of a common key infrastructure.  Therefore, the AS provisions credentials and associated information to allow mutual authentication between the client and the RS.  The resulting security association between the client and the RS may then also be used to bind these credentials to the access tokens the client uses. </ins> The message can also contain the following OPTIONAL parameters:  <ins> A "audience" element contains an identifier the client should request at the AS, as suggested by the RS.  With this parameter, when included in the access token request to the AS, the AS is able to restrict the use of access token to specific RSs.  See audience for a discussion of this parameter. </ins> A "kid" element containing the key identifier of a key used in an existing security association between the client and the RS.  The In the example above, the response parameter "AS" points the receiver of this message to the URI "coaps://as.example.com/token" to request  <ins> access tokens.  The RS sending this response uses an internal clock that is not synchronized with the clock of the AS.  Therefore, it can not reliably verify the expiration time of access tokens it receives. To ensure a certain level of access token freshness nevertheless, the RS has included a "cnonce" parameter (see cnonceParam) in the response.  (The hex-sequence of the cnonce parameter is encoded in CBOR-based notation in this example.) </ins> fig:as-info-cbor illustrates the mandatory to use binary encoding of the message payload shown in fig:as-info-payload. If HTTPS is used, JSON or CBOR payloads may be supported.  If JSON payloads are used, the semantics of Sections 4.1.3 and 4.1.4 of the OAuth 2.0 specification MUST be followed (with additions as described  <ins> below).  If the CBOR payload formaat is supported, the semantics described in this section MUST be followed. </ins> For the AS to be able to issue a token, the client MUST be authenticated and present a valid grant for the scopes requested. client and how the communication between client and AS is protected, fulfilling the requirements specified in oauthProfile.  <ins> The default name of this endpoint in an url-path SHOULD be '/token'. However, implementations are not required to use this name and can define their own instead. </ins> The figures of this section use CBOR diagnostic notation without the integer abbreviations for the parameters or their values for


Another building block is the lightweight web transfer protocol CoAP RFC7252 for those communication environments where HTTP is not appropriate.  CoAP typically runs on top of UDP which further reduces <del> overhead and message exchanges.  Transport layer security can be provided either by DTLS 1.2 RFC6347 or TLS 1.2 RFC5246.  Application layer security can be provided by OSCOAP I-D.selander-ace-object- security. </del>  A third building block is CBOR RFC7049 for encodings where JSON RFC7159 is not sufficiently compact.  CBOR is a binary encoding <del> designed for extremely small code size and fairly small message size. OAuth 2.0 allows access tokens to use different encodings and this document defines such an alternative encoding.  The COSE message format I-D.ietf-cose-msg is also based on CBOR. A fourth building block is object security, which is already used in OAuth 2.0 with PoP tokens I-D.ietf-oauth-pop-architecture, but is here extended to so called "Client Tokens" (clientToken).  Also, this specification allows the use of object security instead of transport layer security between any nodes in the architecture.  A preferred compact secure message format is COSE I-D.ietf-cose-msg, which adds object security to CBOR-encoded data.  More details about applying COSE to CoAP can be found in OSCOAP I-D.selander-ace-object-security. </del>  With the building blocks listed above, solutions satisfying various IoT device and network constraints are possible.  A list of <del> The AS resource (in OAuth 2.0 called "endpoint") /token is the resource targeted by a Client requesting an access token for use when accessing a resource on the RS.  The client makes a POST request to /token on the AS and receives the access token in the POST response. </del>  <del> The AS resource /introspect is the resource targeted by an RS when requesting additional information regarding a received access </del>  token.  The RS makes a POST request to /introspect on the AS and <del> receives such information in the POST response.  (See "Introspection" below.) </del>  <del> Access tokens are credentials used to access protected resources. An access token is a data structure representing authorization permissions issued to the client.  Access tokens are generated by the authorization server and consumed by the resource server.  The access token is opaque to the client. </del>  Access tokens can have different formats, and various methods of utilization (e.g., cryptographic properties) based on the security corresponding private key for the proof of possession. The access token is protected against modifications using a MAC or <del> a digital signature of the AS.  The choice of PoP key does not necessarily imply a specific credential type for the integrity protection of the token.  More information about PoP tokens can be found in I-D.ietf-oauth-pop-architecture. </del>  In OAuth 2.0, the client specifies the type of permissions it is seeking to obtain (via the scope parameter) in the access request. <del> In turn, the AS may use the "scope" response parameter to inform the client of the scope of the access token issued.  As the client </del>  could be a constrained device as well, this memo uses CBOR encoded <del> messages defined in oauthProfile to request scopes and to be informed what scopes the access token was actually authorized for by the AS. </del>  The values of the scope parameter are expressed as a list of space- delimited, case-sensitive strings, with a semantic that is <del> The information carried in the access token in the form of type- value pairs is called parameters.  [FIXME: This gives the </del>  impression that "parameter" is only used to describe the attributes in the access token and not in messages in general.] <del> An access token may for example include a parameter about the AS that issued the token (the "iss" parameter) and what audience the access token is intended for (the "aud" parameter).  The audience of an access token can be a specific resource or one or many resource servers.  The resource owner policies influence what parameters are put into the access token by the authorization server. </del>  While the structure and encoding of the access token varies throughout deployments, a standardized format has been defined where the authorization decisions are very dynamic and/or where the received access token itself is a reference rather than a self-contained token.  More information about introspection in <del> OAuth 2.0 can be found in I-D.ietf-oauth-introspection. </del>  3.2. called 'options'. CoAP supports application-layer fragmentation of the CoAP payloads <del> through blockwise transfers I-D.ietf-core-block.  However, this method does not allow the fragmentation of large CoAP options, therefore data encoded in options has to be kept small. </del>  Transport layer security for CoAP can be provided by DTLS 1.2 RFC6347 or TLS 1.2 RFC5246.  CoAP defines a number of proxy operations which proxies, and also to support security for CoAP over different transport in a uniform way, is to provide security on application layer using an object-based security mechanism such as CBOR Encoded <del> Message Syntax (COSE) I-D.ietf-cose-msg. </del>  One application of COSE is OSCOAP I-D.selander-ace-object-security, which provides end-to-end confidentiality, integrity and replay

I went through the overview section and updated the text. The text is already good and only a few minor changes had to be made. I believe we may need to determine (some time in the future) whether it is worthwhile to combine the introduction with the text in the overview section since there is some overlap.
I spotted a few sentences that were missing a word to make sense. I'll go through and try to fix this on Monday, unless someone else manages before me. Otherwise the changes look fine.

Another building block is the lightweight web transfer protocol CoAP RFC7252 for those communication environments where HTTP is not appropriate.  CoAP typically runs on top of UDP which further reduces  <ins> overhead and message exchanges.  While this specification defines extensions for the use of OAuth over CoAP, we do envision further underlying protocols to be supported in the future, such as MQTT or QUIC.  For communication security DTLS 1.2 RFC6347 or TLS 1.2 RFC5246.  Application layer security for CoAP can be provided by OSCOAP I-D.selander-ace-object-security. </ins> A third building block is CBOR RFC7049 for encodings where JSON RFC7159 is not sufficiently compact.  CBOR is a binary encoding  <ins> designed for small code and message size.  OAuth 2.0 allows access tokens to use different encodings and this document defines such an alternative encoding.  To protect these CBOR-encoded access tokens the CBOR encoded message syntax I-D.ietf-cose-msg is re-used. As a fourth building block we use proof-of-possession (PoP) tokens I- D.ietf-oauth-pop-architecture, which is an extension to the OAuth access tokens.  Additionally, those PoP tokens are extended with called "Client Tokens" (see clientToken).  As an additional security enhancement, this specification allows the use of object security instead of transport layer security between any nodes in the architecture.  A preferred compact secure message format is COSE I- D.ietf-cose-msg, which adds object security to CBOR-encoded data. More details about applying COSE to CoAP can be found in OSCOAP I- D.selander-ace-object-security. </ins> With the building blocks listed above, solutions satisfying various IoT device and network constraints are possible.  A list of  <ins> The AS hosts the /token endpoint that allows a client to request access tokens.  The client makes a POST request to the /token endpoint on the AS and receives the access token in the response (if the request was successful). </ins>  <ins> The token introspection endpoint, /introspect, is used by the RS when requesting additional information regarding a received access </ins> token.  The RS makes a POST request to /introspect on the AS and  <ins> receives information about the access token contain in the response.  (See "Introspection" below.) </ins>  <ins> Access tokens are credentials needed to access protected resources.  An access token is a data structure representing authorization permissions issued by the AS to the client.  Access tokens are generated by the authorization server and consumed by the resource server.  The access token content is opaque to the client. </ins> Access tokens can have different formats, and various methods of utilization (e.g., cryptographic properties) based on the security corresponding private key for the proof of possession. The access token is protected against modifications using a MAC or  <ins> a digital signature, which is added by the AS.  The choice of PoP key does not necessarily imply a specific credential type for the integrity protection of the token.  More information about PoP tokens can be found in I-D.ietf-oauth-pop-architecture. </ins> In OAuth 2.0, the client specifies the type of permissions it is seeking to obtain (via the scope parameter) in the access request.  <ins> In turn, the AS may use the scope response parameter to inform the client of the scope of the access token issued.  As the client </ins> could be a constrained device as well, this memo uses CBOR encoded  <ins> messages for CoAP, defined in oauthProfile, to request scopes and to be informed what scopes the access token was actually authorized for by the AS. </ins> The values of the scope parameter are expressed as a list of space- delimited, case-sensitive strings, with a semantic that is  <ins> Information carried in the access token, called claims, is in the form of type-value pairs.  [FIXME: This statement may give the </ins> impression that "parameter" is only used to describe the attributes in the access token and not in messages in general.]  <ins> An access token may, for example, include a claim identifying the AS that issued the token (via the "iss" parameter) and what audience the access token is intended for (via the "aud" parameter).  The audience of an access token can be a specific resource or one or many resource servers.  The resource owner policies influence what claims are put into the access token by the authorization server. </ins> While the structure and encoding of the access token varies throughout deployments, a standardized format has been defined where the authorization decisions are very dynamic and/or where the received access token itself is a reference rather than a self-contained token.  More information about introspection in  <ins> OAuth 2.0 can be found in RFC7662. </ins> 3.2. called 'options'. CoAP supports application-layer fragmentation of the CoAP payloads  <ins> through blockwise transfers I-D.ietf-core-block.  However, block-wise transfer does not increase the size limits of CoAP options, therefore data encoded in options has to be kept small. </ins> Transport layer security for CoAP can be provided by DTLS 1.2 RFC6347 or TLS 1.2 RFC5246.  CoAP defines a number of proxy operations which proxies, and also to support security for CoAP over different transport in a uniform way, is to provide security on application layer using an object-based security mechanism such as CBOR Encoded  <ins> Message Syntax I-D.ietf-cose-msg. </ins> One application of COSE is OSCOAP I-D.selander-ace-object-security, which provides end-to-end confidentiality, integrity and replay


4. The ACE framework is based on the OAuth 2.0 protocol interactions <del> using the /token and /introspect resources.  A client obtains an access token from an AS using /token and presents the token to an RS to gain access to a protected resource.  Alternatively, or additionally, the RS can use an obtained access token with the AS /introspect resource to get information about the state and content of the access token.  These interactions are shown in fig:protocolFlow.  An overview of various OAuth concepts is provided in oauth2Overview. </del>  The consent of the resource owner, for giving a client access to a protected resource, can be pre-configured authorization policies or and the requesting party (= client owner) are not shown in fig:protocolFlow. <del> The ACE framework supports a wide variety of communication security between client, authorization server, and resource server.  We assume that the client has been registered to an AS.  Registration means that the two share credentials, configuration parameters and that some form of authorization has taken place.  These credentials are used to protect the token request by the client and the token response from AS to the client. It is also assumed that the RS has been registered with the AS. Established keying material between the AS and the RS allows the AS to apply cryptographic protection to the access token to ensure that its content cannot be modified, and if needed, that the content is confidentiality protected. </del>  The keying material necessary for establishing communication security between C and RS is dynamically established as part of the protocol At the start of the protocol there is an optional discovery step where the client discovers the resource server and the resources this server hosts.  In this step the client might also determine what <del> permissions are needed to access the protected resource.  The exact procedure SHOULD be defined in the ACE profile and depends on the protocols being used and the specific deployment environment.  In Bluetooth Smart, for example, advertisements are broadcasted by a peripheral, including information about the supported services.  In CoAP, as a second example, a client can makes a request to "/.well- known/core" to obtain information about available resources, which are returned in a standardized format as described in RFC6690. </del>  <del> FIXME: consider include client token in figure </del>  <del> The client makes an access token request to the /token resource at the AS.  This memo assumes the use of PoP tokens (see </del>  oauth2Overview for a short description) wherein the AS binds a key to an access token.  The client may include permissions it seeks to obtain, and information about the credentials it wants to use <del> (e.g. symmetric/asymmetric cryptography or a reference to a </del>  specific credential). If the AS successfully processes the request from the client, it <del> returns an access token.  It also includes various parameters, which we call "Client Information".  In addition to the response parameters defined by OAuth 2.0 and the PoP token extension, we consider new kinds of response parameters in tokenParams, including information on which profile the client should use with the resource server(s) that it has just been authorized to access. Communication security between client and RS may be based on pre- provisioned keys/security contexts or dynamically established. </del>  The RS authenticates the client via the PoP token; and the client authenticates the RS according to the profile that was specified <del> in the Client Information.  FIXME: Could we say that client and RS mutually authenticates using the security protocol of the profile and the keys obtained in access token or client information. </del>  The client interacts with the RS to request access to the protected resource and provides the access token.  The protocol to <del> use between the client and the RS is not restricted to CoAP; HTTP, HTTP/2, Bluetooth Smart etc., are also possible candidates. </del>  Depending on the device limitations and the selected protocol this exchange may be split up into two parts: A resource server may be configured to introspect the access token <del> by including it in a request to the /introspect resource at that </del>  AS.  Token introspection over CoAP is defined in introspectionResource and for HTTP in RFC7662. The AS validates the token and returns the most recent parameters, such as scope, audience, validity etc. associated with it back to the RS.  The RS then uses the received parameters to process the <del> request to either accept or to deny it.  FIXME: Mention client token. </del>  request and returns a response with the appropriate response code. The RS uses the dynamically established keys to protect the response, according to used communication security protocol. <del> FIXME: Mention client token. </del>  5.

I have reviewed the protocol section and have made some minor edits. I believe the section is looking good. There were only two items that I believe are worthwhile to discuss: I prefer to use the term endpoint for the /token and /introspect rather than calling them resource. The term endpoint is used in the terminology section and aligns with OAuth. The client token is mentioned in this section and even after looking at the text later in the document I didn't really understood the concept.
Looks good to me. Does anyone else have a strong opinion on the use of "endpoint" vs "resource"? We might need to put a note into the text somewhere to clarify, since CoAP IMHO uses "endpoint" with a slightly different meaning.

4. The ACE framework is based on the OAuth 2.0 protocol interactions  <ins> using the /token and /introspect endpoints.  A client obtains an access token from an AS using the /token endpoint and subsequently presents the access token to an RS to gain access to a protected resource.  The RS, after receiving an access token, may present it to the AS via the /introspect endpoint to get information about the state and content of the access token.  In other deployments the RS may process the access token locally without the need to contact an AS.  These interactions are shown in fig:protocolFlow.  An overview of various OAuth concepts is provided in oauth2Overview. </ins> The consent of the resource owner, for giving a client access to a protected resource, can be pre-configured authorization policies or and the requesting party (= client owner) are not shown in fig:protocolFlow.  <ins> This framework supports a wide variety of communication security mechanisms between the ACE entities, such as client, authorization server, and resource server.  We assume that the client has been registered (also called enrolled or onboarded) to an AS using a mechanism defined outside the scope of this document.  In practice, various techniques for onboarding have been used, such as factory- based provisioning or the use of commissioning tools.  Regardless of the onboarding technique, this registration procedure implies that the client and the AS share credentials, and configuration parameters.  These credentials are used to mutually authenticate each other and to protect messages exchanged between the client and the AS. It is also assumed that the RS has been registered with the AS, potentially in a similar way as the client has been registered with the AS.  Established keying material between the AS and the RS allows the AS to apply cryptographic protection to the access token to ensure that its content cannot be modified, and if needed, that the content is confidentiality protected. </ins> The keying material necessary for establishing communication security between C and RS is dynamically established as part of the protocol At the start of the protocol there is an optional discovery step where the client discovers the resource server and the resources this server hosts.  In this step the client might also determine what  <ins> permissions are needed to access the protected resource.  The detailed procedures for this discovery process may be defined in an ACE profile and depend on the protocols being used and the specific deployment environment. In Bluetooth Low Energy, for example, advertisements are broadcasted by a peripheral, including information about the primary services. In CoAP, as a second example, a client can makes a request to "/.well-known/core" to obtain information about available resources, which are returned in a standardized format as described in RFC6690. </ins>  <ins> (FIXME: The Client Token is missing in the figure.) </ins>  <ins> The client makes an access token request to the /token endpoint at the AS.  This framework assumes the use of PoP tokens (see </ins> oauth2Overview for a short description) wherein the AS binds a key to an access token.  The client may include permissions it seeks to obtain, and information about the credentials it wants to use  <ins> (e.g., symmetric/asymmetric cryptography or a reference to a </ins> specific credential). If the AS successfully processes the request from the client, it  <ins> returns an access token.  It also returns various parameters, referred as "Client Information".  In addition to the response parameters defined by OAuth 2.0 and the PoP token extension, further response parameters, such as information on which profile the client should use with the resource server(s).  More informatino about these parameters can be found in in tokenParams. </ins> The RS authenticates the client via the PoP token; and the client authenticates the RS according to the profile that was specified  <ins> in the Client Information.  (FIXME: Could we say that client and RS mutually authenticates using the security protocol of the profile and the keys obtained in access token or client information.) </ins> The client interacts with the RS to request access to the protected resource and provides the access token.  The protocol to  <ins> use between the client and the RS is not restricted to CoAP. HTTP, HTTP/2, QUIC, MQTT, Bluetooth Low Energy, etc., are also viable candidates. </ins> Depending on the device limitations and the selected protocol this exchange may be split up into two parts: A resource server may be configured to introspect the access token  <ins> by including it in a request to the /introspect endpoint at that </ins> AS.  Token introspection over CoAP is defined in introspectionResource and for HTTP in RFC7662. The AS validates the token and returns the most recent parameters, such as scope, audience, validity etc. associated with it back to the RS.  The RS then uses the received parameters to process the  <ins> request to either accept or to deny it.  (FIXME: Mention client token.) </ins> request and returns a response with the appropriate response code. The RS uses the dynamically established keys to protect the response, according to used communication security protocol.  <ins> (FIXME: Mention client token.) </ins> 5.


resource server.  In order to provide communication security, proof of possession, and server authentication they use Object Security for Constrained RESTful Environments (OSCORE) I-D.ietf-core-object- <del> security.  Optionally the client and the resource server may also use CoAP and OSCORE to communicate with the authorization server. </del>  OSCORE specifies how to use CBOR Object Signing and Encryption (COSE) <del> RFC8152 to secure CoAP messages.  In order to provide replay and reordering protection OSCORE also introduces sequence numbers that are used together with COSE. Note that OSCORE can be used to secure CoAP messages, as well as HTTP and combinations of HTTP and CoAP; a profile of ACE similar to the one described in this document, with the difference of using HTTP instead of CoAP as communication protocol, could be specified analogously to this one. </del>  1.1. "authorization", "confidentiality", "(data) integrity", "message authentication code", and "verify" are taken from RFC4949. <del> Since we describe exchanges as RESTful protocol interactions HTTP RFC7231 offers useful terminology. </del>  Terminology for entities in the architecture is defined in OAuth 2.0 <del> RFC6749 and I-D.ietf-ace-actors, such as client (C), resource server (RS), and authorization server (AS).  It is assumed in this document that a given resource on a specific RS is associated to a unique AS. </del>  2. <del> The use of OSCORE for arbitrary CoAP messages is specified in I- D.ietf-core-object-security.  This section defines the specific uses and their purpose for securing the communication between a client and a resource server, and the parameters needed to negotiate the use of this profile with the token resource at the authorization server as specified in section 5.6 of I-D.ietf-ace-oauth-authz. </del>  <del> 2.1. </del>  <del> A client requests a token at an AS via the /token resource.  This follows the message formats specified in section 5.6.1 of I-D.ietf- </del>  ace-oauth-authz. <del> The AS responding to a successful access token request as defined in section 5.6.2 of I-D.ietf-ace-oauth-authz can signal that the use of OSCORE is REQUIRED for a specific access token by including the "profile" parameter with the value "coap_oscore" in the access token response.  This means that the client MUST use OSCORE towards all resource servers for which this access token is valid, and follow oscore-only to derive the security context to run OSCORE. </del>  The error response procedures defined in section 5.6.3 of the ACE framework are unchanged by this profile. <del> Note the the client and the authorization server MAY OPTIONALLY use OSCORE to protect the interaction via the /token resource.  See c-as for details. 2.2. Section 3.2 of I-D.ietf-core-object-security defines how to derive a security context based on a shared master secret and a set of other parameters, established between client and server.  The proof-of- possession key (pop-key) provisioned from the AS MAY, in case of pre- shared keys, be used directly as master secret in OSCORE. If OSCORE is used directly with the symmetric pop-key as master secret, then the AS MUST provision the following data, in response to the access token request: </del>  a master secret <del> the sender identifier </del>  <del> the recipient identifier </del>  Additionally, the AS MAY provision the following data, in the same <del> response.  In case these parameters are omitted, the default values are used as described in section 3.2 of I-D.ietf-core-object- security. </del>  an AEAD algorithm <del> a KDF algorithm </del>  a salt The master secret MUST be communicated as COSE_Key in the 'cnf' parameter of the access token response as defined in Section 5.6.4.5 of I-D.ietf-ace-oauth-authz.  The AEAD algorithm MAY be included as <del> the 'alg' parameter in the COSE_Key; the KDF algorithm MAY be included as the 'kdf' parameter of the COSE_Key and the salt MAY be included as the 'slt' parameter of the COSE_Key as defined in table 1. </del>  <del> The same parameters MUST be included as metadata of the access token; if the token is a CWT RFC8392, the same COSE_Key structure MUST be placed in the 'cnf' claim of this token.  If a CWT is used it MUST be encrypted, since the token is transferred from the client to the RS over an unprotected channel. </del>  The AS MUST also assign identifiers to both client and RS, which are then used as Sender ID and Recipient ID in the OSCORE context as described in section 3.1 of I-D.ietf-core-object-security.  These identifiers MUST be unique in the set of all clients and RS identifiers for a certain AS.  Moreover, these MUST be included in <del> the COSE_Key as header parameters, as defined in table 1. </del>  We assume in this document that a resource is associated to one single AS, which makes it possible to assume unique identifiers for case the RS needs to have a mechanism in place to disambiguate identifiers or mitigate their effect. <del> Note that C should set the Sender ID of its security context to the </del>  clientId value received and the Recipient ID to the serverId value, and RS should do the opposite. <del> Figure 1 shows an example of such an AS response, in CBOR diagnostic </del>  notation without the tag and value abbreviations. <del> Figure 2 shows an example CWT, containing the necessary OSCORE parameters in the 'cnf' claim, in CBOR diagnostic notation without tag and value abbreviations. Note that the proof-of-possession required to bind the access token to the client is implicitly performed by generating the shared OSCORE context using the pop-key as master secret, both on the client and RS side.  An attacker using a stolen token will not be able to generate a valid OSCORE context and thus not be able to prove possession of the pop-key. </del>  <del> 3. </del>  <del> As specified in the ACE framework (section 5.6 of I-D.ietf-ace-oauth- authz), the Client and AS can also use CoAP instead of HTTP to communicate via the token resource.  This section specifies how to use OSCORE between Client and AS together with CoAP.  The use of OSCORE for this communication is OPTIONAL in this profile, other security protocols (such as DTLS) MAY be used instead. </del>  <del> The client and the AS are expected to have pre-established security contexts in place.  How these security contexts are established is out of scope for this profile.  Furthermore the client and the AS communicate using OSCORE (I-D.ietf-core-object-security) through the introspection resource as specified in section 5.7 of I-D.ietf-ace- oauth-authz. </del>  4. <del> As specified in the ACE framework (section 5.7 of I-D.ietf-ace-oauth- authz), the RS and AS can also use CoAP instead of HTTP to communicate via the introspection resource.  This section specifies how to use OSCORE between RS and AS.  The use of OSCORE for this communication is OPTIONAL in this profile, other security protocols (such as DTLS) MAY be used instead. The RS and the AS are expected to have pre-established security contexts in place.  How these security contexts are established is out of scope for this profile.  Furthermore the RS and the AS communicate using OSCORE (I-D.ietf-core-object-security) through the introspection resource as specified in section 5.7 of I-D.ietf-ace- oauth-authz. </del>  5.  This document specifies a profile for the Authentication and Authorization for Constrained Environments (ACE) framework I-D.ietf- ace-oauth-authz.  Thus the general security considerations from the expected use of OSCORE, to prevent weakening the security assurances provided by OSCORE. <del> 6. </del>  TBD. <del> 7. </del>  Note to RFC Editor: Please replace all occurrences of "[[this specification]]" with the RFC number of this specification and delete Description: Identifies the server in an OSCORE context Reference: [[this specification]] <del> Name: kdf </del>  Label: TBD3 (value between 1 and 255) Value Type: bstr Value Registry: COSE Algorithms registry

restructuring for readability adding a section for protocol overview adding examples for each message adding details about updating clients rights (request new token with only scope different) where before there were ref to the framework, explicitly state all the normative text add mechanism during OSCORE Setup for making sure the context is not reused on the server if token is re-posted after it has been lost/removed (nonces) added section about access rights verification between OSCORE layer and CoAP (handling of the resource) layer

resource server.  In order to provide communication security, proof of possession, and server authentication they use Object Security for Constrained RESTful Environments (OSCORE) I-D.ietf-core-object-  <ins> security. </ins> OSCORE specifies how to use CBOR Object Signing and Encryption (COSE)  <ins> RFC8152 to secure CoAP messages.  Note that OSCORE can be used to secure CoAP messages, as well as HTTP and combinations of HTTP and CoAP; a profile of ACE similar to the one described in this document, with the difference of using HTTP instead of CoAP as communication protocol, could be specified analogously to this one. </ins> 1.1. "authorization", "confidentiality", "(data) integrity", "message authentication code", and "verify" are taken from RFC4949.  <ins> RESTful terminology follows HTTP RFC7231. </ins> Terminology for entities in the architecture is defined in OAuth 2.0  <ins> RFC6749, such as client (C), resource server (RS), and authorization server (AS).  It is assumed in this document that a given resource on a specific RS is associated to a unique AS. </ins> 2.  <ins> This section gives an overview on how to use the ACE Framework I- D.ietf-ace-oauth-authz to secure the communication between a client and a resource server using OSCORE I-D.ietf-core-object-security. The parameters needed to negotiate the use of this profile with the token resource at the authorization server as specified in section 5.6 of I-D.ietf-ace-oauth-authz are described in detail in the following sections. This profile requires a client to retrieve an access token from the AS for the resource it wants to access on a RS, using the token endpoint, as specified in section 5.6.1 of I-D.ietf-ace-oauth-authz. To determine the AS in charge of a resource hosted at the RS, the client C MAY send an initial Unauthorized Resource Request message to the RS.  The RS then denies the request and sends the address of its AS back to the client C as specified in section 5.1 of I-D.ietf-ace- oauth-authz.  The access token request and response MUST be confidentiality-protected and ensure authenticity.  This profile RECOMMENDS the use of OSCORE between client and AS, but TLS or DTLS MAY be used additionally or instead. Once the client has retrieved the access token, it forwards it to the RS using the authz-info endpoint and mechanisms specified in section 5.8.1. of I-D.ietf-ace-oauth-authz.  If the access token is valid, the RS replies to this request with a 2.01 (Created) response, which contains a nonce N1. After receiving the nonce N1, the client generates a nonce N2, concatenates it with N1 and sets the ID Context in its Security Context (see section 3 of I-D.ietf-core-object-security) to N1 concatenated with N2.  The client then derives the complete Security Context from the ID Context plus the parameters received from the AS. Finally, the client sends a request protected with OSCORE to the RS. This message contains the ID Context value.  When receiving this request after the 2.01 (Created) response, the server extract the ID Context from it, verifies that the first part is equal to the nonce N1 it previously sent, and if so, sets its own ID Context and derives the complete Security Context from it plus the parameters received in the AS, following section 3.2 of I-D.ietf-core-object-security.  If the request verifies, then this Security Context is stored in the server, and used in the response, and in further communications with the client, until token expiration.  The client will not include the ID Context value in further requests. An overview of the profile flow for the OSCORE profile is given in prof-overview. 3. </ins>  <ins> The following subsections describe the details of the POST /token request and response between client and AS.  Section 3.2 of I-D.ietf- core-object-security defines how to derive a security context based on a shared master secret and a set of other parameters, established between client and server, which the client receives from the AS in this exchange.  The proof-of-possession key (pop-key) provisioned from the AS MUST be used as master secret in OSCORE. </ins>  <ins> 3.1. The client-to-AS request is specified in Section 5.6.1 of I-D.ietf- </ins> ace-oauth-authz.  <ins> If the client wants to update its access rights using the same OSCORE Security Context, it MUST include in its POST /token request a cnf object carrying the Sender ID in the kid field.  This identifier can be used by the AS to determine the shared secret to construct the proof-of-possession token and therefore MUST specify a symmetric key that was previously generated by the AS as a shared secret for the communication between the client and the RS. The client MUST send this POST /token request over a secure channel that guarantees authentication, message integrity and confidentiality (see introsp). An example of such a request, in CBOR diagnostic notation without the tag and value abbreviations is reported in ex0 3.2. After verifying the POST /token request and that the client is authorized to obtain an access token corresponding to its access token request, the AS responds as defined in section 5.6.2 of I- D.ietf-ace-oauth-authz.  It signals that the use of OSCORE is REQUIRED for a specific access token by including the "profile" parameter with the value "coap_oscore" in the access token response. This means that the client MUST use OSCORE towards all resource servers for which this access token is valid, and follow oscore-setup to derive the security context to run OSCORE. </ins> The error response procedures defined in section 5.6.3 of the ACE framework are unchanged by this profile.  <ins> Moreover, the AS MUST provision the following data: </ins> a master secret  <ins> a client identifier </ins>  <ins> a server identifier </ins> Additionally, the AS MAY provision the following data, in the same  <ins> response. </ins> an AEAD algorithm  <ins> an HKDF algorithm </ins> a salt The master secret MUST be communicated as COSE_Key in the 'cnf' parameter of the access token response as defined in Section 5.6.4.5 of I-D.ietf-ace-oauth-authz.  The AEAD algorithm MAY be included as  <ins> the 'alg' parameter in the COSE_Key; the HKDF algorithm MAY be included as the 'hkdf' parameter of the COSE_Key and the salt MAY be included as the 'slt' parameter of the COSE_Key as defined in tab1. </ins>  <ins> The same parameters MUST be included as metadata of the access token. This profile RECOMMENDS the use of CBOR web token (CWT) as specified in RFC8392.  If the token is a CWT, the same COSE_Key structure defined above MUST be placed in the 'cnf' claim of this token. </ins> The AS MUST also assign identifiers to both client and RS, which are then used as Sender ID and Recipient ID in the OSCORE context as described in section 3.1 of I-D.ietf-core-object-security.  These identifiers MUST be unique in the set of all clients and RS identifiers for a certain AS.  Moreover, these MUST be included in  <ins> the COSE_Key as header parameters, as defined in tab1. </ins> We assume in this document that a resource is associated to one single AS, which makes it possible to assume unique identifiers for case the RS needs to have a mechanism in place to disambiguate identifiers or mitigate their effect.  <ins> Note that C should set the Sender ID of its Security Context to the </ins> clientId value received and the Recipient ID to the serverId value, and RS should do the opposite.  <ins> ex1 shows an example of such an AS response, in CBOR diagnostic </ins> notation without the tag and value abbreviations.  <ins> ex2 shows an example CWT, containing the necessary OSCORE parameters in the 'cnf' claim, in CBOR diagnostic notation without tag and value abbreviations. </ins>  <ins> If the client has requested an update to its access rights using the same OSCORE Security Context, and the token associated with it is not expired, the AS MAY omit the master secret and server identifier both in the COSE_Key in the 'cnf' parameter and in the token.  The client identifier needs to be provisioned, in order for the RS to identify the previously generated Security Context. </ins>  <ins> ex5 shows an example of such an AS response, in CBOR diagnostic notation without the tag and value abbreviations. </ins>  <ins> ex6 shows an example CWT, containing the necessary OSCORE parameters in the 'cnf' claim for update of access rights, in CBOR diagnostic notation without tag and value abbreviations. </ins> 4.  <ins> The following subsections describe the details of the POST /authz- info request and response between client and RS.  The client posts the token that includes the materials provisioned by the AS to the RS, which can then use Section 3.2 of I-D.ietf-core-object-security to derive a security context based on a shared master secret and a set of other parameters, established between client and server. Note that the proof-of-possession required to bind the access token to the client is implicitly performed by generating the shared OSCORE Security Context using the pop-key as master secret, for both client and RS.  An attacker using a stolen token will not be able to generate a valid OSCORE context and thus not be able to prove possession of the pop-key. 4.1. The client MUST use CoAP and the Authorization Information endpoint as described in section 5.8.1 of I-D.ietf-ace-oauth-authz to transport the token to the RS. The authz-info endpoint is not protected, nor are the responses from this endpoint. The access token MUST be encrypted, since it is transferred from the client to the RS over an unprotected channel. ex3 shows an example of the request sent from the client to the RS. 4.2. The RS MUST follow the procedures defined in section 5.8.1 of I- D.ietf-ace-oauth-authz: the RS MUST verify the validity of the token. If the token is valid, the RS MUST respond to the POST request with 2.01 (Created).  This response MAY contain an identifier of the token (e.g., the cti for a CWT) as a payload, in order to allow the client to refer to the token.  If the token is valid but is associated to claims that the RS cannot process (e.g., an unknown scope) the RS MUST respond with a response code equivalent to the CoAP code 4.00 (Bad Request).  In the latter case the RS MAY provide additional information in the error response, in order to clarify what went wrong.  The RS MAY make an introspection request to validate the token before responding to the POST request to the authz-info endpoint. Additionally, the RS MUST generate a nonce (N1) with a good amount of randomness, and include it in the payload of the 2.01 (Created) response as a CBOR byte string.  This profile RECOMMENDS to use a nonce of 64 bits.  The RS MUST store this nonce as long as the access token related to it is still valid. ex4 shows an example of the response sent from the RS to the client. As specified in section 5.8.3 of I-D.ietf-ace-oauth-authz, the RS MUST notify the client with an error response with code 4.01 (Unauthorized) for any long running request before terminating the session, when the access token expires. 4.3. Once receiving the 2.01 (Created) response from the RS, following the POST /authz-info request, the client MUST extract the nonce N1 from the CBOR byte string in the payload of the response.  The client MUST generate itself a nonce (N2) with a good amount of randomness.  This profile RECOMMENDS to use a nonce of 64 bits.  Then, the client MUST set the ID Context of the Security Context created to communicate with the RS to the concatenation of N1 and N2, in this order: ID Context = N1 | N2, where | denotes byte string concatenation.  The client MUST set the Master Secret, Sender ID and Recipient ID from the parameters received from the AS in as-c.  The client MUST set the AEAD Algorithm, Master Salt, HKDF and Replay Window from the parameters received from the AS in as-c, if present.  In case these parameters are omitted, the default values are used as described in section 3.2 of I-D.ietf-core-object-security.  After that, the client MUST derive the complete Security Context following section 3.2.1 of I-D.ietf-core-object-security.  From this point on, the client MUST use this Security Context to communicate with the RS when accessing the resources as specified by the authorization information. The client then uses this Security Context to send requests to RS using OSCORE.  In the first request sent to the RS, the client MUST include the kid context, with value ID Context, i.e. N1 concatenated with N2.  The client needs to make sure the RS receives the kid context, possibly adding the kid context to later requests, until it receives a valid OSCORE response from the RS using the same Security Context. When the RS receives this first OSCORE-protected request, it MUST extract the kid context from the message first.  Then, it needs to verify that the first part of the kid context corresponds to the nonce N1 it previously sent, and that it is followed by a non-zero- length byte string.  If that is verified, the RS MUST set the ID Context to the kid context value.  Then, the RS MUST set the Master Secret, Sender ID and Recipient ID from the parameters received from the client in the access token in c-rs.  The RS MUST set the AEAD Algorithm, Master Salt, HKDF and Replay Window from the parameters received from the client in the access token in c-rs, if present.  In case these parameters are omitted, the default values are used as described in section 3.2 of I-D.ietf-core-object-security.  After that, the RS MUST derive the complete Security Context following section 3.2.1 of I-D.ietf-core-object-security, and MUST associate this Security Context with the authorization information from the access token.  Then, the RS MUST delete the nonce N1 from memory. The RS then uses this Security Context to verify the request and send responses to RS using OSCORE.  If OSCORE verification fails, error responses are used, as specified in section 8 of I-D.ietf-core- object-security.  Additionally, if OSCORE verification succeeds, the verification of access rights is performed as described in section tok-ver.  The RS MUST NOT use the Security Context after the related token has expired, and MUST respond with a unprotected 4.01 (Unauthorized) error message. 4.4. The RS MUST follow the procedures defined in section 5.8.2 of I- D.ietf-ace-oauth-authz: if an RS receives a OSCORE-protected request from a client, then it processes according to I-D.ietf-core-object- security.  If OSCORE verification succeeds, and the target resource requires authorization, the RS retrieves the authorization information from the access token associated to the Security Context. The RS then MUST verify that the authorization information covers the resource and the action requested. The response code MUST be 4.01 (Unauthorized) in case the client has not used the Security Context associated with the access token, or if RS has no valid access token for the client.  If RS has an access token for the client but not for the resource that was requested, RS MUST reject the request with a 4.03 (Forbidden).  If RS has an access token for the client but it does not cover the action that was requested on the resource, RS MUST reject the request with a 4.05 (Method Not Allowed). </ins> 5. <ins> As specified in the ACE framework (section 5.7 of I-D.ietf-ace-oauth- authz), the requesting entity (RS and/or client) and the AS communicates via the introspection or token endpoint.  The use of CoAP and OSCORE for this communication is RECOMMENDED in this profile, other protocols (such as HTTP and DTLS or TLS) MAY be used instead. If OSCORE is used, the requesting entity and the AS are expected to have pre-established security contexts in place.  How these security contexts are established is out of scope for this profile. Furthermore the requesting entity and the AS communicate using OSCORE (I-D.ietf-core-object-security) through the introspection endpoint as specified in section 5.7 of I-D.ietf-ace-oauth-authz and through the token endpoint as specified in section 5.6 of I-D.ietf-ace-oauth- authz. 6. </ins> This document specifies a profile for the Authentication and Authorization for Constrained Environments (ACE) framework I-D.ietf- ace-oauth-authz.  Thus the general security considerations from the expected use of OSCORE, to prevent weakening the security assurances provided by OSCORE.  <ins> TODO: explain the rationale for the nonces construction, and the security implications for Man-in-the-Middle attacks. 7. </ins> TBD.  <ins> 8. </ins> Note to RFC Editor: Please replace all occurrences of "[[this specification]]" with the RFC number of this specification and delete Description: Identifies the server in an OSCORE context Reference: [[this specification]]  <ins> Name: hkdf </ins> Label: TBD3 (value between 1 and 255) Value Type: bstr Value Registry: COSE Algorithms registry


existing OSCORE Security Context, it MUST include in its POST request to the token endpoint a req_cnf object.  The req_cnf MUST include a kid field carrying a bstr-wrapped CBOR array object containing the <del> client's identifier (assigned as discussed in as-c) and optionally the context identifier (if assigned as discussed in as-c).  The CBOR array is defined in kid, and follows the notation of RFC8610.  These </del>  identifiers, together with other information such as audience, can be used by the AS to determine the shared secret bound to the proof-of- possession token and therefore MUST identify a symmetric key that was The OSCORE_Security_Context is a CBOR map object, defined in oscore- sec-ctx.  This object is transported in the 'cnf' parameter of the access token response as defined in Section 3.2 of I-D.ietf-ace- <del> oauth-params, as value of a field named 'osc' registered in osc-cwt and osc-jwt.  The master secret MUST be communicated as the 'ms' </del>  field in the 'osc' field in the 'cnf' parameter of the access token response as defined in Section 3.2 of I-D.ietf-ace-oauth-params.  The AEAD algorithm may be included as the 'alg' parameter in the client identifier and the context identifier (if it was set and included in the initial access token response by the AS) in the 'kid' field in the 'cnf' parameter of the token, with the same structure <del> defined in kid.  These identifiers need to be included in the response, in order for the RS to identify the previously generated Security Context. </del>  ex5 shows an example of such an AS response, with payload in CBOR diagnostic notation without the tag and value abbreviations.  The OSCORE (Section 3.1 of RFC8613).  In particular, the OSCORE_Security_Context object is defined to be serialized and transported between nodes, as specified by this document, but can <del> also be used in this way by other specifications if needed.  The OSCORE_Security_Context object can either be encoded as a JSON object or as a CBOR map.  The set of common parameters that can appear in an OSCORE_Security_Context object can be found in the IANA "OSCORE Security Context Parameters" registry (sec-ctx-params-reg), defined for extensibility, and is specified below.  All parameters are optional.  table-key-labels provides a summary of the OSCORE_Security_Context parameters defined in this section. </del>  This parameter identifies the OSCORE Version number, which is an int.  For more information about this field, see section 5.4 of and response to the authz-info endpoint between client and RS.  The client generates a nonce N1, and posts it together with the token that includes the materials (e.g., OSCORE parameters) received from <del> the AS to the RS.  The RS then generates a nonce N2, and use </del>  Section 3.2 of RFC8613 to derive a security context based on a shared master secret and the two nonces, established between client and server.  The nonces are encoded as CBOR bstr if CBOR is used, and as profile, the client MUST wrap the token and N1 in a CBOR map.  The client MUST use the Content-Format "application/ace+cbor" defined in section 8.14 of I-D.ietf-ace-oauth-authz.  The client MUST include <del> the access token using the correct CBOR label (e.g., "cwt" for CWT, "jwt" for JWT) and N1 using the 'nonce1' parameter defined in nonce1. </del>  The authz-info endpoint is not protected, nor are the responses from this resource. If the exchange was an update of access rights, i.e., a new Security Context was derived from a client that already had a Security Context in place, the RS is RECOMMENDED to delete the old Security Context <del> after OSCORE verification and verification of access rights succeed. The RS MUST delete the Security Context if it deletes the access token associated to it. </del>  4.4.

Not much here, though a couple points I'll leave some further comments on, as the proper disposition is not entirely clear.
If you agree NAME I would go ahead and merge this PR (excluding the "update of access rights" change at l.776).
Sorry, I missed this when it came in. Please go ahead.

existing OSCORE Security Context, it MUST include in its POST request to the token endpoint a req_cnf object.  The req_cnf MUST include a kid field carrying a bstr-wrapped CBOR array object containing the  <ins> client's identifier (assigned as discussed in as-c) and the context identifier (if assigned as discussed in as-c).  The CBOR array is defined in kid, and follows the notation of RFC8610.  These </ins> identifiers, together with other information such as audience, can be used by the AS to determine the shared secret bound to the proof-of- possession token and therefore MUST identify a symmetric key that was The OSCORE_Security_Context is a CBOR map object, defined in oscore- sec-ctx.  This object is transported in the 'cnf' parameter of the access token response as defined in Section 3.2 of I-D.ietf-ace-  <ins> oauth-params, as the value of a field named 'osc', registered in osc- cwt and osc-jwt.  The master secret MUST be communicated as the 'ms' </ins> field in the 'osc' field in the 'cnf' parameter of the access token response as defined in Section 3.2 of I-D.ietf-ace-oauth-params.  The AEAD algorithm may be included as the 'alg' parameter in the client identifier and the context identifier (if it was set and included in the initial access token response by the AS) in the 'kid' field in the 'cnf' parameter of the token, with the same structure  <ins> defined in kid.  These identifiers need to be included in the token in order for the RS to identify the previously generated Security Context. </ins> ex5 shows an example of such an AS response, with payload in CBOR diagnostic notation without the tag and value abbreviations.  The OSCORE (Section 3.1 of RFC8613).  In particular, the OSCORE_Security_Context object is defined to be serialized and transported between nodes, as specified by this document, but can  <ins> also be used as a representation of Security Context state by other specifications if needed.  The OSCORE_Security_Context object can either be encoded as a JSON object or as a CBOR map.  The set of common parameters that can appear in an OSCORE_Security_Context object can be found in the IANA "OSCORE Security Context Parameters" registry (sec-ctx-params-reg), defined for extensibility, and is specified below.  All parameters are optional.  table-key-labels provides a summary of the OSCORE_Security_Context parameters defined in this section. </ins> This parameter identifies the OSCORE Version number, which is an int.  For more information about this field, see section 5.4 of and response to the authz-info endpoint between client and RS.  The client generates a nonce N1, and posts it together with the token that includes the materials (e.g., OSCORE parameters) received from  <ins> the AS to the RS.  The RS then generates a nonce N2, and uses </ins> Section 3.2 of RFC8613 to derive a security context based on a shared master secret and the two nonces, established between client and server.  The nonces are encoded as CBOR bstr if CBOR is used, and as profile, the client MUST wrap the token and N1 in a CBOR map.  The client MUST use the Content-Format "application/ace+cbor" defined in section 8.14 of I-D.ietf-ace-oauth-authz.  The client MUST include  <ins> the access token using the "access_token" parameter and N1 using the 'nonce1' parameter defined in nonce1. </ins> The authz-info endpoint is not protected, nor are the responses from this resource. If the exchange was an update of access rights, i.e., a new Security Context was derived from a client that already had a Security Context in place, the RS is RECOMMENDED to delete the old Security Context  <ins> after OSCORE verification succeeds.  The RS MUST delete the Security Context if it deletes the access token associated to it. </ins> 4.4.


Moreover, implementers of this specification need to be aware that if other authentication mechanisms are used to set up OSCORE between the same client and RS, that do not rely on AS assigning identifiers, <del> collisions may happen and need to be mitigated. </del>  Note that in oscore-setup C sets the Sender ID of its Security Context to the clientId value received and the Recipient ID to the abbreviations. The same CWT token as in ex2, using the value abbreviations defined <del> in I-D.ietf-ace-oauth-authz and I-D.ietf-ace-cwt-proof-of-possession and encoded in CBOR is shown in ex2-cbor. </del>  NOTE TO THE RFC EDITOR: before publishing, it should be checked (and in case fixed) that the values used below (which are not yet Note that a client may be required to re-POST the access token in order to complete a request, since an RS may delete a stored access <del> token at any time, for example due to all storage space being consumed.  This situation is detected by the client when it receives an AS Request Creation Hints response. </del>  ex3 shows an example of the request sent from the client to the RS, with payload in CBOR diagnostic notation without the tag and value abbreviations.  The access token has been truncated for readability.  4.1.1. This parameter MUST be sent from the client to the RS, together with with payload in CBOR diagnostic notation without the tag and value abbreviations.  As specified in section 5.8.1 of I-D.ietf-ace-oauth-authz, when receiving an updated access token with updated authorization information from the client (see c-as), it is recommended that the RS simplifies for the RS to keep track of authorization information for a given client. <del> As specified in section 5.8.3 of I-D.ietf-ace-oauth-authz, the RS must notify the client with an error response with code 4.01 (Unauthorized) for any long running request before terminating the session, when the access token expires. </del> 4.2.1. This parameter MUST be sent from the RS to the Client if the ace error message to requests received that correspond to a Security Context with an expired token. <del> If the exchange was an update of access rights, i.e., a new Security Context was derived from a client that already had a Security Context in place, the RS is RECOMMENDED to delete the old Security Context after OSCORE verification and verification of access rights succeed. The RS MUST delete the Security Context if it deletes the access token associated to it.  If the exchange was an update of access rights, i.e., a new Security Context was derived from a client that already had a Security Context in place, the RS is RECOMMENDED to delete the old Security Context after OSCORE verification succeeds. The RS MUST delete the Security Context if it deletes the access token associated to it. </del> 4.4. The RS MUST follow the procedures defined in section 5.8.2 of I- There are a number of scenarios where a client or RS needs to discard the OSCORE security context, and acquire a new one. <del> The client MUST discard the current security context associated with </del>  an RS when: the Sequence Number space ends. the access token associated with the context expires. the client receives a number of 4.01 Unauthorized responses to <del> OSCORE requests using the same security context.  The exact number </del>  needs to be specified by the application. the client receives a new nonce in the 2.01 (Created) response (see rs-c) to a POST request to the authz-info endpoint, when re- posting a (non-expired) token associated to the existing context. <del> The RS MUST discard the current security context associated with a </del>  client when: the Sequence Number space ends. the access token associated with the context expires.  7. This document specifies a profile for the Authentication and 9.5. The following registration is done for the CWT Confirmation Methods <del> Registry following the procedure specified in section 7.2.1 of I- D.ietf-ace-cwt-proof-of-possession: </del>  Confirmation Method Name: "osc" Confirmation Method Description: OSCORE_Security_Context carrying

OCF comments.
check that re-sending token triggers nonces exchange and new security context derived.
add a implementation note about namespaces for identifiers in case several methods are used (EDHOC, ACE, others)

Moreover, implementers of this specification need to be aware that if other authentication mechanisms are used to set up OSCORE between the same client and RS, that do not rely on AS assigning identifiers,  <ins> collisions may happen and need to be mitigated.  A mitigation example would be to use distinct namespaces of identifiers for different authentication mechanisms. </ins> Note that in oscore-setup C sets the Sender ID of its Security Context to the clientId value received and the Recipient ID to the abbreviations. The same CWT token as in ex2, using the value abbreviations defined  <ins> in I-D.ietf-ace-oauth-authz and RFC8747 and encoded in CBOR is shown in ex2-cbor. </ins> NOTE TO THE RFC EDITOR: before publishing, it should be checked (and in case fixed) that the values used below (which are not yet Note that a client may be required to re-POST the access token in order to complete a request, since an RS may delete a stored access  <ins> token (and associated Security Context) at any time, for example due to all storage space being consumed.  This situation is detected by the client when it receives an AS Request Creation Hints response. Reposting the same access token will result in deriving a new OSCORE Security Context to be used with the RS, as different nonces will be used. </ins> ex3 shows an example of the request sent from the client to the RS, with payload in CBOR diagnostic notation without the tag and value abbreviations.  The access token has been truncated for readability. <ins> If the client has already posted a valid token, has already established a security association with the RS, and wants to update its access rights, the client can do so by posting the new token (retrieved from the AS and containing the update of access rights) to the /authz-info endpoint.  The client MUST protect the request using the OSCORE Security Context established during the first token exchange.  The client MUST only send the access token in the payload, no nonce is sent.  After proper verification (see rs-c), the RS will replace the old token with the new one, maintaining the same Security Context. </ins> 4.1.1. This parameter MUST be sent from the client to the RS, together with with payload in CBOR diagnostic notation without the tag and value abbreviations. <ins> As specified in section 5.8.3 of I-D.ietf-ace-oauth-authz, the RS must notify the client with an error response with code 4.01 (Unauthorized) for any long running request before terminating the session, when the access token expires. If the RS receives the token in a OSCORE protected message, it means that the client is requesting an update of access rights.  The RS MUST discard any nonce in the request, if any was sent.  The RS MUST check that the "kid" of the "cnf" parameter of the new access token matches the OSCORE Security Context used to protect the message.  If that's the case, the RS MUST discard the old token and associate the new token to the Security Context identified by "kid".  The RS MUST respond with a 2.01 (Created) response protected with the same Security Context, with no payload.  If any verification fails, the RS MUST respond with a 4.01 (Unauthorized) error response. </ins> As specified in section 5.8.1 of I-D.ietf-ace-oauth-authz, when receiving an updated access token with updated authorization information from the client (see c-as), it is recommended that the RS simplifies for the RS to keep track of authorization information for a given client.  4.2.1. This parameter MUST be sent from the RS to the Client if the ace error message to requests received that correspond to a Security Context with an expired token.  4.4. The RS MUST follow the procedures defined in section 5.8.2 of I- There are a number of scenarios where a client or RS needs to discard the OSCORE security context, and acquire a new one.  <ins> The client MUST discard the current Security Context associated with </ins> an RS when: the Sequence Number space ends. the access token associated with the context expires. the client receives a number of 4.01 Unauthorized responses to  <ins> OSCORE requests using the same Security Context.  The exact number </ins> needs to be specified by the application. the client receives a new nonce in the 2.01 (Created) response (see rs-c) to a POST request to the authz-info endpoint, when re- posting a (non-expired) token associated to the existing context.  <ins> The RS MUST discard the current Security Context associated with a </ins> client when: the Sequence Number space ends. the access token associated with the context expires. <ins> the client has successfully replaced the current security context with a newer one by posting an access token to the unprotected /authz-info endpoint at the RS, e.g., by re-posting the same token, as specified in c-rs. Whenever one more access token is successfully posted to the RS, and a new Security Context is derived between the client and RS, messages in transit that were protected with the previous Security Context might not pass verification, as the old context is discarded.  That means that messages sent shortly before the client posts one more access token to the RS might not successfully reach the destination. Analogously, implementations may want to cancel CoAP observations at the RS registered before the Security Context is replaced, or conversely they will need to implement a mechanism to ensure that those observation are to be protected with the newly derived Security Context. </ins> 7. This document specifies a profile for the Authentication and 9.5. The following registration is done for the CWT Confirmation Methods  <ins> Registry following the procedure specified in section 7.2.1 of RFC8747: </ins> Confirmation Method Name: "osc" Confirmation Method Description: OSCORE_Security_Context carrying


case of re-boots.  This document RECOMMENDS the exchange of 64 bit random nonces.  Considering the birthday paradox, the average collision for each nonce will happen after 2^32 messages, which is <del> considerably more token provisioned than would be expected for </del>  intended applications.  If applications use something else, such as a counter, they need to guarantee that reboot and loss of state on either node does not provoke reuse.  If that is not guaranteed, nodes

This part got reworded a bit in response to IESG comments and this (admittedly unusual) grammatical construction got changed to something that doesn't make sense.
Thanks. "which is considerably more token provisioned" is clearly not right. I think the intent was "tokens provisioned" but "token provisionings" is more accurate. Unless there are any objections I will merge on Monday.

case of re-boots.  This document RECOMMENDS the exchange of 64 bit random nonces.  Considering the birthday paradox, the average collision for each nonce will happen after 2^32 messages, which is  <ins> considerably more token provisionings than would be expected for </ins> intended applications.  If applications use something else, such as a counter, they need to guarantee that reboot and loss of state on either node does not provoke reuse.  If that is not guaranteed, nodes


Since the last acknowledgement was sent, "max_ack_delay" amount of time has passed. <del> loss and batch section describes exceptions to this strategy. </del>  An endpoint is expected to bundle acknowledgements when possible. Every time an acknowledgement is sent, bundled or otherwise, all 6.1. <del> To expedite loss detection, endpoints SHOULD send an acknowledgement immediately on receiving an ack-eliciting packet that is out of order.  Endpoints MAY continue sending acknowledgements immediately on each subsequently received packet, but they SHOULD return to using delay thresholds as specified above within a period of 1/8 x RTT, unless more ack-eliciting packets are received out of order. </del>  <del> Similarly, packets marked with the ECN Congestion Experienced (CE) codepoint in the IP header SHOULD be acknowledged immediately, to reduce the peer's response time to congestion events. </del>  6.2.  For performance reasons, an endpoint can receive incoming packets from the underlying platform in a batch of multiple packets.  This batch can contain enough packets to cause multiple acknowledgements

merging.
Endpoints expect the connection to encounter reordering might want to indicate that the receiver should not send immediate acks on receiving a reordered packet.

Since the last acknowledgement was sent, "max_ack_delay" amount of time has passed.  <ins> reordering, congestion, and batch describe exceptions to this strategy. </ins> An endpoint is expected to bundle acknowledgements when possible. Every time an acknowledgement is sent, bundled or otherwise, all 6.1.  <ins> As specified in Section 13.3.1 of QUIC-TRANSPORT, endpoints SHOULD send an acknowledgement immediately on receiving a reordered ack- eliciting packet, unless the peer has sent a "disable_ack_on_reordering" transport parameter, described below: </ins>  <ins> This optional transport parameter is sent by an endpoint that is reordering tolerant or expects reordering in the connection.  An endpoint that receives this transport parameter MUST NOT send an immediate acknowledgement when reordering is observed, and MUST continue delaying acknowledgements as per sending.  This parameter is a zero-length value. </ins> 6.2. <ins> As specified in Section 13.3.1 of QUIC-TRANSPORT, an endpoint SHOULD immediately acknowledge packets marked with the ECN Congestion Experienced (CE) codepoint in the IP header.  Doing so reduces the peer's response time to congestion events. 6.3. </ins> For performance reasons, an endpoint can receive incoming packets from the underlying platform in a batch of multiple packets.  This batch can contain enough packets to cause multiple acknowledgements