Skip to main content

Authentication and Authorization for Constrained Environments Using the OAuth 2.0 Framework (ACE-OAuth)
RFC 9200

Document Type RFC - Proposed Standard (August 2022)
Authors Ludwig Seitz , Göran Selander , Erik Wahlstroem , Samuel Erdtman , Hannes Tschofenig
Last updated 2022-08-31
RFC stream Internet Engineering Task Force (IETF)
Formats
Additional resources Mailing list discussion
IESG Responsible AD Benjamin Kaduk
Send notices to (None)
RFC 9200
quot;.

5.9.4.  Mapping Introspection Parameters to CBOR

   If CBOR is used, the introspection request and response parameters
   MUST be mapped to CBOR types, as specified in the registry defined by
   Section 8.12, using the given integer abbreviation for the map key.

   Note that we have aligned abbreviations that correspond to a claim
   with the abbreviations defined in [RFC8392] and the abbreviations of
   parameters with the same name from Section 5.8.5.

    +===================+======+======================+===============+
    | Parameter name    | CBOR | Value Type           | Original      |
    |                   | Key  |                      | Specification |
    +===================+======+======================+===============+
    | iss               | 1    | text string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | sub               | 2    | text string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | aud               | 3    | text string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | exp               | 4    | integer or floating- | [RFC7662]     |
    |                   |      | point number         |               |
    +-------------------+------+----------------------+---------------+
    | nbf               | 5    | integer or floating- | [RFC7662]     |
    |                   |      | point number         |               |
    +-------------------+------+----------------------+---------------+
    | iat               | 6    | integer or floating- | [RFC7662]     |
    |                   |      | point number         |               |
    +-------------------+------+----------------------+---------------+
    | cti               | 7    | byte string          | RFC 9200      |
    +-------------------+------+----------------------+---------------+
    | scope             | 9    | text or byte string  | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | active            | 10   | True or False        | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | token             | 11   | byte string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | client_id         | 24   | text string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | error             | 30   | integer              | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | error_description | 31   | text string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | error_uri         | 32   | text string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | token_type_hint   | 33   | text string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | token_type        | 34   | integer              | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | username          | 35   | text string          | [RFC7662]     |
    +-------------------+------+----------------------+---------------+
    | ace_profile       | 38   | integer              | RFC 9200      |
    +-------------------+------+----------------------+---------------+
    | cnonce            | 39   | byte string          | RFC 9200      |
    +-------------------+------+----------------------+---------------+
    | exi               | 40   | unsigned integer     | RFC 9200      |
    +-------------------+------+----------------------+---------------+

         Table 6: CBOR Mappings for Token Introspection Parameters

5.10.  The Access Token

   In this framework, the use of CBOR Web Token (CWT) as specified in
   [RFC8392] is RECOMMENDED.

   In order to facilitate offline processing of access tokens, this
   document uses the cnf claim from [RFC8747] and the scope claim from
   [RFC8693] for JWT- and CWT-encoded tokens.  In addition to string
   encoding specified for the scope claim, a binary encoding MAY be
   used.  The syntax of such an encoding is explicitly not specified
   here and left to profiles or applications, specifically note that a
   binary encoded scope does not necessarily use the space character
   '0x20' to delimit scope-tokens.

   If the AS needs to convey a hint to the RS about which profile it
   should use to communicate with the client, the AS MAY include an
   ace_profile claim in the access token, with the same syntax and
   semantics as defined in Section 5.8.4.3.

   If the client submitted a cnonce parameter in the access token
   request (Section 5.8.4.4), the AS MUST include the value of this
   parameter in the cnonce claim specified here.  The cnonce claim uses
   binary encoding.

5.10.1.  The Authorization Information Endpoint

   The access token, containing authorization information and
   information about the proof-of-possession method used by the client,
   needs to be transported to the RS so that the RS can authenticate and
   authorize the client request.

   This section defines a method for transporting the access token to
   the RS using a RESTful protocol, such as CoAP.  Profiles of this
   framework MAY define other methods for token transport.

   The method consists of an authz-info endpoint, implemented by the RS.
   A client using this method MUST make a POST request to the authz-info
   endpoint at the RS with the access token in the payload.  The CoAP
   Content-Format or HTTP media type MUST reflect the format of the
   token, e.g., "application/cwt", for CBOR Web Tokens; if no Content-
   Format or media type is defined for the token format, "application/
   octet-stream" MUST be used.

   The RS receiving the token MUST verify the validity of the token.  If
   the token is valid, the RS MUST respond to the POST request with a
   response code equivalent to CoAP code 2.01 (Created).
   Section 5.10.1.1 outlines how an RS MUST proceed to verify the
   validity of an access token.

   The RS MUST be prepared to store at least one access token for future
   use.  This is a difference as to how access tokens are handled in
   OAuth 2.0, where the access token is typically sent along with each
   request and therefore not stored at the RS.

   When using this framework, it is RECOMMENDED that an RS stores only
   one token per proof-of-possession key.  This means that an additional
   token linked to the same key will supersede any existing token at the
   RS by replacing the corresponding authorization information.  The
   reason is that this greatly simplifies (constrained) implementations,
   with respect to required storage and resolving a request to the
   applicable token.  The use of multiple access tokens for a single
   client increases the strain on the resource server, as it must
   consider every access token and calculate the actual permissions of
   the client.  Also, tokens may contradict each other, which may lead
   the server to enforce wrong permissions.  If one of the access tokens
   expires earlier than others, the resulting permissions may offer
   insufficient protection.

   If the payload sent to the authz-info endpoint does not parse to a
   token, the RS MUST respond with a response code equivalent to the
   CoAP code 4.00 (Bad Request).

   The RS MAY make an introspection request to validate the token before
   responding to the POST request to the authz-info endpoint, e.g., if
   the token is an opaque reference.  Some transport protocols may
   provide a way to indicate that the RS is busy and the client should
   retry after an interval; this type of status update would be
   appropriate while the RS is waiting for an introspection response.

   Profiles MUST specify whether the authz-info endpoint is protected,
   including whether error responses from this endpoint are protected.
   Note that since the token contains information that allows the client
   and the RS to establish a security context in the first place, mutual
   authentication may not be possible at this point.

   The default name of this endpoint in a url-path is '/authz-info';
   however, implementations are not required to use this name and can
   define their own instead.

5.10.1.1.  Verifying an Access Token

   When an RS receives an access token, it MUST verify it before storing
   it.  The details of token verification depends on various aspects,
   including the token encoding, the type of token, the security
   protection applied to the token, and the claims.  The token encoding
   matters since the security protection differs between the token
   encodings.  For example, a CWT token uses COSE, while a JWT token
   uses JSON Object Signing and Encryption (JOSE).  The type of token
   also has an influence on the verification procedure since tokens may
   be self-contained, whereby token verification may happen locally at
   the RS, while a reference token requires further interaction with the
   authorization server, for example, using token introspection, to
   obtain the claims associated with the token reference.  Self-
   contained tokens MUST at least be integrity protected, but they MAY
   also be encrypted.

   For self-contained tokens, the RS MUST process the security
   protection of the token first, as specified by the respective token
   format.  For CWT, the description can be found in [RFC8392]; for JWT,
   the relevant specification is [RFC7519].  This MUST include a
   verification that security protection (and thus the token) was
   generated by an AS that has the right to issue access tokens for this
   RS.

   In case the token is communicated by reference, the RS needs to
   obtain the claims first.  When the RS uses token introspection, the
   relevant specification is [RFC7662] with CoAP transport specified in
   Section 5.9.

   Errors may happen during this initial processing stage:

   *  If the verification of the security wrapper fails, or the token
      was issued by an AS that does not have the right to issue tokens
      for the receiving RS, the RS MUST discard the token and, if this
      was an interaction with authz-info, return an error message with a
      response code equivalent to the CoAP code 4.01 (Unauthorized).

   *  If the claims cannot be obtained, the RS MUST discard the token
      and, in case of an interaction via the authz-info endpoint, return
      an error message with a response code equivalent to the CoAP code
      4.00 (Bad Request).

   Next, the RS MUST verify claims, if present, contained in the access
   token.  Errors are returned when claim checks fail, in the order of
   priority of this list:

   iss
      The iss claim (if present) must identify the AS that has produced
      the security protection for the access token.  If that is not the
      case, the RS MUST discard the token.  If this was an interaction
      with authz-info, the RS MUST also respond with a response code
      equivalent to the CoAP code 4.01 (Unauthorized).

   exp
      The expiration date must be in the future.  If that is not the
      case, the RS MUST discard the token.  If this was an interaction
      with authz-info, the RS MUST also respond with a response code
      equivalent to the CoAP code 4.01 (Unauthorized).  Note that the RS
      has to terminate access rights to the protected resources at the
      time when the tokens expire.

   aud
      The aud claim must refer to an audience that the RS identifies
      with.  If that is not the case, the RS MUST discard the token.  If
      this was an interaction with authz-info, the RS MUST also respond
      with a response code equivalent to the CoAP code 4.03 (Forbidden).

   scope
      The RS must recognize value of the scope claim.  If that is not
      the case, the RS MUST discard the token.  If this was an
      interaction with authz-info, the RS MUST also respond with a
      response code equivalent to the CoAP code 4.00 (Bad Request).  The
      RS MAY provide additional information in the error response to
      clarify what went wrong.

   Additional processing may be needed for other claims in a way
   specific to a profile or the underlying application.

   Note that the sub (Subject) claim cannot always be verified when the
   token is submitted to the RS since the client may not have
   authenticated yet.  Also note that a counter for the exi (expires in)
   claim MUST be initialized when the RS first verifies this token.

   Also note that profiles of this framework may define access token
   transport mechanisms that do not allow for error responses.
   Therefore, the error messages specified here only apply if the token
   was sent to the authz-info endpoint.

   When sending error responses, the RS MAY use the error codes from
   Section 3.1 of [RFC6750] to provide additional details to the client.

5.10.1.2.  Protecting the Authorization Information Endpoint

   As this framework can be used in RESTful environments, it is
   important to make sure that attackers cannot perform unauthorized
   requests on the authz-info endpoints, other than submitting access
   tokens.

   Specifically, it SHOULD NOT be possible to perform GET, DELETE, or
   PUT on the authz-info endpoint.

   The RS SHOULD implement rate-limiting measures to mitigate attacks
   aiming to overload the processing capacity of the RS by repeatedly
   submitting tokens.  For CoAP-based communication, the RS could use
   the mechanisms from [RFC8516] to indicate that it is overloaded.

5.10.2.  Client Requests to the RS

   Before sending a request to an RS, the client MUST verify that the
   keys used to protect this communication are still valid.  See
   Section 5.10.4 for details on how the client determines the validity
   of the keys used.

   If an RS receives a request from a client and the target resource
   requires authorization, the RS MUST first verify that it has an
   access token that authorizes this request and that the client has
   performed the proof-of-possession binding for that token to the
   request.

   The response code MUST be 4.01 (Unauthorized) in case the client has
   not performed the proof of possession or if the RS has no valid
   access token for the client.  If the RS has an access token for the
   client but the token does not authorize access for the resource that
   was requested, the RS MUST reject the request with a 4.03
   (Forbidden).  If the RS has an access token for the client but it
   does not cover the action that was requested on the resource, the RS
   MUST reject the request with a 4.05 (Method Not Allowed).

   Note: The use of the response codes 4.03 and 4.05 is intended to
   prevent infinite loops where a client optimistically tries to access
   a requested resource with any access token received from AS.  As
   malicious clients could pretend to be the C to determine the C's
   privileges, these detailed response codes must be used only when a
   certain level of security is already available, which can be achieved
   only when the client is authenticated.

   Note: The RS MAY use introspection for timely validation of an access
   token at the time when a request is presented.

   Note: Matching the claims of the access token (e.g., scope) to a
   specific request is application specific.

   If the request matches a valid token and the client has performed the
   proof of possession for that token, the RS continues to process the
   request as specified by the underlying application.

5.10.3.  Token Expiration

   Depending on the capabilities of the RS, there are various ways in
   which it can verify the expiration of a received access token.  The
   following is a list of the possibilities including what functionality
   they require of the RS.

   *  The token is a CWT and includes an exp claim and possibly the nbf
      claim.  The RS verifies these by comparing them to values from its
      internal clock, as defined in [RFC7519].  In this case, the RS's
      internal clock must reflect the current date and time or at least
      be synchronized with the AS's clock.  How this clock
      synchronization would be performed is out of scope for this
      specification.

   *  The RS verifies the validity of the token by performing an
      introspection request, as specified in Section 5.9.  This requires
      the RS to have a reliable network connection to the AS and to be
      able to handle two secure sessions in parallel (C to RS and RS to
      AS).

   *  In order to support token expiration for devices that have no
      reliable way of synchronizing their internal clocks, this
      specification defines the following approach: The claim exi
      (expires in) can be used to provide the RS with the lifetime of
      the token in seconds from the time the RS first receives the
      token.  This mechanism only works for self-contained tokens, i.e.,
      CWTs and JWTs.  For CWTs, this parameter is encoded as an unsigned
      integer, while JWTs encode this as JSON number.

   *  Processing this claim requires that the RS does the following:

      -  For each token the RS receives that contains an exi claim, keep
         track of the time it received that token and revisit that list
         regularly to expunge expired tokens.

      -  Keep track of the identifiers of tokens containing the exi
         claim that have expired (in order to avoid accepting them
         again).  In order to avoid an unbounded memory usage growth,
         this MUST be implemented in the following way when the exi
         claim is used:

         o  When creating the token, the AS MUST add a cti claim (or jti
            for JWTs) to the access token.  The value of this claim MUST
            be created as the binary representation of the concatenation
            of the identifier of the RS with a sequence number counting
            the tokens containing an exi claim, issued by this AS for
            the RS.

         o  The RS MUST store the highest sequence number of an expired
            token containing the exi claim that it has seen and treat
            tokens with lower sequence numbers as expired.  Note that
            this could lead to discarding valid tokens with lower
            sequence numbers if the AS where to issue tokens of
            different validity time for the same RS.  The assumption is
            that typically tokens in such a scenario would all have the
            same validity time.

   If a token that authorizes a long-running request, such as a CoAP
   Observe [RFC7641], expires, the RS MUST send an error response with
   the response code equivalent to the CoAP code 4.01 (Unauthorized) to
   the client and then terminate processing the long-running request.

5.10.4.  Key Expiration

   The AS provides the client with key material that the RS uses.  This
   can either be a common symmetric PoP key or an asymmetric key used by
   the RS to authenticate towards the client.  Since there is currently
   no expiration metadata associated to those keys, the client has no
   way of knowing if these keys are still valid.  This may lead to
   situations where the client sends requests containing sensitive
   information to the RS using a key that is expired and possibly in the
   hands of an attacker or where the client accepts responses from the
   RS that are not properly protected and could possibly have been
   forged by an attacker.

   In order to prevent this, the client must assume that those keys are
   only valid as long as the related access token is.  Since the access
   token is opaque to the client, one of the following methods MUST be
   used to inform the client about the validity of an access token:

   *  The client knows a default validity time for all tokens it is
      using (i.e., how long a token is valid after being issued).  This
      information could be provisioned to the client when it is
      registered at the AS or published by the AS in a way that the
      client can query.

   *  The AS informs the client about the token validity using the
      expires_in parameter in the Access Information.

   A client that is not able to obtain information about the expiration
   of a token MUST NOT use this token.

6.  Security Considerations

   Security considerations applicable to authentication and
   authorization in RESTful environments provided in OAuth 2.0 [RFC6749]
   apply to this work.  Furthermore, [RFC6819] provides additional
   security considerations for OAuth, which apply to IoT deployments as
   well.  If the introspection endpoint is used, the security
   considerations from [RFC7662] also apply.

   The following subsections address issues specific to this document
   and its use in constrained environments.

6.1.  Protecting Tokens

   A large range of threats can be mitigated by protecting the contents
   of the access token by using a digital signature or a keyed message
   digest, e.g., a Message Authentication Code (MAC) or an Authenticated
   Encryption with Associated Data (AEAD) algorithm.  Consequently, the
   token integrity protection MUST be applied to prevent the token from
   being modified, particularly since it contains a reference to the
   symmetric key or the asymmetric key used for proof of possession.  If
   the access token contains the symmetric key, this symmetric key MUST
   be encrypted by the authorization server so that only the resource
   server can decrypt it.  Note that using an AEAD algorithm is
   preferable over using a MAC unless the token needs to be publicly
   readable.

   If the token is intended for multiple recipients (i.e., an audience
   that is a group), integrity protection of the token with a symmetric
   key, shared between the AS and the recipients, is not sufficient,
   since any of the recipients could modify the token undetected by the
   other recipients.  Therefore, a token with a multirecipient audience
   MUST be protected with an asymmetric signature.

   It is important for the authorization server to include the identity
   of the intended recipient (the audience), typically a single resource
   server (or a list of resource servers), in the token.  The same
   shared secret MUST NOT be used as a proof-of-possession key with
   multiple resource servers, since the benefit from using the proof-of-
   possession concept is then significantly reduced.

   If clients are capable of doing so, they should frequently request
   fresh access tokens, as this allows the AS to keep the lifetime of
   the tokens short.  This allows the AS to use shorter proof-of-
   possession key sizes, which translate to a performance benefit for
   the client and for the resource server.  Shorter keys also lead to
   shorter messages (particularly with asymmetric keying material).

   When authorization servers bind symmetric keys to access tokens, they
   SHOULD scope these access tokens to a specific permission.

   In certain situations, it may be necessary to revoke an access token
   that is still valid.  Client-initiated revocation is specified in
   [RFC7009] for OAuth 2.0.  Other revocation mechanisms are currently
   not specified, as the underlying assumption in OAuth is that access
   tokens are issued with a relatively short lifetime.  This may not
   hold true for disconnected constrained devices needing access tokens
   with relatively long lifetimes and would therefore necessitate
   further standardization work that is out of scope for this document.

6.2.  Communication Security

   Communication with the authorization server MUST use confidentiality
   protection.  This step is extremely important since the client or the
   RS may obtain the proof-of-possession key from the authorization
   server for use with a specific access token.  Not using
   confidentiality protection exposes this secret (and the access token)
   to an eavesdropper, thereby completely negating proof-of-possession
   security.  The requirements for communication security of profiles
   are specified in Section 5.

   Additional protection for the access token can be applied by
   encrypting it, for example, encryption of CWTs is specified in
   Section 7.1 of [RFC8392].  Such additional protection can be
   necessary if the token is later transferred over an insecure
   connection (e.g., when it is sent to the authz-info endpoint).

   Care must be taken by developers to prevent leakage of the PoP
   credentials (i.e., the private key or the symmetric key).  An
   adversary in possession of the PoP credentials bound to the access
   token will be able to impersonate the client.  Be aware that this is
   a real risk with many constrained environments, since adversaries may
   get physical access to the devices and can therefore use physical
   extraction techniques to gain access to memory contents.  This risk
   can be mitigated to some extent by making sure that keys are
   refreshed frequently, by using software isolation techniques, and by
   using hardware security.

6.3.  Long-Term Credentials

   Both the clients and RSs have long-term credentials that are used to
   secure communications and authenticate to the AS.  These credentials
   need to be protected against unauthorized access.  In constrained
   devices deployed in publicly accessible places, such protection can
   be difficult to achieve without specialized hardware (e.g., secure
   key storage memory).

   If credentials are lost or compromised, the operator of the affected
   devices needs to have procedures to invalidate any access these
   credentials give and needs to revoke tokens linked to such
   credentials.  The loss of a credential linked to a specific device
   MUST NOT lead to a compromise of other credentials not linked to that
   device; therefore, secret keys used for authentication MUST NOT be
   shared between more than two parties.

   Operators of the clients or RSs SHOULD have procedures in place to
   replace credentials that are suspected to have been compromised or
   that have been lost.

   Operators also SHOULD have procedures for decommissioning devices
   that include securely erasing credentials and other security-critical
   material in the devices being decommissioned.

6.4.  Unprotected AS Request Creation Hints

   Initially, no secure channel exists to protect the communication
   between the C and RS.  Thus, the C cannot determine if the AS Request
   Creation Hints contained in an unprotected response from the RS to an
   unauthorized request (see Section 5.3) are authentic.  Therefore, the
   C MUST determine if an AS is authorized to provide access tokens for
   a certain RS.  How this determination is implemented is out of scope
   for this document and left to the applications.

6.5.  Minimal Security Requirements for Communication

   This section summarizes the minimal requirements for the
   communication security of the different protocol interactions.

   C-AS
      All communication between the client and the authorization server
      MUST be encrypted and integrity and replay protected.
      Furthermore, responses from the AS to the client MUST be bound to
      the client's request to avoid attacks where the attacker swaps the
      intended response for an older one valid for a previous request.
      This requires that the client and the authorization server have
      previously exchanged either a shared secret or their public keys
      in order to negotiate a secure communication.  Furthermore, the
      client MUST be able to determine whether an AS has the authority
      to issue access tokens for a certain RS.  This can, for example,
      be done through preconfigured lists or through an online lookup
      mechanism that in turn also must be secured.

   RS-AS
      The communication between the resource server and the
      authorization server via the introspection endpoint MUST be
      encrypted and integrity and replay protected.  Furthermore,
      responses from the AS to the RS MUST be bound to the RS's request.
      This requires that the RS and the authorization server have
      previously exchanged either a shared secret or their public keys
      in order to negotiate a secure communication.  Furthermore, the RS
      MUST be able to determine whether an AS has the authority to issue
      access tokens itself.  This is usually configured out of band but
      could also be performed through an online lookup mechanism,
      provided that it is also secured in the same way.

   C-RS
      The initial communication between the client and the resource
      server cannot be secured in general, since the RS is not in
      possession of on access token for that client, which would carry
      the necessary parameters.  If both parties support DTLS without
      client authentication, it is RECOMMENDED to use this mechanism for
      protecting the initial communication.  After the client has
      successfully transmitted the access token to the RS, a secure
      communication protocol MUST be established between the client and
      RS for the actual resource request.  This protocol MUST provide
      confidentiality, integrity, and replay protection, as well as a
      binding between requests and responses.  This requires that the
      client learned either the RS's public key or received a symmetric
      proof-of-possession key bound to the access token from the AS.
      The RS must have learned either the client's public key, a shared
      symmetric key from the claims in the token, or an introspection
      request.  Since ACE does not provide profile negotiation between
      the C and RS, the client MUST have learned what profile the RS
      supports (e.g., from the AS or preconfigured) and initiated the
      communication accordingly.

6.6.  Token Freshness and Expiration

   An RS that is offline faces the problem of clock drift.  Since it
   cannot synchronize its clock with the AS, it may be tricked into
   accepting old access tokens that are no longer valid or have been
   compromised.  In order to prevent this, an RS may use the nonce-based
   mechanism (cnonce) defined in Section 5.3 to ensure freshness of an
   Access Token subsequently presented to this RS.

   Another problem with clock drift is that evaluating the standard
   token expiration claim exp can give unpredictable results.

   Acceptable ranges of clock drift are highly dependent on the concrete
   application.  Important factors are how long access tokens are valid
   and how critical timely expiration of the access token is.

   The expiration mechanism implemented by the exi claim, based on the
   first time the RS sees the token, was defined to provide a more
   predictable alternative.  The exi approach has some drawbacks that
   need to be considered:

   *  A malicious client may hold back tokens with the exi claim in
      order to prolong their lifespan.

   *  If an RS loses state (e.g., due to an unscheduled reboot), it may
      lose the current values of counters tracking the exi claims of
      tokens it is storing.

   The first drawback is inherent to the deployment scenario and the exi
   solution.  It can therefore not be mitigated without requiring the RS
   be online at times.  The second drawback can be mitigated by
   regularly storing the value of exi counters to persistent memory.

6.7.  Combining Profiles

   There may be use cases where different transport and security
   protocols are allowed for the different interactions, and, if that is
   not explicitly covered by an existing profile, it corresponds to
   combining profiles into a new one.  For example, a new profile could
   specify that a previously defined MQTT-TLS profile is used between
   the client and the RS in combination with a previously defined CoAP-
   DTLS profile for interactions between the client and the AS.  The new
   profile that combines existing profiles MUST specify how the existing
   profiles' security requirements remain satisfied.  Therefore, any
   profile MUST clearly specify its security requirements and MUST
   document if its security depends on the combination of various
   protocol interactions.

6.8.  Unprotected Information

   Communication with the authz-info endpoint, as well as the various
   error responses defined in this framework, potentially includes
   sending information over an unprotected channel.  These messages may
   leak information to an adversary or may be manipulated by active
   attackers to induce incorrect behavior.  For example, error responses
   for requests to the authorization information endpoint can reveal
   information about an otherwise opaque access token to an adversary
   who has intercepted this token.

   As far as error messages are concerned, this framework is written
   under the assumption that, in general, the benefits of detailed error
   messages outweigh the risk due to information leakage.  For
   particular use cases where this assessment does not apply, detailed
   error messages can be replaced by more generic ones.

   In some scenarios, it may be possible to protect the communication
   with the authz-info endpoint (e.g., through DTLS with only server-
   side authentication).  In cases where this is not possible, it is
   RECOMMENDED to use encrypted CWTs or tokens that are opaque
   references and need to be subjected to introspection by the RS.

   If the initial Unauthorized Resource Request message (see
   Section 5.2) is used, the client MUST make sure that it is not
   sending sensitive content in this request.  While GET and DELETE
   requests only reveal the target URI of the resource, POST and PUT
   requests would reveal the whole payload of the intended operation.

   Since the client is not authenticated at the point when it is
   submitting an access token to the authz-info endpoint, attackers may
   be pretending to be a client and trying to trick an RS to use an
   obsolete profile that in turn specifies a vulnerable security
   mechanism via the authz-info endpoint.  Such an attack would require
   a valid access token containing an ace_profile claim requesting the
   use of said obsolete profile.  Resource owners should update the
   configuration of their RSs to prevent them from using such obsolete
   profiles.

6.9.  Identifying Audiences

   The aud claim, as defined in [RFC7519], and the equivalent audience
   parameter from [RFC8693] are intentionally vague on how to match the
   audience value to a specific RS.  This is intended to allow
   application-specific semantics to be used.  This section attempts to
   give some general guidance for the use of audiences in constrained
   environments.

   URLs are not a good way of identifying mobile devices that can switch
   networks and thus be associated with new URLs.  If the audience
   represents a single RS and asymmetric keys are used, the RS can be
   uniquely identified by a hash of its public key.  If this approach is
   used, it is RECOMMENDED to apply the procedure from Section 3 of
   [RFC6920].

   If the audience addresses a group of resource servers, the mapping of
   a group identifier to an individual RS has to be provisioned to each
   RS before the group-audience is usable.  Managing dynamic groups
   could be an issue if any RS is not always reachable when the groups'
   memberships change.  Furthermore, issuing access tokens bound to
   symmetric proof-of-possession keys that apply to a group-audience is
   problematic, as an RS that is in possession of the access token can
   impersonate the client towards the other RSs that are part of the
   group.  It is therefore NOT RECOMMENDED to issue access tokens bound
   to a group-audience and symmetric proof-of possession keys.

   Even the client must be able to determine the correct values to put
   into the audience parameter in order to obtain a token for the
   intended RS.  Errors in this process can lead to the client
   inadvertently obtaining a token for the wrong RS.  The correct values
   for audience can either be provisioned to the client as part of its
   configuration or dynamically looked up by the client in some
   directory.  In the latter case, the integrity and correctness of the
   directory data must be assured.  Note that the audience hint provided
   by the RS as part of the AS Request Creation Hints (Section 5.3) is
   not typically source authenticated and integrity protected and should
   therefore not be treated a trusted value.

6.10.  Denial of Service Against or with Introspection

   The optional introspection mechanism provided by OAuth and supported
   in the ACE framework allows for two types of attacks that need to be
   considered by implementers.

   First, an attacker could perform a denial-of-service attack against
   the introspection endpoint at the AS in order to prevent validation
   of access tokens.  To maintain the security of the system, an RS that
   is configured to use introspection MUST NOT allow access based on a
   token for which it couldn't reach the introspection endpoint.

   Second, an attacker could use the fact that an RS performs
   introspection to perform a denial-of-service attack against that RS
   by repeatedly sending tokens to its authz-info endpoint that require
   an introspection call.  The RS can mitigate such attacks by
   implementing rate limits on how many introspection requests they
   perform in a given time interval for a certain client IP address
   submitting tokens to /authz-info.  When that limit has been reached,
   incoming requests from that address are rejected for a certain amount
   of time.  A general rate limit on the introspection requests should
   also be considered in order to mitigate distributed attacks.

7.  Privacy Considerations

   Implementers and users should be aware of the privacy implications of
   the different possible deployments of this framework.

   The AS is in a very central position and can potentially learn
   sensitive information about the clients requesting access tokens.  If
   the client credentials grant is used, the AS can track what kind of
   access the client intends to perform.  With other grants, this can be
   prevented by the resource owner.  To do so, the resource owner needs
   to bind the grants it issues to anonymous, ephemeral credentials that
   do not allow the AS to link different grants and thus different
   access token requests by the same client.

   The claims contained in a token can reveal privacy-sensitive
   information about the client and the RS to any party having access to
   them (whether by processing the content of a self-contained token or
   by introspection).  The AS SHOULD be configured to minimize the
   information about clients and RSs disclosed in the tokens it issues.

   If tokens are only integrity protected and not encrypted, they may
   reveal information to attackers listening on the wire or be able to
   acquire the access tokens in some other way.  In the case of CWTs,
   the token may, e.g., reveal the audience, the scope, and the
   confirmation method used by the client.  The latter may reveal the
   identity of the device or application running the client.  This may
   be linkable to the identity of the person using the client (if there
   is a person and not a machine-to-machine interaction).

   Clients using asymmetric keys for proof of possession should be aware
   of the consequences of using the same key pair for proof of
   possession towards different RSs.  A set of colluding RSs or an
   attacker able to obtain the access tokens will be able to link the
   requests or even to determine the client's identity.

   An unprotected response to an unauthorized request (see Section 5.3)
   may disclose information about the RS and/or its existing
   relationship with the C.  It is advisable to include as little
   information as possible in an unencrypted response.  Even the
   absolute URI of the AS may reveal sensitive information about the
   service that the RS provides.  Developers must ensure that the RS
   does not disclose information that has an impact on the privacy of
   the stakeholders in the AS Request Creation Hints.  They may choose
   to use a different mechanism for the discovery of the AS if
   necessary.  If means of encrypting communication between the C and RS
   already exist, more detailed information may be included with an
   error response to provide the C with sufficient information to react
   on that particular error.

8.  IANA Considerations

   This document creates several registries with a registration policy
   of Expert Review; guidelines to the experts are given in
   Section 8.17.

8.1.  ACE Authorization Server Request Creation Hints

   This specification establishes the IANA "ACE Authorization Server
   Request Creation Hints" registry.

   The columns of the registry are:

   Name:  The name of the parameter.

   CBOR Key:  CBOR map key for the parameter.  Different ranges of
      values use different registration policies [RFC8126].  Integer
      values from -256 to 255 are designated as Standards Action.
      Integer values from -65536 to -257 and from 256 to 65535 are
      designated as Specification Required.  Integer values greater than
      65535 are designated as Expert Review.  Integer values less than
      -65536 are marked as Private Use.

   Value Type:  The CBOR data types allowable for the values of this
      parameter.

   Reference:  This contains a pointer to the public specification of
      the Request Creation Hint abbreviation, if one exists.

   This registry has been initially populated by the values in Table 1.
   The Reference column for all of these entries is this document.

8.2.  CoRE Resource Types

   IANA has registered a new Resource Type (rt=) Link Target Attribute
   in the "Resource Type (rt=) Link Target Attribute Values" subregistry
   under the "Constrained RESTful Environments (CoRE) Parameters"
   [IANA.CoreParameters] registry:

   Value:  ace.ai
   Description:  ACE-OAuth authz-info endpoint resource.
   Reference:  RFC 9200

   Specific ACE-OAuth profiles can use this common resource type for
   defining their profile-specific discovery processes.

8.3.  OAuth Extensions Errors

   This specification registers the following error values in the "OAuth
   Extensions Error Registry" [IANA.OAuthExtensionsErrorRegistry].

   Name:  unsupported_pop_key
   Usage Location:  token error response
   Protocol Extension:  RFC 9200
   Change Controller:  IETF
   Reference:  Section 5.8.3 of RFC 9200

   Name:  incompatible_ace_profiles
   Usage Location:  token error response
   Protocol Extension:  RFC 9200
   Change Controller:  IETF
   Reference:  Section 5.8.3 of RFC 9200

8.4.  OAuth Error Code CBOR Mappings

   This specification establishes the IANA "OAuth Error Code CBOR
   Mappings" registry.

   The columns of the registry are:

   Name:  The OAuth Error Code name, refers to the name in Section 5.2
      of [RFC6749], e.g., "invalid_request".

   CBOR Value:  CBOR abbreviation for this error code.  Integer values
      less than -65536 are marked as Private Use; all other values use
      the registration policy Expert Review [RFC8126].

   Reference:  This contains a pointer to the public specification of
      the error code abbreviation, if one exists.

   Original Specification:  This contains a pointer to the public
      specification of the error code, if one exists.

   This registry has been initially populated by the values in Table 3.
   The Reference column for all of these entries is this document.

8.5.  OAuth Grant Type CBOR Mappings

   This specification establishes the IANA "OAuth Grant Type CBOR
   Mappings" registry.

   The columns of this registry are:

   Name:  The name of the grant type, as specified in Section 1.3 of
      [RFC6749].

   CBOR Value:  CBOR abbreviation for this grant type.  Integer values
      less than -65536 are marked as Private Use; all other values use
      the registration policy Expert Review [RFC8126].

   Reference:  This contains a pointer to the public specification of
      the grant type abbreviation, if one exists.

   Original Specification:  This contains a pointer to the public
      specification of the grant type, if one exists.

   This registry has been initially populated by the values in Table 4.
   The Reference column for all of these entries is this document.

8.6.  OAuth Access Token Types

   This section registers the following new token type in the "OAuth
   Access Token Types" registry [IANA.OAuthAccessTokenTypes].

   Name:  PoP
   Additional Token Endpoint Response Parameters:  cnf, rs_cnf (see
      Section 3.1 of [RFC8747] and Section 3.2 of [RFC9201]).
   HTTP Authentication Scheme(s):  N/A
   Change Controller:  IETF
   Reference:  RFC 9200

8.7.  OAuth Access Token Type CBOR Mappings

   This specification establishes the IANA "OAuth Access Token Type CBOR
   Mappings" registry.

   The columns of this registry are:

   Name:  The name of the token type, as registered in the "OAuth Access
      Token Types" registry, e.g., "Bearer".

   CBOR Value:  CBOR abbreviation for this token type.  Integer values
      less than -65536 are marked as Private Use; all other values use
      the registration policy Expert Review [RFC8126].

   Reference:  This contains a pointer to the public specification of
      the OAuth token type abbreviation, if one exists.

   Original Specification:  This contains a pointer to the public
      specification of the OAuth token type, if one exists.

8.7.1.  Initial Registry Contents

   Name:  Bearer
   CBOR Value:  1
   Reference:  RFC 9200
   Original Specification:  [RFC6749]

   Name:  PoP
   CBOR Value:  2
   Reference:  RFC 9200
   Original Specification:  RFC 9200

8.8.  ACE Profiles

   This specification establishes the IANA "ACE Profile" registry.

   The columns of this registry are:

   Name:  The name of the profile to be used as the value of the profile
      attribute.

   Description:  Text giving an overview of the profile and the context
      it is developed for.

   CBOR Value:  CBOR abbreviation for this profile name.  Different
      ranges of values use different registration policies [RFC8126].
      Integer values from -256 to 255 are designated as Standards
      Action.  Integer values from -65536 to -257 and from 256 to 65535
      are designated as Specification Required.  Integer values greater
      than 65535 are designated as Expert Review.  Integer values less
      than -65536 are marked as Private Use.

   Reference:  This contains a pointer to the public specification of
      the profile abbreviation, if one exists.

8.9.  OAuth Parameters

   This specification registers the following parameter in the "OAuth
   Parameters" registry [IANA.OAuthParameters]:

   Name:  ace_profile
   Parameter Usage Location:  token response
   Change Controller:  IETF
   Reference:  Sections 5.8.2 and 5.8.4.3 of RFC 9200

8.10.  OAuth Parameters CBOR Mappings

   This specification establishes the IANA "OAuth Parameters CBOR
   Mappings" registry.

   The columns of this registry are:

   Name:  The OAuth Parameter name, refers to the name in the OAuth
      parameter registry, e.g., client_id.

   CBOR Key:  CBOR map key for this parameter.  Integer values less than
      -65536 are marked as Private Use; all other values use the
      registration policy Expert Review [RFC8126].

   Value Type:  The allowable CBOR data types for values of this
      parameter.

   Reference:  This contains a pointer to the public specification of
      the OAuth parameter abbreviation, if one exists.

   Original Specification  This contains a pointer to the public
      specification of the OAuth parameter, if one exists.

   This registry has been initially populated by the values in Table 5.
   The Reference column for all of these entries is this document.

8.11.  OAuth Introspection Response Parameters

   This specification registers the following parameters in the "OAuth
   Token Introspection Response" registry
   [IANA.TokenIntrospectionResponse].

   Name:  ace_profile
   Description:  The ACE profile used between the client and RS.
   Change Controller:  IETF
   Reference:  Section 5.9.2 of RFC 9200

   Name:  cnonce
   Description:  "client-nonce".  A nonce previously provided to the AS
      by the RS via the client.  Used to verify token freshness when the
      RS cannot synchronize its clock with the AS.
   Change Controller:  IETF
   Reference:  Section 5.9.2 of RFC 9200

   Name  cti
   Description  "CWT ID".  The identifier of a CWT as defined in
      [RFC8392].
   Change Controller  IETF
   Reference  Section 5.9.2 of RFC 9200

   Name:  exi
   Description:  "Expires in".  Lifetime of the token in seconds from
      the time the RS first sees it.  Used to implement a weaker form of
      token expiration for devices that cannot synchronize their
      internal clocks.
   Change Controller:  IETF
   Reference:  Section 5.9.2 of RFC 9200

8.12.  OAuth Token Introspection Response CBOR Mappings

   This specification establishes the IANA "OAuth Token Introspection
   Response CBOR Mappings" registry.

   The columns of this registry are:

   Name:  The OAuth Parameter name, refers to the name in the OAuth
      parameter registry, e.g., client_id.

   CBOR Key:  CBOR map key for this parameter.  Integer values less than
      -65536 are marked as Private Use; all other values use the
      registration policy Expert Review [RFC8126].

   Value Type:  The allowable CBOR data types for values of this
      parameter.

   Reference:  This contains a pointer to the public specification of
      the introspection response parameter abbreviation, if one exists.

   Original Specification  This contains a pointer to the public
      specification of the OAuth Token Introspection parameter, if one
      exists.

   This registry has been initially populated by the values in Table 6.
   The Reference column for all of these entries is this document.

   Note that the mappings of parameters corresponding to claim names
   intentionally coincide with the CWT claim name mappings from
   [RFC8392].

8.13.  JSON Web Token Claims

   This specification registers the following new claims in the "JSON
   Web Token Claims" subregistry under the "JSON Web Token (JWT)"
   registry [IANA.JsonWebTokenClaims]:

   Claim Name:  ace_profile
   Claim Description:  The ACE profile a token is supposed to be used
      with.
   Change Controller:  IETF
   Reference:  Section 5.10 of RFC 9200

   Claim Name:  cnonce
   Claim Description:  "client-nonce".  A nonce previously provided to
      the AS by the RS via the client.  Used to verify token freshness
      when the RS cannot synchronize its clock with the AS.
   Change Controller:  IETF
   Reference:  Section 5.10 of RFC 9200

   Claim Name:  exi
   Claim Description:  "Expires in".  Lifetime of the token in seconds
      from the time the RS first sees it.  Used to implement a weaker
      form of token expiration for devices that cannot synchronize their
      internal clocks.
   Change Controller:  IETF
   Reference:  Section 5.10.3 of RFC 9200

8.14.  CBOR Web Token Claims

   This specification registers the following new claims in the "CBOR
   Web Token (CWT) Claims" registry [IANA.CborWebTokenClaims].

   Claim Name:  ace_profile
   Claim Description:  The ACE profile a token is supposed to be used
      with.
   JWT Claim Name:  ace_profile
   Claim Key:  38
   Claim Value Type:  integer
   Change Controller:  IETF
   Reference:  Section 5.10 of RFC 9200

   Claim Name:  cnonce
   Claim Description:  The client-nonce sent to the AS by the RS via the
      client.
   JWT Claim Name:  cnonce
   Claim Key:  39
   Claim Value Type:  byte string
   Change Controller:  IETF
   Reference:  Section 5.10 of RFC 9200

   Claim Name:  exi
   Claim Description:  The expiration time of a token measured from when
      it was received at the RS in seconds.
   JWT Claim Name:  exi
   Claim Key:  40
   Claim Value Type:  unsigned integer
   Change Controller:  IETF
   Reference:  Section 5.10.3 of RFC 9200

   Claim Name:  scope
   Claim Description:  The scope of an access token, as defined in
      [RFC6749].
   JWT Claim Name:  scope
   Claim Key:  9
   Claim Value Type:  byte string or text string
   Change Controller:  IETF
   Reference:  Section 4.2 of [RFC8693]

8.15.  Media Type Registration

   This specification registers the "application/ace+cbor" media type
   for messages of the protocols defined in this document carrying
   parameters encoded in CBOR.  This registration follows the procedures
   specified in [RFC6838].

   Type name:  application

   Subtype name:  ace+cbor

   Required parameters:  N/A

   Optional parameters:  N/A

   Encoding considerations:  Must be encoded as a CBOR map containing
      the protocol parameters defined in RFC 9200.

   Security considerations:  See Section 6 of RFC 9200

   Interoperability considerations:  N/A

   Published specification:  RFC 9200

   Applications that use this media type:  The type is used by
      authorization servers, clients, and resource servers that support
      the ACE framework with CBOR encoding, as specified in RFC 9200.

   Fragment identifier considerations:  N/A

   Additional information:  N/A

   Person & email address to contact for further information:
      IESG <iesg@ietf.org>

   Intended usage:  COMMON

   Restrictions on usage:  none

   Author:  Ludwig Seitz <ludwig.seitz@combitech.se>

   Change controller:  IETF

8.16.  CoAP Content-Formats

   The following entry has been registered in the "CoAP Content-Formats"
   registry:

   Media Type:  application/ace+cbor
   Encoding:  -
   ID:  19
   Reference:  RFC 9200

8.17.  Expert Review Instructions

   All of the IANA registries established in this document are defined
   to use a registration policy of Expert Review.  This section gives
   some general guidelines for what the experts should be looking for,
   but they are being designated as experts for a reason, so they should
   be given substantial latitude.

   Expert Reviewers should take into consideration the following points:

   *  Point squatting should be discouraged.  Reviewers are encouraged
      to get sufficient information for registration requests to ensure
      that the usage is not going to duplicate one that is already
      registered and that the point is likely to be used in deployments.
      The zones tagged as Private Use are intended for testing purposes
      and closed environments; code points in other ranges should not be
      assigned for testing.

   *  Specifications are needed for the first-come, first-serve range if
      they are expected to be used outside of closed environments in an
      interoperable way.  When specifications are not provided, the
      description provided needs to have sufficient information to
      identify what the point is being used for.

   *  Experts should take into account the expected usage of fields when
      approving point assignment.  The fact that there is a range for
      Standards Track documents does not mean that a Standards Track
      document cannot have points assigned outside of that range.  The
      length of the encoded value should be weighed against how many
      code points of that length are left, i.e., the size of device it
      will be used on.

   *  Since a high degree of overlap is expected between these
      registries and the contents of the OAuth parameters
      [IANA.OAuthParameters] registries, experts should require new
      registrations to maintain alignment with parameters from OAuth
      that have comparable functionality.  Deviation from this alignment
      should only be allowed if there are functional differences that
      are motivated by the use case and that cannot be easily or
      efficiently addressed by comparable OAuth parameters.

9.  References

9.1.  Normative References

   [IANA.CborWebTokenClaims]
              IANA, "CBOR Web Token (CWT) Claims",
              <https://www.iana.org/assignments/cwt>.

   [IANA.CoreParameters]
              IANA, "Constrained RESTful Environments (CoRE)
              Parameters",
              <https://www.iana.org/assignments/core-parameters>.

   [IANA.JsonWebTokenClaims]
              IANA, "JSON Web Token Claims",
              <https://www.iana.org/assignments/jwt>.

   [IANA.OAuthAccessTokenTypes]
              IANA, "OAuth Access Token Types",
              <https://www.iana.org/assignments/oauth-parameters>.

   [IANA.OAuthExtensionsErrorRegistry]
              IANA, "OAuth Extensions Error Registry",
              <https://www.iana.org/assignments/oauth-parameters>.

   [IANA.OAuthParameters]
              IANA, "OAuth Parameters",
              <https://www.iana.org/assignments/oauth-parameters>.

   [IANA.TokenIntrospectionResponse]
              IANA, "OAuth Token Introspection Response",
              <https://www.iana.org/assignments/oauth-parameters>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3986]  Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
              Resource Identifier (URI): Generic Syntax", STD 66,
              RFC 3986, DOI 10.17487/RFC3986, January 2005,
              <https://www.rfc-editor.org/info/rfc3986>.

   [RFC4648]  Josefsson, S., "The Base16, Base32, and Base64 Data
              Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006,
              <https://www.rfc-editor.org/info/rfc4648>.

   [RFC6347]  Rescorla, E. and N. Modadugu, "Datagram Transport Layer
              Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347,
              January 2012, <https://www.rfc-editor.org/info/rfc6347>.

   [RFC6749]  Hardt, D., Ed., "The OAuth 2.0 Authorization Framework",
              RFC 6749, DOI 10.17487/RFC6749, October 2012,
              <https://www.rfc-editor.org/info/rfc6749>.

   [RFC6750]  Jones, M. and D. Hardt, "The OAuth 2.0 Authorization
              Framework: Bearer Token Usage", RFC 6750,
              DOI 10.17487/RFC6750, October 2012,
              <https://www.rfc-editor.org/info/rfc6750>.

   [RFC6838]  Freed, N., Klensin, J., and T. Hansen, "Media Type
              Specifications and Registration Procedures", BCP 13,
              RFC 6838, DOI 10.17487/RFC6838, January 2013,
              <https://www.rfc-editor.org/info/rfc6838>.

   [RFC6920]  Farrell, S., Kutscher, D., Dannewitz, C., Ohlman, B.,
              Keranen, A., and P. Hallam-Baker, "Naming Things with
              Hashes", RFC 6920, DOI 10.17487/RFC6920, April 2013,
              <https://www.rfc-editor.org/info/rfc6920>.

   [RFC7252]  Shelby, Z., Hartke, K., and C. Bormann, "The Constrained
              Application Protocol (CoAP)", RFC 7252,
              DOI 10.17487/RFC7252, June 2014,
              <https://www.rfc-editor.org/info/rfc7252>.

   [RFC7519]  Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token
              (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015,
              <https://www.rfc-editor.org/info/rfc7519>.

   [RFC7662]  Richer, J., Ed., "OAuth 2.0 Token Introspection",
              RFC 7662, DOI 10.17487/RFC7662, October 2015,
              <https://www.rfc-editor.org/info/rfc7662>.

   [RFC8126]  Cotton, M., Leiba, B., and T. Narten, "Guidelines for
              Writing an IANA Considerations Section in RFCs", BCP 26,
              RFC 8126, DOI 10.17487/RFC8126, June 2017,
              <https://www.rfc-editor.org/info/rfc8126>.

   [RFC8152]  Schaad, J., "CBOR Object Signing and Encryption (COSE)",
              RFC 8152, DOI 10.17487/RFC8152, July 2017,
              <https://www.rfc-editor.org/info/rfc8152>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8392]  Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig,
              "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392,
              May 2018, <https://www.rfc-editor.org/info/rfc8392>.

   [RFC8610]  Birkholz, H., Vigano, C., and C. Bormann, "Concise Data
              Definition Language (CDDL): A Notational Convention to
              Express Concise Binary Object Representation (CBOR) and
              JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610,
              June 2019, <https://www.rfc-editor.org/info/rfc8610>.

   [RFC8693]  Jones, M., Nadalin, A., Campbell, B., Ed., Bradley, J.,
              and C. Mortimore, "OAuth 2.0 Token Exchange", RFC 8693,
              DOI 10.17487/RFC8693, January 2020,
              <https://www.rfc-editor.org/info/rfc8693>.

   [RFC8747]  Jones, M., Seitz, L., Selander, G., Erdtman, S., and H.
              Tschofenig, "Proof-of-Possession Key Semantics for CBOR
              Web Tokens (CWTs)", RFC 8747, DOI 10.17487/RFC8747, March
              2020, <https://www.rfc-editor.org/info/rfc8747>.

   [RFC8949]  Bormann, C. and P. Hoffman, "Concise Binary Object
              Representation (CBOR)", STD 94, RFC 8949,
              DOI 10.17487/RFC8949, December 2020,
              <https://www.rfc-editor.org/info/rfc8949>.

   [RFC9201]  Seitz, L., "Additional OAuth Parameters for Authentication
              and Authorization in Constrained Environments (ACE)",
              RFC 9201, DOI 10.17487/RFC9201, August 2022,
              <https://www.rfc-editor.org/info/rfc9201>.

9.2.  Informative References

   [BLE]      Bluetooth Special Interest Group, "Core Specification
              5.3", Section 4.4, July 2021,
              <https://www.bluetooth.com/specifications/bluetooth-core-
              specification/>.

   [DCAF]     Gerdes, S., Bergmann, O., and C. Bormann, "Delegated CoAP
              Authentication and Authorization Framework (DCAF)", Work
              in Progress, Internet-Draft, draft-gerdes-ace-dcaf-
              authorize-04, 19 October 2015,
              <https://datatracker.ietf.org/doc/html/draft-gerdes-ace-
              dcaf-authorize-04>.

   [Margi10impact]
              Margi, C., de Oliveira, B., de Sousa, G., Simplicio Jr,
              M., Barreto, P., Carvalho, T., Naeslund, M., and R. Gold,
              "Impact of Operating Systems on Wireless Sensor Networks
              (Security) Applications and Testbeds", Proceedings of the
              19th International Conference on Computer Communications
              and Networks, DOI 10.1109/ICCCN.2010.5560028, August 2010,
              <https://doi.org/10.1109/ICCCN.2010.5560028>.

   [MQTT5.0]  Banks, A., Briggs, E., Borgendale, K., and R. Gupta, "MQTT
              Version 5.0", OASIS Standard, March 2019,
              <https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-
              v5.0.html>.

   [OAUTH-RPCC]
              Seitz, L., Erdtman, S., and M. Tiloca, "Raw-Public-Key and
              Pre-Shared-Key as OAuth client credentials", Work in
              Progress, Internet-Draft, draft-erdtman-oauth-rpcc-00, 21
              November 2017, <https://datatracker.ietf.org/doc/html/
              draft-erdtman-oauth-rpcc-00>.

   [POP-KEY-DIST]
              Bradley, J., Hunt, P., Jones, M., Tschofenig, H., and M.
              Meszaros, "OAuth 2.0 Proof-of-Possession: Authorization
              Server to Client Key Distribution", Work in Progress,
              Internet-Draft, draft-ietf-oauth-pop-key-distribution-07,
              27 March 2019, <https://datatracker.ietf.org/doc/html/
              draft-ietf-oauth-pop-key-distribution-07>.

   [RFC4949]  Shirey, R., "Internet Security Glossary, Version 2",
              FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007,
              <https://www.rfc-editor.org/info/rfc4949>.

   [RFC6690]  Shelby, Z., "Constrained RESTful Environments (CoRE) Link
              Format", RFC 6690, DOI 10.17487/RFC6690, August 2012,
              <https://www.rfc-editor.org/info/rfc6690>.

   [RFC6819]  Lodderstedt, T., Ed., McGloin, M., and P. Hunt, "OAuth 2.0
              Threat Model and Security Considerations", RFC 6819,
              DOI 10.17487/RFC6819, January 2013,
              <https://www.rfc-editor.org/info/rfc6819>.

   [RFC7009]  Lodderstedt, T., Ed., Dronia, S., and M. Scurtescu, "OAuth
              2.0 Token Revocation", RFC 7009, DOI 10.17487/RFC7009,
              August 2013, <https://www.rfc-editor.org/info/rfc7009>.

   [RFC7228]  Bormann, C., Ersue, M., and A. Keranen, "Terminology for
              Constrained-Node Networks", RFC 7228,
              DOI 10.17487/RFC7228, May 2014,
              <https://www.rfc-editor.org/info/rfc7228>.

   [RFC7521]  Campbell, B., Mortimore, C., Jones, M., and Y. Goland,
              "Assertion Framework for OAuth 2.0 Client Authentication
              and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521,
              May 2015, <https://www.rfc-editor.org/info/rfc7521>.

   [RFC7591]  Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and
              P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol",
              RFC 7591, DOI 10.17487/RFC7591, July 2015,
              <https://www.rfc-editor.org/info/rfc7591>.

   [RFC7641]  Hartke, K., "Observing Resources in the Constrained
              Application Protocol (CoAP)", RFC 7641,
              DOI 10.17487/RFC7641, September 2015,
              <https://www.rfc-editor.org/info/rfc7641>.

   [RFC7744]  Seitz, L., Ed., Gerdes, S., Ed., Selander, G., Mani, M.,
              and S. Kumar, "Use Cases for Authentication and
              Authorization in Constrained Environments", RFC 7744,
              DOI 10.17487/RFC7744, January 2016,
              <https://www.rfc-editor.org/info/rfc7744>.

   [RFC7959]  Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in
              the Constrained Application Protocol (CoAP)", RFC 7959,
              DOI 10.17487/RFC7959, August 2016,
              <https://www.rfc-editor.org/info/rfc7959>.

   [RFC8252]  Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps",
              BCP 212, RFC 8252, DOI 10.17487/RFC8252, October 2017,
              <https://www.rfc-editor.org/info/rfc8252>.

   [RFC8259]  Bray, T., Ed., "The JavaScript Object Notation (JSON) Data
              Interchange Format", STD 90, RFC 8259,
              DOI 10.17487/RFC8259, December 2017,
              <https://www.rfc-editor.org/info/rfc8259>.

   [RFC8414]  Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0
              Authorization Server Metadata", RFC 8414,
              DOI 10.17487/RFC8414, June 2018,
              <https://www.rfc-editor.org/info/rfc8414>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

   [RFC8516]  Keranen, A., ""Too Many Requests" Response Code for the
              Constrained Application Protocol", RFC 8516,
              DOI 10.17487/RFC8516, January 2019,
              <https://www.rfc-editor.org/info/rfc8516>.

   [RFC8613]  Selander, G., Mattsson, J., Palombini, F., and L. Seitz,
              "Object Security for Constrained RESTful Environments
              (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019,
              <https://www.rfc-editor.org/info/rfc8613>.

   [RFC8628]  Denniss, W., Bradley, J., Jones, M., and H. Tschofenig,
              "OAuth 2.0 Device Authorization Grant", RFC 8628,
              DOI 10.17487/RFC8628, August 2019,
              <https://www.rfc-editor.org/info/rfc8628>.

   [RFC9000]  Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based
              Multiplexed and Secure Transport", RFC 9000,
              DOI 10.17487/RFC9000, May 2021,
              <https://www.rfc-editor.org/info/rfc9000>.

   [RFC9110]  Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
              Ed., "HTTP Semantics", STD 97, RFC 9110,
              DOI 10.17487/RFC9110, June 2022,
              <https://www.rfc-editor.org/info/rfc9110>.

   [RFC9113]  Thomson, M., Ed. and C. Benfield, Ed., "HTTP/2", RFC 9113,
              DOI 10.17487/RFC9113, June 2022,
              <https://www.rfc-editor.org/info/rfc9113>.

   [RFC9147]  Rescorla, E., Tschofenig, H., and N. Modadugu, "The
              Datagram Transport Layer Security (DTLS) Protocol Version
              1.3", RFC 9147, DOI 10.17487/RFC9147, April 2022,
              <https://www.rfc-editor.org/info/rfc9147>.

   [RFC9202]  Gerdes, S., Bergmann, O., Bormann, C., Selander, G., and
              L. Seitz, "Datagram Transport Layer Security (DTLS)
              Profile for Authentication and Authorization for
              Constrained Environments (ACE)", RFC 9202,
              DOI 10.17487/RFC9202, August 2022,
              <https://www.rfc-editor.org/info/rfc9202>.

   [RFC9203]  Palombini, F., Seitz, L., Selander, G., and M. Gunnarsson,
              "The Object Security for Constrained RESTful Environments
              (OSCORE) Profile of the Authentication and Authorization
              for Constrained Environments (ACE) Framework", RFC 9203,
              DOI 10.17487/RFC9203, August 2022,
              <https://www.rfc-editor.org/info/rfc9203>.

Appendix A.  Design Justification

   This section provides further insight into the design decisions of
   the solution documented in this document.  Section 3 lists several
   building blocks and briefly summarizes their importance.  The
   justification for offering some of those building blocks, as opposed
   to using OAuth 2.0 as is, is given below.

   Common IoT constraints are:

   Low Power Radio:
      Many IoT devices are equipped with a small battery that needs to
      last for a long time.  For many constrained wireless devices, the
      highest energy cost is associated to transmitting or receiving
      messages (roughly by a factor of 10 compared to AES)
      [Margi10impact].  It is therefore important to keep the total
      communication overhead low, including minimizing the number and
      size of messages sent and received, which has an impact of choice
      on the message format and protocol.  By using CoAP over UDP and
      CBOR-encoded messages, some of these aspects are addressed.
      Security protocols contribute to the communication overhead and
      can, in some cases, be optimized.  For example, authentication and
      key establishment may, in certain cases where security
      requirements allow, be replaced by the provisioning of security
      context by a trusted third party, using transport or application-
      layer security.

   Low CPU Speed:
      Some IoT devices are equipped with processors that are
      significantly slower than those found in most current devices on
      the Internet.  This typically has implications on what timely
      cryptographic operations a device is capable of performing, which
      in turn impacts, e.g., protocol latency.  Symmetric key
      cryptography may be used instead of the computationally more
      expensive public key cryptography where the security requirements
      so allow, but this may also require support for trusted, third-
      party-assisted secret key establishment using transport- or
      application-layer security.

   Small Amount of Memory:
      Microcontrollers embedded in IoT devices are often equipped with
      only a small amount of RAM and flash memory, which places
      limitations on what kind of processing can be performed and how
      much code can be put on those devices.  To reduce code size, fewer
      and smaller protocol implementations can be put on the firmware of
      such a device.  In this case, CoAP may be used instead of HTTP,
      symmetric-key cryptography may be used instead of public-key
      cryptography, and CBOR may be used instead of JSON.  An
      authentication and key establishment protocol, e.g., the DTLS
      handshake, in comparison with assisted key establishment, also has
      an impact on memory and code footprints.

   User Interface Limitations:
      Protecting access to resources is both an important security as
      well as privacy feature.  End users and enterprise customers may
      not want to give access to the data collected by their IoT device
      or to functions it may offer to third parties.  Since the
      classical approach of requesting permissions from end users via a
      rich user interface does not work in many IoT deployment
      scenarios, these functions need to be delegated to user-controlled
      devices that are better suitable for such tasks, such as
      smartphones and tablets.

   Communication Constraints:
      In certain constrained settings, an IoT device may not be able to
      communicate with a given device at all times.  Devices may be
      sleeping or just disconnected from the Internet because of general
      lack of connectivity in the area, cost reasons, or security
      reasons, e.g., to avoid an entry point for denial-of-service
      attacks.

      The communication interactions this framework builds upon (as
      shown graphically in Figure 1) may be accomplished using a variety
      of different protocols, and not all parts of the message flow are
      used in all applications due to the communication constraints.
      Deployments making use of CoAP are expected, but this framework is
      not limited to them.  Other protocols, such as HTTP or Bluetooth
      Smart communication, that do not necessarily use IP could also be
      used.  The latter raises the need for application-layer security
      over the various interfaces.

   In the light of these constraints, we have made the following design
   decisions:

   CBOR, COSE, CWT:
      When using this framework, it is RECOMMENDED to use CBOR [RFC8949]
      as the data format.  Where CBOR data needs to be protected, the
      use of COSE [RFC8152] is RECOMMENDED.  Furthermore, where self-
      contained tokens are needed, it is RECOMMENDED to use CWT
      [RFC8392].  These measures aim at reducing the size of messages
      sent over the wire, the RAM size of data objects that need to be
      kept in memory, and the size of libraries that devices need to
      support.

   CoAP:
      When using this framework, it is RECOMMENDED to use CoAP [RFC7252]
      instead of HTTP.  This does not preclude the use of other
      protocols specifically aimed at constrained devices, e.g.,
      Bluetooth Low Energy (see Section 3.2).  This aims again at
      reducing the size of messages sent over the wire, the RAM size of
      data objects that need to be kept in memory, and the size of
      libraries that devices need to support.

   Access Information:
      This framework defines the name "Access Information" for data
      concerning the RS that the AS returns to the client in an access
      token response (see Section 5.8.2).  This aims at enabling
      scenarios where a powerful client supporting multiple profiles
      needs to interact with an RS for which it does not know the
      supported profiles and the raw public key.

   Proof of Possession:
      This framework makes use of proof-of-possession tokens, using the
      cnf claim [RFC8747].  A request parameter cnf and a Response
      parameter cnf, both having a value space semantically and
      syntactically identical to the cnf claim, are defined for the
      token endpoint to allow requesting and stating confirmation keys.
      This aims at making token theft harder.  Token theft is
      specifically relevant in constrained use cases, as communication
      often passes through middleboxes, which could be able to steal
      bearer tokens and use them to gain unauthorized access.

   Authz-Info endpoint:
      This framework introduces a new way of providing access tokens to
      an RS by exposing an authz-info endpoint to which access tokens
      can be POSTed.  This aims at reducing the size of the request
      message and the code complexity at the RS.  The size of the
      request message is problematic, since many constrained protocols
      have severe message size limitations at the physical layer (e.g.,
      in the order of 100 bytes).  This means that larger packets get
      fragmented, which in turn combines badly with the high rate of
      packet loss and the need to retransmit the whole message if one
      packet gets lost.  Thus, separating sending of the request and
      sending of the access tokens helps to reduce fragmentation.

   Client Credentials Grant:
      In this framework, the use of the client credentials grant is
      RECOMMENDED for machine-to-machine communication use cases, where
      manual intervention of the resource owner to produce a grant token
      is not feasible.  The intention is that the resource owner would
      instead prearrange authorization with the AS based on the client's
      own credentials.  The client can then (without manual
      intervention) obtain access tokens from the AS.

   Introspection:
      In this framework, the use of access token introspection is
      RECOMMENDED in cases where the client is constrained in a way that
      it cannot easily obtain new access tokens (i.e., it has
      connectivity issues that prevent it from communicating with the
      AS).  In that case, it is RECOMMENDED to use a long-term token
      that could be a simple reference.  The RS is assumed to be able to
      communicate with the AS and can therefore perform introspection in
      order to learn the claims associated with the token reference.
      The advantage of such an approach is that the resource owner can
      change the claims associated to the token reference without having
      to be in contact with the client, thus granting or revoking access
      rights.

Appendix B.  Roles and Responsibilities

   Resource Owner
      *  Make sure that the RS is registered at the AS.  This includes
         making known to the AS which profiles, token_type, scopes, and
         key types (symmetric/asymmetric) the RS supports.  Also making
         it known to the AS which audience(s) the RS identifies itself
         with.

      *  Make sure that clients can discover the AS that is in charge of
         the RS.

      *  If the client-credentials grant is used, make sure that the AS
         has the necessary, up-to-date access control policies for the
         RS.

   Requesting Party
      *  Make sure that the client is provisioned the necessary
         credentials to authenticate to the AS.

      *  Make sure that the client is configured to follow the security
         requirements of the requesting party when issuing requests
         (e.g., minimum communication security requirements or trust
         anchors).

      *  Register the client at the AS.  This includes making known to
         the AS which profiles, token_types, and key types (symmetric/
         asymmetric) for the client.

   Authorization Server
      *  Register the RS and manage corresponding security contexts.

      *  Register clients and authentication credentials.

      *  Allow resource owners to configure and update access control
         policies related to their registered RSs.

      *  Expose the token endpoint to allow clients to request tokens.

      *  Authenticate clients that wish to request a token.

      *  Process a token request using the authorization policies
         configured for the RS.

      *  Optionally, expose the introspection endpoint that allows RSs
         to submit token introspection requests.

      *  If providing an introspection endpoint, authenticate RSs that
         wish to get an introspection response.

      *  If providing an introspection endpoint, process token
         introspection requests.

      *  Optionally, handle token revocation.

      *  Optionally, provide discovery metadata.  See [RFC8414].

      *  Optionally, handle refresh tokens.

   Client
      *  Discover the AS in charge of the RS that is to be targeted with
         a request.

      *  Submit the token request (see step (A) of Figure 1).

         -  Authenticate to the AS.

         -  Optionally (if not preconfigured), specify which RS, which
            resource(s), and which action(s) the request(s) will target.

         -  If raw public keys (RPKs) or certificates are used, make
            sure the AS has the right RPK or certificate for this
            client.

      *  Process the access token and Access Information (see step (B)
         of Figure 1).

         -  Check that the Access Information provides the necessary
            security parameters (e.g., PoP key or information on
            communication security protocols supported by the RS).

         -  Safely store the proof-of-possession key.

         -  If provided by the AS, safely store the refresh token.

      *  Send the token and request to the RS (see step (C) of
         Figure 1).

         -  Authenticate towards the RS (this could coincide with the
            proof-of-possession process).

         -  Transmit the token as specified by the AS (default is to the
            authz-info endpoint; alternative options are specified by
            profiles).

         -  Perform the proof-of-possession procedure as specified by
            the profile in use (this may already have been taken care of
            through the authentication procedure).

      *  Process the RS response (see step (F) of Figure 1) of the RS.

   Resource Server
      *  Expose a way to submit access tokens.  By default, this is the
         authz-info endpoint.

      *  Process an access token.

         -  Verify the token is from a recognized AS.

         -  Check the token's integrity.

         -  Verify that the token applies to this RS.

         -  Check that the token has not expired (if the token provides
            expiration information).

         -  Store the token so that it can be retrieved in the context
            of a matching request.

         Note: The order proposed here is not normative; any process
         that arrives at an equivalent result can be used.  A noteworthy
         consideration is whether one can use cheap operations early on
         to quickly discard nonapplicable or invalid tokens before
         performing expensive cryptographic operations (e.g., doing an
         expiration check before verifying a signature).

      *  Process a request.

         -  Set up communication security with the client.

         -  Authenticate the client.

         -  Match the client against existing tokens.

         -  Check that tokens belonging to the client actually authorize
            the requested action.

         -  Optionally, check that the matching tokens are still valid,
            using introspection (if this is possible.)

      *  Send a response following the agreed upon communication
         security mechanism(s).

      *  Safely store credentials, such as raw public keys, for
         authentication or proof-of-possession keys linked to access
         tokens.

Appendix C.  Requirements on Profiles

   This section lists the requirements on profiles of this framework for
   the convenience of profile designers.

   *  Optionally, define new methods for the client to discover the
      necessary permissions and AS for accessing a resource different
      from the one proposed in Sections 5.1 and 4

   *  Optionally, specify new grant types (Section 5.4).

   *  Optionally, define the use of client certificates as client
      credential type (Section 5.5).

   *  Specify the communication protocol the client and RS must use
      (e.g., CoAP) (Sections 5 and 5.8.4.3).

   *  Specify the security protocol the client and RS must use to
      protect their communication (e.g., OSCORE or DTLS).  This must
      provide encryption and integrity and replay protection
      (Section 5.8.4.3).

   *  Specify how the client and the RS mutually authenticate
      (Section 4).

   *  Specify the proof-of-possession protocol(s) and how to select one
      if several are available.  Also specify which key types (e.g.,
      symmetric/asymmetric) are supported by a specific proof-of-
      possession protocol (Section 5.8.4.2).

   *  Specify a unique ace_profile identifier (Section 5.8.4.3).

   *  If introspection is supported, specify the communication and
      security protocol for introspection (Section 5.9).

   *  Specify the communication and security protocol for interactions
      between the client and AS.  This must provide encryption,
      integrity protection, replay protection, and a binding between
      requests and responses (Sections 5 and 5.8).

   *  Specify how/if the authz-info endpoint is protected, including how
      error responses are protected (Section 5.10.1).

   *  Optionally, define other methods of token transport than the
      authz-info endpoint (Section 5.10.1).

Appendix D.  Assumptions on AS Knowledge about the C and RS

   This section lists the assumptions on what an AS should know about a
   client and an RS in order to be able to respond to requests to the
   token and introspection endpoints.  How this information is
   established is out of scope for this document.

   *  The identifier of the client or RS.

   *  The profiles that the client or RS supports.

   *  The scopes that the RS supports.

   *  The audiences that the RS identifies with.

   *  The key types (e.g., pre-shared symmetric key, raw public key, key
      length, and other key parameters) that the client or RS supports.

   *  The types of access tokens the RS supports (e.g., CWT).

   *  If the RS supports CWTs, the COSE parameters for the crypto
      wrapper (e.g., algorithm, key-wrap algorithm, and key-length) that
      the RS supports.

   *  The expiration time for access tokens issued to this RS (unless
      the RS accepts a default time chosen by the AS).

   *  The symmetric key shared between the client and AS (if any).

   *  The symmetric key shared between the RS and AS (if any).

   *  The raw public key of the client or RS (if any).

   *  Whether the RS has synchronized time (and thus is able to use the
      exp claim) or not.

Appendix E.  Differences to OAuth 2.0

   This document adapts OAuth 2.0 to be suitable for constrained
   environments.  This section lists the main differences from the
   normative requirements of OAuth 2.0.

   Use of TLS
      OAuth 2.0 requires the use of TLS to protect the communication
      between the AS and client when requesting an access token, between
      the client and RS when accessing a resource, and between the AS
      and RS if introspection is used.  This framework requires similar
      security properties but does not require that they be realized
      with TLS.  See Section 5.

   Cardinality of grant_type parameter
      In client-to-AS requests using OAuth 2.0, the grant_type parameter
      is required (per [RFC6749]).  In this framework, this parameter is
      optional.  See Section 5.8.1.

   Encoding of scope parameter
      In client-to-AS requests using OAuth 2.0, the scope parameter is
      string encoded (per [RFC6749]).  In this framework, this parameter
      may also be encoded as a byte string.  See Section 5.8.1.

   Cardinality of token_type parameter
      In AS-to-client responses using OAuth 2.0, the token_type
      parameter is required (per [RFC6749]).  In this framework, this
      parameter is optional.  See Section 5.8.2.

   Access token retention
      In OAuth 2.0, the access token may be sent with every request to
      the RS.  The exact use of access tokens depends on the semantics
      of the application and the session management concept it uses.  In
      this framework, the RS must be able to store these tokens for
      later use.  See Section 5.10.1.

Appendix F.  Deployment Examples

   There is a large variety of IoT deployments, as is indicated in
   Appendix A, and this section highlights a few common variants.  This
   section is not normative but illustrates how the framework can be
   applied.

   For each of the deployment variants, there are a number of possible
   security setups between clients, resource servers, and authorization
   servers.  The main focus in the following subsections is on how
   authorization of a client request for a resource hosted by an RS is
   performed.  This requires the security of the requests and responses
   between the clients and the RS to be considered.

   Note: CBOR diagnostic notation is used for examples of requests and
   responses.

F.1.  Local Token Validation

   In this scenario, the case where the resource server is offline is
   considered, i.e., it is not connected to the AS at the time of the
   access request.  This access procedure involves steps (A), (B), (C),
   and (F) of Figure 1.

   Since the resource server must be able to verify the access token
   locally, self-contained access tokens must be used.

   This example shows the interactions between a client, the
   authorization server, and a temperature sensor acting as a resource
   server.  Message exchanges A and B are shown in Figure 11.

   A:  The client first generates a public-private key pair used for
       communication security with the RS.

       The client sends a CoAP POST request to the token endpoint at the
       AS.  The security of this request can be transport or application
       layer.  It is up the communication security profile to define.
       In the example, it is assumed that both the client and AS have
       performed mutual authentication, e.g., via DTLS.  The request
       contains the public key of the client and the audience parameter
       set to "tempSensorInLivingRoom", a value that the temperature
       sensor identifies itself with.  The AS evaluates the request and
       authorizes the client to access the resource.

   B:  The AS responds with a 2.05 (Content) response containing the
       Access Information, including the access token.  The PoP access
       token contains the public key of the client, and the Access
       Information contains the public key of the RS.  For communication
       security, this example uses DTLS RawPublicKey between the client
       and the RS.  The issued token will have a short validity time,
       i.e., exp close to iat, in order to mitigate attacks using stolen
       client credentials.  The token includes claims, such as scope,
       with the authorized access that an owner of the temperature
       device can enjoy.  In this example, the scope claim issued by the
       AS informs the RS that the owner of the token that can prove the
       possession of a key is authorized to make a GET request against
       the /temperature resource and a POST request on the /firmware
       resource.  Note that the syntax and semantics of the scope claim
       are application specific.

       Note: In this example, it is assumed that the client knows what
       resource it wants to access and is therefore able to request
       specific audience and scope claims for the access token.

            Authorization
     Client    Server
       |         |
       |<=======>| DTLS Connection Establishment
       |         |   and mutual authentication
       |         |
   A:  +-------->| Header: POST (Code=0.02)
       |  POST   | Uri-Path:"token"
       |         | Content-Format: application/ace+cbor
       |         | Payload: <Request-Payload>
       |         |
   B:  |<--------+ Header: 2.05 Content
       |  2.05   | Content-Format: application/ace+cbor
       |         | Payload: <Response-Payload>
       |         |

       Figure 11: Token Request and Response Using Client Credentials

   The information contained in the Request-Payload and the Response-
   Payload is shown in Figure 12.  Note that the parameter rs_cnf from
   [RFC9201] is used to inform the client about the resource server's
   public key.

   Request-Payload :
   {
     / audience / 5 : "tempSensorInLivingRoom",
     / client_id / 24 : "myclient",
     / req_cnf / 4 : {
     / COSE_Key / 1 : {
         / kid / 2 : b64'1Bg8vub9tLe1gHMzV76e',
         / kty / 1 : 2 / EC2 /,
         / crv / -1 : 1 / P-256 /,
         / x / -2 : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU',
         / y / -3 : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0'
       }
     }
   }

   Response-Payload :
   {
     / access_token / 1 : b64'0INDoQEKoQVNKkXfb7xaWqMT'/ .../,
     / rs_cnf / 41 : {
       / COSE_Key / 1 : {
         / kid / 2 : b64'c29tZSBwdWJsaWMga2V5IGlk',
         / kty / 1 : 2 / EC2 /,
         / crv / -1 : 1 / P-256 /,
         / x / -2   : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4',
         / y / -3   : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM'
       }
     }
   }

              Figure 12: Request and Response Payload Details

   The content of the access token is shown in Figure 13.

   {
     / aud / 3 : "tempSensorInLivingRoom",
     / iat / 6 : 1563451500,
     / exp / 4 : 1563453000,
     / scope / 9 :  "temperature_g firmware_p",
     / cnf / 8 : {
       / COSE_Key / 1 : {
         / kid / 2 : b64'1Bg8vub9tLe1gHMzV76e',
         / kty / 1 : 2 / EC2 /,
         / crv / -1 : 1 / P-256 /,
         / x / -2 : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU',
         / y / -3 : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0'
       }
     }
   }

         Figure 13: Access Token Including Public Key of the Client

   Messages C and F are shown in Figures 14 and 15.

   C:  The client then sends the PoP access token to the authz-info
       endpoint at the RS.  This is a plain CoAP POST request, i.e., no
       transport or application-layer security is used between the
       client and RS since the token is integrity protected between the
       AS and RS.  The RS verifies that the PoP access token was created
       by a known and trusted AS, which it applies to this RS, and that
       it is valid.  The RS caches the security context together with
       authorization information about this client contained in the PoP
       access token.

              Resource
    Client     Server
       |         |
   C:  +-------->| Header: POST (Code=0.02)
       |  POST   | Uri-Path:"authz-info"
       |         | Payload: 0INDoQEKoQVN ...
       |         |
       |<--------+ Header: 2.04 Changed
       |  2.04   |
       |         |

               Figure 14: Access Token Provisioning to the RS

   The client and the RS runs the DTLS handshake using the raw public
   keys established in steps B and C.

   The client sends a CoAP GET request to /temperature on the RS over
   DTLS.  The RS verifies that the request is authorized based on
   previously established security context.

   F:  The RS responds over the same DTLS channel with a CoAP 2.05
      Content response containing a resource representation as payload.

              Resource
    Client     Server
       |         |
       |<=======>| DTLS Connection Establishment
       |         |   using Raw Public Keys
       |         |
       +-------->| Header: GET (Code=0.01)
       | GET     | Uri-Path: "temperature"
       |         |
       |         |
       |         |
   F:  |<--------+ Header: 2.05 Content
       | 2.05    | Payload: <sensor value>
       |         |

         Figure 15: Resource Request and Response Protected by DTLS

F.2.  Introspection Aided Token Validation

   In this deployment scenario, it is assumed that a client is not able
   to access the AS at the time of the access request, whereas the RS is
   assumed to be connected to the back-end infrastructure.  Thus, the RS
   can make use of token introspection.  This access procedure involves
   steps (A)-(F) of Figure 1 but assumes steps (A) and (B) have been
   carried out during a phase when the client had connectivity to the
   AS.

   Since the client is assumed to be offline, at least for a certain
   period of time, a preprovisioned access token has to be long lived.
   Since the client is constrained, the token will not be self-contained
   (i.e., not a CWT) but instead just a reference.  The resource server
   uses its connectivity to learn about the claims associated to the
   access token by using introspection, which is shown in the example
   below.

   In the example, interactions between an offline client (key fob), an
   RS (online lock), and an AS is shown.  It is assumed that there is a
   provisioning step where the client has access to the AS.  This
   corresponds to message exchanges A and B, which are shown in
   Figure 16.

   Authorization consent from the resource owner can be preconfigured,
   but it can also be provided via an interactive flow with the resource
   owner.  An example of this for the key fob case could be that the
   resource owner has a connected car and buys a generic key to use with
   the car.  To authorize the key fob, the owner connects it to a
   computer that then provides the UI for the device.  After that, OAuth
   2.0 implicit flow can be used to authorize the key for the car at the
   car manufacturer's AS.

   Note: In this example, the client does not know the exact door it
   will be used to access since the token request is not sent at the
   time of access.  So the scope and audience parameters are set quite
   wide to start with, while tailored values narrowing down the claims
   to the specific RS being accessed can be provided to that RS during
   an introspection step.

   A:  The client sends a CoAP POST request to the token endpoint at the
       AS.  The request contains the audience parameter set to
       "PACS1337" (Physical Access System (PACS)), a value that
       identifies the physical access control system to which the
       individual doors are connected.  The AS generates an access token
       as an opaque string, which it can match to the specific client
       and the targeted audience.  It furthermore generates a symmetric
       proof-of-possession key.  The communication security and
       authentication between the client and AS is assumed to have been
       provided at the transport layer (e.g., via DTLS) using a pre-
       shared security context (pre-shared key (PSK), RPK, or
       certificate).

   B:  The AS responds with a CoAP 2.05 Content response, containing as
       payload the Access Information, including the access token and
       the symmetric proof-of-possession key.  Communication security
       between the C and RS will be DTLS and PreSharedKey.  The PoP key
       is used as the PreSharedKey.

   Note: In this example, we are using a symmetric key for a multi-RS
   audience, which is not recommended normally (see Section 6.9).
   However, in this case, the risk is deemed to be acceptable, since all
   the doors are part of the same physical access control system;
   therefore, the risk of a malicious RS impersonating the client
   towards another RS is low.

            Authorization
    Client     Server
       |         |
       |<=======>| DTLS Connection Establishment
       |         |   and mutual authentication
       |         |
   A:  +-------->| Header: POST (Code=0.02)
       |  POST   | Uri-Path:"token"
       |         | Content-Format: application/ace+cbor
       |         | Payload: <Request-Payload>
       |         |
   B:  |<--------+ Header: 2.05 Content
       |         | Content-Format: application/ace+cbor
       |  2.05   | Payload: <Response-Payload>
       |         |

       Figure 16: Token Request and Response Using Client Credentials

   The information contained in the Request-Payload and the Response-
   Payload is shown in Figure 17.

   Request-Payload:
   {
     / client_id / 24 : "keyfob",
     / audience / 5   : "PACS1337"
   }

   Response-Payload:
   {
     / access_token / 1 : b64'VGVzdCB0b2tlbg',
     / cnf / 8 : {
       / COSE_Key / 1 : {
         / kid / 2 : b64'c29tZSBwdWJsaWMga2V5IGlk',
         / kty / 1 : 4 / Symmetric /,
         / k / -1  : b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE'
       }
     }
   }

         Figure 17: Request and Response Payload for the C Offline

   In this case, the access token is just an opaque byte string
   referencing the authorization information at the AS.

   C:  Next, the client POSTs the access token to the authz-info
       endpoint in the RS.  This is a plain CoAP request, i.e., no DTLS
       between the client and RS.  Since the token is an opaque string,
       the RS cannot verify it on its own, and thus defers to respond to
       the client with a status code until after step E.

   D:  The RS sends the token to the introspection endpoint on the AS
       using a CoAP POST request.  In this example, the RS and AS are
       assumed to have performed mutual authentication using a pre-
       shared security context (PSK, RPK, or certificate) with the RS
       acting as the DTLS client.

   E:  The AS provides the introspection response (2.05 Content)
       containing parameters about the token.  This includes the
       confirmation key (cnf) parameter that allows the RS to verify the
       client's proof of possession in step F.  Note that our example in
       Figure 19 assumes a preestablished key (e.g., one used by the
       client and the RS for a previous token) that is now only
       referenced by its key identifier kid.

       After receiving message E, the RS responds to the client's POST
       in step C with the CoAP response code 2.01 (Created).

              Resource
     Client    Server
       |         |
   C:  +-------->| Header: POST (T=CON, Code=0.02)
       |  POST   | Uri-Path:"authz-info"
       |         | Payload: b64'VGVzdCB0b2tlbg'
       |         |
       |         |     Authorization
       |         |       Server
       |         |          |
       |      D: +--------->| Header: POST (Code=0.02)
       |         |  POST    | Uri-Path: "introspect"
       |         |          | Content-Format: application/ace+cbor
       |         |          | Payload: <Request-Payload>
       |         |          |
       |      E: |<---------+ Header: 2.05 Content
       |         |  2.05    | Content-Format: application/ace+cbor
       |         |          | Payload: <Response-Payload>
       |         |          |
       |         |
       |<--------+ Header: 2.01 Created
       |  2.01   |
       |         |

              Figure 18: Token Introspection for the C Offline

   The information contained in the Request-Payload and the Response-
   Payload is shown in Figure 19.

   Request-Payload:
   {
     / token /     11 : b64'VGVzdCB0b2tlbg',
     / client_id / 24 : "FrontDoor"
   }

   Response-Payload:
   {
     / active / 10 : true,
     / aud /     3 : "lockOfDoor4711",
     / scope /   9 : "open close",
     / iat /     6 : 1563454000,
     / cnf /     8 : {
            / kid / 3 : b64'c29tZSBwdWJsaWMga2V5IGlk'
     }
   }

         Figure 19: Request and Response Payload for Introspection

   The client uses the symmetric PoP key to establish a DTLS
   PreSharedKey secure connection to the RS.  The CoAP request PUT is
   sent to the uri-path /state on the RS, changing the state of the door
   to locked.

   F:  The RS responds with an appropriate response over the secure DTLS
       channel.

              Resource
     Client    Server
       |         |
       |<=======>| DTLS Connection Establishment
       |         |   using Pre Shared Key
       |         |
       +-------->| Header: PUT (Code=0.03)
       | PUT     | Uri-Path: "state"
       |         | Payload: <new state for the lock>
       |         |
   F:  |<--------+ Header: 2.04 Changed
       | 2.04    | Payload: <new state for the lock>
       |         |

        Figure 20: Resource Request and Response Protected by OSCORE

Acknowledgments

   This document is a product of the ACE Working Group of the IETF.

   Thanks to Eve Maler for her contributions to the use of OAuth 2.0 and
   Unlicensed Mobile Access (UMA) in IoT scenarios, Robert Taylor for
   his discussion input, and Mališa Vučinić for his input on the
   predecessors of this proposal.

   Thanks to the authors of "[POP-KEY-DIST]OAuth 2.0
   Proof-of-Possession: Authorization Server to Client Key Distribution"
   [POP-KEY-DIST], from where parts of the security considerations where
   copied.

   Thanks to Stefanie Gerdes, Olaf Bergmann, and Carsten Bormann for
   contributing their work on AS discovery from "Delegated CoAP
   Authentication and Authorization Framework (DCAF)" [DCAF] (see
   Section 5.1) and the considerations on multiple access tokens.

   Thanks to Jim Schaad and Mike Jones for their comprehensive reviews.

   Thanks to Benjamin Kaduk for his input on various questions related
   to this work.

   Thanks to Cigdem Sengul for some very useful review comments.

   Thanks to Carsten Bormann for contributing the text for the CoRE
   Resource Type registry.

   Thanks to Roman Danyliw for suggesting Appendix E (including its
   contents).

   Ludwig Seitz and Göran Selander worked on this document as part of
   the CelticPlus project CyberWI, with funding from Vinnova.  Ludwig
   Seitz has also received further funding for this work by Vinnova in
   the context of the CelticNext project CRITISEC.

Authors' Addresses

   Ludwig Seitz
   Combitech
   Djäknegatan 31
   SE-211 35 Malmö
   Sweden
   Email: ludwig.seitz@combitech.com

   Göran Selander
   Ericsson
   SE-164 80 Kista
   Sweden
   Email: goran.selander@ericsson.com

   Erik Wahlstroem
   Sweden
   Email: erik@wahlstromstekniska.se

   Samuel Erdtman
   Spotify AB
   Birger Jarlsgatan 61, 4tr
   SE-113 56 Stockholm
   Sweden
   Email: erdtman@spotify.com

   Hannes Tschofenig
   Arm Ltd.
   6067 Absam
   Austria
   Email: Hannes.Tschofenig@arm.com