ACE Working Group L. Seitz Internet-Draft Combitech Intended status: Standards Track G. Selander Expires:September 9,October 18, 2021 Ericsson E. Wahlstroem S. Erdtman Spotify AB H. Tschofenig Arm Ltd.March 8,April 16, 2021 Authentication and Authorization for Constrained Environments (ACE) using the OAuth 2.0 Framework (ACE-OAuth)draft-ietf-ace-oauth-authz-38draft-ietf-ace-oauth-authz-39 Abstract This specification defines a framework for authentication and authorization in Internet of Things (IoT) environments called ACE- OAuth. The framework is based on a set of building blocks including OAuth 2.0 and the Constrained Application Protocol (CoAP), thus transforming a well-known and widely used authorization solution into a form suitable for IoT devices. Existing specifications are used where possible, but extensions are added and profiles are defined to better serve the IoT use cases. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire onSeptember 9,October 18, 2021. Copyright Notice Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1. OAuth 2.0 . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2. CoAP . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4. Protocol Interactions . . . . . . . . . . . . . . . . . . . . 11 5. Framework . . . . . . . . . . . . . . . . . . . . . . . . . .1514 5.1. Discovering Authorization Servers . . . . . . . . . . . . 16 5.2. Unauthorized Resource Request Message . . . . . . . . . .1716 5.3. AS Request Creation Hints . . . . . . . . . . . . . . . . 17 5.3.1. The Client-Nonce Parameter . . . . . . . . . . . . . 19 5.4. Authorization Grants . . . . . . . . . . . . . . . . . . 20 5.5. Client Credentials . . . . . . . . . . . . . . . . . . . 21 5.6. AS Authentication . . . . . . . . . . . . . . . . . . . . 21 5.7. The Authorization Endpoint . . . . . . . . . . . . . . . 21 5.8. The Token Endpoint . . . . . . . . . . . . . . . . . . .2221 5.8.1. Client-to-AS Request . . . . . . . . . . . . . . . . 22 5.8.2. AS-to-Client Response . . . . . . . . . . . . . . . . 25 5.8.3. Error Response . . . . . . . . . . . . . . . . . . . 27 5.8.4. Request and Response Parameters . . . . . . . . . . . 28 5.8.4.1. Grant Type . . . . . . . . . . . . . . . . . . .2928 5.8.4.2. Token Type . . . . . . . . . . . . . . . . . . . 29 5.8.4.3. Profile . . . . . . . . . . . . . . . . . . . . . 29 5.8.4.4. Client-Nonce . . . . . . . . . . . . . . . . . . 30 5.8.5. Mapping Parameters to CBOR . . . . . . . . . . . . . 30 5.9. The Introspection Endpoint . . . . . . . . . . . . . . . 31 5.9.1. Introspection Request . . . . . . . . . . . . . . . . 32 5.9.2. Introspection Response . . . . . . . . . . . . . . . 33 5.9.3. Error Response . . . . . . . . . . . . . . . . . . . 34 5.9.4. Mapping IntrospectionparametersParameters to CBOR . . . . . . 35 5.10. The Access Token . . . . . . . . . . . . . . . . . . . . 35 5.10.1. The Authorization Information Endpoint . . . . . . . 36 5.10.1.1. Verifying an Access Token . . . . . . . . . . . 37 5.10.1.2. Protecting the Authorization Information Endpoint . . . . . . . . . . . . . . . . . . . . 39 5.10.2. Client Requests to the RS . . . . . . . . . . . . . 39 5.10.3. Token Expiration . . . . . . . . . . . . . . . . . . 40 5.10.4. Key Expiration . . . . . . . . . . . . . . . . . . .4142 6. Security Considerations . . . . . . . . . . . . . . . . . . . 42 6.1. Protecting Tokens . . . . . . . . . . . . . . . . . . . . 42 6.2. Communication Security . . . . . . . . . . . . . . . . . 43 6.3. Long-Term Credentials . . . . . . . . . . . . . . . . . . 44 6.4. Unprotected AS Request Creation Hints . . . . . . . . . .4445 6.5. Minimalsecurity requirementsSecurity Requirements forcommunicationCommunication . 45 6.6. Token Freshness and Expiration . . . . . . . . . . . . . 46 6.7. CombiningprofilesProfiles . . . . . . . . . . . . . . . . . . .4647 6.8. Unprotected Information . . . . . . . . . . . . . . . . . 47 6.9. IdentifyingaudiencesAudiences . . . . . . . . . . . . . . . . . .4748 6.10. Denial ofservice againstService Against or with Introspection . . 48 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 49 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 50 8.1. ACE Authorization Server Request Creation Hints . . . . . 50 8.2. CoRE Resource TyperegistryRegistry . . . . . . . . . . . . . . .5051 8.3. OAuth Extensions Error Registration . . . . . . . . . . . 51 8.4. OAuth Error Code CBOR Mappings Registry . . . . . . . . . 51 8.5. OAuth Grant Type CBOR Mappings . . . . . . . . . . . . .5152 8.6. OAuth Access Token Types . . . . . . . . . . . . . . . . 52 8.7. OAuth Access Token Type CBOR Mappings . . . . . . . . . . 52 8.7.1. Initial Registry Contents . . . . . . . . . . . . . . 53 8.8. ACE Profile Registry . . . . . . . . . . . . . . . . . . 53 8.9. OAuth Parameter Registration . . . . . . . . . . . . . .5354 8.10. OAuth Parameters CBOR Mappings Registry . . . . . . . . . 54 8.11. OAuth Introspection Response Parameter Registration . . . 54 8.12. OAuth Token Introspection Response CBOR Mappings Registry 55 8.13. JSON Web Token Claims . . . . . . . . . . . . . . . . . . 55 8.14. CBOR Web Token Claims . . . . . . . . . . . . . . . . . . 56 8.15. Media Type Registrations . . . . . . . . . . . . . . . . 57 8.16. CoAP Content-Format Registry . . . . . . . . . . . . . .5758 8.17. Expert Review Instructions . . . . . . . . . . . . . . . 58 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 59 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 59 10.1. Normative References . . . . . . . . . . . . . . . . . . 59 10.2. Informative References . . . . . . . . . . . . . . . . . 62 Appendix A. Design Justification . . . . . . . . . . . . . . . . 65 Appendix B. Roles and Responsibilities . . . . . . . . . . . . . 68 Appendix C. Requirements on Profiles . . . . . . . . . . . . . . 71 Appendix D. Assumptions on ASknowledgeKnowledge about C and RS . . . . .7172 Appendix E.Deployment Examples . . . . . . . . . . . . . . . . 72 E.1. Local Token Validation . . .Differences to OAuth 2.0 . . . . . . . . . . . . . . 72E.2. Introspection Aided Token Validation . . . . . . . . . . 76Appendix F.Document Updates . .Deployment Examples . . . . . . . . . . . . . . . .8073 F.1.Version -21 to 22 . . .Local Token Validation . . . . . . . . . . . . . . . . .8173 F.2.Version -20 to 21 . . . . . . . . . . . . . . . . . . . . 81 F.3. Version -19 to 20 . . . . . . . . . . . . . . . . . . . . 81 F.4. Version -18 to -19 . . . . .Introspection Aided Token Validation . . . . . . . . . . 77 Authors' Addresses . . . .81 F.5. Version -17 to -18. . . . . . . . . . . . . . . . . . . 81F.6. Version -161. Introduction Authorization is the process for granting approval to-17 . . . . . . . . . . . . . . . . . . . 81 F.7. Version -15an entity to-16 . . . . . . . . . . . . . . . . . . . 82 F.8. Version -14access a generic resource [RFC4949]. The authorization task itself can best be described as granting access to-15 . . . . . . . . . . . . . . . . . . . 82 F.9. Version -13 to -14 . . . . . . . . . . . . . . . . . . . 82 F.10. Version -12 to -13 . . . . . . . . . . . . . . . . . . . 82 F.11. Version -11 to -12 . . . . . . . . . . . . . . . . . . . 83 F.12. Version -10 to -11 . . . . . . . . . . . . . . . . . . . 83 F.13. Version -09 to -10 . . . . . . . . . . . . . . . . . . . 83 F.14. Version -08 to -09 . . . . . . . . . . . . . . . . . . . 83 F.15. Version -07 to -08 . . . . . . . . . . . . . . . . . . . 83 F.16. Version -06 to -07 . . . . . . . . . . . . . . . . . . . 84 F.17. Version -05 to -06 . . . . . . . . . . . . . . . . . . . 84 F.18. Version -04 to -05 . . . . . . . . . . . . . . . . . . . 84 F.19. Version -03 to -04 . . . . . . . . . . . . . . . . . . . 85 F.20. Version -02 to -03 . . . . . . . . . . . . . . . . . . . 85 F.21. Version -01 to -02 . . . . . . . . . . . . . . . . . . . 85 F.22. Version -00 to -01 . . . . . . . . . . . . . . . . . . . 86 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 86 1. Introduction Authorization is the process for granting approval to an entity to access a generic resource [RFC4949]. The authorization task itself can best be described as granting access to a requesting client, for a resource hosted on a device, the resource server (RS). This exchange is mediated by one or multiple authorization servers (AS). Managing authorization for a large number of devices and users can be a complex task. While prior work on authorization solutions for the Web and for the mobile environment also applies to the Internet of Things (IoT) environment, many IoT devices are constrained, for example, in terms of processing capabilities, available memory, etc. For web applications on constrained nodes, this specification RECOMMENDS the use of the Constrained Application Protocol (CoAP) [RFC7252] as replacement for HTTP. Appendix A gives an overview of the constraints considered in this design, and a more detailed treatment of constraints can be found in [RFC7228]. This design aims to accommodate different IoT deployments and thus a continuous range of device and network capabilities. Taking energy consumption as an example: At one end there are energy- harvesting or battery powered devices which have a tight power budget, on the other end there are mains-powered devices, and all levels in between. Hence, IoT devices may be very different in terms of available processing and message exchange capabilities and there is a need to support many different authorization use cases [RFC7744]. This specification describes a framework for authentication and authorization in constrained environments (ACE) built on re-use of OAuth 2.0 [RFC6749], thereby extending authorization to Internet of Things devices. This specification contains the necessary building blocks for adjusting OAuth 2.0 to IoT environments. More detailed, interoperable specifications can be found in separate profile specifications. Implementations may claim conformance with a specific profile, whereby implementations utilizing the same profile interoperate while implementations of different profiles are not expected to be interoperable. Some devices, such as mobile phones and tablets, may implement multiple profiles and will therefore be able to interact with a wider range of low end devices. Requirements on profiles are described at contextually appropriate places throughout this specification, and also summarized in Appendix C. 2. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. Certain security-related terms such as "authentication", "authorization", "confidentiality", "(data) integrity", "message authentication code", and "verify" are taken from [RFC4949]. Since exchanges in this specification are described as RESTful protocol interactions, HTTP [RFC7231] offers useful terminology. Terminology for entities in the architecture is defined in OAuth 2.0 [RFC6749] such as client (C), resource server (RS), and authorization server (AS). Note that the term "endpoint" is used here following its OAuth definition, which is to denote resources such as token and introspection at the AS and authz-info at the RS (see Section 5.10.1 for a definition of the authz-info endpoint). The CoAP [RFC7252] definition, which is "An entity participating in the CoAP protocol" is not used in this specification. The specifications in this document is called the "framework" or "ACE framework". When referring to "profiles of this framework" it refers to additional specifications that define the use of this specification with concrete transport and communication security protocols (e.g., CoAP over DTLS). We use the term "Access Information" for parameters other than the access token provided to the client by the AS to enable it to access the RS (e.g. public key of the RS, profile supported by RS). We use the term "Authorization Information" to denote all information, including the claims of relevant access tokens, that an RS uses to determine whether an access request should be granted. 3. Overview This specification defines the ACE framework for authorization in the Internet of Things environment. It consists of a set of building blocks. The basic block is the OAuth 2.0 [RFC6749] framework, which enjoys widespread deployment. Many IoT devices can support OAuth 2.0 without any additional extensions, but for certain constrained settings additional profiling is needed. Another building block is the lightweight web transfer protocol CoAP [RFC7252], for those communication environments where HTTP is not appropriate. CoAP typically runs on top of UDP, which further reduces overhead and message exchanges. While this specification defines extensions for the use of OAuth over CoAP, other underlying protocols are not prohibited from being supported in the future, such as HTTP/2 [RFC7540], Message Queuing Telemetry Transport (MQTT) [MQTT5.0], Bluetooth Low Energy (BLE) [BLE] and QUIC [I-D.ietf-quic-transport]. Note that this document specifies protocol exchanges in terms of RESTful verbs such as GET and POST. Future profiles using protocols that do not support these verbs MUST specify how the corresponding protocol messages are transmitted instead. A third building block is the Concise Binary Object Representation (CBOR) [RFC8949], for encodings where JSON [RFC8259] is not sufficiently compact. CBOR is a binary encoding designed for small code and message size, which may be used for encoding of self contained tokens, and also for encoding payloads transferred in protocol messages. A fourth building block is CBOR Object Signing and Encryption (COSE) [RFC8152], which enables object-level layer security as an alternative or complement to transport layer security (DTLS [RFC6347] or TLS [RFC8446]). COSE is used to secure self-contained tokens such as proof-of-possession (PoP) tokens, which are an extension to the OAuth bearer tokens. The default token format is defined in CBOR web token (CWT) [RFC8392]. Application layer security for CoAP using COSE can be provided with OSCORE [RFC8613]. With the building blocks listed above, solutions satisfying various IoT device and network constraints are possible. A list of constraints is described in detail in [RFC7228] and a description of how the building blocks mentioned above relate to the various constraints can be found in Appendix A. Luckily, not every IoT device suffers from all constraints. The ACE framework nevertheless takes all these aspects into account and allows several different deployment variants to co-exist, rather than mandating a one-size-fits-all solution. It is important to cover the wide range of possible interworking use cases and the different requirements from a security point of view. Once IoT deployments mature, popular deployment variants will be documented in the form of ACE profiles. 3.1. OAuth 2.0 The OAuth 2.0 authorization framework enables a client to obtain scoped access to a resource with the permission of a resource owner. Authorization information, or references to it, is passed between the nodes using access tokens. These access tokens are issued to clients by an authorization server with the approval of the resource owner. The client uses the access token to access the protected resources hosted by the resource server. A number of OAuth 2.0 terms are used within this specification: The token and introspection Endpoints: The AS hosts the token endpoint that allows a client to request access tokens. The client makes a POST request to the token endpoint on the AS and receives the access token in the response (if the request was successful). In some deployments, a token introspection endpoint is provided by the AS, which can be used by the RS if it needs to request additional information regarding a received access token. The RS makes a POST request to the introspection endpoint on the AS and receives information about the access token in the response. (See "Introspection" below.) Access Tokens: Access tokens are credentials needed to access protected resources. An access token is a data structure representing authorization permissions issued by the AS to the client. Access tokens are generated by the AS and consumed by the RS. The access token content is opaque to the client. Access tokens can have different formats, and various methods of utilization e.g., cryptographic properties) based on the security requirements of the given deployment. Refresh Tokens: Refresh tokens are credentials used to obtain access tokens. Refresh tokens are issued to the client by the authorization server and are used to obtain a new access token when the current access token becomes invalid or expires, or to obtain additional access tokens with identical or narrower scope (such access tokens may have a shorter lifetime and fewer permissions than authorized by the resource owner). Issuing a refresh token is optional at the discretion of the authorization server. If the authorization server issues a refresh token, it is included when issuing an access token (i.e., step (B) in Figure 1). A refresh token in OAuth 2.0 is a string representing the authorization granted to the client by the resource owner. The string is usually opaque to the client. The token denotes an identifier used to retrieve the authorization information. Unlike access tokens, refresh tokens are intended for use only with authorization servers and are never sent to resource servers. In this framework, refresh tokens are encoded in binary instead of strings, if used. Proof of Possession Tokens: A token may be bound to a cryptographic key, which is then used to bind the token to a request authorized by the token. Such tokens are called proof-of-possession tokens (or PoP tokens). The proof-of-possession (PoP) security concept used here assumes that the AS acts as a trusted third party that binds keys to tokens. In the case of access tokens, these so called PoP keys are then used by the client to demonstrate the possession of the secret to the RS when accessing the resource. The RS, when receiving an access token, needs to verify that the key used by the client matches the one bound to the access token. When this specification uses the term "access token" it is assumed to be a PoP access token token unless specifically stated otherwise. The key bound to the token (the PoP key) may use either symmetric or asymmetric cryptography. The appropriate choice of the kind of cryptography depends on the constraints of the IoT devices as well as on the security requirements of the use case. Symmetric PoP key: The AS generates a random symmetric PoP key. The key is either stored to be returned on introspection calls or encrypted and included in the token. The PoP key is also encrypted for the token recipient and sent to the recipient together with the token. Asymmetric PoP key: An asymmetric key pair is generated on the token's recipient and the public key is sent to the AS (if it does not already have knowledge of the recipient's public key). Information about the public key, which is the PoP key in this case, is either stored to be returned on introspection calls or included inside the token and sent back to the requesting party. The consumer of the token can identify the public key from the information in the token, which allows the recipient of the token to use the corresponding private key for the proof of possession. The token is either a simple reference, or a structured information object (e.g., CWT [RFC8392]) protected by a cryptographic wrapper (e.g., COSE [RFC8152]). The choice of PoP key does not necessarily imply a specific credential type for the integrity protection of the token. Scopes and Permissions: In OAuth 2.0, the client specifies the type of permissions it is seeking to obtain (via the scope parameter) in the access token request. In turn, the AS may use the scope response parameter to inform the client of the scope of the access token issued. As the client could be a constrained device as well, this specification defines the use of CBOR encoding, see Section 5, for such requests and responses. The values of the scope parameter in OAuth 2.0 are expressed as a list of space-delimited, case-sensitive strings, with a semantic that is well-known to the AS and the RS. More details about the concept of scopes is found under Section 3.3 in [RFC6749]. Claims: Information carried in the access token or returned from introspection, called claims, is in the form of name-value pairs. An access token may, for example, include a claim identifying the AS that issued the token (via the "iss" claim) and what audience the access token is intended for (via the "aud" claim). The audience of an access token can be a specific resource or one or many resource servers. The resource owner policies influence what claims are put into the access token by the authorization server. While the structure and encoding of the access token varies throughout deployments, a standardized format has been defined with the JSON Web Token (JWT) [RFC7519] where claims are encoded as a JSON object. In [RFC8392], an equivalent format using CBOR encoding (CWT) has been defined. Introspection: Introspection is a method for a resource server to query the authorization server for the active state and content of a received access token. This is particularly useful in those cases where the authorization decisions are very dynamic and/or where the received access token itself is an opaque reference rather than a self-contained token. More information about introspection in OAuth 2.0 can be found in [RFC7662]. 3.2. CoAP CoAP is an application layer protocol similar to HTTP, but specifically designed for constrained environments. CoAP typically uses datagram-oriented transport, such as UDP, where reordering and loss of packets can occur. A security solution needs to take the latter aspects into account. While HTTP uses headers and query strings to convey additional information about a request, CoAP encodes such information into header parameters called 'options'. CoAP supports application-layer fragmentation of the CoAP payloads through blockwise transfers [RFC7959]. However, blockwise transfer does not increase the size limits of CoAP options, therefore data encoded in options has to be kept small. Transport layer security for CoAP can be provided by DTLS or TLS [RFC6347][RFC8446] [I-D.ietf-tls-dtls13]. CoAP defines a number of proxy operations that require transport layer security to be terminated at the proxy. One approach for protecting CoAP communication end-to-end through proxies, and also to support security for CoAP over a different transport in a uniform way, is to provide security at the application layer using an object-based security mechanism such as COSE [RFC8152]. One application of COSE is OSCORE [RFC8613], which provides end-to- end confidentiality, integrity and replay protection, and a secure binding between CoAP request and response messages. In OSCORE, the CoAP messages are wrapped in COSE objects and sent using CoAP. This framework RECOMMENDS the use of CoAP as replacement for HTTP for use in constrained environments. For communication security this framework does not make an explicit protocol recommendation, since the choice depends on the requirements of the specific application. DTLS [RFC6347], [I-D.ietf-tls-dtls13] and OSCORE [RFC8613] are mentioned as examples, other protocols fulfilling the requirements from Section 6.5 are also applicable. 4. Protocol Interactions The ACE framework is based on the OAuth 2.0 protocol interactions using the token endpoint and optionally the introspection endpoint. A client obtains an access token, and optionally a refresh token, from an AS using the token endpoint and subsequently presents the access token to an RS to gain access to a protected resource. In most deployments the RS can process the access token locally, however in some cases the RS may present it to the AS via the introspection endpoint to get fresh information. These interactions are shown in Figure 1. An overview of various OAuth concepts is provided in Section 3.1. The OAuth 2.0 framework defines a number of "protocol flows" via grant types, which have been extended further with extensions to OAuth 2.0 (such as [RFC7521] and [RFC8628]). What grant types works best depends on the usage scenario and [RFC7744] describes many different IoT use cases but there are two preferred grant types, namely the Authorization Code Grant (described in Section 4.1 of [RFC7521]) and the Client Credentials Grant (described in Section 4.4 of [RFC7521]). The Authorization Code Grant is a good fit for use with apps running on smart phones and tablets that request access to IoT devices, a common scenario in the smart home environment, where users need to go through an authentication and authorization phase (at least during the initial setup phase). The native apps guidelines described in [RFC8252] are applicable to this use case. The Client Credential Grant is a good fit for use with IoT devices where the OAuth client itself is constrained. In such a case, the resource owner has pre-arranged access rights for the client with the authorization server, which is often accomplished using a commissioning tool. The consent of the resource owner, for giving a client access to a protected resource, can be provided dynamically as in the traditional OAuth flows, or it could be pre-configured by the resource owner as authorization policies at the AS, which the AS evaluates when a token request arrives. The resource owner and the requesting party (i.e., client owner) are not shown in Figure 1. This framework supports a wide variety of communication security mechanisms between the ACE entities, such as client, AS, and RS. It is assumed that the client has been registered (also called enrolled or onboarded) to an AS using a mechanism defined outside the scope of this document. In practice, various techniques for onboarding have been used, such as factory-based provisioning or the use of commissioning tools. Regardless of the onboarding technique, this provisioning procedure implies that the client and the AS exchange credentials and configuration parameters. These credentials are used to mutually authenticate each other and to protect messages exchanged between the client and the AS. It is also assumed that the RS has been registered with the AS, potentially in a similar way as the client has been registered with the AS. Established keying material between the AS and the RS allows the AS to apply cryptographic protection to the access token to ensure that its content cannot be modified, and if needed, that the content is confidentiality protected. The keying material necessary for establishing communication security between C and RS is dynamically established as part of the protocol described in this document. At the start of the protocol, there is an optional discovery step where the client discovers the resource server and the resources this server hosts. In this step, the client might also determine what permissions are needed to access the protected resource. A generic procedure is described in Section 5.1; profiles MAY define other procedures for discovery. In Bluetooth Low Energy, for example, advertisements are broadcasted by a peripheral, including information about the primary services. In CoAP, as a second example, a client can make a request to "/.well- known/core" to obtain information about available resources, which are returned in a standardized format as described in [RFC6690]. +--------+ +---------------+ | |---(A)-- Token Request ------->| | | | | Authorization | | |<--(B)-- Access Token ---------| Server | | | + Access Information | | | | + Refresh Token (optional) +---------------+ | | ^ | | | Introspection Request (D)| | | Client | (optional) | | | | Response | |(E) | | (optional) | v | | +--------------+ | |---(C)-- Token + Request ----->| | | | | Resource | | |<--(F)-- Protected Resource ---| Server | | | | | +--------+ +--------------+ Figure 1: Basic Protocol Flow. Requesting an Access Token (A): The client makes an access token request to the token endpoint at the AS. This framework assumes the use of PoP access tokens (see Section 3.1 for a short description) wherein the AS binds a key to an access token. The client may include permissions it seeks to obtain, and information about the credentials it wants to use (e.g., symmetric/asymmetric cryptography or a reference to a specific credential). Access Token Response (B): If the AS successfully processes the request from the client, it returns an access token and optionally a refresh token (note that only certain grant types support refresh tokens). It can also return additional parameters, referred to as "Access Information". In addition to the response parameters defined by OAuth 2.0 and the PoP access token extension, this framework defines parameters that can be used to inform the client about capabilities of the RS, e.g. the profiles the RS supports. More information about these parameters can be found in Section 5.8.4. Resource Request (C): The client interacts with the RS to request access to the protected resource and provides the access token. The protocol to use between the client and the RS is not restricted to CoAP. HTTP, HTTP/2, QUIC, MQTT, Bluetooth Low Energy, etc., are also viable candidates. Depending on the device limitations and the selected protocol, this exchange may be split up into two parts: (1) the client sends the access token containing, or referencing, the authorization information to the RS, that may be used for subsequent resource requests by the client, and (2) the client makes the resource access request, using the communication security protocol and other Access Information obtained from the AS. The Client and the RS mutually authenticate using the security protocol specified in the profile (see step B) and the keys obtained in the access token or the Access Information. The RS verifies that the token is integrity protected and originated by the AS. It then compares the claims contained in the access token with the resource request. If the RS is online, validation can be handed over to the AS using token introspection (see messages D and E) over HTTP or CoAP. Token Introspection Request (D): A resource server may be configured to introspect the access token by including it in a request to the introspection endpoint at that AS. Token introspection over CoAP is defined in Section 5.9 and for HTTP in [RFC7662]. Note that token introspection is an optional step and can be omitted if the token is self-contained and the resource server is prepared to perform the token validation on its own. Token Introspection Response (E): The AS validates the token and returns the most recent parameters, such as scope, audience, validity etc. associated with it back to the RS. The RS then uses the received parameters to process the request to either accept or to deny it. Protected Resource (F): If the request from the client is authorized, the RS fulfills the request and returns a response with the appropriate response code. The RS uses the dynamically established keys to protect the response, according to the communication security protocol used. 5. Framework The following sections detail the profiling and extensions of OAuth 2.0 for constrained environments, which constitutes the ACE framework. Credential Provisioning For IoT, it cannot be assumed that the client and RS are part of a common key infrastructure, so the AS provisions credentials or associated information to allow mutual authentication between client and RS. The resulting security association between client and RS may then also be used to bind these credentials to the access tokens the client uses. Proof-of-Possession The ACE framework, by default, implements proof-of-possession for access tokens, i.e., that the token holder can prove being a holder of the key bound to the token. The binding is provided by the "cnf" claim [RFC8747] indicating what key is used for proof- of-possession. If a client needs to submit a new access token, e.g., to obtain additional access rights, they can request that the AS binds this token to the same key as the previous one. ACE Profiles The client or RS may be limited in the encodings or protocols it supports. To support a variety of different deployment settings, specific interactions between client and RS are defined in an ACE profile. In ACE framework the AS is expected to manage the matching of compatible profile choices between a client and an RS. The AS informs the client of the selected profile using the "ace_profile" parameter in the token response. OAuth 2.0 requires the use of TLS both to protect the communication between AS and client when requesting an access token; between client and RS when accessing a resource and between AS and RS if introspection is used. In constrained settings TLS is not always feasible, or desirable. Nevertheless it is REQUIRED that the communications named above are encrypted, integrity protected and protected against message replay. It is also REQUIRED that the communicating endpoints perform mutual authentication. Furthermore it MUST be assured that responses are bound to the requests in the sense that the receiver of a response can be certain that the response actually belongs to a certain request. Note that setting up such a secure communication may require some unprotected messages to be exchanged first (e.g. sending the token from the client to the RS). Profiles MUST specify a communication security protocol between client and RS that provides the features required above. Profiles MUST specifyacommunication security protocol RECOMMENDED to be used between client and AS that provides the features required above. Profiles MUST specifyrequesting client, forintrospectionacommunication security protocol RECOMMENDED to be used between RS and AS that provides the features required above. These recommendations enable interoperability between different implementations without the need to defineresource hosted on anew profile ifdevice, thecommunication between C and AS,resource server (RS). This exchange is mediated by one orbetween RSmultiple authorization servers (AS). Managing authorization for a large number of devices andAS, is protected withusers can be adifferent security protocol complying with the security requirements above. In OAuth 2.0 the communication withcomplex task. While prior work on authorization solutions for theTokenWeb and for theIntrospection endpoints at the AS is assumed to be via HTTP and may use Uri-query parameters. When profiles of this framework use CoAP instead, it is REQUIREDmobile environment also applies touse ofthefollowing alternative insteadInternet ofUri-query parameters: The sender (client or RS) encodes the parametersThings (IoT) environment, many IoT devices are constrained, for example, in terms ofits request as a CBOR map and submits that map asprocessing capabilities, available memory, etc. For such devices thepayloadConstrained Application Protocol (CoAP) [RFC7252] can alleviate some resource concerns when used instead of HTTP to implement thePOST request. Profiles that use CBOR encodingcommunication flows of this specification. Appendix A gives an overview ofprotocol message parameters at the outermost encoding layer MUST use the media format 'application/ ace+cbor'. If CoAP is used for communication, the Content-Format MUST be abbreviated withtheID: 19 (see Section 8.16). The OAuth 2.0 AS uses a JSON structureconstraints considered inthe payloadthis design, and a more detailed treatment ofits responses bothconstraints can be found in [RFC7228]. This design aims toclientaccommodate different IoT deployments andRS. If CoAP is used, it is REQUIRED to use CBOR [RFC8949] insteadthus a continuous range ofJSON. Dependingdevice and network capabilities. Taking energy consumption as an example: At one end there are energy- harvesting or battery powered devices which have a tight power budget, on theprofile, the CBOR payload MAY be enclosedother end there are mains-powered devices, and all levels ina non-CBOR cryptographic wrapper. 5.1. Discovering Authorization Servers C must discover the ASbetween. Hence, IoT devices may be very different inchargeterms ofRS to determine where to request the access token. To do so, C must 1. find out the AS URI to which the token requestavailable processing and messagemust be sentexchange capabilities and2. MUST validate that the AS with this URIthere isauthorizeda need toprovide access tokenssupport many different authorization use cases [RFC7744]. This specification describes a framework forthis RS. In orderauthentication and authorization in constrained environments (ACE) built on re-use of OAuth 2.0 [RFC6749], thereby extending authorization todetermineInternet of Things devices. This specification contains theAS URI, C MAY send an initial Unauthorized Resource Request messagenecessary building blocks for adjusting OAuth 2.0 toRS. RS then denies the request and sendsIoT environments. Profiles of this framework are available in separate specifications, such as [I-D.ietf-ace-dtls-authorize] or [I-D.ietf-ace-oscore-profile]. Such profiles may specify theaddressuse ofits AS back to C (see Section 5.2). How C validatestheAS authorization is not in scopeframework forthis document. C may, e.g., ask it's owner if this AS is authorizeda specific security protocol and the underlying transports forthis RS. C may alsouse in amechanism that addresses both problems at once. 5.2. Unauthorized Resource Request Message An Unauthorized Resource Request message isspecific deployment environment to improve interoperability. Implementations may claim conformance with arequest for any resource hosted by RS for whichspecific profile, whereby implementations utilizing theclient doessame profile interoperate, while implementations of different profiles are nothave authorization granted. RSes MUST treat any request forexpected to be interoperable. More powerful devices, such as mobile phones and tablets, may implement multiple profiles and will therefore be able to interact with aprotected resourcewider range of constrained devices. Requirements on profiles are described at contextually appropriate places throughout this specification, and also summarized in Appendix C. 2. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. Certain security-related terms such as "authentication", "authorization", "confidentiality", "(data) integrity", "message authentication code", and "verify" are taken from [RFC4949]. Since exchanges in this specification are described as RESTful protocol interactions, HTTP [RFC7231] offers useful terminology. Terminology for entities in the architecture is defined in OAuth 2.0 [RFC6749] such asan Unauthorized Resource Request message when any ofclient (C), resource server (RS), and authorization server (AS). Note that the term "endpoint" is used here followinghold: o The request has been received on an unprotected channel. o The RS has no valid accessits OAuth definition, which is to denote resources such as tokenfor the sender ofand introspection at therequest regardingAS and authz-info at therequested action on that resource. o TheRShas a valid access token(see Section 5.10.1 forthe sendera definition of therequest, but that token does not authorize the requested action on the requested resource. Note: These conditions ensure that the RS can handle requests autonomously once access was granted and a secure channel has been established between C and RS. Theauthz-infoendpoint, as part ofendpoint). The CoAP [RFC7252] definition, which is "An entity participating in theprocess for authorizing to protected resources,CoAP protocol" is notitself a protected resource and MUST NOT be protected as specified above (cf. Section 5.10.1). Unauthorized Resource Request messages MUST be denied with an "unauthorized_client" error response. Inused in thisresponse,specification. The specifications in this document is called theResource Server SHOULD provide proper AS Request Creation Hints"framework" or "ACE framework". When referring toenable the Client"profiles of this framework" it refers torequest an access token from RS's AS as described in Section 5.3. The handlingadditional specifications that define the use ofallthis specification with concrete transport and communication security protocols (e.g., CoAP over DTLS). The term "Access Information" is used for parameters, other than the access token, provided to the clientrequests (including unauthorized ones)by theRS is described in Section 5.10.2. 5.3. AS Request Creation Hints TheASRequest Creation Hints message is sent by an RS as a responsetoan Unauthorized Resource Request message (see Section 5.2)enable it tohelpaccess thesenderRS (e.g. public key of theUnauthorized Resource Request message acquire a valid access token.RS, profile supported by RS). TheAS Request Creation Hints messageterm "Authorization Information" isa CBOR map, with an OPTIONAL element "AS" specifying an absolute URI (see Section 4.3used to denote all information, including the claims of[RFC3986])relevant access tokens, thatidentifiesan RS uses to determine whether an access request should be granted. 3. Overview This specification defines theappropriate ASACE framework for authorization in theRS. The message can also contain the following OPTIONAL parameters: o A "audience" element containingInternet of Things environment. It consists of asuggested audience thatset of building blocks. The basic block is theclient should request atOAuth 2.0 [RFC6749] framework, which enjoys widespread deployment. Many IoT devices can support OAuth 2.0 without any additional extensions, but for certain constrained settings additional profiling is needed. Another building block is theAS. o A "kid" element containinglightweight web transfer protocol CoAP [RFC7252], for those communication environments where HTTP is not appropriate. CoAP typically runs on top of UDP, which further reduces overhead and message exchanges. While this specification defines extensions for thekey identifieruse ofa key used in an existing security association betweenOAuth over CoAP, other underlying protocols are not prohibited from being supported in theclientfuture, such as HTTP/2 [RFC7540], Message Queuing Telemetry Transport (MQTT) [MQTT5.0], Bluetooth Low Energy (BLE) [BLE] andthe RS. The RS expects the client to request an access token bound toQUIC [I-D.ietf-quic-transport]. Note that thiskey,document specifies protocol exchanges inorder to avoid having to re-establish the security association. o A "cnonce" element containing a client-nonce. See Section 5.3.1. o A "scope" element containing the suggested scopeterms of RESTful verbs such as GET and POST. Future profiles using protocols that do not support these verbs MUST specify how theclient should request towards the AS. Figure 2 summarizescorresponding protocol messages are transmitted instead. A third building block is theparameters thatConcise Binary Object Representation (CBOR) [RFC8949], for encodings where JSON [RFC8259] is not sufficiently compact. CBOR is a binary encoding designed for small code and message size, which may bepartused for encoding ofthe AS Request Creation Hints. /-----------+----------+---------------------\ | Name |self contained tokens, and also for encoding payloads transferred in protocol messages. A fourth building block is CBORKey | Value Type | |-----------+----------+---------------------| | AS | 1 | text string | | kid | 2 | byte string | | audience | 5 | text string | | scope | 9 | textObject Signing and Encryption (COSE) [RFC8152], which enables object-level layer security as an alternative orbyte string | | cnonce | 39 | byte string | \-----------+----------+---------------------/ Figure 2: AS Request Creation Hints Note that the schema part of the AS parameter may need to be adaptedcomplement tothetransport layer securityprotocol that(DTLS [RFC6347] or TLS [RFC8446]). COSE is usedbetween the client and the AS. Thus the example AS value "coap://as.example.com/token" might need to be transformedto"coaps://as.example.com/token". It is assumed that the client can determine the correct schema part on its own depending on the way it communicates with the AS. Figure 3 shows an example forsecure self-contained tokens such as proof-of-possession (PoP) tokens, which are anAS Request Creation Hints message payload using CBOR [RFC8949] diagnostic notation, using the parameter names instead ofextension to the OAuth bearer tokens. The default token format is defined in CBORkeysWeb Token (CWT) [RFC8392]. Application-layer security forbetter human readability. 4.01 Unauthorized Content-Format: application/ace+cbor Payload : { "AS" : "coaps://as.example.com/token", "audience" : "coaps://rs.example.com" "scope" : "rTempC", "cnonce" : h'e0a156bb3f' } Figure 3: AS Request Creation Hints payload example InCoAP using COSE can be provided with OSCORE [RFC8613]. With theexamplebuilding blocks listed above,the response parameter "AS" points the receiversolutions satisfying various IoT device and network constraints are possible. A list ofthis message toconstraints is described in detail in [RFC7228] and a description of how theURI "coaps://as.example.com/token"building blocks mentioned above relate torequest access tokens.the various constraints can be found in Appendix A. Luckily, not every IoT device suffers from all constraints. TheRS sending this response (i.e., RS) uses an internal clock thatACE framework nevertheless takes all these aspects into account and allows several different deployment variants to co-exist, rather than mandating a one-size-fits-all solution. It isonly loosely synchronized withimportant to cover the wide range of possible interworking use cases and theclockdifferent requirements from a security point of view. Once IoT deployments mature, popular deployment variants will be documented in theAS. Therefore it can not reliably verify the expiration timeform ofaccess tokens it receives. To ensureACE profiles. 3.1. OAuth 2.0 The OAuth 2.0 authorization framework enables acertain level ofclient to obtain scoped accesstoken freshness nevetheless, the RS has includedto a"cnonce" parameter (see Section 5.3.1) inresource with theresponse. Figure 4 illustratespermission of a resource owner. Authorization information, or references to it, is passed between themandatorynodes using access tokens. These access tokens are issued touse binary encodingclients by an authorization server with the approval of themessage payload shown in Figure 3. a4 # map(4) 01 # unsigned(1) (=AS) 78 1c # text(28) 636f6170733a2f2f61732e657861 6d706c652e636f6d2f746f6b656e # "coaps://as.example.com/token" 05 # unsigned(5) (=audience) 76 # text(22) 636f6170733a2f2f72732e657861 6d706c652e636f6d # "coaps://rs.example.com" 09 # unsigned(9) (=scope) 66 # text(6) 7254656d7043 # "rTempC" 18 27 # unsigned(39) (=cnonce) 45 # bytes(5) e0a156bb3f # Figure 4: AS Request Creation Hints example encoded in CBOR 5.3.1.resource owner. TheClient-Nonce Parameter If the RS does not synchronize its clock withclient uses theAS, it could be tricked into accepting oldaccesstokens, that are either expired or have been compromised. In order to ensure some level oftokenfreshness in that case,to access theRS can useprotected resources hosted by the"cnonce" (client-nonce) parameter. The processing requirements forresource server. A number of OAuth 2.0 terms are used within thisparameterspecification: Access Tokens: Access tokens areas follows: ocredentials needed to access protected resources. AnRS sendingaccess token is a"cnonce" parameter in andata structure representing authorization permissions issued by the ASRequest Creation Hints message MUST store informationtovalidate that a given cnonce is fresh. How this is implemented internallythe client. Access tokens are generated by the AS and consumed by the RS. The access token content isout of scope for this specification. Expirationopaque to the client. Access tokens can have different formats, and various methods ofclient-nonces should beutilization e.g., cryptographic properties) basedroughlyon thetime it would takesecurity requirements of the given deployment. Introspection: Introspection is aclientmethod for a resource server or potentially a client, toobtain an access token after receivingquery theAS Request Creation Hints message, with some allowanceauthorization server forunexpected delays. o A client receiving a "cnonce" parameter in an AS Request Creation Hints message MUST include this intheparameters when requesting anactive state and content of a received accesstoken attoken. This is particularly useful in those cases where theAS, usingauthorization decisions are very dynamic and/or where the"cnonce" parameter from Section 5.8.4.4. o If an AS grants anreceived access tokenrequest containingitself is an opaque reference rather than a"cnonce" parameter, it MUST include this valueself-contained token. More information about introspection intheOAuth 2.0 can be found in [RFC7662]. Refresh Tokens: Refresh tokens are credentials used to obtain accesstoken, usingtokens. Refresh tokens are issued to the"cnonce" claim specified in Section 5.10. o An RS that is usingclient by theclient-nonce mechanismauthorization server andthat receives anare used to obtain a new access tokenMUST verify that thiswhen the current access tokencontains a cnonce claim,expires, or to obtain additional access tokens with identical or narrower scope (such access tokens may have aclient-nonce value that is fresh according toshorter lifetime and fewer permissions than authorized by theinformation storedresource owner). Issuing a refresh token is optional at thefirst step above.discretion of the authorization server. If thecnonce claimauthorization server issues a refresh token, it isnot present or if the cnonce claim valueincluded when issuing an access token (i.e., step (B) in Figure 1). A refresh token in OAuth 2.0 isnot fresh,a string representing theRS MUST discardauthorization granted to theaccess token. If this was an interaction withclient by theauthz-info endpointresource owner. The string is usually opaque to theRS MUST also respond withclient. The token denotes anerror message using a response code equivalentidentifier used to retrieve theCoAP code 4.01 (Unauthorized). 5.4. Authorization Grants To request anauthorization information. Unlike accesstoken, the client obtainstokens, refresh tokens are intended for use only with authorizationfrom theservers and are never sent to resourceowner or uses its client credentials as a grant. The authorization is expressedservers. In this framework, refresh tokens are encoded inthe formbinary instead ofan authorization grant. The OAuth framework [RFC6749] defines four grant types. The grant types can be split up into two groups, those granted on behalfstrings, if used. Proof of Possession Tokens: A token may be bound to a cryptographic key, which is then used to bind theresource owner (password, authorization code, implicit) and those fortoken to a request authorized by theclient (client credentials). Further grant types have been added later, such as [RFC7521] defining an assertion-based authorization grant.token. Such tokens are called proof-of-possession tokens (or PoP tokens). Thegrant type is selected depending onproof-of-possession security concept used here assumes that theuse case.AS acts as a trusted third party that binds keys to tokens. Incases wherethe case of access tokens, these so called PoP keys are then used by the clientacts on behalfto demonstrate the possession of theresource owner,secret to theauthorization code grant is recommended. IfRS when accessing the resource. The RS, when receiving an access token, needs to verify that the key used by the clientacts on behalf ofmatches theresource owner, but does not have any display or has very limited interaction possibilities,one bound to the access token. When this specification uses the term "access token" it isrecommendedassumed to be a PoP access token unless specifically stated otherwise. The key bound touse the device code grant defined in [RFC8628]. In cases wheretheclient acts autonomouslytoken (the PoP key) may use either symmetric or asymmetric cryptography. The appropriate choice of theclient credentials grant is recommended. For detailskind of cryptography depends on thedifferent grant types, see section 1.3 of [RFC6749]. The OAuth 2.0 framework provides an extension mechanism for defining additional grant types, so profilesconstraints ofthis framework MAY define additional grant types, if needed. 5.5. Client Credentials Authenticationthe IoT devices as well as on the security requirements of theclientuse case. Symmetric PoP key: The AS generates a random symmetric PoP key. The key ismandatory independent ofeither stored to be returned on introspection calls or included in thegrant type when requesting an access token fromtoken. Either the whole tokenendpoint. In the case ofor only theclient credentials grant type,key MUST be encrypted in theauthentication and grant coincide. Client registration and provisioning of client credentialslatter case. The PoP key is also returned totheclient together with the token. Asymmetric PoP key: An asymmetric key pair isout of scope for this specification. The OAuth framework defines one client credential type in section 2.3.1 of [RFC6749]: client id andgenerated by the clientsecret. [I-D.erdtman-ace-rpcc] adds raw-public-keyandpre-shared-keythe public key is sent to theclient credentials types. Profiles of this framework MAY extend with an additional client credentials type using client certificates. 5.6.ASAuthentication The client credential grant(if it doesnot, by default, authenticate the AS thatnot already have knowledge of theclient connects to. In classic OAuth,client's public key). Information about theASpublic key, which isauthenticated with a TLS server certificate. Profiles ofthe PoP key in thisframework MUST specify how clients authenticatecase, is either stored to be returned on introspection calls or included inside theAStoken andhow communication security is implemented. By default, server side TLS certificates, as defined by OAuth 2.0, are required. 5.7. The Authorization Endpoint The OAuth 2.0 authorization endpoint is usedsent back tointeract withthe client. The resourceowner and obtain an authorization grant,server consuming the token can identify the public key from the information incertain grant flows. The primarythe token, which allows the client to usecase fortheACE-OAuth framework iscorresponding private key formachine-to-machine interactions that do not involve the resource owner intheauthorization flow; therefore, this endpointproof of possession. The token isouteither a simple reference, or a structured information object (e.g., CWT [RFC8392]) protected by a cryptographic wrapper (e.g., COSE [RFC8152]). The choice ofscope here. Future profiles may define constrained adaptation mechanismsPoP key does not necessarily imply a specific credential type forthis endpoint as well. Non-constrained clients interacting with constrained resource servers can usethespecification in section 3.1integrity protection of[RFC6749] andtheattack countermeasures suggested in section 4.2 of [RFC6819]. 5.8. The Token Endpointtoken. Scopes and Permissions: InstandardOAuth 2.0, theAS provides the token endpoint for submitting access token requests. This framework extendsclient specifies thefunctionalitytype of permissions it is seeking to obtain (via the scope parameter) in the access tokenendpoint, givingrequest. In turn, the AS may use thepossibilityscope response parameter tohelpinform the clientand RS to establish shared keys or to exchange their public keys. Furthermore, this framework defines encodings using CBOR, as a substitute for JSON. The endpoint may, however, be exposed over HTTPS as in classical OAuth or even other transports. A profile MUST defineof thedetailsscope of themapping betweenaccess token issued. As thefields described below, and these transports. If HTTPS is used, JSON or CBOR payloads mayclient could besupported. If JSON payloads are used,a constrained device as well, this specification defines thesemanticsuse of CBOR encoding, see Section45, for such requests and responses. The values of the scope parameter in OAuth 2.0specification MUST be followed (with additionsare expressed asdescribed below). If CBOR payloada list of space-delimited, case-sensitive strings, with a semantic that issupported, the semantics described below MUST be followed. For the AS to be ablewell-known toissue a token,theclient MUST be authenticatedAS andpresent a valid grant forthe RS. More details about the concept of scopesrequested. Profilesis found under Section 3.3 in [RFC6749]. Claims: Information carried in the access token or returned from introspection, called claims, is in the form ofthis framework MUST specify howname-value pairs. An access token may, for example, include a claim identifying the ASauthenticatesthat issued theclient and howtoken (via thecommunication between client"iss" claim) andASwhat audience the access token isprotected, fulfillingintended for (via therequirements specified in Section 5."aud" claim). Thedefault nameaudience ofthis endpoint inanurl-path is '/token', however implementations are not required to use this name andaccess token candefine their own instead.be a specific resource or one or many resource servers. Thefigures of this section use CBOR diagnostic notation withoutresource owner policies influence what claims are put into theinteger abbreviations foraccess token by theparameters or their values for illustrative purposes. Note that implementations MUST useauthorization server. While theinteger abbreviationsstructure and encoding of thebinaryaccess token varies throughout deployments, a standardized format has been defined with the JSON Web Token (JWT) [RFC7519] where claims are encoded as a JSON object. In [RFC8392] the CBOR Web Token (CWT) has been defined as an equivalent format using CBORencoding, ifencoding. The token and introspection Endpoints: The AS hosts theCBOR encoding is used. 5.8.1. Client-to-AS Requesttoken endpoint that allows a client to request access tokens. The clientsendsmakes a POST request to the token endpointat the AS. The profile MUST specify how the communication is protected. The content ofon therequest consists ofAS and receives theparameters specifiedaccess token in therelevant subsection of section 4 ofresponse (if theOAuth 2.0 specification [RFC6749], depending onrequest was successful). In some deployments, a token introspection endpoint is provided by thegrant type, withAS, which can be used by thefollowing exceptionsRS andadditions: o The parameter "grant_type" is OPTIONAL in the context of this framework (as opposed to REQUIRED in RFC6749). If that parameter is missing,potentially thedefault value "client_credentials" is implied. o The "audience" parameter from [RFC8693] is OPTIONALclient, if they need to requestan access token bound toadditional information regarding aspecific audience. oreceived access token. The"cnonce" parameter defined in Section 5.8.4.4 is REQUIRED if the RS providedrequesting entity makes aclient-nonce inPOST request to the"AS Request Creation Hints" message Section 5.3 o The "scope" parameter MAY be encoded as a byte string instead ofintrospection endpoint on thestring encoding specified in section 3.3 of [RFC6749],AS and receives information about the access token inorder allow compact encoding of complex scopes. The syntaxthe response. (See "Introspection" above.) 3.2. CoAP CoAP is an application-layer protocol similar to HTTP, but specifically designed for constrained environments. CoAP typically uses datagram-oriented transport, such as UDP, where reordering and loss ofsuch a binary encoding is explicitly not specified herepackets can occur. A security solution needs to take the latter aspects into account. While HTTP uses headers andleftquery strings toprofiles or applications, specifically note thatconvey additional information about abinary encoded scoperequest, CoAP encodes such information into header parameters called 'options'. CoAP supports application-layer fragmentation of the CoAP payloads through blockwise transfers [RFC7959]. However, blockwise transfer does notnecessarily useincrease thespace character '0x20'size limits of CoAP options, therefore data encoded in options has todelimit scope-tokens. o The clientbe kept small. Transport layer security for CoAP cansend an empty (null value) "ace_profile" parameter to indicatebe provided by DTLS or TLS [RFC6347][RFC8446] [I-D.ietf-tls-dtls13]. CoAP defines a number of proxy operations thatit wants the ASrequire transport layer security toincludebe terminated at the"ace_profile" parameterproxy. One approach for protecting CoAP communication end-to-end through proxies, and also to support security for CoAP over a different transport inthe response. See Section 5.8.4.3. o A client MUST be ablea uniform way, is touseprovide security at theparameters from [I-D.ietf-ace-oauth-params] inapplication layer using anaccess tokenobject-based security mechanism such as COSE [RFC8152]. One application of COSE is OSCORE [RFC8613], which provides end-to- end confidentiality, integrity and replay protection, and a secure binding between CoAP requesttoand response messages. In OSCORE, thetoken endpointCoAP messages are wrapped in COSE objects and sent using CoAP. In this framework theAS MUST be able to process these additional parameters. The default behavior,use of CoAP as replacement for HTTP isthat the AS generates a symmetric proof-of- possession keyRECOMMENDED forthe client. In order touse in constrained environments. For communication security this framework does not make anasymmetric key pair or to re-use a key previously established withexplicit protocol recommendation, since theRS,choice depends on theclient is supposed to userequirements of the"req_cnf" parameter from [I-D.ietf-ace-oauth-params]. If CBOR is used then these parameters MUST be providedspecific application. DTLS [RFC6347], [I-D.ietf-tls-dtls13] and OSCORE [RFC8613] are mentioned asa CBOR map. When HTTPexamples, other protocols fulfilling the requirements from Section 6.5 are also applicable. 4. Protocol Interactions The ACE framework isused as a transport thenbased on theclient makes a request toOAuth 2.0 protocol interactions using the token endpointby sending the parameters usingand optionally the"application/ x-www-form-urlencoded" format withintrospection endpoint. A client obtains an access token, and optionally acharacter encoding of UTF-8 inrefresh token, from an AS using theHTTP request entity-body, as defined in section 3.2 of [RFC6749]. The following examples illustrate different types of requests for proof-of-possession tokens. Figure 5 shows a request for atokenwith a symmetric proof-of- possession key. The content is displayed in CBOR diagnostic notation, without abbreviations for better readability. Header: POST (Code=0.02) Uri-Host: "as.example.com" Uri-Path: "token" Content-Format: "application/ace+cbor" Payload: { "client_id" : "myclient", "audience" : "tempSensor4711" } Figure 5: Example request for anendpoint and subsequently presents the access tokenboundtoa symmetric key. Figure 6 shows a request for a token withanasymmetric proof-of- possession key. Note that in this example OSCORE [RFC8613] is usedRS toprovide object-security, thereforegain access to a protected resource. In most deployments theContent-Format is "application/oscore" wrappingRS can process the"application/ace+cbor" type content. The OSCORE option has a decoded interpretation appendedaccess token locally, however inparentheses forsome cases thereader's convenience. Also note that in this exampleRS may present it to theaudience is implicitly known by both client and AS. Furthermore note that this example usesAS via the"req_cnf" parameter from [I-D.ietf-ace-oauth-params]. Header: POST (Code=0.02) Uri-Host: "as.example.com" Uri-Path: "token" OSCORE: 0x09, 0x05, 0x44, 0x6C (h=0, k=1, n=001, partialIV= 0x05, kid=[0x44, 0x6C]) Content-Format: "application/oscore" Payload: 0x44025d1 ... (full payload omitted for brevity) ... 68b3825e Decrypted payload: { "client_id" : "myclient", "req_cnf" : { "COSE_Key" : { "kty" : "EC", "kid" : h'11', "crv" : "P-256", "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' } } } Figure 6: Example token request boundintrospection endpoint toan asymmetric key.get fresh information. These interactions are shown in Figure7 shows a1. An overview of various OAuth concepts is provided in Section 3.1. +--------+ +---------------+ | |---(A)-- Token Request ------->| | | | | Authorization | | |<--(B)-- Access Token ---------| Server | | | + Access Information | | | | + Refresh Token (optional) +---------------+ | | ^ | | | Introspection Request (D)| | | Client | Response | |(E) | | (optional exchange) | | | | | v | | +--------------+ | |---(C)-- Token + Request ----->| | | | | Resource | | |<--(F)-- Protected Resource ---| Server | | | | | +--------+ +--------------+ Figure 1: Basic Protocol Flow. Requesting an Access Token (A): The client makes an access token request to the token endpoint at the AS. This framework assumes the use of PoP access tokens (see Section 3.1 for atoken whereshort description) wherein the AS binds apreviously communicated proof-of-possessionkeyis only referenced usingto an access token. The client may include permissions it seeks to obtain, and information about the"req_cnf" parameter from [I-D.ietf-ace-oauth-params]. Header: POST (Code=0.02) Uri-Host: "as.example.com" Uri-Path: "token" Content-Format: "application/ace+cbor" Payload: { "client_id" : "myclient", "audience" : "valve424", "scope" : "read", "req_cnf" : { "kid" : b64'6kg0dXJM13U' } }W Figure 7: Example requestcredentials it wants to use for proof-of-possession (e.g., symmetric/asymmetric cryptography or a reference to a specific key) of the access token. Access Token Response (B): If the request from the client has been successfully verified, authenticated, and authorized, the AS returns an access tokenbound toand optionally akey reference. Refresh tokens are typically not stored as securely as proof-of- possession keys in requesting clients. Proof-of-possession basedrefreshtoken requests MUST NOT request different proof-of-possession keys or different audiences in token requests. Refresh token requests cantoken. Note that onlyusecertain grant types support refresh tokens. The AS can also return additional parameters, referred torequest access tokens boundas "Access Information". In addition to thesame proof-of-possession keyresponse parameters defined by OAuth 2.0 and thesame audience asPoP accesstokens issued in the initialtokenrequest. 5.8.2. AS-to-Client Response Ifextension, this framework defines parameters that can be used to inform the client about capabilities of the RS, e.g. the profile the RS supports. More information about these parameters can be found in Section 5.8.4. Resource Request (C): The client interacts with theaccess tokenRS to requesthas been successfully verified byaccess to theASprotected resource and provides theclient is authorized to obtain anaccesstoken correspondingtoken. The protocol toits access token request,use between theAS sends a response withclient and theresponse code equivalentRS is not restricted to CoAP. HTTP, HTTP/2 [RFC7540], QUIC [I-D.ietf-quic-transport], MQTT [MQTT5.0], Bluetooth Low Energy [BLE], etc., are also viable candidates. Depending on the device limitations and the selected protocol, this exchange may be split up into two parts: (1) theCoAP response code 2.01 (Created). Ifclientrequest was invalid,sends the access token containing, ornot authorized,referencing, theAS returns an error response as described in Section 5.8.3. Noteauthorization information to the RS, that will be used for subsequent resource requests by theAS decides which token typeclient, andprofile to use when issuing a successful response. It is assumed that(2) theAS has prior knowledge ofclient makes thecapabilities ofresource access request, using the communication security protocol and other Access Information obtained from the AS. The client and the RS(see Appendix D). This prior knowledge may, for example, be set bymutually authenticate using theuse of a dynamic client registrationsecurity protocolexchange [RFC7591]. If the client has requested a specific proof-of-possession key usingspecified in the"req_cnf" parameter from [I-D.ietf-ace-oauth-params], this may also influence whichprofile (see step B) and theAS selects, as it needs to supportkeys obtained in theuse ofaccess token or the Access Information. The RS verifies that the token is integrity protected and originated by the AS. It then compares the claims contained in thekey type requestedaccess token with theclient. The content ofresource request. If thesuccessful replyRS is online, validation can be handed over to theAccess Information. WhenAS usingCBOR payloads, the content MUSTtoken introspection (see messages D and E) over HTTP or CoAP. Token Introspection Request (D): A resource server may beencoded asconfigured to introspect the access token by including it in aCBOR map, containing parameters as specifiedrequest to the introspection endpoint at that AS. Token introspection over CoAP is defined in Section5.1 of [RFC6749], with the following additions5.9 andchanges: ace_profile: OPTIONAL unless the request included an empty ace_profile parameterfor HTTP inwhich case it is MANDATORY. This indicates the profile[RFC7662]. Note that token introspection is an optional step and can be omitted if theclient MUST use towards the RS. See Section 5.8.4.3 fortoken is self-contained and theformatting of this parameter. If this parameterresource server isabsent,prepared to perform the token validation on its own. Token Introspection Response (E): The ASassumes thatvalidates theclient implicitly knows which profile to use towardstoken and returns theRS. token_type: This parameter is OPTIONAL,most recent parameters, such asopposedscope, audience, validity etc. associated with it back to'required' in [RFC6749]. By default implementations of this framework SHOULD assume thatthetoken_type is "PoP". If a specific use case requires another token_type (e.g., "Bearer") to be usedRS. The RS thenthis parameter is REQUIRED. Furthermore [I-D.ietf-ace-oauth-params] defines additionaluses the received parametersthatto process theAS MUST be ablerequest touse when respondingeither accept or toadeny it. Protected Resource (F): If the requesttofrom thetoken endpoint. Figure 8 summarizesclient is authorized, theparameters that can currently be part ofRS fulfills theAccess Information. Future extensions may define additional parameters. /-------------------+-------------------------------\ | Parameter name | Specified in | |-------------------+-------------------------------| | access_token | RFC 6749 | | token_type | RFC 6749 | | expires_in | RFC 6749 | | refresh_token | RFC 6749 | | scope | RFC 6749 | | state | RFC 6749 | | error | RFC 6749 | | error_description | RFC 6749 | | error_uri | RFC 6749 | | ace_profile | [this document] | | cnf | [I-D.ietf-ace-oauth-params] | | rs_cnf | [I-D.ietf-ace-oauth-params] | \-------------------+-------------------------------/ Figure 8: Access Information parameters Figure 9 shows a response containing a tokenrequest and returns a"cnf" parameterresponse with the appropriate response code. The RS uses the dynamically established keys to protect the response, according to the communication security protocol used. The OAuth 2.0 framework defines asymmetric proof-of-possession key,number of "protocol flows" via grant types, whichis defined in [I-D.ietf-ace-oauth-params]. Notehave been extended further with extensions to OAuth 2.0 (such as [RFC7521] and [RFC8628]). What grant type works best depends on the usage scenario and [RFC7744] describes many different IoT use cases but there are two grant types that cover a majority of these scenarios, namely thekey identifier 'kid' is only used to simplify indexingAuthorization Code Grant (described in Section 4.1 of [RFC7521]) andretrievingthekey,Client Credentials Grant (described in Section 4.4 of [RFC7521]). The Authorization Code Grant is a good fit for use with apps running on smart phones andno assumptions should be madetablets thatit is uniquerequest access to IoT devices, a common scenario in thedomains of either the client orsmart home environment, where users need to go through an authentication and authorization phase (at least during theRS. Header: Created (Code=2.01) Content-Format: "application/ace+cbor" Payload: { "access_token" : b64'SlAV32hkKG ... (remainder of CWT omitted for brevity; CWT contains COSE_Keyinitial setup phase). The native apps guidelines described inthe "cnf" claim)', "ace_profile" : "coap_dtls", "expires_in" : "3600", "cnf" : { "COSE_Key" : { "kty" : "Symmetric", "kid" : b64'39Gqlw', "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' } } } Figure 9: Example AS response with an access token bound[RFC8252] are applicable toa symmetric key. 5.8.3. Error Responsethis use case. Theerror responsesClient Credential Grant is a good fit forCoAP-based interactionsuse with IoT devices where theAS are generally equivalent toOAuth client itself is constrained. In such a case, theonesresource owner has pre-arranged access rights forHTTP-based interactions as defined in Section 5.2 of [RFC6749],the client with thefollowing exceptions: o Whenauthorization server, which is often accomplished usingCBOR the raw payload before being processed by the communication security protocol MUST be encoded asaCBOR map. o A response code equivalent tocommissioning tool. The consent of theCoAP code 4.00 (Bad Request) MUST be used for all error responses, exceptresource owner, forinvalid_client wheregiving aresponse code equivalentclient access tothe CoAP code 4.01 (Unauthorized) MAYa protected resource, can beused under the same conditions as specified in Section 5.2 of [RFC6749]. o The Content-Format (for CoAP-based interactions)provided dynamically as in the traditional OAuth flows, ormedia type (for HTTP-based interactions) "application/ace+cbor" MUSTit could beused forpre-configured by theerror response. oresource owner as authorization policies at the AS, which the AS evaluates when a token request arrives. Theparameters "error", "error_description"resource owner and"error_uri" MUST be abbreviated usingthecodes specifiedrequesting party (i.e., client owner) are not shown in Figure12, when1. This framework supports aCBOR encoding is used. o The error code (i.e., valuewide variety of communication security mechanisms between the"error" parameter) MUST be abbreviatedACE entities, such asspecified in Figure 10, when a CBOR encodingclient, AS, and RS. It isused. /---------------------------+-------------\ | Name | CBOR Values | |---------------------------+-------------| | invalid_request | 1 | | invalid_client | 2 | | invalid_grant | 3 | | unauthorized_client | 4 | | unsupported_grant_type | 5 | | invalid_scope | 6 | | unsupported_pop_key | 7 | | incompatible_ace_profiles | 8 | \---------------------------+-------------/ Figure 10: CBOR abbreviations for common error codesassumed that the client has been registered (also called enrolled or onboarded) to an AS using a mechanism defined outside the scope of this document. Inadditionpractice, various techniques for onboarding have been used, such as factory-based provisioning or the use of commissioning tools. Regardless of the onboarding technique, this provisioning procedure implies that the client and the AS exchange credentials and configuration parameters. These credentials are used to mutually authenticate each other and to protect messages exchanged between theerror responses defined in OAuth 2.0,client and thefollowing behavior MUST be implemented byAS. It is also assumed that theAS: o IfRS has been registered with theclient submits an asymmetric keyAS, potentially in a similar way as thetoken request thatclient has been registered with the AS. Established keying material between the AS and the RScannot process,allows the ASMUST rejectto apply cryptographic protection to the access token to ensure thatrequest withits content cannot be modified, and if needed, that the content is confidentiality protected. Confidentiality protection of the access token content would be provided on top of confidentiality protection via aresponse code equivalentcommunication security protocol. The keying material necessary for establishing communication security between C and RS is dynamically established as part of the protocol described in this document. At the start of the protocol, there is an optional discovery step where the client discovers the resource server and the resources this server hosts. In this step, the client might also determine what permissions are needed to access theCoAP code 4.00 (Bad Request)protected resource. A generic procedure is described in Section 5.1; profiles MAY define other procedures for discovery. In Bluetooth Low Energy, for example, advertisements are broadcast by a peripheral, including information about theerror code "unsupported_pop_key" definedprimary services. In CoAP, as a second example, a client can make a request to "/.well- known/core" to obtain information about available resources, which are returned inFigure 10. o Ifa standardized format as described in [RFC6690]. 5. Framework The following sections detail the profiling and extensions of OAuth 2.0 for constrained environments, which constitutes the ACE framework. Credential Provisioning In constrained environments it cannot be assumed that the client and the RSit has requested an access token for do not shareare part of a commonprofile,key infrastructure. Therefore, the ASMUST reject that request with a response code equivalentprovisions credentials and associated information to allow mutual authentication between theCoAP code 4.00 (Bad Request) includingclient and theerror code "incompatible_ace_profiles" defined in Figure 10. 5.8.4. RequestRS. The resulting security association between the client andResponse Parameters This section provides more detail aboutthenew parameters that canRS may then also be usedinto bind these credentials to the accesstoken requests and responses, as well as abbreviationstokens the client uses. Proof-of-Possession The ACE framework, by default, implements proof-of-possession formore compact encodingaccess tokens, i.e., that the token holder can prove being a holder ofexisting parameters and common parameter values. 5.8.4.1. Grant Typethe key bound to the token. Theabbreviations specified inbinding is provided by theregistry defined in Section 8.5 MUST be"cnf" claim [RFC8747] indicating what key is usedin CBOR encodings instead of the string values defined in [RFC6749], if CBOR payloads are used. /--------------------+------------+------------------------\ | Name | CBOR Value | Original Specification | |--------------------+------------+------------------------| | password | 0 | [RFC6749] | | authorization_code | 1 | [RFC6749] | | client_credentials | 2 | [RFC6749] | | refresh_token | 3 | [RFC6749] | \--------------------+------------+------------------------/ Figure 11: CBOR abbreviationsforcommon grant types 5.8.4.2. Token Typeproof- of-possession. If a client needs to submit a new access token, e.g., to obtain additional access rights, they can request that the AS binds this token to the same key as the previous one. ACE Profiles The"token_type" parameter, definedclient or RS may be limited insection 5.1the encodings or protocols it supports. To support a variety of[RFC6749], allowsdifferent deployment settings, specific interactions between client and RS are defined in an ACE profile. In ACE framework the AS is expected toindicate tomanage theclient which typematching ofaccess token it is receiving (e.g.,compatible profile choices between abearer token). This document registersclient and an RS. The AS informs thenew value "PoP" forclient of theOAuth Access Token Types registry, specifying a proof-of-possession token. Howselected profile using theproof-of-possession by"ace_profile" parameter in theclienttoken response. OAuth 2.0 requires the use of TLS both to protect the communication between AS and client when requesting an access token; between client and RS when accessing a resource and between AS and RS if introspection isperformedused. In constrained settings TLS is not always feasible, or desirable. Nevertheless it is REQUIRED that the communications named above are encrypted, integrity protected and protected against message replay. It is also REQUIRED that the communicating endpoints perform mutual authentication. Furthermore it MUST bespecified byassured that responses are bound to theprofiles. The valuesrequests in the"token_type" parameter MUST usesense that theCBOR abbreviations defined inreceiver of a response can be certain that theregistry specified by Section 8.7, ifresponse actually belongs to aCBOR encoding is used. In this frameworkcertain request. Note that setting up such a secure communication may require some unprotected messages to be exchanged first (e.g. sending the"pop" value fortoken from the"token_type" parameter isclient to thedefault. The AS may, however, provide a different value. 5.8.4.3. ProfileRS). Profilesof this frameworkMUSTdefine the communication protocol and thespecify a communication security protocol betweentheclient and RS that provides theRS. The security protocol MUST provide encryption, integrity and replay protection. Itfeatures required above. Profiles MUSTalso providespecify abindingcommunication security protocol RECOMMENDED to be used betweenrequestsclient andresponses. Furthermore profiles MUST define a list of allowed proof- of-possession methods, if they support proof-of-possession tokens. A profile MUST specify an identifierAS thatMUST be used to uniquely identify itself in the "ace_profile" parameter. The textual representation ofprovides theprofile identifier is intended for human readability and for JSON-based interactions, it MUST NOT be used for CBOR-based interactions.features required above. Profiles MUSTregister their identifier in the registry defined in Section 8.8. Profiles MAY define additional parametersspecify forboth the token requestintrospection a communication security protocol RECOMMENDED to be used between RS and AS that provides theAccess Information infeatures required above. These recommendations enable interoperability between different implementations without theaccess token response in orderneed tosupport negotiation or signaling ofdefine a new profilespecific parameters. Clients that wantif theAS to provide themcommunication between C and AS, or between RS and AS, is protected with a different security protocol complying with the"ace_profile" parameter insecurity requirements above. In OAuth 2.0 theaccess token response can indicate that by sending a ace_profile parametercommunication witha null value (for CBOR-based interactions) or an empty string (for JSON based interactions) intheaccess token request. 5.8.4.4. Client-Nonce This parameter MUST be sent fromToken and the Introspection endpoints at theclientAS is assumed tothe AS, ifbe via HTTP and may use Uri-query parameters. When profiles of this framework use CoAP instead, itpreviously received a "cnonce" parameter inis REQUIRED to use of theAS Request Creation Hints Section 5.3.following alternative instead of Uri-query parameters: Theparameter is encodedsender (client or RS) encodes the parameters of its request as abyte string for CBOR-based interactions,CBOR map and submits that map asa string (Base64 encoded binary) for JSON-based interactions. Itthe payload of the POST request. Profiles that use CBOR encoding of protocol message parameters at the outermost encoding layer MUSTcopyuse thevalue fromcontent format 'application/ ace+cbor'. If CoAP is used for communication, thecnonce parameter inContent-Format MUST be abbreviated with the ID: 19 (see Section 8.16). The OAuth 2.0 ASRequest Creation Hints. 5.8.5. Mapping Parametersuses a JSON structure in the payload of its responses both toCBORclient and RS. IfCBOR encodingCoAP is used,all OAuth parameters in access token requests and responses MUST be mappedit is REQUIRED to use CBORtypes as specified in[RFC8949] instead of JSON. Depending on theregistry defined by Section 8.10, usingprofile, thegiven integer abbreviation forCBOR payload MAY be enclosed in a non-CBOR cryptographic wrapper. 5.1. Discovering Authorization Servers C must discover themap keys. Note that we have alignedAS in charge of RS to determine where to request theabbreviations correspondingaccess token. To do so, C must 1. find out the AS URI toclaims withwhich theabbreviations defined in [RFC8392]. Note alsotoken request message must be sent and 2. MUST validate thatabbreviations from -24the AS with this URI is authorized to23 have a 1 byte encoding size in CBOR. We have thus chosenprovide access tokens for this RS. In order toassign abbreviations in that rangedetermine the AS URI, C MAY send an initial Unauthorized Resource Request message toparameters we expectRS. RS then denies the request and sends the address of its AS back tobe used most frequently in constrained scenarios. /-------------------+----------+---------------------\ | Name | CBOR Key | Value Type | |-------------------+----------+---------------------| | access_token | 1 | byte string | | expires_in | 2 | unsigned integer | | audience | 5 | text string | | scope | 9 | text or byte string | | client_id | 24 | text string | | client_secret | 25 | byte string | | response_type | 26 | text string | | redirect_uri | 27 | text string | | state | 28 | text string | | code | 29 | byte string | | error | 30 | integer | | error_description | 31 | text string | | error_uri | 32 | text string | | grant_type | 33 | unsigned integer | | token_type | 34 | integer | | username | 35 | text string | | password | 36 | text string | | refresh_token | 37 | byte string | | ace_profile | 38 | integer | | cnonce | 39 | byte string | \-------------------+----------+---------------------/ Figure 12: CBOR mappings usedC (see Section 5.2). How C validates the AS authorization is not in scope for this document. C may, e.g., ask its owner if this AS is authorized for this RS. C may also use a mechanism that addresses both problems at once (e.g. by querying a dedicated secure service provided by the client owner) . 5.2. Unauthorized Resource Request Message An Unauthorized Resource Request message is a request for any resource hosted by RS for which the client does not have authorization granted. RSes MUST treat any request for a protected resource as an Unauthorized Resource Request message when any of the following hold: o The request has been received on an unsecured channel. o The RS has no valid access token for the sender of the request regarding the requested action on that resource. o The RS has a valid access token for the sender of the request, but that token does not authorize the requested action on the requested resource. Note: These conditions ensure that the RS can handle requests autonomously once access was granted andresponses 5.9.a secure channel has been established between C and RS. TheIntrospection Endpoint Token introspection [RFC7662] canauthz-info endpoint, as part of the process for authorizing to protected resources, is not itself a protected resource and MUST NOT beOPTIONALLY providedprotected as specified above (cf. Section 5.10.1). Unauthorized Resource Request messages MUST be denied with an "unauthorized_client" error response. In this response, the Resource Server SHOULD provide proper "AS Request Creation Hints" to enable the client to request an access token from RS's AS as described in Section 5.3. The handling of all client requests (including unauthorized ones) by theAS, andRS isthen useddescribed in Section 5.10.2. 5.3. AS Request Creation Hints The "AS Request Creation Hints" message is sent bythean RSand potentially the client to query the AS for metadata aboutas agiven token, e.g., validity or scope. Analogousresponse tothe protocol defined in [RFC7662] for HTTP and JSON, this section defines adaptationsan Unauthorized Resource Request message (see Section 5.2) tomore constrained environments using CBOR and leavinghelp thechoicesender of theapplication protocol toUnauthorized Resource Request message acquire a valid access token. The "AS Request Creation Hints" message is a CBOR or JSON map, with an OPTIONAL element "AS" specifying an absolute URI (see Section 4.3 of [RFC3986]) that identifies theprofile. Communication betweenappropriate AS for therequesting entity andRS. The message can also contain theintrospection endpointfollowing OPTIONAL parameters: o A "audience" element contains an identifier the client should request at theAS MUST be integrity protected and encrypted. The communication security protocol MUST also provide a binding between requests and responses. FurthermoreAS, as suggested by thetwo interacting parties MUST perform mutual authentication. FinallyRS. With this parameter, when included in theAS SHOULD verify thataccess token request to therequesting entity hasAS, therightAS is able toaccess introspection information aboutrestrict theprovided token. Profilesuse of access token to specific RSs. See Section 6.9 for a discussion of thisframework that support introspection MUST specify how authentication and communicationparameter. o A "kid" element containing the key identifier of a key used in an existing security association between therequesting entityclient and theAS is implemented.RS. Thedefault name of this endpoint inRS expects the client to request anurl-path is '/introspect', however implementations are not requiredaccess token bound touse this name and can define their own instead. The figures ofthissection uses CBOR diagnostic notation withoutkey, in order to avoid having to re-establish theinteger abbreviations forsecurity association. o A "cnonce" element containing a client-nonce. See Section 5.3.1. o A "scope" element containing theparameters or their values for better readability. Notesuggested scope thatsupporting introspection is OPTIONAL for implementations of this framework. 5.9.1. Introspection Request The requesting entity sends a POST request totheintrospection endpoint atclient should request towards the AS.The profile MUST specify how the communication is protected. If CBOR is used,Figure 2 summarizes thepayload MUSTparameters that may beencoded as a CBOR map with a "token" entry containingpart of theaccess token. Further optional parameters representing additional context"AS Request Creation Hints". /-----------+----------+---------------------\ | Name | CBOR Key | Value Type | |-----------+----------+---------------------| | AS | 1 | text string | | kid | 2 | byte string | | audience | 5 | text string | | scope | 9 | text or byte string | | cnonce | 39 | byte string | \-----------+----------+---------------------/ Figure 2: AS Request Creation Hints Note thatis known bytherequesting entity to aidschema part of the ASin its response MAYparameter may need to beincluded. For CoAP-based interaction, all messages MUST useadapted to thecontent type "application/ace+cbor", while for HTTP-based interactionssecurity protocol that is used between theequivalent media type "application/ace+cbor" MUST be used. The same parameters are requiredclient andoptional as in Section 2.1 of [RFC7662]. For example, Figure 13 shows an RS callingthetoken introspection endpoint atAS. Thus the example AS value "coap://as.example.com/token" might need toquery about an OAuth 2.0 proof-of-possession token. Note that object security based on OSCORE [RFC8613]be transformed to "coaps://as.example.com/token". It is assumedin this example, thereforethat theContent-Format is "application/oscore".client can determine the correct schema part on its own depending on the way it communicates with the AS. Figure143 shows an example for an "AS Request Creation Hints" message payload using CBOR [RFC8949] diagnostic notation, using thedecoded payload. Header: POST (Code=0.02) Uri-Host: "as.example.com" Uri-Path: "introspect" OSCORE: 0x09, 0x05, 0x25parameter names instead of the CBOR keys for better human readability. 4.01 Unauthorized Content-Format:"application/oscore" Payload: ... COSE content ... Figure 13: Example introspection request.application/ace+cbor Payload : {"token""AS" :b64'7gj0dXJQ43U', "token_type_hint""coaps://as.example.com/token", "audience" :"PoP""coaps://rs.example.com" "scope" : "rTempC", "cnonce" : h'e0a156bb3f' } Figure14: Decoded payload. 5.9.2. Introspection Response If3: AS Request Creation Hints payload example In theintrospection request is authorized and successfully processed,example above, theAS sends aresponsewithparameter "AS" points theresponse code equivalentreceiver of this message to theCoAP code 2.01 (Created). If the introspectionURI "coaps://as.example.com/token" to requestwas invalid,access tokens. The RS sending this response uses an internal clock that is notauthorized or couldn't be processedsynchronized with the clock of the AS. Therefore, it can not reliably verify the expiration time of access tokens it receives. To ensure a certain level of access token freshness nevertheless, theAS returns an error response as described in Section 5.9.3. InRS has included asuccessful response,"cnonce" parameter (see Section 5.3.1) in theAS encodesresponse. (The hex-sequence of theresponse parameterscnonce parameter is encoded ina map including with the same required and optional parameters asCBOR-based notation inSection 2.2 of [RFC7662] withthis example.) Figure 4 illustrates thefollowing addition: ace_profile OPTIONAL. This indicatesmandatory to use binary encoding of theprofile thatmessage payload shown in Figure 3. a4 # map(4) 01 # unsigned(1) (=AS) 78 1c # text(28) 636f6170733a2f2f61732e657861 6d706c652e636f6d2f746f6b656e # "coaps://as.example.com/token" 05 # unsigned(5) (=audience) 76 # text(22) 636f6170733a2f2f72732e657861 6d706c652e636f6d # "coaps://rs.example.com" 09 # unsigned(9) (=scope) 66 # text(6) 7254656d7043 # "rTempC" 18 27 # unsigned(39) (=cnonce) 45 # bytes(5) e0a156bb3f # Figure 4: AS Request Creation Hints example encoded in CBOR 5.3.1. The Client-Nonce Parameter If the RSMUST usedoes not synchronize its clock with theclient. See Section 5.8.4.3 for more details on the formatting of this parameter. cnonce OPTIONAL. A client-nonce providedAS, it could be tricked into accepting old access tokens, that are either expired or have been compromised. In order to ensure some level of token freshness in that case, theAS byRS can use theclient."cnonce" (client-nonce) parameter. The processing requirements for this parameter are as follows: o An RS sending a "cnonce" parameter in an "AS Request Creation Hints" message MUSTverifystore information to validate that a given cnonce is fresh. How thiscorresponds tois implemented internally is out of scope for this specification. Expiration of client-nonces should be based roughly on theclient-nonce previously providedtime it would take a client to obtain an access token after receiving the "AS Request Creation Hints" message, with some allowance for unexpected delays. o A client receiving a "cnonce" parameter inthe ASan "AS Request CreationHints. See Section 5.3 and Section 5.8.4.4. exi OPTIONAL. The "expires-in" claim associated toHints" message MUST include thisaccess token. See Section 5.10.3. Furthermore [I-D.ietf-ace-oauth-params] defines more parameters thatin theAS MUST be able to useparameters whenresponding to a request torequesting an access token at theintrospection endpoint. For example, Figure 15 showsAS, using the "cnonce" parameter from Section 5.8.4.4. o If an ASresponse to the introspectiongrants an access token requestin Figure 13. Note thatcontaining a "cnonce" parameter, it MUST include thisexample contains the "cnf" parameter definedvalue in[I-D.ietf-ace-oauth-params]. Header: Created (Code=2.01) Content-Format: "application/ace+cbor" Payload: { "active" : true, "scope" : "read", "ace_profile" : "coap_dtls", "cnf" : { "COSE_Key" : { "kty" : "Symmetric", "kid" : b64'39Gqlw', "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' } } } Figure 15: Example introspection response. 5.9.3. Error Response The error responses for CoAP-based interactions withtheAS are equivalent toaccess token, using theones for HTTP-based interactions as defined"cnonce" claim specified in Section2.3 of [RFC7662], with the following differences:5.10. oIf content is sent and CBORAn RS that isusedusing thepayloadclient-nonce mechanism and that receives an access token MUSTbe encoded asverify that this token contains aCBOR map andcnonce claim, with a client-nonce value that is fresh according to the information stored at the first step above. If the cnonce claim is not present or if the cnonce claim value is not fresh, theContent-Format "application/ace+cbor"RS MUSTbe used. o If the credentials used bydiscard therequesting entity (usuallyaccess token. If this was an interaction with theRS) are invalidauthz-info endpoint theASRS MUST also respond withthean error message using a response code equivalent to the CoAP code 4.01(Unauthorized) and use(Unauthorized). 5.4. Authorization Grants To request an access token, therequired and optional parametersclient obtains authorization fromSection 5.2the resource owner or uses its client credentials as a grant. The authorization is expressed in[RFC6749]. othe form of an authorization grant. The OAuth framework [RFC6749] defines four grant types. The grant types can be split up into two groups, those granted on behalf of the resource owner (password, authorization code, implicit) and those for the client (client credentials). Further grant types have been added later, such as [RFC7521] defining an assertion-based authorization grant. The grant type is selected depending on the use case. In cases where the client acts on behalf of the resource owner, the authorization code grant is recommended. If therequesting entityclient acts on behalf of the resource owner, but does not havethe rightany display or has very limited interaction possibilities, it is recommended toperformuse the device code grant defined in [RFC8628]. In cases where the client acts autonomously the client credentials grant is recommended. For details on the different grant types, see section 1.3 of [RFC6749]. The OAuth 2.0 framework provides an extension mechanism for defining additional grant types, so profiles of thisintrospection request,framework MAY define additional grant types, if needed. 5.5. Client Credentials Authentication of the client is mandatory independent of theAS MUST respond with a response code equivalent togrant type when requesting an access token from theCoAP code 4.03 (Forbidden).token endpoint. Inthisthe caseno payload is returned. o The parameters "error", "error_description"of the client credentials grant type, the authentication and"error_uri" MUST be abbreviated usinggrant coincide. Client registration and provisioning of client credentials to thecodes specified in Figure 12. oclient is out of scope for this specification. Theerror codes MUST be abbreviated using the codes specifiedOAuth framework defines one client credential type inthe registry defined by Section 8.4. Note that a properly formedsection 2.3.1 of [RFC6749]: client id andauthorized query forclient secret. [I-D.erdtman-ace-rpcc] adds raw-public-key and pre-shared-key to the client credentials types. Profiles of this framework MAY extend with aninactive or otherwise invalid tokenadditional client credentials type using client certificates. 5.6. AS Authentication The client credential grant doesnot warrant an error responsenot, bythis specification.default, authenticate the AS that the client connects to. Inthese cases,classic OAuth, theauthorizationAS is authenticated with a TLS server certificate. Profiles of this framework MUSTinstead respond with an introspection response with the "active" field set to "false". 5.9.4. Mapping Introspection parameters to CBOR If CBOR is used,specify how clients authenticate theintrospection requestAS andresponse parameters MUST be mapped to CBOR typeshow communication security is implemented. By default, server side TLS certificates, asspecified in the registrydefined bySection 8.12, using the given integer abbreviation for the map key. Note that we have aligned abbreviations that correspondOAuth 2.0, are required. 5.7. The Authorization Endpoint The OAuth 2.0 authorization endpoint is used toa claiminteract with theabbreviations defined in [RFC8392]resource owner andthe abbreviations of parameters with the same name from Section 5.8.5. /-------------------+----------+-------------------------\ | Parameter name | CBOR Key | Value Type | |-------------------+----------+-------------------------| | iss | 1 | text string | | sub | 2 | text string | | aud | 3 | text string | | exp | 4 | integer or | | | | floating-point number | | nbf | 5 | integer or | | | | floating-point number | | iat | 6 | integer or | | | | floating-point number | | cti | 7 | byte string | | scope | 9 | text or byte string | | active | 10 | True or False | | token | 11 | byte string | | client_id | 24 | text string | | error | 30 | integer | | error_description | 31 | text string | | error_uri | 32 | text string | | token_type_hint | 33 | text string | | token_type | 34 | integer | | username | 35 | text string | | ace_profile | 38 | integer | | cnonce | 39 | byte string | | exi | 40 | unsigned integer | \-------------------+----------+-------------------------/ Figure 16: CBOR Mappings to Token Introspection Parameters. 5.10.obtain an authorization grant, in certain grant flows. TheAccess Token Thisprimary use case for the ACE-OAuth frameworkRECOMMENDSis for machine-to-machine interactions that do not involve theuse of CBOR web token (CWT) as specifiedresource owner in[RFC8392]. In order to facilitate offline processingthe authorization flow; therefore, this endpoint is out ofaccess tokens,scope here. Future profiles may define constrained adaptation mechanisms for thisdocument usesendpoint as well. Non-constrained clients interacting with constrained resource servers can use the"cnf" claim from [RFC8747]specification in section 3.1 of [RFC6749] and the"scope" claim from [RFC8693] for JWT- and CWT-encoded tokens.attack countermeasures suggested in section 4.2 of [RFC6819]. 5.8. The Token Endpoint Inaddition to string encoding specifiedstandard OAuth 2.0, the AS provides the token endpoint for submitting access token requests. This framework extends the"scope" claim, a binary encoding MAY be used. The syntaxfunctionality ofsuch an encoding is explicitly not specified here and left to profiles or applications, specifically note that a binary encoded scope does not necessarily usethespace character '0x20' to delimit scope-tokens. Iftoken endpoint, giving the ASneeds to convey a hintthe possibility to help the client and RSabout which profile it should usetocommunicate withestablish shared keys or to exchange their public keys. Furthermore, this framework defines encodings using CBOR, as a substitute for JSON. The endpoint may also be exposed over HTTPS as in classical OAuth or even other transports. A profile MUST define theclient,details of theAS MAY include an "ace_profile" claim inmapping between theaccess token,fields described below, and these transports. If HTTPS is used, the semantics of Sections 4.1.3 and 4.1.4 of the OAuth 2.0 specification MUST be followed (with additions as described below). If the CoAP is some other transport with CBOR payload format is supported, thesame syntax andsemanticsas defineddescribed inSection 5.8.4.3. Ifthis section MUST be followed. For theclient submittedAS to be able to issue aclient-nonce parameter in the access token request Section 5.8.4.4,token, theASclient MUSTincludebe authenticated and present a valid grant for thevaluescopes requested. Profiles of thisparameter inframework MUST specify how the"cnonce" claim specified here. The "cnonce" claim uses binary encoding. 5.10.1. The Authorization Information Endpoint The access token, containing authorization informationAS authenticates the client andinformation abouthow theproof-of-possession method used bycommunication between client and AS is protected, fulfilling theclient, needs torequirements specified in Section 5. The default name of this endpoint in an url-path SHOULD betransported'/token'. However, implementations are not required to use this name and can define their own instead. The figures of this section use CBOR diagnostic notation without theRS sointeger abbreviations for the parameters or their values for illustrative purposes. Note that implementations MUST use theRS can authenticateinteger abbreviations andauthorizethe binary CBOR encoding, if the CBOR encoding is used. 5.8.1. Client-to-AS Request The clientrequest. This section definessends amethod for transporting the access tokenPOST request to theRS using a RESTful protocol such as CoAP. Profiles of this framework MAY define other methods fortokentransport.endpoint at the AS. Themethod consistsprofile MUST specify how the communication is protected. The content ofan authz-info endpoint, implemented bytheRS. A client using this method MUST make a POSTrequesttoconsists of the parameters specified in the relevant subsection of section 4 of theauthz-info endpoint atOAuth 2.0 specification [RFC6749], depending on theRSgrant type, with theaccess token in the payload.following exceptions and additions: o TheRS receiving the token MUST verifyparameter "grant_type" is OPTIONAL in thevaliditycontext ofthe token.this framework (as opposed to REQUIRED in RFC6749). Ifthe tokenthat parameter isvalid,missing, theRS MUST responddefault value "client_credentials" is implied. o The "audience" parameter from [RFC8693] is OPTIONAL tothe POSTrequestwith 2.01 (Created). Section Section 5.10.1.1 outlines how an RS MUST proceed to verify the validity ofan accesstoken. The RS MUST be prepared to store at least one accesstokenfor future use. Thisbound to a specific audience. o The "cnonce" parameter defined in Section 5.8.4.4 is REQUIRED if the RS provided adifference to how access tokens are handledclient-nonce inOAuth 2.0, wheretheaccess token"AS Request Creation Hints" message Section 5.3 o The "scope" parameter MAY be encoded as a byte string instead of the string encoding specified in section 3.3 of [RFC6749], in order allow compact encoding of complex scopes. The syntax of such a binary encoding istypically sent along with each request,explicitly not specified here andthereforeleft to profiles or applications. Note specifically that a binary encoded scope does notstored atnecessarily use theRS. This specification RECOMMENDS thatspace character '0x20' to delimit scope-tokens. o The client can send anRS stores only one token per proof-of-possession key. This meansempty (null value) "ace_profile" parameter to indicate that it wants the AS to include the "ace_profile" parameter in the response. See Section 5.8.4.3. o A client MUST be able to use the parameters from [I-D.ietf-ace-oauth-params] in anadditionalaccess tokenlinkedrequest to thesame key will supersede any existingtokenat the RS, by replacingendpoint and thecorresponding authorization information.AS MUST be able to process these additional parameters. Thereasondefault behavior, is thatthis greatly simplifies (constrained) implementations, with respect to required storage and resolving a request totheapplicable token. IfAS generates a symmetric proof-of- possession key for thepayload sentclient. In order tothe authz-info endpoint does not parseuse an asymmetric key pair or to re-use atoken, the RS MUST respondkey previously established witha response code equivalent totheCoAP code 4.00 (Bad Request). The RS MAY make an introspection request to validateRS, thetoken before respondingclient is supposed to use thePOST"req_cnf" parameter from [I-D.ietf-ace-oauth-params]. If CoAP is used then these parameters MUST be provided in a CBOR map, see Figure 12. When HTTP is used as a transport then the client makes a request to theauthz-infotoken endpoint,e.g. ifthe parameters MUST be encoded as defined in Appendix B of [RFC6749]. The following examples illustrate different types of requests for proof-of-possession tokens. Figure 5 shows a request for a token with a symmetric proof-of- possession key. The content is displayed in CBOR diagnostic notation, without abbreviations for better readability. Header: POST (Code=0.02) Uri-Host: "as.example.com" Uri-Path: "token" Content-Format: "application/ace+cbor" Payload: { "client_id" : "myclient", "audience" : "tempSensor4711" } Figure 5: Example request for anopaque reference. Some transport protocols may provide a wayaccess token bound toindicatea symmetric key. Figure 6 shows a request for a token with an asymmetric proof-of- possession key. Note that in this example OSCORE [RFC8613] is used to provide object-security, therefore theRSContent-Format isbusy and"application/oscore" wrapping theclient should retry after an interval; this"application/ace+cbor" typeof status update would be appropriate while the RS is waitingcontent. The OSCORE option has a decoded interpretation appended in parentheses foran introspection response. Profiles MUST specify whether the authz-info endpoint is protected, including whether error responses from this endpoint are protected. Note that sincethetoken contains informationreader's convenience. Also note thatallowin this example the audience is implicitly known by both client and AS. Furthermore note that this example uses theRS"req_cnf" parameter from [I-D.ietf-ace-oauth-params]. Header: POST (Code=0.02) Uri-Host: "as.example.com" Uri-Path: "token" OSCORE: 0x09, 0x05, 0x44, 0x6C (h=0, k=1, n=001, partialIV= 0x05, kid=[0x44, 0x6C]) Content-Format: "application/oscore" Payload: 0x44025d1 ... (full payload omitted for brevity) ... 68b3825e Decrypted payload: { "client_id" : "myclient", "req_cnf" : { "COSE_Key" : { "kty" : "EC", "kid" : h'11', "crv" : "P-256", "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' } } } Figure 6: Example token request bound toestablish a security context in the first place, mutual authentication may not be possible at this point. The default name of this endpoint inanurl-pathasymmetric key. Figure 7 shows a request for a token where a previously communicated proof-of-possession key 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 receivesonly referenced using the "req_cnf" parameter from [I-D.ietf-ace-oauth-params]. Header: POST (Code=0.02) Uri-Host: "as.example.com" Uri-Path: "token" Content-Format: "application/ace+cbor" Payload: { "client_id" : "myclient", "audience" : "valve424", "scope" : "read", "req_cnf" : { "kid" : b64'6kg0dXJM13U' } } Figure 7: Example request for an accesstoken, ittoken bound to a key reference. Refresh tokens are typically not stored as securely as proof-of- possession keys in requesting clients. Proof-of-possession based refresh token requests MUSTverify it before storing it. The details ofNOT request different proof-of-possession keys or different audiences in tokenverification depends on various aspects, including therequests. Refresh tokenencoding, the type of token, the security protection appliedrequests can only use to request access tokens bound to thetoken,same proof-of-possession key and theclaims. The token encoding matters since the security wrapper differs betweensame audience as access tokens issued in the initial tokenencodings. For example, a CWT token uses COSE while a JWT token uses JOSE. The type ofrequest. 5.8.2. AS-to-Client Response If the access tokenalsorequest hasan influence onbeen successfully verified by theverification procedure since tokens may be self-contained wherebyAS and the client is authorized to obtain an access tokenverification may happen locally atcorresponding to its access token request, theRS whileAS sends atoken-by-reference requires further interactionresponse with theauthorization server, for example using token introspection,response code equivalent toobtaintheclaims associated withCoAP response code 2.01 (Created). If client request was invalid, or not authorized, thetoken reference. Self-contained tokens MUST, at a minimum, be integrity protected but they MAY also be encrypted. For self-contained tokensAS returns an error response as described in Section 5.8.3. Note that theRS MUST processAS decides which token type and profile to use when issuing a successful response. It is assumed that thesecurity protectionAS has prior knowledge of thetoken first, as specified by the respective token format. For CWTcapabilities of thedescription can be found in [RFC8392]client andfor JWTtherelevant specification is [RFC7519].RS (see Appendix D). ThisMUST includeprior knowledge may, for example, be set by the use of averification that security protection (and thusdynamic client registration protocol exchange [RFC7591]. If thetoken) was generated by an AS thatclient has requested a specific proof-of-possession key using theright to issue access tokens for"req_cnf" parameter from [I-D.ietf-ace-oauth-params], thisRS. In case the token is communicated by referencemay also influence which profile theRSAS selects, as it needs toobtainsupport theclaims first.use of the key type requested the client. The content of the successful reply is the Access Information. When using CoAP, theRS uses token introspectionpayload MUST be encoded as a CBOR map, when using HTTP therelevant specificationencoding is[RFC7662] with CoAP transporta JSON map as specified in seciton 5.1 of [RFC6749]. In both cases the parameters specified in Section5.9. Errors may happen during this initial processing stage: o If token or claim verification fails,5.1 of [RFC6749] are used, with theRS MUST discardfollowing additions and changes: ace_profile: OPTIONAL unless thetoken and, if this was an interaction with authz-info, returnrequest included anerror message with a response code equivalent toempty ace_profile parameter in which case it is MANDATORY. This indicates theCoAP code 4.01 (Unauthorized). oprofile that the client MUST use towards the RS. See Section 5.8.4.3 for the formatting of this parameter. If this parameter is absent, theclaims cannot be obtainedAS assumes that theRS MUST discardclient implicitly knows which profile to use towards thetoken and,RS. token_type: This parameter is OPTIONAL, as opposed to 'required' incase[RFC6749]. By default implementations ofan interaction viathis framework SHOULD assume that theauthz-info endpoint, return an error message withtoken_type is "PoP". If aresponse code equivalentspecific use case requires another token_type (e.g., "Bearer") to be used then this parameter is REQUIRED. Furthermore [I-D.ietf-ace-oauth-params] defines additional parameters that theCoAP code 4.00 (Bad Request). Next, the RSAS MUSTverify claims, if present, contained in the access token. Errors are returnedbe able to use whenclaim checks fail, inresponding to a request to theorder of prioritytoken endpoint. Figure 8 summarizes the parameters that can currently be part ofthis list: iss The issuer claim must identify an ASthe Access Information. Future extensions may define additional parameters. /-------------------+-------------------------------\ | Parameter name | Specified in | |-------------------+-------------------------------| | access_token | RFC 6749 | | token_type | RFC 6749 | | expires_in | RFC 6749 | | refresh_token | RFC 6749 | | scope | RFC 6749 | | state | RFC 6749 | | error | RFC 6749 | | error_description | RFC 6749 | | error_uri | RFC 6749 | | ace_profile | [this document] | | cnf | [I-D.ietf-ace-oauth-params] | | rs_cnf | [I-D.ietf-ace-oauth-params] | \-------------------+-------------------------------/ Figure 8: Access Information parameters Figure 9 shows a response containing a token and a "cnf" parameter with a symmetric proof-of-possession key, which is defined in [I-D.ietf-ace-oauth-params]. Note thathastheauthoritykey identifier 'kid' is only used toissue access tokens forsimplify indexing and retrieving thereceiving RS. Ifkey, and no assumptions should be made that it isnotunique in thecasedomains of either theRS MUST discardclient or thetoken. If this was an interaction with authz-info,RS. Header: Created (Code=2.01) Content-Format: "application/ace+cbor" Payload: { "access_token" : b64'SlAV32hkKG ... (remainder of CWT omitted for brevity; CWT contains COSE_Key in theRS MUST also respond with a"cnf" claim)', "ace_profile" : "coap_dtls", "expires_in" : "3600", "cnf" : { "COSE_Key" : { "kty" : "Symmetric", "kid" : b64'39Gqlw', "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' } } } Figure 9: Example AS responsecode equivalentwith an access token bound tothe CoAP code 4.01 (Unauthorized). expa symmetric key. 5.8.3. Error Response Theexpiration date must be in the future. If that is not the case the RS MUST discard the token. If this was an interactionerror responses for interactions withauthz-infotheRS MUST also respond with a response codeAS are generally equivalent to theCoAP code 4.01 (Unauthorized). Note that the RS has to terminate access rights toones defined in Section 5.2 of [RFC6749], with theprotected resources atfollowing exceptions: o When using CoAP thetime whenpayload MUST be encoded as a CBOR map, with thetokens expire. aud The audience claim must refer to an audience thatContent-Format "application/ace+cbor". When using HTTP theRS identifies with. If thatpayload isnot the case the RS MUST discard the token. If this was an interaction with authz-info,encoded in JSON as specified in section 5.2 of [RFC6749]. o A response code equivalent to theRSCoAP code 4.00 (Bad Request) MUSTalso respond withbe used for all error responses, except for invalid_client where a response code equivalent to the CoAP code4.03 (Forbidden). scope4.01 (Unauthorized) MAY be used under the same conditions as specified in Section 5.2 of [RFC6749]. o TheRS must recognizeparameters "error", "error_description" and "error_uri" MUST be abbreviated using the codes specified in Figure 12, when a CBOR encoding is used. o The error code (i.e., value of thescope claim. If that"error" parameter) MUST be abbreviated as specified in Figure 10, when a CBOR encoding isnotused. /---------------------------+-------------\ | Name | CBOR Values | |---------------------------+-------------| | invalid_request | 1 | | invalid_client | 2 | | invalid_grant | 3 | | unauthorized_client | 4 | | unsupported_grant_type | 5 | | invalid_scope | 6 | | unsupported_pop_key | 7 | | incompatible_ace_profiles | 8 | \---------------------------+-------------/ Figure 10: CBOR abbreviations for common error codes In addition to thecaseerror responses defined in OAuth 2.0, theRSfollowing behavior MUSTdiscardbe implemented by thetoken.AS: o Ifthis wasthe client submits aninteraction with authz-info,asymmetric key in the token request that the RS cannot process, the AS MUSTalso respondreject that request with a response code equivalent to the CoAP code 4.00 (BadRequest). The RS MAY provide additional information inRequest) including the errorresponse, to clarify what went wrong. Additional processing may be needed for other claimscode "unsupported_pop_key" specified ina way specific to a profile or the underlying application. Note that the Subject (sub) claim cannot always be verified when the token is submitted to the RS sinceFigure 10. o If the clientmay not have authenticated yet. Also note that a counter for the expires_in (exi) claim MUST be initialized whenand the RSfirst verifies this token. Also note that profiles of this framework may defineit has requested an access tokentransport mechanisms thatfor do notallow for error responses. Therefore the error messages specified here only apply ifshare a common profile, thetoken was sentAS MUST reject that request with a response code equivalent to theauthz-info endpoint. When sending error responses, the RS MAY useCoAP code 4.00 (Bad Request) including the errorcodes from Section 3.1 of [RFC6750], to provide additional details to the client. 5.10.1.2. Protectingcode "incompatible_ace_profiles" specified in Figure 10. 5.8.4. Request and Response Parameters This section provides more detail about theAuthorization Information Endpoint As this frameworknew parameters that can be used inRESTful environments, it is important to make sure that attackers cannot perform unauthorizedaccess token requestsonand responses, as well as abbreviations for more compact encoding of existing parameters and common parameter values. 5.8.4.1. Grant Type The abbreviations specified in theauthz-info endpoints, other than submitting access tokens. Specifically it SHOULD NOTregistry defined in Section 8.5 MUST bepossible to perform GET, DELETE or PUT onused in CBOR encodings instead of theauthz-info endpoint and on it's children (if any).string values defined in [RFC6749], if CBOR payloads are used. /--------------------+------------+------------------------\ | Name | CBOR Value | Original Specification | |--------------------+------------+------------------------| | password | 0 | s. 4.3.2 of [RFC6749] | | authorization_code | 1 | s. 4.1.3 of [RFC6749] | | client_credentials | 2 | s. 4.4.2 of [RFC6749] | | refresh_token | 3 | s. 6 of [RFC6749] | \--------------------+------------+------------------------/ Figure 11: CBOR abbreviations for common grant types 5.8.4.2. Token Type ThePOST method SHOULD NOT be allowed on children"token_type" parameter, defined in section 5.1 of [RFC6749], allows theauthz-info endpoint. The RS SHOULD implement rate limiting measuresAS tomitigate attacks aimingindicate tooverloadtheprocessing capacityclient which type ofthe RS by repeatedly submitting tokens. For CoAP-based communication the RS could use the mechanisms from [RFC8516] to indicate thataccess token it isoverloaded. 5.10.2. Client Requests to the RS Before sendingreceiving (e.g., arequest to an RS, the client MUST verify thatbearer token). This document registers thekeys used to protect this communication are still valid. See Section 5.10.4new value "PoP" fordetails on how the client determinesthevalidity of the keys used. If an RS receives a request fromOAuth Access Token Types registry, specifying aclient, and the target resource requires authorization,proof-of-possession token. How theRS MUST first verify that it has an access token that authorizes this request, and thatproof-of-possession by the clienthas performed the proof-of-possession binding that tokento therequest. The response codeRS is performed MUST be4.01 (Unauthorized)specified by the profiles. The values incasetheclient has not performed"token_type" parameter MUST use theproof-of-possession, orCBOR abbreviations defined in the registry specified by Section 8.7, ifRS has no valid access tokena CBOR encoding is used. In this framework the "pop" value for theclient. If RS has an access token for"token_type" parameter is the default. The AS may, however, provide a different value from those registered in [IANA.OAuthAccessTokenTypes]. 5.8.4.3. Profile Profiles of this framework MUST define the communication protocol and theclient butcommunication security protocol between thetoken does not authorize access forclient and theresource that was requested, RSRS. The security protocol MUSTreject the request withprovide encryption, integrity and replay protection. It MUST also provide a4.03 (Forbidden). If RS hasbinding between requests and responses. Furthermore profiles MUST define a list of allowed proof- of-possession methods, if they support proof-of-possession tokens. A profile MUST specify anaccess token for the client but it does not cover the actionidentifier thatwas requested on the resource, RSMUSTrejectbe used to uniquely identify itself in therequest with a 4.05 (Method Not Allowed). Note:"ace_profile" parameter. Theusetextual representation of theresponse codes 4.03 and 4.05profile identifier is intendedto prevent infinite loops where a dumb Client optimistically tries to access a requested resource with any access token received from AS. As malicious clients could pretend to be C to determine C's privileges, these detailed response codes mustfor human readability and for JSON-based interactions, it MUST NOT be usedonly when a certain level of security is already available which can be achieved only whenfor CBOR-based interactions. Profiles MUST register their identifier in theClient is authenticated. Note: The RSregistry defined in Section 8.8. Profiles MAYuse introspectiondefine additional parameters fortimely validation of an access token, atboth thetime when atoken requestis presented. Note: Matchingand the Access Information in the access token response in order to support negotiation or signaling of profile specific parameters. Clients that want theclaims ofAS to provide them with the "ace_profile" parameter in the access token(e.g., scope) toresponse can indicate that by sending aspecific requestace_profile parameter with a null value for CBOR-based interactions, or an empty string if CBOR isapplication specific. Ifnot used, in therequest matches a validaccess tokenandrequest. 5.8.4.4. Client-Nonce This parameter MUST be sent from the clienthas performed the proof-of-possession for that token, the RS continuestoprocess the request as specified by the underlying application. 5.10.3. Token Expiration Depending on the capabilities oftheRS, there are various ways in whichAS, if itcan verify the expiration of apreviously receivedaccess token. Here followsalist of the possibilities including what functionality they require of"cnonce" parameter in theRS. o"AS Request Creation Hints" Section 5.3. Thetokenparameter is encoded as aCWT and includes an "exp" claimbyte string for CBOR-based interactions, andpossiblyas a string (Base64 encoded binary) if CBOR is not used. It MUST copy the"nbf" claim. The RS verifies these by comparing them to valuesvalue fromits internal clock as defined in [RFC7519]. In this casetheRS's internal clock must reflectcnonce parameter in thecurrent date"AS Request Creation Hints". 5.8.5. Mapping Parameters to CBOR If CBOR encoding is used, all OAuth parameters in access token requests andtime, or at leastresponses MUST besynchronized withmapped to CBOR types as specified in theAS's clock. How this clock synchronization would be performed is out of scoperegistry defined by Section 8.10, using the given integer abbreviation forthis specification. o The RS verifiesthevalidity ofmap keys. Note that we have aligned the abbreviations corresponding to claims with thetoken by performing an introspection request as specifiedabbreviations defined inSection 5.9. This requires the RS[RFC8392]. Note also that abbreviations from -24 to 23 have areliable network connection1 byte encoding size in CBOR. We have thus chosen to assign abbreviations in that range to parameters we expect to be used most frequently in constrained scenarios. /-------------------+----------+---------------------\ | Name | CBOR Key | Value Type | |-------------------+----------+---------------------| | access_token | 1 | byte string | | expires_in | 2 | unsigned integer | | audience | 5 | text string | | scope | 9 | text or byte string | | client_id | 24 | text string | | client_secret | 25 | byte string | | response_type | 26 | text string | | redirect_uri | 27 | text string | | state | 28 | text string | | code | 29 | byte string | | error | 30 | integer | | error_description | 31 | text string | | error_uri | 32 | text string | | grant_type | 33 | unsigned integer | | token_type | 34 | integer | | username | 35 | text string | | password | 36 | text string | | refresh_token | 37 | byte string | | ace_profile | 38 | integer | | cnonce | 39 | byte string | \-------------------+----------+---------------------/ Figure 12: CBOR mappings used in token requests and responses 5.9. The Introspection Endpoint Token introspection [RFC7662] MAY be implemented by theASAS, andtothe RS. When implemented, it MAY beable to handle two secure sessions in parallel (C toused by the RS andRStoAS). o In orderquery the AS for metadata about a given token, e.g., validity or scope. Analogous tosupport token expirationthe protocol defined in [RFC7662] fordevices that have no reliable way of synchronizing their internal clocks,HTTP and JSON, thisspecificationsection defines adaptations to more constrained environments using CBOR and leaving thefollowing approach: The claim "exi" ("expires in") can be used,choice of the application protocol toprovidetheRS withprofile. Communication between thelifetime ofrequesting entity and thetoken in seconds fromintrospection endpoint at thetimeAS MUST be integrity protected and encrypted. The communication security protocol MUST also provide a binding between requests and responses. Furthermore, theRS first receivestwo interacting parties MUST perform mutual authentication. Finally, thetoken. For CBOR-based interaction this parameter is encoded as unsigned integer, while JSON-based interactions encode this as JSON number. o Processing this claim requiresAS SHOULD verify that theRS doesrequesting entity has thefollowing: * For each tokenright to access introspection information about theRS receives, that contains an "exi" claim: Keep trackprovided token. Profiles ofthe time it receivedthis framework thattokensupport introspection MUST specify how authentication andrevisit that list regularly to expunge expired tokens. * Keep track ofcommunication security between theidentifiers of tokens containingrequesting entity and the"exi" claim that have expired (in order to avoid accepting them again). In order to avoid an unbounded memory usage growth,AS is implemented. The default name of thisMUST be implementedendpoint in an url-path SHOULD be '/introspect'. However, implementations are not required to use this name and can define their own instead. The figures of this section use thefollowing way when the "exi" claim is used: + When creatingCBOR diagnostic notation without thetoken,integer abbreviations for theAS MUST add a 'cti' claim ( or 'jti'parameters and their values forJWTs)better readability. 5.9.1. Introspection Request The requesting entity sends a POST request to theaccess token.introspection endpoint at the AS. Thevalue of this claimprofile MUSTbe created as the binary representation of the concatenation ofspecify how theidentifier ofcommunication is protected. If CoAP is used, theRSpayload MUST be encoded as a CBOR map with asequence number counting the tokens"token" entry containingan 'exi' claim, issuedthe access token. Further optional parameters representing additional context that is known bythis AS fortheRS. + The RSrequesting entity to aid the AS in its response MAY be included. For CoAP-based interaction, all messages MUSTstoreuse thehighest sequence numbercontent type "application/ace+cbor". For HTTP the encoding defined in section 2.1 of [RFC7662] is used. The same parameters are required and optional as in Section 2.1 of [RFC7662]. For example, Figure 13 shows anexpiredRS calling the tokencontainingintrospection endpoint at the"exi" claimAS to query about an OAuth 2.0 proof-of-possession token. Note thatit has seen, and treat tokens with lower sequence numbers as expired.object security based on OSCORE [RFC8613] is assumed in this example, therefore the Content-Format is "application/oscore". Figure 14 shows the decoded payload. Header: POST (Code=0.02) Uri-Host: "as.example.com" Uri-Path: "introspect" OSCORE: 0x09, 0x05, 0x25 Content-Format: "application/oscore" Payload: ... COSE content ... Figure 13: Example introspection request. { "token" : b64'7gj0dXJQ43U', "token_type_hint" : "PoP" } Figure 14: Decoded payload. 5.9.2. Introspection Response Ifa token that authorizes a long runningthe introspection requestsuch as a CoAP Observe [RFC7641] expires,is authorized and successfully processed, theRS MUST send an errorAS sends a response with the response code equivalent to the CoAP code4.01 (Unauthorized) to2.01 (Created). If theclient and then terminate processingintrospection request was invalid, not authorized or couldn't be processed thelong running request. 5.10.4. Key Expiration TheASprovides the client with key material that the RS uses. This can either be a common symmetric PoP-key, orreturns anasymmetric key used byerror response as described in Section 5.9.3. In a successful response, theRS to authenticate towardsAS encodes theclient. Since thereresponse parameters in a map. If CoAP iscurrently 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 usingused, this MUST be encoded as akey thatCBOR map, if HTTP isexpired and possibly inused thehandsJSON encoding specified in section 2.2 ofan attacker, or 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[RFC7662] isopaque toused. The map containing theclient, oneresponse payload includes the same required and optional parameters as in Section 2.2 of [RFC7662] with the followingmethodsadditions: ace_profile OPTIONAL. This indicates the profile that the RS MUSTbe used to informuse with theclient aboutclient. See Section 5.8.4.3 for more details on thevalidityformatting ofan access token: o The client knows a default validity time for all tokens it is using (i.e. how long a tokenthis parameter. If this parameter isvalid after being issued). This information could be provisionedabsent, the AS assumes that the RS implicitly knows which profile to use towards theclient when it is registered atclient. cnonce OPTIONAL. A client-nonce provided to theAS, or publishedAS by theAS in a wayclient. The RS MUST verify that this corresponds to the client-nonce previously provided to the clientcan query. oin the "AS Request Creation Hints". See Section 5.3 and Section 5.8.4.4. exi OPTIONAL. The "expires-in" claim associated to this access token. See Section 5.10.3. Furthermore [I-D.ietf-ace-oauth-params] defines more parameters that the ASinformsMUST be able to use when responding to a request to theclient aboutintrospection endpoint. For example, Figure 15 shows an AS response to thetoken validity usingintrospection request in Figure 13. Note that this example contains the"expires_in""cnf" parameter defined in [I-D.ietf-ace-oauth-params]. Header: Created (Code=2.01) Content-Format: "application/ace+cbor" Payload: { "active" : true, "scope" : "read", "ace_profile" : "coap_dtls", "cnf" : { "COSE_Key" : { "kty" : "Symmetric", "kid" : b64'39Gqlw', "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' } } } Figure 15: Example introspection response. 5.9.3. Error Response The error responses for CoAP-based interactions with theAccess Information. A client that is not ableAS are equivalent toobtain information abouttheexpiration 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 considerationsones forOAuth which apply to IoT deploymentsHTTP-based interactions aswell. If the introspection endpoint is used, the security considerations from [RFC7662] also apply. The following subsections address issues specific to this document and it's usedefined inconstrained environments. 6.1. Protecting Tokens A large rangeSection 2.3 ofthreats can be mitigated by protecting[RFC7662], with thecontents offollowing differences: o If content is sent and CoAP is used theaccess token by using a digital signature orpayload MUST be encoded as akeyed message digest (MAC) or an Authenticated Encryption with Associated Data (AEAD) algorithm. Consequently,CBOR map and thetoken integrity protectionContent-Format "application/ace+cbor" MUST beapplied to prevent the token from being modified, particularly since it contains a reference toused. For HTTP thesymmetric key orencoding defined in section 2.3 of [RFC6749] is used. o If theasymmetric keycredentials usedfor proof-of-possession. Ifby theaccess token containsrequesting entity (usually thesymmetric key, this symmetric keyRS) are invalid the AS MUSTbe encrypted byrespond with theauthorization server so that onlyresponse code equivalent to theresource server can decrypt it. Note that using an AEAD algorithm is preferable over using a MAC unlessCoAP code 4.01 (Unauthorized) and use thetoken needs to be publicly readable.required and optional parameters from Section 2.3 in [RFC7662]. o If thetoken is intended for multiple recipients (i.e. an audience that is a group), integrity protection ofrequesting entity does not have thetokenright to perform this introspection request, the AS MUST respond with asymmetric key, shared betweenresponse code equivalent to theASCoAP code 4.03 (Forbidden). In this case no payload is returned. o The parameters "error", "error_description" and "error_uri" MUST be abbreviated using therecipients, is not sufficient, since any ofcodes specified in Figure 12. o The error codes MUST be abbreviated using therecipients could modifycodes specified in thetoken undetectedregistry defined bythe other recipients. ThereforeSection 8.4. Note that a properly formed and authorized query for an inactive or otherwise invalid tokenwith a multi-recipient audience MUST be protected withdoes not warrant anasymmetric signature. It is important forerror response by this specification. In these cases, the authorization serverto 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 secretMUSTNOT be used as proof-of-possession keyinstead respond with an introspection response withmultiple resource servers since the benefit from usingtheproof-of- possession concept is then significantly reduced."active" field set to "false". 5.9.4. Mapping Introspection Parameters to CBOR Ifclients are capable of doing so, they should frequently request fresh access tokens, as this allowsCBOR is used, theASintrospection request and response parameters MUST be mapped tokeep the lifetime ofCBOR types as specified in thetokens short. This allowsregistry defined by Section 8.12, using theAS to use shorter proof-of- possession key sizes, which translategiven integer abbreviation for the map key. Note that we have aligned abbreviations that correspond to aperformance benefit forclaim with theclientabbreviations defined in [RFC8392] andfortheresource server. Shorter keys also lead to shorter messages (particularlyabbreviations of parameters withasymmetric keying material). When authorization servers bind symmetric keys to access tokens, they SHOULDthe same name from Section 5.8.5. /-------------------+----------+-------------------------\ | Parameter name | CBOR Key | Value Type | |-------------------+----------+-------------------------| | iss | 1 | text string | | sub | 2 | text string | | aud | 3 | text string | | exp | 4 | integer or | | | | floating-point number | | nbf | 5 | integer or | | | | floating-point number | | iat | 6 | integer or | | | | floating-point number | | cti | 7 | byte string | | scopethese access tokens| 9 | text or byte string | | active | 10 | True or False | | token | 11 | byte string | | client_id | 24 | text string | | error | 30 | integer | | error_description | 31 | text string | | error_uri | 32 | text string | | token_type_hint | 33 | text string | | token_type | 34 | integer | | username | 35 | text string | | ace_profile | 38 | integer | | cnonce | 39 | byte string | | exi | 40 | unsigned integer | \-------------------+----------+-------------------------/ Figure 16: CBOR Mappings toa specific permission.Token Introspection Parameters. 5.10. The Access Token Incertain 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, asthis framework theunderlying assumptionuse of CBOR Web Token (CWT) as specified inOAuth 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[RFC8392] isoutRECOMMENDED. In order to facilitate offline processing ofscope foraccess tokens, thisdocument. 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 obtaindocument uses theproof-of-possession key"cnf" claim from [RFC8747] and theauthorization server"scope" claim from [RFC8693] foruse with a specific access token. Not using confidentiality protection exposes this secret (and the access token)JWT- and CWT-encoded tokens. In addition toan eavesdropper thereby completely negating proof-of-possession security. The requirements for communication security of profiles arestring encoding specifiedin Section 5. Additional protectionfor theaccess token can"scope" claim, a binary encoding MAY beapplied by encrypting it, for example encryptionused. The syntax ofCWTssuch an encoding is explicitly not specifiedin Section 5.1 of [RFC8392]. Such additional protection can be necessary ifhere 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 thetoken is later transferred over an insecure connection (e.g. whenAS needs to convey a hint to the RS about which profile itis sentshould use to communicate with theauthz-info endpoint). Developers MUST ensure thatclient, theephemeral credentials (i.e.,AS MAY include an "ace_profile" claim in theprivate key oraccess token, with thesession key) are not leaked to third parties. An adversarysame syntax and semantics as defined inpossession ofSection 5.8.4.3. If theephemeral credentials bound toclient submitted a client-nonce parameter in the access tokenwill be able to impersonaterequest Section 5.8.4.4, theclient. Be aware thatAS MUST include the value of thisis a real risk with many constrained environments, since adversaries can often easily get physical access toparameter in thedevices. This risk can also be mitigated to some extent by making sure that keys are refreshed more frequently. 6.3. Long-Term Credentials Both clients"cnonce" claim specified here. The "cnonce" claim uses binary encoding. 5.10.1. The Authorization Information Endpoint The access token, containing authorization information andRSs have long-term credentials that areinformation about the proof-of-possession method usedto secure communications, and authenticate toby theAS. These credentials needclient, needs to beprotected against unauthorized access. In constrained devices, deployed in publicly accessible places, such protection can be difficulttransported toachieve without specialized hardware (e.g. secure key storage memory). If credentials are lost or compromised,theoperator ofRS so that theaffected devices needs to have procedures to invalidate any access these credentials giveRS can authenticate and authorize the client request. This section defines a method for transporting the access token torevoke tokens linked tothe RS using a RESTful protocol suchcredentials.as CoAP. Profiles of this framework MAY define other methods for token transport. Thelossmethod consists of an authz-info endpoint, implemented by the RS. A client using this method MUST make acredential linkedPOST request toa specific devicethe authz-info endpoint at the RS with the access token in the payload. The CoAP Content-Format or HTTP Media Type MUSTNOT lead to a compromisereflect the format ofother credentials not linked to that device, therefore secret keys usedthe token, e.g. application/cwt forauthenticationCBOR Web Tokens, if no Content-Format or Media Type is defined for the token format, application/octet- stream MUSTNOTbeshared between more than two parties. Operators of clients orused. The RSSHOULD 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 inreceiving thedevices being decommissioned. 6.4. Unprotected AS Request Creation Hints Initially, no secure channel exists to protecttoken MUST verify thecommunication between C and RS. Thus, C cannot determine ifvalidity of the token. If the token is valid, theAS Request Creation Hints contained in an unprotected response fromRS MUST respond toan unauthorizedthe POST request(seewith a response code equivalent to CoAP's 2.01 (Created). Section5.3) are authentic. C therefore5.10.1.1 outlines how an RS MUSTdetermine ifproceed to verify the validity of anASaccess token. The RS MUST be prepared to store at least one access token for future use. This isauthorizeda difference toprovidehow access tokensfor a certain RS. A compromised RS may useare handled in OAuth 2.0, where thehints for attempting to trick a client into contacting an AS thataccess token is typically sent along with each request, and therefore notsupposed to be in charge of thatstored at the RS.Therefore, C must not communicate with an AS ifWhen using this framework itcannot determineis RECOMMENDED thatthis AS has the authority to issue access tokens for this RS. Otherwise, a compromisedan RSmay usestores 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 toperformrequired storage and resolving adenial of service attack againstrequest to the applicable token. If the payload sent to the authz-info endpoint does not parse to aspecific AS, by redirectingtoken, the RS MUST respond with alarge number of client requestsresponse code equivalent tothat AS. 6.5. Minimal security requirements for communication This section summarizes the minimal requirements forthecommunication security ofCoAP code 4.00 (Bad Request). The RS MAY make an introspection request to validate thedifferent protocol interactions. C-AS All communication betweentoken before responding to theclient andPOST request to theAuthorization Server MUST be encrypted, integrity and replay protected. Furthermore responses fromauthz-info endpoint, e.g. if theAStoken is an opaque reference. Some transport protocols may provide a way to indicate that the RS is busy and the clientMUSTshould retry after an interval; this type of status update would bebound to the client's request to avoid attacks where the attacker swapsappropriate while theintended responseRS is waiting for anolder one valid for a previous request. This requiresintrospection 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 allow the client and theAuthorization Server have previously exchanged either a shared secret or their public keys in orderRS tonegotiateestablish asecure communication. Furthermoresecurity context in theclient MUSTfirst place, mutual authentication may not beable to determine whetherpossible at this point. The default name of this endpoint in anAS has the authorityurl-path is '/authz-info', however implementations are not required toissue access tokens for a certain RS. Thisuse this name and canfor example be done through pre-configured lists, or throughdefine their own instead. 5.10.1.1. Verifying anonline lookup mechanism that in turn also must be secured. RS-ASAccess Token When an RS receives an access token, it MUST verify it before storing it. Thecommunication betweendetails of token verification depends on various aspects, including theResource Server andtoken encoding, theAuthorization Server viatype of token, theintrospection endpoint MUST be encrypted, integritysecurity protection applied to the token, andreplay protected. Furthermore responses fromtheAS toclaims. 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 JOSE. The type of token also has an influence on theRS MUSTverification procedure since tokens may bebound to the RS's request. This requires thatself-contained whereby token verification may happen locally at the RSand the Authorization Server have previously exchanged either a shared secret, or their public keys in order to negotiatewhile asecure communication. Furthermoretoken-by-reference requires further interaction with theRS MUST be ableauthorization server, for example using token introspection, todetermine whether an AS hasobtain theauthority to issue accessclaims associated with the token reference. Self-contained tokensitself. This is usually configured out of band, but could alsoMUST, at least beperformed through an online lookup mechanism provided that it isintegrity protected but they MAY alsosecured in the same way. C-RS The initial communication between the client and the Resource Server can notbesecured in general, sinceencrypted. For self-contained tokens the RSis 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 RECOMMEND to use this mechanism for protectingMUST process theinitial communication. Aftersecurity protection of theclient has successfully transmittedtoken first, as specified by theaccessrespective tokentoformat. For CWT theRS, a secure communication protocol MUSTdescription can beestablished between clientfound in [RFC8392] andRSfor JWT theactual resource request.relevant specification is [RFC7519]. ThisprotocolMUSTprovide confidentiality, integrity and replay protection as well asinclude abinding between requests and responses. This requiresverification that security protection (and thus theclient learned either the RS's public key or received a symmetric proof-of-possession key bound totoken) was generated by an AS that has the right to issue access tokens for this RS. In case the tokenfromis communicated by reference theAS. TheRSmust have learned either the client's public key or a shared symmetric key fromneeds to obtain the claimsinfirst. 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: o If the verification of the security wrapper fails, or the token was issued by anintrospection request. Since ACEAS that does notprovide profile negotiation between C and RS, the client MUSThavelearned what profiletheRS supports (e.g. fromright to issue tokens for theAS or pre-configured) and initiatereceiving RS, thecommunication accordingly. 6.6. Token Freshness and Expiration AnRSthat is offline facesMUST discard theproblem of clock drift. Since it cannot synchronize its clocktoken and, if this was an interaction with authz-info, return an error message with a response code equivalent to theAS, it mayCoAP code 4.01 (Unauthorized). o If the claims cannot betricked into accepting old access tokens that are no longer valid or have been compromised. In order to prevent this, anobtained the RSmay useMUST discard thenonce-based mechanism definedtoken and, inSection 5.3 to ensure freshnesscase of anAccess Token subsequently presented to this RS. Another probleminteraction via the authz-info endpoint, return an error message withclock drift is that evaluatinga response code equivalent to thestandard token expiration claim "exp" can give unpredictable results. Acceptable ranges of clock drift are highly dependent onCoAP code 4.00 (Bad Request). Next, the RS MUST verify claims, if present, contained in theconcrete application. Important factors are how longaccesstokenstoken. Errors arevalid, and how critical timely expirationreturned when claim checks fail, in the order ofaccess token is.priority of this list: iss Theexpiration mechanism implemented byissuer claim (if present) must identify the"exi" claim, based onAS that has produced thefirst timesecurity protection for the access token. If that is not the case the RSseesMUST discard thetokentoken. If this wasdefined to provide a more predictable alternative. The "exi" approach has some drawbacks that need to be considered: A malicious client may hold back tokensan interaction with authz-info, the"exi" claim in order to prolong their lifespan. If anRSloses state (e.g. dueMUST also respond with a response code equivalent toan unscheduled reboot), it may loose the current values of counters trackingthe"exi" claims of tokens it is storing.CoAP code 4.01 (Unauthorized). exp Thefirst drawbackexpiration date must be in the future. If that isinherent tonot thedeployment scenario andcase the"exi" solution. It can therefore not be mitigated without requiringRS MUST discard the token. If this was an interaction with authz-info the RSbe online at times. The second drawback can be mitigated by regularly storingMUST also respond with a response code equivalent to thevalue of "exi" countersCoAP 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 audience claim must refer topersistent memory. 6.7. Combining profiles There may be use cases were different profiles of this framework are combined. For example,anMQTT-TLS profileaudience that the RS identifies with. If that isused betweennot theclient andcase the RSin combinationMUST discard the token. If this was an interaction witha CoAP-DTLS profile for interactions betweenauthz-info, theclient andRS MUST also respond with a response code equivalent to theAS.CoAP code 4.03 (Forbidden). scope ThesecurityRS must recognize value ofa profile MUST NOT depend ontheassumptionscope claim. If thatthe profileisused for allnot thedifferent types of interactions incase the RS MUST discard the token. If thisframework. 6.8. Unprotected Information Communicationwas an interaction with authz-info, theauthz-info endpoint, as well asRS MUST also respond with a response code equivalent to thevarious error responses defined in this framework, all potentially include sendingCoAP code 4.00 (Bad Request). The RS MAY provide additional informationover an unprotected channel. These messagesin the error response, to clarify what went wrong. Additional processing mayleak informationbe needed for other claims in a way specific toan adversary,a profile ormaythe underlying application. Note that the Subject (sub) claim cannot always bemanipulated by active attackersverified when the token is submitted toinduce incorrect behavior. For example error responsesthe RS since the client may not have authenticated yet. Also note that a counter forrequests totheAuthorization Information endpoint can reveal information about an otherwise opaqueexpires_in (exi) claim MUST be initialized when the RS first verifies this token. Also note that profiles of this framework may define access tokento an adversary who has intercepted this token. As far astransport mechanisms that do not allow for errormessages are concerned, this framework is written under the assumption that, in general,responses. Therefore thebenefits of detailederror messagesoutweighspecified here only apply if therisk duetoken was sent toinformation leakage. For particularthe authz-info endpoint. When sending error responses, the RS MAY usecases, where this assessment does not apply, detailedthe errormessages can be replaced by more generic ones. In some scenarios it may be possiblecodes from Section 3.1 of [RFC6750], to provide additional details toprotectthecommunication withclient. 5.10.1.2. Protecting theauthz-info endpoint (e.g. through DTLS with only server-side authentication). In cases where this is not possibleAuthorization Information Endpoint As this frameworkRECOMMENDS to use encrypted CWTs or tokens that are opaque references and need tocan besubjected to introspection by the RS. If the initial unauthorized resource request message (see Section 5.2)used in RESTful environments, it isused, the client MUSTimportant to make sure that attackers cannot perform unauthorized requests on the authz-info endpoints, other than submitting access tokens. Specifically itis not sending sensitive content in this request. While GET andSHOULD NOT be possible to perform GET, DELETErequests only revealor PUT on thetarget URIauthz-info endpoint and on its children (if any). The POST method SHOULD NOT be allowed on children of theresource, POST and PUT requests would revealauthz-info endpoint. The RS SHOULD implement rate limiting measures to mitigate attacks aiming to overload thewhole payloadprocessing capacity of theintended operation. SinceRS by repeatedly submitting tokens. For CoAP-based communication theclient is not authenticated atRS could use thepoint whenmechanisms from [RFC8516] to indicate that it issubmitting an access tokenoverloaded. 5.10.2. Client Requests to theauthz-info endpoint, attackers may be pretending to be a client and trying to trick anRSto use an obsolete profile that in turn specifies a vulnerable security mechanism via the authz-info endpoint. Such an attack would requireBefore sending avalid access token containingrequest to an"ace_profile" claim requestingRS, theuse of said obsolete profile. Resource Owners should updateclient MUST verify that theconfiguration of their RS'skeys used toprevent them from using such obsolete profiles. 6.9. Identifying audiences The audience claim as defined in [RFC7519] and the equivalent "audience" parameter from [RFC8693]protect this communication areintentionally vaguestill valid. See Section 5.10.4 for details on howto matchtheaudience value to a specific RS. This is intended to allow application specific semantics to be used. This section attempts to give some general guidance forclient determines theuse of audiences in constrained environments. URLs are not a good wayvalidity ofidentifying mobile devices that can switch networks and thus be associated with new URLs. Iftheaudience represents a single RS, and asymmetrickeysare used, theused. If an RScan be uniquely identified byreceives ahash of its public key. If this approach is used this framework RECOMMENDS to apply the procedurerequest fromsection 3 of [RFC6920]. If the audience addressesagroup ofclient, and the target resourceservers,requires authorization, the RS MUST first verify that it has an access token that authorizes this request, and that themapping of group identifier to individual RSclient has performed the proof-of-possession binding that token tobe provisioned to each RS beforethegroup-audience is usable. Managing dynamic groups couldrequest. The response code MUST bean issue,4.01 (Unauthorized) in case the client has not performed the proof-of-possession, or ifanyRSis not always reachable whenhas no valid access token for thegroups' memberships change. Furthermore, issuingclient. If RS has an accesstokens bound to symmetric proof-of-possession keystoken for the client but the token does not authorize access for the resource thatapply to a group-audience is problematic, as anwas requested, RSthat is in possession ofMUST reject the request with a 4.03 (Forbidden). If RS has an access tokencan impersonatefor the clienttowardsbut it does not cover theother RSsaction thatare partwas requested on the resource, RS MUST reject the request with a 4.05 (Method Not Allowed). Note: The use of thegroup. Itresponse codes 4.03 and 4.05 istherefore NOT RECOMMENDED to issue access tokens boundintended to prevent infinite loops where agroup audience and symmetric proof-of possession keys. Even thedumb clientmustoptimistically tries to access a requested resource with any access token received from AS. As malicious clients could pretend to beableC to determine 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 thecorrect valuesaccess token (e.g., scope) toput intoa specific request is application specific. If the"audience" parameter, in order to obtainrequest matches a valid tokenfor the intended RS. Errors in this process can lead toand the clientinadvertently obtaining a token forhas performed thewrong RS. The correct valuesproof-of-possession for"audience" can either be provisionedthat token, the RS continues to process theclientrequest aspart of its configuration, or dynamically looked upspecified by theclient in some directory. In the latter caseunderlying application. 5.10.3. Token Expiration Depending on theintegrity and correctnesscapabilities of thedirectory data must be assured. Note thatRS, there are various ways in which it can verify the"audience" hint provided byexpiration of a received access token. Here follows a list of theRS as partpossibilities including what functionality they require of the"AS Request Creation Hints" Section 5.3RS. o The token isnot typically source authenticateda CWT andintegrity protected,includes an "exp" claim andshould therefore not be treated a trusted value. 6.10. Denial of service against or with Introspectionpossibly the "nbf" claim. Theoptional introspection mechanism providedRS verifies these byOAuth and supportedcomparing them to values from its internal clock as defined in [RFC7519]. In this case theACE framework allows for two types of attacks that need toRS's internal clock must reflect the current date and time, or at least beconsidered by implementers. First, an attacker could perform a denialsynchronized with the AS's clock. How this clock synchronization would be performed is out of scope for this specification. o The RS verifies the validity ofservice attack againstthe token by performing an introspectionendpoint atrequest 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). o In order toprevent validationsupport token expiration for devices that have no reliable way ofaccess tokens. To maintainsynchronizing their internal clocks, this specification defines thesecurityfollowing approach: The claim "exi" ("expires in") can be used, to provide the RS with the lifetime of thesystem, antoken in seconds from the time the RSthatfirst receives the token. This mechanism only works for self-contained tokens, i.e. CWTs and JWTs. For CWTs this parameter isconfigured to use introspection MUST NOT allow access based on aencoded as unsigned integer, while JWTs encode this as JSON number. o Processing this claim requires that the RS does the following: * For each tokenfor which it couldn't reachtheintrospection endpoint. Second,RS receives, that contains anattacker could use"exi" claim: Keep track of thefacttime it received thatan RS performs introspectiontoken and revisit that list regularly toperform a denialexpunge expired tokens. * Keep track of the identifiers ofservice attack against that RS by repeatedly sendingtokensto its authz-info endpointcontaining the "exi" claim thatrequirehave expired (in order to avoid accepting them again). In order to avoid anintrospection call. RS can mitigate such attacks by implementing rate limits on how many introspection requests they performunbounded memory usage growth, this MUST be implemented in the following way when the "exi" claim is used: + When creating the token, the AS MUST add agiven time interval'cti' claim ( or 'jti' fora certain client IP address submitting tokensJWTs) 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 ontheintrospection requests should also be considered, to mitigate distributed attacks. 7. Privacy Considerations Implementers and users shouldaccess token. The value of this claim MUST beawarecreated as the binary representation of theprivacy implicationsconcatenation of thedifferent possible deploymentsidentifier of the RS with a sequence number counting the tokens containing an 'exi' claim, issued by thisframework. TheASis in a very central position and can potentially learn sensitive information aboutfor theclients requesting access tokens. IfRS. + The RS MUST store theclient credentials grant is used,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 AScan track what kindwhere to issue tokens ofaccessdifferent validity time for theclient intends to perform. With other grants this can be prevented bysame RS. The assumption is that typically tokens in such a scenario would all have theResource Owner. To do so,same validity time. If a token that authorizes a long running request such as a CoAP Observe [RFC7641] expires, theresource owner needs to bindRS MUST send an error response with thegrants it issuesresponse code equivalent toanonymous, ephemeral credentials that do not allowtheASCoAP code 4.01 (Unauthorized) tolink different grantsthe client andthus different access token requests bythen terminate processing thesame client.long running request. 5.10.4. Key Expiration Theclaims contained in a token can reveal privacy sensitive information aboutAS provides the clientandwith key material that the RS uses. This can either be a common symmetric PoP-key, or an asymmetric key used by the RS toany party having accessauthenticate towards the client. Since there is currently no expiration metadata associated tothem (whether by processingthose keys, thecontentclient has no way ofa self-contained token or by introspection). The AS SHOULD be configuredknowing if these keys are still valid. This may lead tominimizesituations where the client sends requests containing sensitive informationabout clientsto the RS using a key that is expired andRSs disclosedpossibly in thetokens it issues. If tokenshands of an attacker, or accepts responses from the RS that areonly integritynot properly protected andnot encrypted, they may reveal informationcould possibly have been forged by an attacker. In order toattackers listening onprevent this, thewire, or able to acquireclient must assume that those keys are only valid as long as the related accesstokens in some other way. Intoken is. Since thecaseaccess token is opaque to the client, one ofCWTsthetoken may, e.g., revealfollowing methods MUST be used to inform theaudience,client about the validity of an access token: o 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 thescope andclient when it is registered at theconfirmation method usedAS, or published by theclient. The latter may reveal the identity of the device or application runningAS in a way that theclient. This may be linkable toclient can query. o The AS informs theidentity ofclient about thepersontoken validity using the "expires_in" parameter in the Access Information. A client(if therethat isa person andnota 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 attackerable to obtain information about theaccess tokens will be able to link the requests, or evenexpiration of a token MUST NOT use this token. 6. Security Considerations Security considerations applicable todetermine the client's identity. An unprotected responseauthentication and authorization in RESTful environments provided in OAuth 2.0 [RFC6749] apply toan unauthorized request (see Section 5.3) may disclose information about RS and/or its existing relationship with C. It is advisablethis work. Furthermore [RFC6819] provides additional security considerations for OAuth which apply toinclude as little informationIoT deployments aspossible in an unencrypted response. Even the absolute URI of the AS may reveal sensitive information aboutwell. If theservice that RS provides. Developers must ensure thatintrospection endpoint is used, theRS does not disclose information that has an impact onsecurity considerations from [RFC7662] also apply. The following subsections address issues specific to this document and it's use in constrained environments. 6.1. Protecting Tokens A large range of threats can be mitigated by protecting theprivacycontents of thestakeholders inaccess token by using a digital signature or a keyed message digest (MAC) or an Authenticated Encryption with Associated Data (AEAD) algorithm. Consequently, theAS Request Creation Hints. They may choosetoken integrity protection MUST be applied touseprevent the token from being modified, particularly since it contains adifferent mechanism forreference to thediscovery ofsymmetric key or theAS if necessary.asymmetric key used for proof-of-possession. Ifmeans of encrypting communication between C and RS already exist, more detailed information maythe access token contains the symmetric key, this symmetric key MUST beincluded withencrypted by the authorization server so that only the resource server can decrypt it. Note that using anerror response to provide C with sufficient informationAEAD algorithm is preferable over using a MAC unless the token needs toreact onbe publicly readable. If the token is intended for multiple recipients (i.e. an audience thatparticular error. 8. IANA Considerations This document creates several registriesis a group), integrity protection of the token with aregistration policysymmetric key, shared between the AS and the recipients, is not sufficient, since any of"Expert Review"; guidelines totheexperts are given in Section 8.17. 8.1. ACE Authorization Server Request Creation Hints This specification establishesrecipients could modify theIANA "ACE Authorization Server Request Creation Hints" registry. The registry has been created to usetoken undetected by the"Expert Review" registration procedure [RFC8126].other recipients. Therefore a token with a multi-recipient audience MUST be protected with an asymmetric signature. Itshould be noted that, in additionis important for the authorization server to include theexpert review, some portionsidentity of theregistry requireintended recipient (the audience), typically aspecification, potentiallysingle resource server (or aStandards Track RFC, be supplied as well. The columnslist of resource servers), in theregistry are: Nametoken. Thename of the parameter CBOR Key CBOR mapsame shared secret MUST NOT be used as proof-of-possession keyforwith multiple resource servers since theparameter. Different ranges of values use different registration policies [RFC8126]. Integer valuesbenefit from-256 to 255using the proof-of- possession concept is then significantly reduced. If clients aredesignatedcapable of doing so, they should frequently request fresh access tokens, asStandards Action. Integer values from -65536 to -257 and from 256this allows the AS to65535 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 forkeep thevalueslifetime ofthis parameter. Referencethe tokens short. Thiscontains a pointerallows the AS to use shorter proof-of- possession key sizes, which translate to a performance benefit for thepublic specification ofclient and for therequest creation hint abbreviation, if one exists. This registry willresource 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 beinitially populated bynecessary 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 thevaluesunderlying assumption inFigure 2. The Reference columnOAuth is that access tokens are issued with a relatively short lifetime. This may not hold true foralldisconnected constrained devices, needing access tokens with relatively long lifetimes, and would therefore necessitate further standardization work that is out ofthese entries will bescope for this document.8.2. CoRE Resource Type registry IANA6.2. Communication Security Communication with the authorization server MUST use confidentiality protection. This step isrequested to register a new Resource Type (rt=) Link Target Attribute inextremely important since the"Resource Type (rt=) Link Target Attribute Values" subregistry underclient or the"Constrained RESTful Environments (CoRE) Parameters" [IANA.CoreParameters] registry: rt="ace.ai". This resource type describes an ACE-OAuth authz-info endpoint resource. Specific ACE-OAuth profiles canRS may obtain the proof-of-possession key from the authorization server for use with a specific access token. Not using confidentiality protection exposes thiscommon resource type for defining their profile-specific discovery processes. 8.3. OAuth Extensions Error Registration This specification registerssecret (and thefollowing error valuesaccess token) to an eavesdropper thereby completely negating proof-of-possession security. The requirements for communication security of profiles are specified inthe OAuth Extensions Error registry [IANA.OAuthExtensionsErrorRegistry]. o Error name: "unsupported_pop_key" o Error usage location: token error response o Related protocol extension: [this document] o Change Controller: IESG o Specification document(s):Section5.8.3 of [this document] o Error name: "incompatible_ace_profiles" o Error usage location: token error response o Related protocol extension: [this document] o Change Controller: IESG o Specification document(s):5. Additional protection for the access token can be applied by encrypting it, for example encryption of CWTs is specified in Section5.8.35.1 of[this document] 8.4. OAuth Error Code CBOR Mappings Registry This specification establishes[RFC8392]. Such additional protection can be necessary if theIANA "OAuth Error Code CBOR Mappings" registry. The registry has been createdtoken is later transferred over an insecure connection (e.g. when it is sent tousethe"Expert Review" registration procedure [RFC8126], except forauthz-info endpoint). Care must by taken by developers to prevent leakage of the PoP credentials (i.e., thevalue range designated forprivateuse. The columnskey or the symmetric key). An adversary in possession of theregistry are: Name The OAuth Error Code name, refersPoP credentials bound to thename 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 useaccess token will be able to impersonate theregistration policy "Expert Review" [RFC8126]. Reference This containsclient. Be aware that this is apointerreal risk with many constrained environments, since adversaries may get physical access to thepublic specification of the error code abbreviation, if one exists.devices and can therefore use phyical extraction techniques to gain access to memory contents. Thisregistry willrisk can beinitially populatedmitigated 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 clients and RSs have long-term credentials that are used to secure communications, and authenticate to thevaluesAS. These credentials need to be protected against unauthorized access. In constrained devices, deployed inFigure 10. The Reference column for all of these entries willpublicly accessible places, such protection can bethis document. 8.5. OAuth Grant Type CBOR Mappings This specification establishes the IANA "OAuth Grant Type CBOR Mappings" registry. The registry has been createddifficult touse the "Expert Review" registration procedure [RFC8126], except forachieve without specialized hardware (e.g. secure key storage memory). If credentials are lost or compromised, thevalue range designated for private use. The columnsoperator ofthis registry are: Namethe affected devices needs to have procedures to invalidate any access these credentials give and to revoke tokens linked to such credentials. Thenameloss ofthe grant type as specified in Section 1.3a credential linked to a specific device MUST NOT lead to a compromise of[RFC6749]. CBOR Value CBOR abbreviation for this grant type. Integer values less than -65536 are marked as "Private Use", allothervalues use the registration policy "Expert Review" [RFC8126]. Reference This contains a pointercredentials not linked tothe public specificationthat device, therefore secret keys used for authentication MUST NOT be shared between more than two parties. Operators ofthe grant type abbreviation, if one exists. Original Specification This contains a pointerclients or RS 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 thepublic specification ofdevices being decommissioned. 6.4. Unprotected AS Request Creation Hints Initially, no secure channel exists to protect thegrant type,communication between C and RS. Thus, C cannot determine ifone exists. This registry will be initially populated bythevalues"AS Request Creation Hints" contained inFigure 11. The Reference columnan unprotected response from RS to an unauthorized request (see Section 5.3) are authentic. C therefore MUST determine if an AS is authorized to provide access tokens foralla certain RS. How this determination is implemented is out ofthese entries will bescope for thisdocument. 8.6. OAuth Access Token Typesdocument and left to the applications. 6.5. Minimal Security Requirements for Communication This sectionregisterssummarizes thefollowing new token type inminimal requirements for the"OAuth Access Token Types" registry [IANA.OAuthAccessTokenTypes]. o Type name: "PoP" o Additional Token Endpoint Response Parameters: "cnf", "rs_cnf" see section 3.3communication security of[I-D.ietf-ace-oauth-params]. o HTTP Authentication Scheme(s): N/A o Change Controller: IETF o Specification document(s): [this document] 8.7. OAuth Access Token Type CBOR Mappings This specification established the IANA "OAuth Access Token Type CBOR Mappings" registry. The registry has been created to usethe"Expert Review" registration procedure [RFC8126], except fordifferent protocol interactions. C-AS All communication between thevalue range designated for private use. The columns of this registry are: Name The name of token type as registered inclient and theOAuth 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 useAuthorization Server MUST be encrypted, integrity and replay protected. Furthermore responses from theregistration policy "Expert Review" [RFC8126]. Reference This contains a pointerAS to thepublic specification ofclient MUST be bound to theOAuth token type abbreviation, if one exists. Original Specification This contains a pointerclient's request to avoid attacks where thepublic specification ofattacker swaps theOAuth token type, ifintended response for an older oneexists. 8.7.1. Initial Registry Contents o Name: "Bearer" o Value: 1 o Reference: [this document] o Original Specification: [RFC6749] o Name: "PoP" o Value: 2 o Reference: [this document] o Original Specification: [this document] 8.8. ACE Profile Registryvalid for a previous request. Thisspecification establishesrequires that theIANA "ACE Profile" registry. The registry has been created to useclient and the"Expert Review" registration procedure [RFC8126]. It should be noted that,Authorization Server have previously exchanged either a shared secret or their public keys inadditionorder tothe expert review, some portions of the registry require a specification, potentiallynegotiate aStandards Track RFC,secure communication. Furthermore the client MUST besupplied as well. The columns of this registry are: Name The name ofable to determine whether an AS has theprofile,authority to issue access tokens for a certain RS. This can for example beused as value of the profile attribute. Description Text givingdone through pre-configured lists, or through anoverview ofonline lookup mechanism that in turn also must be secured. RS-AS The communication between theprofileResource Server andthe 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 -257the Authorization Server via the introspection endpoint MUST be encrypted, integrity and replay protected. Furthermore responses from256the AS to65535 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. Referencethe RS MUST be bound to the RS's request. Thiscontainsrequires that the RS and the Authorization Server have previously exchanged either apointershared secret, or their public keys in order to negotiate a secure communication. Furthermore thepublic specification ofRS MUST be able to determine whether an AS has theprofile abbreviation, if one exists.authority to issue access tokens itself. Thisregistry will be initially empty and willis usually configured out of band, but could also bepopulated byperformed through an online lookup mechanism provided that it is also secured in theregistrations fromsame way. C-RS The initial communication between theACE framework profiles. 8.9. OAuth Parameter Registration This specification registersclient and thefollowing parameterResource Server can not be secured in general, since the"OAuth Parameters" registry [IANA.OAuthParameters]: o Name: "ace_profile" o Parameter Usage Location: token response o Change Controller: IESG o Reference: Section 5.8.2 and Section 5.8.4.3RS is not in possession of[this document] 8.10. OAuth Parameters CBOR Mappings Registry This specification establishes the IANA "OAuth Parameters CBOR Mappings" registry. The registry has been created to use the "Expert Review" registration procedure [RFC8126], excepton access token for that client, which would carry thevalue range designated for private use. The columns of this registry are: Name The OAuth Parameter name, refersnecessary parameters. If both parties support DTLS without client authentication it is RECOMMEND to use this mechanism for protecting thename ininitial communication. After theOAuth 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 useclient has successfully transmitted theregistration policy "Expert Review" [RFC8126]. Value Type The allowable CBOR data typesaccess token to the RS, a secure communication protocol MUST be established between client and RS forvalues of this parameter. Referencethe actual resource request. Thiscontainsprotocol MUST provide confidentiality, integrity and replay protection as well as apointer tobinding between requests and responses. This requires that the client learned either the RS's publicspecification ofkey or received a symmetric proof-of-possession key bound to theOAuth parameter abbreviation, if one exists. This registry will be initially populated byaccess token from thevalues in Figure 12.AS. TheReference column for all of these entries will be this document. 8.11. OAuth Introspection Response Parameter Registration This specification registersRS must have learned either thefollowing parametersclient's public key or a shared symmetric key from the claims in theOAuth Token Introspection Response registry [IANA.TokenIntrospectionResponse]. o Name: "ace_profile" o Description: Thetoken or an introspection request. Since ACE does not provide profileusednegotiation betweenclientC andRS. o Change Controller: IESG o Reference: Section 5.9.2 of [this document] o Name: "cnonce" o Description: "client-nonce". A nonce previously provided toRS, theAS byclient MUST have learned what profile the RSviasupports (e.g. from theclient. Used to verify token freshness whenAS or pre-configured) and initiate 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 theAS. o Change Controller: IESG o Reference: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 Section5.9.25.3 to ensure freshness of[this document] o Name: "exi" o Description: "Expires in". Lifetimean 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 access tokenin seconds fromis. The expiration mechanism implemented by the "exi" claim, based on the first time the RSfirstseesit. Usedthe token was defined toimplementprovide aweaker from of token expiration for devicesmore predictable alternative. The "exi" approach has some drawbacks thatcannot synchronizeneed to be considered: A malicious client may hold back tokens with the "exi" claim in order to prolong theirinternal clocks. o Change Controller: IESG o Reference: Section 5.9.2lifespan. If an RS loses state (e.g. due to an unscheduled reboot), it may lose the current values of[this document] 8.12. OAuth Token Introspection Response CBOR Mappings Registry This specification establishescounters 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 theIANA "OAuth Token Introspection Response CBOR Mappings" registry.RS be online at times. Theregistry has been createdsecond drawback can be mitigated by regularly storing the value of "exi" counters to persistent memory. 6.7. Combining Profiles There may be use cases were different profiles of this framework are combined. For example, an MQTT-TLS profile is used between the"Expert Review" registration procedure [RFC8126], except forclient and thevalue range designatedRS in combination with a CoAP-DTLS profile forprivate use.interactions between the client and the AS. Thecolumnssecurity ofthis registry are: Name The OAuth Parameter name, refers toa profile MUST NOT depend on thename inassumption that theOAuth parameter registry, e.g., "client_id". CBOR Key CBOR map keyprofile is used forthis parameter. Integer values less than -65536 are marked as "Private Use",allother values usetheregistration policy "Expert Review" [RFC8126]. Value Type The allowable CBOR datadifferent typesfor valuesof interactions in thisparameter. Reference This contains a pointer toframework. 6.8. Unprotected Information Communication with thepublic specification ofauthz-info endpoint, as well as theintrospection response parameter abbreviation, if one exists. This registry willvarious error responses defined in this framework, all potentially include sending information over an unprotected channel. These messages may leak information to an adversary, or may beinitially populatedmanipulated 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 thevaluesassumption that, inFigure 16. The Reference column for all of these entries will be this document. Note thatgeneral, themappingsbenefits ofparameters corresponding to claim names intentionally coincide withdetailed error messages outweigh theCWT claim name mappings from [RFC8392]. 8.13. JSON Web Token Claims This specification registersrisk 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 thefollowing new claims incommunication with theJSON Web Token (JWT) registry of JSON Web Token Claims [IANA.JsonWebTokenClaims]: o Claim Name: "ace_profile" o Claim Description: The ACE profile a tokenauthz-info endpoint (e.g. through DTLS with only server-side authentication). In cases where this issupposednot possible, it is RECOMMENDED to use encrypted CWTs or tokens that are opaque references and need to beused with. o Change Controller: IESG o Reference: Section 5.10 of [this document] o Claim Name: "cnonce" o Claim Description: "client-nonce". A nonce previously providedsubjected tothe ASintrospection by theRS viaRS. If theclient. Used to verify token freshness wheninitial unauthorized resource request message (see Section 5.2) is used, theRS cannot synchronize its clock withclient MUST make sure that it is not sending sensitive content in this request. While GET and DELETE requests only reveal theAS. o Change Controller: IESG o Reference: Section 5.10target URI of[this document] o Claim Name: "exi" o Claim Description: "Expires in". Lifetimethe resource, POST and PUT requests would reveal the whole payload of thetoken in seconds fromintended operation. Since thetimeclient 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 RSfirst sees it. Usedtoimplementuse an obsolete profile that in turn specifies aweaker from ofvulnerable security mechanism via the authz-info endpoint. Such an attack would require a valid access tokenexpiration for devices that cannot synchronize their internal clocks. o Change Controller: IESG o Reference: Section 5.10.3containing an "ace_profile" claim requesting the use of[this document] 8.14. CBOR Web Token Claims This specification registerssaid obsolete profile. Resource Owners should update thefollowing new claimsconfiguration of their RS's to prevent them from using such obsolete profiles. 6.9. Identifying Audiences The audience claim as defined in [RFC7519] and the"CBOR Web Token (CWT) Claims" registry [IANA.CborWebTokenClaims]. o Claim Name: "ace_profile" o Claim Description: The ACE profileequivalent "audience" parameter from [RFC8693] are intentionally vague on how to match the audience value to atokenspecific RS. This issupposedintended to allow application specific semantics to beused with. o JWT Claim Name: ace_profile o Claim Key: TBD (suggested: 38) o Claim Value Type(s): integer o Change Controller: IESG o Specification Document(s): Section 5.10 of [this document] o Claim Name: "cnonce" o Claim Description: The client-nonce sentused. 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 theAS byaudience represents a single RS, and asymmetric keys are used, the RSvia the client. o JWT Claim Name: cnonce o Claim Key: TBD (suggested: 39) o Claim Value Type(s): byte string o Change Controller: IESG o Specification Document(s): Section 5.10can be uniquely identified by a hash of[this document] o Claim Name: "exi" o Claim Description: The expiration timeits public key. If this approach is used it is RECOMMENDED to apply the procedure from section 3 of [RFC6920]. If the audience addresses atoken measured fromgroup of resource servers, the mapping of group identifier to 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 whenit was received atthe 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 inseconds. o JWT Claim Name: exi o Claim Key: TBD (suggested: 40) o Claim Value Type(s): integer o Change Controller: IESG o Specification Document(s): Section 5.10.3 of [this document] o Claim Name: "scope" o Claim Description: The scopepossession ofanthe access tokenas defined in [RFC6749]. o JWT Claim Name: scope o Claim Key: TBD (suggested: 9) o Claim Value Type(s): byte string or text string o Change Controller: IESG o Specification Document(s): Section 4.2can impersonate the client towards the other RSs that are part of[RFC8693] 8.15. Media Type Registrations This specification registersthe'application/ace+cbor' media typegroup. 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 formessages oftheprotocols definedintended RS. Errors in thisdocument carrying parameters encoded in CBOR. This registration followsprocess can lead to theprocedures specified in [RFC6838]. Type name: application Subtype name: ace+cbor Required parameters: N/A Optional parameters: N/A Encoding considerations: Mustclient inadvertently obtaining a token for the wrong RS. The correct values for "audience" can either beencodedprovisioned to the client asCBOR map containingpart of its configuration, or dynamically looked up by theprotocol parameters definedclient in[this document]. Security considerations: See Section 6some directory. In the latter case the integrity and correctness of[this document] Interoperability considerations: N/A Published specification: [this document] Applicationsthe directory data must be assured. Note thatuse this media type: The typethe "audience" hint provided by the RS as part of the "AS Request Creation Hints" Section 5.3 isusednot 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 byauthorization servers, clientsOAuth andresource servers that supportsupported in the ACE frameworkas specified in [this document]. Fragment identifier considerations: N/A Additional information: N/A Person & email address to contactallows forfurther information: <iesg@ietf.org> Intended usage: COMMON Restrictions on usage: none Author: Ludwig Seitz <ludwig.seitz@combitech.se> Change controller: IESG 8.16. CoAP Content-Format Registry This specification registerstwo types of attacks that need to be considered by implementers. First, an attacker could perform a denial of service attack against thefollowing entryintrospection endpoint at the AS in order to prevent validation of access tokens. To maintain the"CoAP Content-Formats" registry: Media Type: application/ace+cbor Encoding: - ID: TBD (suggested: 19) Reference: [this document] 8.17. Expert Review Instructions Allsecurity of theIANA registries established in this document are definedsystem, an RS that is configured to use introspection MUST NOT allow access based on aregistration policy of Expert Review. This section gives some general guidelinestoken forwhatwhich it couldn't reach theexperts should be looking for, butintrospection 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. 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 arebeing designated as expertsrejected for areason, so theycertain amount of time. A general rate limit on the introspection requests should also begiven substantial latitude. Expert reviewersconsidered, to mitigate distributed attacks. 7. Privacy Considerations Implementers and users shouldtake into considerationbe 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, thefollowing points: o Point squatting shouldAS can track what kind of access the client intends to perform. With other grants this can bediscouraged. Reviewers are encouragedprevented by the Resource Owner. To do so, the resource owner needs toget sufficient information for registration requestsbind the grants it issues toensureanonymous, ephemeral credentials thatthe usage isdo notgoingallow the AS toduplicate one that is already registered,link different grants andthatthus different access token requests by thepoint is likelysame 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 beusedconfigured to minimize the information about clients and RSs disclosed indeployments. The zones tagged as private usethe tokens it issues. If tokens areintended for testing purposesonly integrity protected andclosed environments; code points in other ranges shouldnotbe assigned for testing. o Specifications are needed for the first-come, first-serve range ifencrypted, theyare expectedmay reveal information tobe used outside of closed environmentsattackers listening on the wire, or able to acquire the access tokens inan interoperablesome other way.When specifications are not provided,In thedescription provided needs to have sufficient information to identify whatcase of CWTs thepoint is beingtoken may, e.g., reveal the audience, the scope and the confirmation method usedfor. o Experts should take into accountby the client. The latter may reveal the identity of the device or application running theexpected usageclient. This may be linkable to the identity offields when approving point assignment. The fact thatthe person using the client (if there is arange for standards track documents doesperson and notmean thatastandards track document cannot have points assigned outside of that range. The length of the encoded valuemachine-to-machine interaction). Clients using asymmetric keys for proof-of-possession should beweighed against how many code pointsaware ofthat length are left,thesizeconsequences ofdevice itusing 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 beused on. o Since a high degree of overlap is expected between these registries andable to link thecontents ofrequests, or even to determine theOAuth parameters [IANA.OAuthParameters] registries, experts should require new registrationsclient's identity. An unprotected response tomaintain alignmentan unauthorized request (see Section 5.3) may disclose information about RS and/or its existing relationship withparameters from OAuthC. 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 thathave comparable functionality. Deviation from this alignment should only be allowed if there are functional differences,RS provides. Developers must ensure thatare motivated bythe 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 usecasea different mechanism for the discovery of the AS if necessary. If means of encrypting communication between C andthat cannotRS already exist, more detailed information may beeasily or efficiently addressed by comparable OAuth parameters. 9. Acknowledgmentsincluded with an error response to provide C with sufficient information to react on that particular error. 8. IANA Considerations This documentiscreates several registries with aproductregistration policy of "Expert Review"; guidelines to the experts are given in Section 8.17. 8.1. ACEworking group ofAuthorization Server Request Creation Hints This specification establishes theIETF. Thanks to Eve Maler for her contributionsIANA "ACE Authorization Server Request Creation Hints" registry. The registry has been created totheuseof OAuth 2.0 and UMAthe "Expert Review" registration procedure [RFC8126]. It should be noted that, inIoT scenarios, Robert Taylor for his discussion input, and Malisa Vucinic for his input onaddition to thepredecessorsexpert review, some portions ofthis proposal. Thanks totheauthorsregistry require a specification, potentially a Standards Track RFC, be supplied as well. The columns ofdraft-ietf-oauth-pop-key-distribution, from where large partsthe registry are: Name The name of thesecurity considerations where copied. Thanks to Stefanie Gerdes, Olaf Bergmann, and Carsten Bormannparameter CBOR Key CBOR map key forcontributing their work on AS discoverythe parameter. Different ranges of values use different registration policies [RFC8126]. Integer values fromdraft-gerdes-ace-dcaf- authorize (see Section 5.1). Thanks-256 toJim Schaad255 are designated as Standards Action. Integer values from -65536 to -257 andMike Jones for their comprehensive reviews. Thanksfrom 256 toBenjamin Kaduk65535 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 forhis input on various questions related tothe values of thiswork. Thanks to Cigdem Sengul for some very useful review comments. Thanksparameter. Reference This contains a pointer toCarsten Bormann for contributingthetext forpublic specification of the request creation hint abbreviation, if one exists. This registry will be initially populated by the values in Figure 2. The Reference column for all of these entries will be this document. 8.2. CoRE Resource Typeregistry. Ludwig Seitz and Goeran Selander worked onRegistry IANA is requested to register 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: o Value: "ace.ai" o Description: ACE-OAuth authz-info endpoint resource. o Reference: [this document] Specific ACE-OAuth profiles can use thisdocument as partcommon resource type for defining their profile-specific discovery processes. 8.3. OAuth Extensions Error Registration This specification registers the following error values in the OAuth Extensions Error registry [IANA.OAuthExtensionsErrorRegistry]. o Error name: "unsupported_pop_key" o Error usage location: token error response o Related protocol extension: [this document] o Change Controller: IESG o Specification document(s): Section 5.8.3 of [this document] o Error name: "incompatible_ace_profiles" o Error usage location: token error response o Related protocol extension: [this document] o Change Controller: IESG o Specification document(s): Section 5.8.3 of [this document] 8.4. OAuth Error Code CBOR Mappings Registry This specification establishes theCelticPlus project CyberWI, with funding from Vinnova. Ludwig Seitz was also received further fundingIANA "OAuth Error Code CBOR Mappings" registry. The registry has been created to use the "Expert Review" registration procedure [RFC8126], except forthis work by Vinnova inthecontextvalue range designated for private use. The columns of theCelticNext project Critisec. 10. References 10.1. Normative References [I-D.ietf-ace-oauth-params] Seitz, L., "Additionalregistry are: Name The OAuthParameters for Authorization in Constrained Environments (ACE)", draft-ietf-ace-oauth- params-13 (work in progress), April 2020. [IANA.CborWebTokenClaims] IANA, "CBOR Web Token (CWT) Claims", <https://www.iana.org/assignments/cwt/cwt.xhtml#claims- registry>. [IANA.CoreParameters] IANA, "Constrained RESTful Environments (CoRE) Parameters", <https://www.iana.org/assignments/core- parameters/core-parameters.xhtml>. [IANA.JsonWebTokenClaims] IANA, "JSON Web Token Claims", <https://www.iana.org/assignments/jwt/jwt.xhtml#claims>. [IANA.OAuthAccessTokenTypes] IANA, "OAuth Access Token Types", <https://www.iana.org/assignments/oauth-parameters/oauth- parameters.xhtml#token-types>. [IANA.OAuthExtensionsErrorRegistry] IANA, "OAuth ExtensionsErrorRegistry", <https://www.iana.org/assignments/oauth-parameters/oauth- parameters.xhtml#extensions-error>. [IANA.OAuthParameters] IANA, "OAuth Parameters", <https://www.iana.org/assignments/oauth-parameters/oauth- parameters.xhtml#parameters>. [IANA.TokenIntrospectionResponse] IANA, "OAuth Token Introspection Response", <https://www.iana.org/assignments/oauth-parameters/oauth- parameters.xhtml#token-introspection-response>. [RFC2119] Bradner, S., "Key wordsCode 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 usein RFCsthe registration policy "Expert Review" [RFC8126]. Reference This contains a pointer toIndicate 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>. [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, "Thethe public specification of the error code abbreviation, if one exists. This registry will be initially populated by the values in Figure 10. The Reference column for all of these entries will be this document. 8.5. OAuth2.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, "MediaGrant TypeSpecifications 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.,CBOR Mappings This specification establishes the IANA "OAuth2.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, "GuidelinesGrant Type CBOR Mappings" registry. The registry has been created to use the "Expert Review" registration procedure [RFC8126], except forWriting an IANA Considerationsthe value range designated for private use. 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 will be initially populated by the values inRFCs", 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., "AmbiguityFigure 11. The Reference column for all ofUppercase vs Lowercasethese entries will be this document. 8.6. OAuth Access Token Types This section registers the following new token type inRFC 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 Webthe "OAuth Access Token(CWT)", RFC 8392, DOI 10.17487/RFC8392, May 2018, <https://www.rfc-editor.org/info/rfc8392>. [RFC8693] Jones, M., Nadalin, A., Campbell, B., Ed., Bradley, J., and C. Mortimore,Types" registry [IANA.OAuthAccessTokenTypes]. o Type name: "PoP" o Additional Token Endpoint Response Parameters: "cnf", "rs_cnf" see section 3.3 of [I-D.ietf-ace-oauth-params]. o HTTP Authentication Scheme(s): N/A o Change Controller: IETF o Specification document(s): [this document] 8.7. OAuth Access Token Type CBOR Mappings This specification established the IANA "OAuth2.0Access TokenExchange", 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 forType CBORWeb 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>. 10.2. Informative References [BLE] Bluetooth SIG, "Bluetooth Core Specification v5.1", Section 4.4, January 2019, <https://www.bluetooth.com/specifications/bluetooth-core- specification/>. [I-D.erdtman-ace-rpcc] Seitz, L. and S. Erdtman, "Raw-Public-Key and Pre-Shared- KeyMappings" registry. The registry has been created to use the "Expert Review" registration procedure [RFC8126], except for the value range designated for private use. The columns of this registry are: Name The name of token type asOAuth client credentials", draft-erdtman-ace- rpcc-02 (work in progress), October 2017. [I-D.ietf-quic-transport] Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed and Secure Transport", draft-ietf-quic-transport-34 (workregistered inprogress), January 2021. [I-D.ietf-tls-dtls13] Rescorla, E., Tschofenig, H., and N. Modadugu, "The Datagram Transport Layer Security (DTLS) Protocol Version 1.3", draft-ietf-tls-dtls13-40 (workthe 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 o Name: "Bearer" o Value: 1 o Reference: [this document] o Original Specification: [RFC6749] o Name: "PoP" o Value: 2 o Reference: [this document] o Original Specification: [this document] 8.8. ACE Profile Registry This specification establishes the IANA "ACE Profile" registry. The registry has been created to use the "Expert Review" registration procedure [RFC8126]. It should be noted that, inprogress), January 2021. [Margi10impact] Margi, C., de Oliveira, B., de Sousa, G., Simplicio Jr, M., Barreto, P., Carvalho, T., Naeslund, M., and R. Gold, "Impactaddition to the expert review, some portions of the registry require a specification, potentially a Standards Track RFC, be supplied as well. The columns ofOperating Systems on Wireless Sensor Networks (Security) Applications and Testbeds", Proceedingsthis registry are: Name The name of the19th International Conference on Computer Communicationsprofile, to be used as value of the profile attribute. Description Text giving an overview of the profile andNetworks (ICCCN), August 2010. [MQTT5.0] Banks, A., Briggs, E., Borgendale, K.,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 andR. Gupta, "MQTT Version 5.0", OASIS Standard, March 2019, <https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt- v5.0.html>. [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.,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. This registry will be initially empty andP. Hunt,will be populated by the registrations from the ACE framework profiles. 8.9. OAuth Parameter Registration This specification registers the following parameter in the "OAuth2.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.,Parameters" registry [IANA.OAuthParameters]: o Name: "ace_profile" o Parameter Usage Location: token response o Change Controller: IESG o Reference: Section 5.8.2 andM. Scurtescu,Section 5.8.4.3 of [this document] 8.10. OAuth Parameters CBOR Mappings Registry This specification establishes the IANA "OAuth2.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, "TerminologyParameters CBOR Mappings" registry. The registry has been created to use the "Expert Review" registration procedure [RFC8126], except forConstrained-Node Networks", RFC 7228, DOI 10.17487/RFC7228, May 2014, <https://www.rfc-editor.org/info/rfc7228>. [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, DOI 10.17487/RFC7231, June 2014, <https://www.rfc-editor.org/info/rfc7231>. [RFC7521] Campbell, B., Mortimore, C., Jones, M., and Y. Goland, "Assertion Frameworkthe value range designated for private use. The columns of this registry are: Name The OAuth2.0 Client Authentication and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521, May 2015, <https://www.rfc-editor.org/info/rfc7521>. [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <https://www.rfc-editor.org/info/rfc7540>. [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 ResourcesParameter name, refers to the name in theConstrained 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 CasesOAuth 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. This registry will be initially populated by the values in Figure 12. The Reference column forAuthentication and Authorizationall of these entries will be this document. 8.11. OAuth Introspection Response Parameter Registration This specification registers the following parameters inConstrained Environments", RFC 7744, DOI 10.17487/RFC7744, January 2016, <https://www.rfc-editor.org/info/rfc7744>. [RFC7959] Bormann, C.the OAuth Token Introspection Response registry [IANA.TokenIntrospectionResponse]. o Name: "ace_profile" o Description: The ACE profile used between client andZ. Shelby, Ed., "Block-Wise TransfersRS. o Change Controller: IESG o Reference: Section 5.9.2 of [this document] o Name: "cnonce" o 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. o Change Controller: IESG o Reference: Section 5.9.2 of [this document] o Name: "exi" o Description: "Expires in". Lifetime of the token in seconds from theConstrained 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.0time the RS first sees it. Used to implement a weaker from of token expiration forNative 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,devices that cannot synchronize their internal clocks. o Change Controller: IESG o Reference: Section 5.9.2 of [this document] 8.12. OAuth Token Introspection Response CBOR Mappings Registry This specification establishes the IANA "OAuth2.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"Token Introspection ResponseCodeCBOR Mappings" registry. The registry has been created to use the "Expert Review" registration procedure [RFC8126], except for theConstrained 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 Securityvalue range designated forConstrained 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>. Appendix A. Design Justificationprivate use. 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 Thissection provides further insight intocontains a pointer to thedesign decisionspublic specification of thesolution documentedintrospection response parameter abbreviation, if one exists. This registry will be initially populated by the values inthis document. Section 3 lists several building blocks and briefly summarizes their importance.Figure 16. ThejustificationReference column foroffering someall of these entries will be this document. Note that the mappings ofthose building blocks, as opposedparameters corresponding tousing OAuth 2.0 as is, is given below. Common IoT constraints are: Low Power Radio: Many IoT devices are equippedclaim names intentionally coincide witha small battery which needs to last for a long time. For many constrained wireless devices,thehighest energy costCWT claim name mappings from [RFC8392]. 8.13. JSON Web Token Claims This specification registers the following new claims in the JSON Web Token (JWT) registry of JSON Web Token Claims [IANA.JsonWebTokenClaims]: o Claim Name: "ace_profile" o Claim Description: The ACE profile a token isassociatedsupposed totransmitting or receiving messages (roughly by a factorbe used with. o Change Controller: IESG o Reference: Section 5.10 of10 compared[this document] o Claim Name: "cnonce" o Claim Description: "client-nonce". A nonce previously provided toAES) [Margi10impact]. It is therefore importantthe AS by the RS via the client. Used tokeepverify token freshness when thetotal communication overhead low, including minimizingRS cannot synchronize its clock with thenumber and size of messages sent and received, which has an impactAS. o Change Controller: IESG o Reference: Section 5.10 ofchoice on the message format and protocol. By using CoAP over UDP and CBOR encoded messages, some[this document] o Claim Name: "exi" o Claim Description: "Expires in". Lifetime ofthese aspects are addressed. Security protocols contribute tothecommunication overhead and can, in some cases, be optimized. For example, authentication and key establishment may,token incertain cases where security requirements allow, be replaced by provisioning of security context byseconds from the time the RS first sees it. Used to implement atrusted third party, using transport or application layer security. Low CPU Speed: Some IoTweaker from of token expiration for devicesare equipped with processorsthatare significantly slower than those foundcannot synchronize their internal clocks. o Change Controller: IESG o Reference: Section 5.10.3 of [this document] 8.14. CBOR Web Token Claims This specification registers the following new claims inmost current devices ontheInternet. This typically has implications on what timely cryptographic operations"CBOR Web Token (CWT) Claims" registry [IANA.CborWebTokenClaims]. o Claim Name: "ace_profile" o Claim Description: The ACE profile adevicetoken iscapable of performing, which in turn impacts, e.g., protocol latency. Symmetric key cryptography maysupposed to be usedinsteadwith. o JWT Claim Name: ace_profile o Claim Key: TBD (suggested: 38) o Claim Value Type(s): integer o Change Controller: IESG o Specification Document(s): Section 5.10 of [this document] o Claim Name: "cnonce" o Claim Description: The client-nonce sent to thecomputationally more expensive public key cryptography whereAS by thesecurity requirements so allow, but this may also require support for trusted-third- party-assisted secret key establishment using transport- or application-layer security. Small AmountRS via the client. o JWT Claim Name: cnonce o Claim Key: TBD (suggested: 39) o Claim Value Type(s): byte string o Change Controller: IESG o Specification Document(s): Section 5.10 of [this document] o Claim Name: "exi" o Claim Description: The expiration time of a token measured from when it was received at the RS in seconds. o JWT Claim Name: exi o Claim Key: TBD (suggested: 40) o Claim Value Type(s): integer o Change Controller: IESG o Specification Document(s): Section 5.10.3 ofMemory: Microcontrollers embedded in IoT devices are often equipped with only a small amount[this document] o Claim Name: "scope" o Claim Description: The scope ofRAM and flash memory, which places limitations on what kindan access token as defined in [RFC6749]. o JWT Claim Name: scope o Claim Key: TBD (suggested: 9) o Claim Value Type(s): byte string or text string o Change Controller: IESG o Specification Document(s): Section 4.2 ofprocessing 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[RFC8693] 8.15. Media Type Registrations This specification registers thefirmware'application/ace+cbor' media type for messages ofsuch a device. Inthe protocols defined in thiscase, CoAP maydocument 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 beused instead of HTTP, symmetric-key cryptography instead of public-key cryptography, andencoded as CBORinstead of JSON. An authentication and key establishment protocol, e.g.,map containing theDTLS handshake,protocol parameters defined incomparison with assisted key establishment, also has an impact on memory and code footprints. User Interface Limitations: Protecting access to resources[this document]. Security considerations: See Section 6 of [this document] Interoperability considerations: N/A Published specification: [this document] Applications that use this media type: The type isboth an important security as well as privacy feature. End usersused by authorization servers, clients andenterprise customers may not want to give access toresource servers that support thedata collected by their IoT device orACE framework with CBOR encoding as specified in [this document]. Fragment identifier considerations: N/A Additional information: N/A Person & email address tofunctions it may offercontact for further information: <iesg@ietf.org> Intended usage: COMMON Restrictions on usage: none Author: Ludwig Seitz <ludwig.seitz@combitech.se> Change controller: IESG 8.16. CoAP Content-Format Registry This specification registers the following entry tothird parties. Sincetheclassical approach"CoAP Content-Formats" registry: Media Type: application/ace+cbor Encoding: - ID: TBD (suggested: 19) Reference: [this document] 8.17. Expert Review Instructions All ofrequesting permissions from end users via a rich user interface does not workthe IANA registries established inmany IoT deployment scenarios, these functions need to be delegated to user-controlled devices thatthis document arebetter suitable for such tasks, such as smart phones and tablets. Communication Constraints: In certain constrained settings an IoT device may not be abledefined tocommunicate withuse agiven device at all times. Devices may be sleeping, or just disconnected from the Internet becauseregistration policy of Expert Review. This section gives some generallack of connectivity inguidelines for what thearea,experts should be looking for, but they are being designated as experts forcost reasons, ora reason, so they should be given substantial latitude. Expert reviewers should take into consideration the following points: o Point squatting should be discouraged. Reviewers are encouraged to get sufficient information forsecurity reasons, e.g.,registration requests toavoid an entryensure that the usage is not going to duplicate one that is already registered, and that the pointfor Denial-of- Service attacks. The communication interactions this framework builds upon (as shown graphically in Figure 1) mayis likely to beaccomplished using a variety of different protocols,used in deployments. The zones tagged as private use are intended for testing purposes and closed environments; code points in other ranges should notall parts ofbe assigned for testing. o Specifications are needed for themessage flowfirst-come, first-serve range if they are expected to be used outside of closed environments inall applications duean interoperable way. When specifications are not provided, the description provided needs to have sufficient information to identify what thecommunication constraints. Deployments making usepoint is being used for. o Experts should take into account the expected usage ofCoAP are expected, but this frameworkfields when approving point assignment. The fact that there is a range for standards track documents does notlimited to them. Other protocols such as HTTP, or even protocols such as Bluetooth Smart communicationmean thatdo not necessarily use IP, could also be used.a standards track document cannot have points assigned outside of that range. Thelatter raises the need for application layer security over the various interfaces. In the lightlength ofthese constraints we have madethefollowing design decisions: CBOR, COSE, CWT: This framework RECOMMENDSencoded value should be weighed against how many code points of that length are left, theusesize ofCBOR [RFC8949] as data format. Where CBOR data needs todevice it will beprotected,used on. o Since a high degree of overlap is expected between these registries and theusecontents ofCOSE [RFC8152] is RECOMMENDED. Furthermore, where self-contained tokens are needed,the OAuth parameters [IANA.OAuthParameters] registries, experts should require new registrations to maintain alignment with parameters from OAuth that have comparable functionality. Deviation from thisframework RECOMMENDSalignment 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. Acknowledgments This document is a product ofCWT [RFC8392]. These measures aim at reducingthesizeACE working group ofmessages sent overthewire,IETF. Thanks to Eve Maler for her contributions to theRAM sizeuse ofdata objects that need to be keptOAuth 2.0 and UMA inmemoryIoT scenarios, Robert Taylor for his discussion input, and Malisa Vucinic for his input on thesizepredecessors oflibraries that devices needthis proposal. Thanks tosupport. CoAP: This framework RECOMMENDStheuseauthors ofCoAP [RFC7252] insteaddraft-ietf-oauth-pop-key-distribution, from where large parts ofHTTP. This does not precludetheuse of other protocols specifically aimed at constrained devices, like, e.g., Bluetooth Low Energysecurity considerations where copied. Thanks to Stefanie Gerdes, Olaf Bergmann, and Carsten Bormann for contributing their work on AS discovery from draft-gerdes-ace-dcaf- authorize (see Section3.2). This aims again at reducing the size of messages sent over the wire, the RAM size of data objects that need5.1). Thanks tobe kept in memoryJim Schaad andthe size of libraries that devices needMike 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 tosupport. Access Information: This framework defines the name "Access Information"Carsten Bormann fordata concerning the RS thatcontributing theAS returns totext for theclient in an access token response (see Section 5.8.2). This aims at enabling scenarios where a powerful client, supporting multiple profiles, needsCoRE Resource Type registry. Thanks tointeract with an RSRoman Danyliw forwhich it does not knowsuggesting thesupported profilesAppendix E (including its contents). Ludwig Seitz andthe raw public key. Proof-of-Possession: This framework makes useGoeran Selander worked on this document as part ofproof-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 tothe"cnf" claim, are definedCelticPlus project CyberWI, with funding from Vinnova. Ludwig Seitz was also received further funding for this work by Vinnova in thetoken endpoint,context of the CelticNext project Critisec. 10. References 10.1. Normative References [I-D.ietf-ace-oauth-params] Seitz, L., "Additional OAuth Parameters for Authorization in Constrained Environments (ACE)", draft-ietf-ace-oauth- params-14 (work in progress), March 2021. [IANA.CborWebTokenClaims] IANA, "CBOR Web Token (CWT) Claims", <https://www.iana.org/assignments/cwt/cwt.xhtml#claims- registry>. [IANA.CoreParameters] IANA, "Constrained RESTful Environments (CoRE) Parameters", <https://www.iana.org/assignments/core- parameters/core-parameters.xhtml>. [IANA.JsonWebTokenClaims] IANA, "JSON Web Token Claims", <https://www.iana.org/assignments/jwt/jwt.xhtml#claims>. [IANA.OAuthAccessTokenTypes] IANA, "OAuth Access Token Types", <https://www.iana.org/assignments/oauth-parameters/oauth- parameters.xhtml#token-types>. [IANA.OAuthExtensionsErrorRegistry] IANA, "OAuth Extensions Error Registry", <https://www.iana.org/assignments/oauth-parameters/oauth- parameters.xhtml#extensions-error>. [IANA.OAuthParameters] IANA, "OAuth Parameters", <https://www.iana.org/assignments/oauth-parameters/oauth- parameters.xhtml#parameters>. [IANA.TokenIntrospectionResponse] IANA, "OAuth Token Introspection Response", <https://www.iana.org/assignments/oauth-parameters/oauth- parameters.xhtml#token-introspection-response>. [RFC2119] Bradner, S., "Key words for use in RFCs toallow requestingIndicate 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>. [RFC6347] Rescorla, E. andstating confirmation keys. This aims at making token theft harder.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 Tokentheft is specifically relevant in constrained use cases, as communication often passes through middle-boxes, which could be able to steal bearer tokensUsage", RFC 6750, DOI 10.17487/RFC6750, October 2012, <https://www.rfc-editor.org/info/rfc6750>. [RFC6838] Freed, N., Klensin, J., anduse them to gain unauthorized access. Authz-Info endpoint: This framework introduces a new way of providing access tokens to an RS by exposing a authz-info endpoint, to which access tokens can be POSTed. This aims at reducing the size of the request messageT. Hansen, "Media Type Specifications andthe 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 badlyRegistration 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 withthe high rate of packet loss,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., andthe need to retransmit the whole message if one packet gets lost. Thus separating sending of the requestN. 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., andsending of the access tokens helps to reduce fragmentation. Client Credentials Grant: This framework RECOMMENDS the use of the client credentials grantT. Narten, "Guidelines formachine-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 pre-arrange 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: This framework RECOMMENDS the use of access token introspection in cases where the client is constrainedWriting an IANA Considerations Section ina way that it can not easily obtain new access tokens (i.e. it has connectivity issues that prevent it from communicating with the AS). In that case this framework RECOMMENDS the useRFCs", 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 ofa long-term token, that could be a simple reference. The RS is assumed to be able to communicate with the AS,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., andcan 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 beH. Tschofenig, "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, May 2018, <https://www.rfc-editor.org/info/rfc8392>. [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>. 10.2. Informative References [BLE] Bluetooth SIG, "Bluetooth Core Specification v5.1", Section 4.4, January 2019, <https://www.bluetooth.com/specifications/bluetooth-core- specification/>. [I-D.erdtman-ace-rpcc] Seitz, L. and S. Erdtman, "Raw-Public-Key and Pre-Shared- Key as OAuth client credentials", draft-erdtman-ace- rpcc-02 (work incontact with the client, thus granting or revoking access rights. Appendix B. Rolesprogress), October 2017. [I-D.ietf-ace-dtls-authorize] Gerdes, S., Bergmann, O., Bormann, C., Selander, G., andResponsibilities Resource Owner * Make sure that the RS is registered at the AS. This includes making known to the AS which profiles, token_type, scopes,L. Seitz, "Datagram Transport Layer Security (DTLS) Profile for Authentication andkey 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 isAuthorization for Constrained Environments (ACE)", draft-ietf-ace-dtls- authorize-16 (work inchargeprogress), March 2021. [I-D.ietf-ace-oscore-profile] Palombini, F., Seitz, L., Selander, G., and M. Gunnarsson, "OSCORE Profile of theRS. * If the client-credentials grant is used, make sure that the AS has the necessary, up-to-date, access control policiesAuthentication and Authorization forthe 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 requirementsConstrained Environments Framework", draft-ietf-ace- oscore-profile-18 (work in progress), April 2021. [I-D.ietf-quic-transport] Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed and Secure Transport", draft-ietf-quic-transport-34 (work in progress), January 2021. [I-D.ietf-tls-dtls13] Rescorla, E., Tschofenig, H., and N. Modadugu, "The Datagram Transport Layer Security (DTLS) Protocol Version 1.3", draft-ietf-tls-dtls13-41 (work in progress), February 2021. [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 theRequesting Party when issuing requests (e.g., minimum communication security requirements, trust anchors). * Register the client at the AS. This includes making known to the AS which profiles, token_types,19th International Conference on Computer Communications and Networks (ICCCN), August 2010. [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>. [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., andkey types (symmetric/ asymmetric) the client. Authorization Server * Register the RSM. 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., andmanage corresponding security contexts. * Register clientsA. Keranen, "Terminology for Constrained-Node Networks", RFC 7228, DOI 10.17487/RFC7228, May 2014, <https://www.rfc-editor.org/info/rfc7228>. [RFC7231] Fielding, R., Ed. andauthentication credentials. * Allow Resource Owners to configureJ. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics andupdate 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 configuredContent", RFC 7231, DOI 10.17487/RFC7231, June 2014, <https://www.rfc-editor.org/info/rfc7231>. [RFC7521] Campbell, B., Mortimore, C., Jones, M., and Y. Goland, "Assertion Framework forthe RS. * Optionally: Expose the introspection endpoint that allows RS's 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.OAuth 2.0 Client* Discover the ASAuthentication and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521, May 2015, <https://www.rfc-editor.org/info/rfc7521>. [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <https://www.rfc-editor.org/info/rfc7540>. [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 incharge of the RS that is to be targeted with a request. * Submit the token request (see step (A) of Figure 1). + Authenticate totheAS. + Optionally (if not pre-configured): Specify which RS, which resource(s),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., andwhich action(s) the request(s) will target. + If raw public keys (rpk) or certificates are used, make sure the AS has the right rpk or certificateS. Kumar, "Use Cases forthis client. * Process the access tokenAuthentication andAccess Information (see step (B) of Figure 1). + Check that the Access Information provides the necessary security parameters (e.g., PoP key, information on communication security protocols supported by the RS). + Safely store the proof-of-possession key. + If provided by the AS: Safely storeAuthorization 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 therefresh token. * SendConstrained 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 thetokenConstrained Application Protocol", RFC 8516, DOI 10.17487/RFC8516, January 2019, <https://www.rfc-editor.org/info/rfc8516>. [RFC8613] Selander, G., Mattsson, J., Palombini, F., andrequest toL. 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>. Appendix A. Design Justification This section provides further insight into theRS (see step (C)design decisions ofFigure 1). + Authenticate towardstheRS (this could coincide with the proofsolution documented in this document. Section 3 lists several building blocks and briefly summarizes their importance. The justification for offering some ofpossession process). + Transmit the tokenthose building blocks, asspecified by the AS (default isopposed tothe authz-info endpoint, alternative optionsusing OAuth 2.0 as is, is given below. Common IoT constraints are: Low Power Radio: Many IoT devices arespecified by profiles). + Performequipped with a small battery which needs to last for a long time. For many constrained wireless devices, theproof-of-possession procedure as specifiedhighest energy cost is associated to transmitting or receiving messages (roughly bythe profile in use (this may already have been taken carea factor ofthrough10 compared to AES) [Margi10impact]. It is therefore important to keep theauthentication procedure). * Processtotal communication overhead low, including minimizing theRS response (see step (F)number and size ofFigure 1)messages sent and received, which has an impact of choice on theRS. Resource Server * Expose a way to submit access tokens.message format and protocol. Bydefault this is the authz-info endpoint. * Process an access token. + Verifyusing CoAP over UDP and CBOR encoded messages, some of these aspects are addressed. Security protocols contribute to thetoken is fromcommunication 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 provisioning of security context by arecognized AS. + Check the token's integrity. + Verify that the token applies to this RS. + Checktrusted 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 thetokenInternet. This typically hasnot expired (ifimplications 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 thetoken provides expiration information). + Storecomputationally more expensive public key cryptography where thetokensecurity requirements sothat itallow, 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 beretrieved input on thecontextfirmware of such amatching request. Note: The order proposed here is not normative, any process that arrives at an equivalent result candevice. In this case, CoAP may beused. A noteworthy consideration is whether one can use cheap operations earlyused instead of HTTP, symmetric-key cryptography instead of public-key cryptography, and CBOR 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 toquickly discard non-applicable or invalid tokens, before performing expensive cryptographic operations (e.g. doingresources is both anexpiration check before verifying a signature). * Process a request. + Set up communicationimportant securitywith the client. + Authenticate the client. + Match the client against existing tokens. + Check that tokens belongingas well as privacy feature. End users and enterprise customers may not want to give access to theclient actually authorizedata collected by their IoT device or to functions it may offer to third parties. Since therequested action. + Optionally: Checkclassical 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 thatthe matching tokensarestill valid, using introspection (if this is possible.) * Send a response following the agreed upon communication security mechanism(s). * Safely store credentialsbetter suitable for such tasks, such asraw public keys for authentication or proof-of-possession keys linkedsmart phones and tablets. Communication Constraints: In certain constrained settings an IoT device may not be able toaccess tokens. Appendix C. Requirements on Profiles This section listscommunicate with a given device at all times. Devices may be sleeping, or just disconnected from therequirements on profilesInternet because ofthis framework, for the conveniencegeneral lack ofprofile designers. o Optionally define new methods forconnectivity in theclientarea, for cost reasons, or for security reasons, e.g., todiscover the necessary permissions and ASavoid an entry point foraccessingDenial-of- Service attacks. The communication interactions this framework builds upon (as shown graphically in Figure 1) may be accomplished using aresource,variety of differentfromprotocols, and not all parts of theone proposedmessage flow are used inSection 5.1. Section 4 o Optionally specify new grant types. Section 5.4 o Optionally define the use of client certificates as client credential type. Section 5.5 o Specifyall applications due to the communicationprotocol the client and RS the must use (e.g., CoAP). Section 5 and Section 5.8.4.3 o Specify the security protocol the client and RS mustconstraints. Deployments making useto protect their communication (e.g., OSCORE or DTLS). This must provide encryption, integrity and replay protection. Section 5.8.4.3 o Specify how the client and the RS mutually authenticate. Section 4 o 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)of CoAP aresupported by a specific proof-of- possession protocol. Section 5.8.4.2 o Specify a unique ace_profile identifier. Section 5.8.4.3 o If introspectionexpected, but this framework issupported: Specify thenot limited to them. Other protocols such as HTTP, or even protocols such as Bluetooth Smart communicationand security protocol for introspection. Section 5.9 o Specifythat do not necessarily use IP, could also be used. The latter raises thecommunication and security protocolneed forinteractions between client and AS. This must provide encryption, integrity protection, replay protection and a binding between requests and responses. Section 5 and Section 5.8 o Specify how/ifapplication-layer security over theauthz-info endpointvarious 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 data format. Where CBOR data needs to be protected,including how error responsesthe use of COSE [RFC8152] is RECOMMENDED. Furthermore, where self-contained tokens areprotected. Section 5.10.1 o Optionally define other methodsneeded, it is RECOMMENDED to use oftoken transport thanCWT [RFC8392]. These measures aim at reducing theauthz- info endpoint. Section 5.10.1 Appendix D. Assumptions on AS knowledge about C and RS This section listssize of messages sent over theassumptions on what an AS should know about a client and an RS in orderwire, the RAM size of data objects that need to beable to respondkept in memory and the size of libraries that devices need torequestssupport. CoAP: When using this framework, it is RECOMMENDED to use of CoAP [RFC7252] instead of HTTP. This does not preclude the use of other protocols specifically aimed at constrained devices, like, e.g., Bluetooth Low Energy (see Section 3.2). This aims again at reducing thetoken and introspection endpoints. How this information is established is out of scope for this document. o The identifiersize of messages sent over theclient or RS. o The profiles that the client or RS supports. o The scopes that the RS supports. o The audiences thatwire, theRS identifies with. o The key types (e.g., pre-shared symmetric key, raw public key, key length, other key parameters)RAM size of data objects that need to be kept in memory and theclient or RS supports. o The typessize ofaccess tokens the RS supports (e.g., CWT). o If the RS supports CWTs,libraries that devices need to support. Access Information: This framework defines theCOSE parametersname "Access Information" for data concerning thecrypto wrapper (e.g., algorithm, key-wrap algorithm, key-length)RS that theRS supports. o The expiration time for access tokens issuedAS returns tothis RS (unless the RS accepts a default time chosen bytheAS). o The symmetric key shared betweenclientand AS (if any). o The symmetric key shared betweenin 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 andAS (if any). o Thethe raw publickeykey. Proof-of-Possession: This framework makes use of proof-of-possession tokens, using theclient or RS (if any). o Whether"cnf" claim [RFC8747]. A request parameter "cnf" and a Response parameter "cnf", both having a value space semantically and syntactically identical to theRS has synchronized time (and thus"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 middle-boxes, which could be able to steal bearer tokens and usethe 'exp' claim) or not. Appendix E. Deployment Examples There isthem to gain unauthorized access. Authz-Info endpoint: This framework introduces alarge varietynew way ofIoT deployments, as is indicated in Appendix A, and this section highlightsproviding access tokens to an RS by exposing afew common variants. This section is not normative but illustrates how the frameworkauthz-info endpoint, to which access tokens can beapplied. For each ofPOSTed. This aims at reducing thedeployment variants, there are a numbersize ofpossible security setups between clients, resource serversthe request message andauthorization servers. The main focus inthefollowing subsections is on how authorizationcode complexity at the RS. The size ofa clientthe requestfor a resource hosted by an RSmessage isperformed. This requiresproblematic, since many constrained protocols have severe message size limitations at thesecurity ofphysical layer (e.g., in therequests and responses betweenorder of 100 bytes). This means that larger packets get fragmented, which in turn combines badly with theclientshigh rate of packet loss, and theRSneed tobe considered. Note: CBOR diagnostic notation is used for examplesretransmit the whole message if one packet gets lost. Thus separating sending ofrequeststhe request andresponses. E.1. Local Token Validationsending of the access tokens helps to reduce fragmentation. Client Credentials Grant: In thisscenario,framework thecaseuse of the client credentials grant is RECOMMENDED for machine-to-machine communication use cases, where manual intervention of the resourceserver is offline is considered, i.e., itowner to produce a grant token is notconnected tofeasible. The intention is that theAS atresource owner would instead pre-arrange authorization with thetime ofAS, based on the client's own credentials. The client can then (without manual intervention) obtain accessrequest. This access procedure involves steps A, B, C, and F of Figure 1. Sincetokens from theresource server must be able to verifyAS. Introspection: In this framework the use of access tokenlocally, self-contained access tokens must be used. This example showsintrospection is RECOMMENDED in cases where theinteractions betweenclient is constrained in aclient,way that it can not easily obtain new access tokens (i.e. it has connectivity issues that prevent it from communicating with theauthorization server andAS). In that case it is RECOMMENDED to use atemperature sensor acting aslong-term token, that could be aresource server. Message exchanges A and B are shown in Figure 17. A:simple reference. Theclient first generates a public-private key pair used for communication securityRS is assumed to be able to communicate with theRS. The client sends a CoAP POST requestAS, and can therefore perform introspection, in order to learn thetoken endpoint atclaims associated with theAS.token reference. Thesecurityadvantage ofthis requestsuch an approach is that the resource owner can change the claims associated to the token reference without having to betransportin contact with the client, thus granting orapplication layer. It is uprevoking access rights. Appendix B. Roles and Responsibilities Resource Owner * Make sure that the RS is registered at thecommunication security profileAS. This includes making known todefine. Intheexample it is assumed that both client andAShave performed mutual authentication e.g. via DTLS. The request contains the public key of the clientwhich profiles, token_type, scopes, and key types (symmetric/asymmetric) theAudience parameter setRS supports. Also making it known to"tempSensorInLivingRoom", a value thatthetemperature sensorAS which audience(s) the RS identifies itself with.The* Make sure that clients can discover the ASevaluatesthat is in charge of therequest and authorizesRS. * If theclient to accessclient-credentials grant is used, make sure that theresource. B: TheASresponds with a 2.05 Content response containing the Access Information, includinghas the necessary, up-to-date, accesstoken. The PoP access token contains the public key of the client, and the Access Information contains the public key ofcontrol policies for the RS.For communication security this example uses DTLS RawPublicKey betweenRequesting Party * Make sure that the clientandis provisioned theRS. The issued token will have a short validity time, i.e., "exp" closenecessary credentials to"iat", in orderauthenticate tomitigate attacks using stolen client credentials. The token includes the claim such as "scope" withtheauthorized accessAS. * Make sure thatan ownerthe client is configured to follow the security requirements of thetemperature device can enjoy. In this example,Requesting Party when issuing requests (e.g., minimum communication security requirements, trust anchors). * Register the"scope" claim, issued byclient at theAS, informsAS. This includes making known to the AS which profiles, token_types, and key types (symmetric/ asymmetric) theRS thatclient. Authorization Server * Register theowner ofRS 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 thetoken,token endpoint to allow clients to request tokens. * Authenticate clients thatcan prove the possession of a key is authorizedwish tomake a GETrequestagainst the /temperature resource andaPOSTtoken. * Process a token requestonusing the/firmware resource. Note thatauthorization policies configured for thesyntax and semantics ofRS. * Optionally: Expose thescope claim are application specific. Note: In this example it is assumedintrospection endpoint thatthe client knows what resource it wantsallows RS's toaccess, and is therefore ablesubmit token introspection requests. * If providing an introspection endpoint: Authenticate RSs that wish torequest 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 17: Token Request and Response Usingget 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. ClientCredentials. The information contained in the Request-Payload and* Discover theResponse- Payload is shownAS inFigure 18 Notecharge of the RS thatthe parameter "rs_cnf" from [I-D.ietf-ace-oauth-params]isusedtoinform the client aboutbe targeted with a request. * Submit theresource server's public key. Request-Payload : { "audience" : "tempSensorInLivingRoom", "client_id" : "myclient", "req_cnf" : { "COSE_Key" : { "kid" : b64'1Bg8vub9tLe1gHMzV76e8', "kty" : "EC", "crv" : "P-256", "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' } } } Response-Payload : { "access_token" : b64'0INDoQEKoQVNKkXfb7xaWqMTf6 ...', "rs_cnf" : { "COSE_Key" : { "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', "kty" : "EC", "crv" : "P-256", "x" : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4', "y" : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM' } } }token request (see step (A) of Figure18: Request1). + Authenticate to the AS. + Optionally (if not pre-configured): Specify which RS, which resource(s), andResponse Payload Details. The content ofwhich action(s) the request(s) will target. + If raw public keys (rpk) or certificates are used, make sure the AS has the right rpk or certificate for this client. * Process the access tokenis shown in Figure 19. { "aud" : "tempSensorInLivingRoom", "iat" : "1563451500", "exp" : "1563453000", "scope" : "temperature_g firmware_p", "cnf" : { "COSE_Key" : { "kid" : b64'1Bg8vub9tLe1gHMzV76e8', "kty" : "EC", "crv" : "P-256", "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' } } } Figure 19:and AccessToken including Public KeyInformation (see step (B) of Figure 1). + Check that theClient. Messages CAccess Information provides the necessary security parameters (e.g., PoP key, 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 andF are shown in Figure 20 -request to the RS (see step (C) of Figure21. C: The client then sends1). + Authenticate towards the RS (this could coincide with the proof of possession process). + Transmit thePoP accesstoken as specified by the AS (default is to the authz-infoendpoint atendpoint, 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.This isResource Server * Expose aplain CoAP POST request, i.e., no transport or application layer securityway to submit access tokens. By default this isused between client and RS sincethe authz-info endpoint. * Process an access token. + Verify the token isintegrity protected betweenfrom a recognized AS. + Check theAS and RS. The RS verifiestoken's integrity. + Verify that thePoP accesstokenwas created by a known and trusted AS, that itapplies to thisRS, andRS. + Check that the token has not expired (if the token provides expiration information). + Store the token so that itis valid.can be retrieved in the context of a matching request. Note: TheRS cachesorder 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 non-applicable 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 thesecurity context together with authorization information about this client contained inclient. + Match thePoP 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 20: Access Token provisioningclient against existing tokens. + Check that tokens belonging toRS Thethe clientandactually authorize theRS runsrequested action. + Optionally: Check that theDTLS handshakematching 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 keysestablished in step B and C. The client sends a CoAP GET requestfor authentication or proof-of-possession keys linked to/temperatureaccess tokens. Appendix C. Requirements onRS over DTLS. The RS verifies thatProfiles This section lists therequest is authorized, basedrequirements onpreviously 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 21: Resource Request and Response protected by DTLS. E.2. Introspection Aided Token Validation Inprofiles of thisdeployment scenario it is assumed that aframework, for the convenience of profile designers. o Optionally define new methods for the clientis not abletoaccessdiscover the necessary permissions and ASatfor accessing a resource, different from thetimeone proposed in Section 5.1. Section 4 o Optionally specify new grant types. Section 5.4 o Optionally define the use of client certificates as client credential type. Section 5.5 o Specify theaccess request, whereascommunication protocol the client and RSis assumed to be connected totheback-end infrastructure. Thusmust use (e.g., CoAP). Section 5 and Section 5.8.4.3 o Specify the security protocol the client and RScan makemust useof token introspection.to protect their communication (e.g., OSCORE or DTLS). Thisaccess procedure involves steps A-F of Figure 1, but assumes steps Amust provide encryption, integrity andB have been carried out during a phase whenreplay protection. Section 5.8.4.3 o Specify how the clienthad connectivity to AS. Sinceand theclient is assumedRS mutually authenticate. Section 4 o Specify the proof-of-possession protocol(s) and how tobe offline, at least forselect one, if several are available. Also specify which key types (e.g., symmetric/asymmetric) are supported by acertain period of time,specific proof-of- possession protocol. Section 5.8.4.2 o Specify apre-provisioned access token has to be long-lived. Since the clientunique ace_profile identifier. Section 5.8.4.3 o If introspection isconstrained,supported: Specify thetoken will not be self contained (i.e. not a CWT) but instead just a reference. The resource server uses its connectivity to learn aboutcommunication and security protocol for introspection. Section 5.9 o Specify theclaims associated tocommunication and security protocol for interactions between client and AS. This must provide encryption, integrity protection, replay protection and a binding between requests and responses. Section 5 and Section 5.8 o Specify how/if theaccess token by using introspection, whichauthz-info endpoint isshown in the example below. Inprotected, including how error responses are protected. Section 5.10.1 o Optionally define other methods of token transport than theexample interactions between an offline client (key fob), an RS (online lock),authz- info endpoint. Section 5.10.1 Appendix D. Assumptions on AS Knowledge about C and RS This section lists the assumptions on what an ASis shown. It is assumed that there isshould know about aprovisioning step where theclienthas access to the AS. This corresponds to message exchanges AandB which are shownan RS inFigure 22. Authorization consent from the resource owner can be pre-configured, but it can alsoorder to beprovided via an interactive flow withable to respond to requests to theresource owner. An example oftoken and introspection endpoints. How this information is established is out of scope for this document. o The identifier of thekey fob case could be that the resource owner has a connected car, he buys a generic keyclient or RS. o The profiles thathe wants to use with the car. To authorizethekey fob he connects it to his computerclient or RS supports. o The scopes thatthen provides the UI forthedevice. AfterRS supports. o The audiences thatOAuth 2.0 implicit flow can used to authorizethe RS identifies with. o The keyfor his car at the the car manufacturers AS. Note: In this exampletypes (e.g., pre-shared symmetric key, raw public key, key length, other key parameters) that the clientdoes not know the exact door it will be used toor RS supports. o The types of accesssincetokens thetoken request is not send atRS supports (e.g., CWT). o If thetime of access. SoRS supports CWTs, thescope and audienceCOSE parametersare set quite wide to start with, while tailored values narrowing downfor theclaims tocrypto wrapper (e.g., algorithm, key-wrap algorithm, key-length) that thespecificRSbeing accessed can be providedsupports. o The expiration time for access tokens issued tothatthis RSduring an introspection step. A: The client sends(unless the RS accepts aCoAP POST request todefault time chosen by thetoken endpoint at AS.AS). o Therequest containssymmetric key shared between client and AS (if any). o The symmetric key shared between RS and AS (if any). o The raw public key of theAudience parameter setclient or RS (if any). o Whether the RS has synchronized time (and thus is able to"PACS1337" (PACS, Physical Access System), a valueuse thethat identifies'exp' claim) or not. Appendix E. Differences to OAuth 2.0 This document adapts OAuth 2.0 to be suitable for constrained environments. This sections lists thephysical access control systemmain differences from the normative requirements of OAuth 2.0. o Use of TLS -- OAuth 2.0 requires the use of TLS both towhichprotect theindividual doors are connected. Thecommunication between ASgeneratesand client when requesting an accesstoken as an opaque string, which it can match to the specifictoken; between client andthe targeted audience. It furthermore generatesRS when accessing asymmetric proof-of- possession key. The communication securityresource andauthenticationbetweenclient andAS and RS if introspection isassumed to have been provided at transport layer (e.g. via DTLS) using a pre-sharedused. This framework requires similar securitycontext (psk, rpk or certificate). B: The AS respondsproperties, but does not require that they be realized witha CoAP 2.05 Content response, containingTLS. See Section 5. o 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. o 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 asplayloada byte string. See Section 5.8.1. o 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. o AccessInformation, includingtoken retention -- in OAuth 2.0, the access tokenand the symmetric proof-of-possession key. Communication security between C and RS will be DTLS and PreSharedKey. The PoP keyisused assent with each request to thePreSharedKey. Note:RS. In thisexample we are using a symmetric keyframework, the RS must be able to store these tokens for later use. See Section 5.10.1. Appendix F. Deployment Examples There is amulti-RS audience, whichlarge variety of IoT deployments, as isnot recommended normally (see Section 6.9). Howeverindicated in Appendix A, and thiscasesection 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 theriskfollowing subsections isdeemed to be acceptable, since allon how authorization of a client request for a resource hosted by an RS is performed. This requires thedoors are partsecurity of thesame physical access control system,requests andthereforeresponses between therisk of a malicious RS impersonatingclients and theclient towards anotherRS to be considered. Note: CBOR diagnostic notation islow. Authorization Client Server | | |<=======>| DTLS Connection Establishment | |used for examples of requests andmutual 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 22:responses. F.1. Local TokenRequest and Response using Client Credentials. The information contained inValidation In this scenario, theRequest-Payload andcase where theResponse- Payloadresource server isshown in Figure 23. Request-Payload: { "client_id" : "keyfob", "audience" : "PACS1337" } Response-Payload: { "access_token" : b64'VGVzdCB0b2tlbg==', "cnf" : { "COSE_Key" : { "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', "kty" : "oct", "alg" : "HS256", "k": b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE' } } } Figure 23: Request and Response Payload for CofflineThe access token in this caseisjust an opaque byte string referencingconsidered, i.e., it is not connected to theauthorization informationAS at theAS. C: Next, the client POSTstime of the accesstoken to the authz-info endpoint in the RS.request. Thisis a plain CoAP request, i.e., no DTLS between clientaccess procedure involves steps A, B, C, andRS.F of Figure 1. Since the resource server must be able to verify the access tokenis an opaque string,locally, self-contained access tokens must be used. This example shows theRS cannot verify it on its own, and thus defers to respondinteractions between a client, the authorization server and a temperature sensor acting as a resource server. Message exchanges A and B are shown in Figure 17. A: The clientwithfirst generates astatus code until after step E. D:public-private key pair used for communication security with the RS. TheRSclient sendsthe tokena CoAP POST request to theintrospectiontoken endpointonat theAS using a CoAP POST request. InAS. The security of this request can be transport or application layer. It is up the communication security profile to define. In the exampleRSit is assumed that both client and ASare assumed tohave performed mutual authenticationusinge.g. via DTLS. The request contains the public key of the client and the Audience parameter set to "tempSensorInLivingRoom", apre shared security context (psk, rpk or certificate) withvalue that theRS acting as DTLS client. E:temperature sensor identifies itself with. The ASprovidesevaluates theintrospectionrequest and authorizes the client to access the resource. B: The AS responds with a 2.05 Content response(2.05 Content)containingparameters aboutthe Access Information, including the access token.ThisThe 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 theconfirmation key (cnf) parameterclaim such as "scope" with the authorized access thatallowsan owner of the temperature device can enjoy. In this example, the "scope" claim, issued by the AS, informs the RSto verifythat theclient's proofowner ofpossession in step F. Notethe token, thatour example in Figure 25 assumescan prove the possession of apre-establishedkey(e.g. one used byis authorized to make a GET request against theclient/temperature resource andthe RS foraprevious token)POST request on the /firmware resource. Note that the syntax and semantics of the scope claim are application specific. Note: In this example it isnow only referenced by its key-identifier 'kid'. After receiving message E,assumed that theRS respondsclient knows what resource it wants to access, and is therefore able to request specific audience and scope claims for theclient's POST in step C with the CoAP response code 2.01 (Created). Resourceaccess token. Authorization Client Server | |C: +-------->| Header: POST (T=CON, Code=0.02) | POST | Uri-Path:"authz-info" | | Payload: b64'VGVzdCB0b2tlbg==' | | | | Authorization | | Server|<=======>| DTLS Connection Establishment | | and mutual authentication | |D: +--------->|A: +-------->| Header: POST (Code=0.02) ||POST |Uri-Path: "introspect" |Uri-Path:"token" | | Content-Format:"application/ace+cbor" |application/ace+cbor | | Payload: <Request-Payload> | || | E: |<---------+B: |<--------+ Header: 2.05 Content ||2.05 | Content-Format:"application/ace+cbor" |application/ace+cbor | | Payload: <Response-Payload> | || | | |<--------+ Header: 2.01 Created | 2.01 | | |Figure24:17: TokenIntrospection for C offlineRequest and Response Using Client Credentials. The information contained in the Request-Payload andthe Response-the Response- Payload is shown in Figure 18 Note that the parameter "rs_cnf" from [I-D.ietf-ace-oauth-params] is used to inform the client about the resource server's public key. Request-Payload : { "audience" : "tempSensorInLivingRoom", "client_id" : "myclient", "req_cnf" : { "COSE_Key" : { "kid" : b64'1Bg8vub9tLe1gHMzV76e8', "kty" : "EC", "crv" : "P-256", "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' } } } Response-Payload : { "access_token" : b64'0INDoQEKoQVNKkXfb7xaWqMTf6 ...', "rs_cnf" : { "COSE_Key" : { "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', "kty" : "EC", "crv" : "P-256", "x" : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4', "y" : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM' } } } Figure 18: Request and Response Payload Details. The content of the access token is shown in Figure25. Request-Payload:19. {"token" : b64'VGVzdCB0b2tlbg==', "client_id""aud" :"FrontDoor", } Response-Payload: { "active""tempSensorInLivingRoom", "iat" :true, "aud""1563451500", "exp" :"lockOfDoor4711","1563453000", "scope" :"open, close", "iat" : 1563454000,"temperature_g firmware_p", "cnf" : { "COSE_Key" : { "kid" :b64'c29tZSBwdWJsaWMga2V5IGlk'b64'1Bg8vub9tLe1gHMzV76e8', "kty" : "EC", "crv" : "P-256", "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' } } } Figure25: Request19: Access Token including Public Key of the client. Messages C andResponse Payload for IntrospectionF are shown in Figure 20 - Figure 21. C: The clientusesthen sends thesymmetricPoPkey to establish a DTLS PreSharedKey secure connectionaccess token to the authz-info endpoint at the RS.TheThis is a plain CoAPrequest PUTPOST request, i.e., no transport or application-layer security issent to the uri-path /state onused between client and RS since theRS, changingtoken is integrity protected between thestate ofAS and RS. The RS verifies that thedoorPoP access token was created by a known and trusted AS, that it applies tolocked. F:this RS, and that it is valid. The RSrespondscaches the security context together witha appropriate overauthorization information about this client contained in thesecure DTLS channel.PoP access token. Resource Client Server | ||<=======>| DTLS Connection Establishment | | using Pre Shared Key | |C: +-------->| Header:PUT (Code=0.03)POST (Code=0.02) |PUTPOST |Uri-Path: "state"Uri-Path:"authz-info" | | Payload:<new state for the lock>0INDoQEKoQVN ... | |F:|<--------+ Header: 2.04 Changed | 2.04 |Payload: <new state for the lock>| |Figure 26: Resource request and response protected by OSCORE Appendix F. Document Updates RFC EDITOR: PLEASE REMOVE THIS SECTION. F.1. Version -21 to 22 o Provided section numbers in references to OAuth RFC. o Updated IANA mapping registries to only use "Private Use" and "Expert Review". o Made error messages optional for RS at token submission since it may not be able to send them depending on the profile. o Corrected errors in examples. F.2. Version -20 to 21 o Added text about expiration of RS keys. F.3. Version -19 to 20 o Replaced "req_aud" with "audience" from the OAuth token exchange draft. o Updated examples to remove unnecessary elements. F.4. Version -18 to -19 o Added definition of "Authorization Information". o Explicitly state that ACE allows encoding refresh tokens in binary format in addition to strings. o Renamed "AS Information" to "AS Request Creation Hints" and added the possibility to specify req_aud and scope as hints. o Added the "kid" parameter to AS Request Creation Hints. o Added security considerations about the integrity protection of tokens with multi-RS audiences. o Renamed IANA registries mapping OAuth parameters to reflect the mapped registry. o Added JWT claim names to CWT claim registrations. o Added expert review instructions. o Updated references to TLS from 1.2 to 1.3. F.5. Version -17 to -18 o Added OSCORE options in examples involving OSCORE. o Removed requirement for the client to send application/cwt, since the client has no way to know. o Clarified verification of tokens by the RS. o Added exi claim CWT registration. F.6. Version -16 to -17 o Added references to (D)TLS 1.3. o Added requirement that responses are bound to requests. o Specify that grant_type is OPTIONAL in C2AS requests (as opposedFigure 20: Access Token provisioning toREQUIRED in OAuth). o Replaced examples with hypothetical COSE profile with OSCORE. o Added requirement for content type application/ace+cbor in error responses for tokenRS The client andintrospection requeststhe RS runs the DTLS handshake using the raw public keys established in step B andresponses. o Reworked abbreviation space for claims,C. The client sends a CoAP GET requestand response parameters. o Added textto /temperature on RS over DTLS. The RS verifies that the request is authorized, based on previously established security context. F: The RSmay indicate thatresponds 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 21: Resource Request and Response protected by DTLS. F.2. Introspection Aided Token Validation In this deployment scenario it isbusy at the authz- info resource. o Added sectionassumed thatspecifies how the RS verifies ana client is not able to accesstoken. o Added section ontheprotectionAS at the time of theauthz-info endpoint. o Removedaccess request, whereas theexpiration mechanism based on sequence numbers. o Added referenceRS is assumed toRFC7662 security considerations. o Added considerations on minimal security requirements for communication. o Added security considerations on unprotected information sentbe connected toauthz-infothe 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 andinB have been carried out during a phase when theerror responses. F.7. Version -15client had connectivity to-16 o Added textAS. Since theRS using RFC6750 error codes. o Defined an error codeclient is assumed to be offline, at least forincompatiblea certain period of time, a pre-provisioned access tokenrequest parameters. o Removed referenceshas to be long-lived. Since theactors draft. o Fixed errors in examples. F.8. Version -14client 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-15 o Added text about refresh tokens. o Added textlearn aboutprotection of credentials. o Rephrased introspection so that other entities than RS can do it. o Editorial improvements. F.9. Version -13 to -14 o Split outthe'aud', 'cnf' and 'rs_cnf' parametersclaims associated to[I-D.ietf-ace-oauth-params] o Introducedthe"application/ace+cbor" Content-Type. o Added claim registrations from 'profile'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'rs_cnf'. o Added note on schema part ofan ASInformation Section 5.3 o Realignedis shown. It is assumed that there is a provisioning step where theparameter abbreviations to push rarely used onesclient has access to the2-byte encoding size of CBOR integers. F.10. Version -12 to -13 o Changed "Resource Information" to "Access Information" to avoid confusion. o Clarified section about AS discovery. o Editorial changes F.11. Version -11AS. This corresponds to-12 o Movedmessage exchanges A and B which are shown in Figure 22. Authorization consent from theRequest error handling to a section of its own. o Requireresource owner can be pre-configured, but it can also be provided via an interactive flow with theuseresource owner. An example ofthe abbreviationthis forprofile identifiers. o Added rs_cnf parameter intheintrospection response, to inform RS' with several RPKs on whichkey fob case could be that the resource owner has a connected car, he buys a generic key that he wants touse. o Alloweduseof rs_cnf as claim in the access token in order to inform an RSwithseveral RPKs on whichthe car. To authorize the key fob he connects it touse. o Clarifiedhis computer thatprofiles must specify if/how error responses are protected. o Fixed label number range to align with COSE/CWT. o Clarifiedthen provides therequirements language in order to allow profilesUI for the device. After that OAuth 2.0 implicit flow can used tospecify other payload formats than CBOR if they doauthorize the key for his car at the car manufacturers AS. Note: In this example the client does notuse CoAP. F.12. Version -10 to -11 o Fixed some CBOR data type errors. o Updated boilerplate text F.13. Version -09know the exact door it will be used to-10 o Removed CBOR major type numbers. o Removedaccess since theclienttokendesign. o Rephrased to clarify that other protocols than CoAP can be used. o Clarifications regardingrequest is not send at theusetime ofHTTP F.14. Version -08 to -09 o Allowed scope to be byte strings. o Defined default names for endpoints. o Refactoredaccess. So theIANA section for briefness and consistency. o Refactored tables that define IANA registry contents for consistency. o Created IANA registry for CBOR mappings of error codes, grant typesscope andAuthorization Server Information. o Added referencesaudience parameters are set quite wide toother document sections defining IANA entries instart with, while tailored values narrowing down theIANA section. F.15. Version -07claims to-08 o Moved AS discovery fromtheDTLS profilespecific RS being accessed can be provided to that RS during an introspection step. A: The client sends a CoAP POST request to theframework, see Section 5.1. o Madetoken endpoint at AS. The request contains theuse of CBOR mandatory. If you use JSON you can use vanilla OAuth. o Made it mandatory for profilesAudience parameter set tospecify C-AS security and RS-AS security (the latter only if introspection is supported). o Made"PACS1337" (PACS, Physical Access System), a value theuse of CBOR abbreviations mandatory. o Added textthat identifies the physical access control system toclarifywhich theuse ofindividual doors are connected. The AS generates an access tokenreferencesas analternative to CWTs. o Added textopaque string, which it can match toclarify that introspection must not be delayed, in casetheRS has to return aspecific clienttoken. o Addedand the targeted audience. It furthermore generates a symmetric proof-of- possession key. The communication securityconsiderations about leakage through unprotected AS discovery information, combining profilesandleakage through error responses. o Added privacy considerations about leakage through unprotectedauthentication between client and ASdiscovery. o Added text that clarifies that introspectionisoptional. o Made profile parameter optional since it can be implicit. o Clarified thatassumed to have been provided at transport layer (e.g. via DTLS) using a pre-shared security context (psk, rpk or certificate). B: The AS responds with a CoAPis not mandatory and other protocols can be used. o Clarified the design justification for specific features of2.05 Content response, containing as payload theframework in appendix A. o Clarified appendix E.2. o Removed specification ofAccess Information, including the"cnf" claim for CBOR/COSE,access token andreplaced with references to [RFC8747] F.16. Version -06 to -07 o Various clarifications added. o Fixed erroneous author email. F.17. Version -05 to -06 o Moved sections that define the ACE framework into a subsection oftheframework Section 5. o Split section on client credentialssymmetric proof-of-possession key. Communication security between C andgrant into two separate sections, Section 5.4,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 Section5.5. o Added Section 5.6 on AS authentication. o Added Section 5.7 on6.9). However in this case theAuthorization endpoint. F.18. Version -04 to -05 o Added RFC 2119 languagerisk is deemed to be acceptable, since all thespecificationdoors are part of therequired behaviorsame physical access control system, and therefore the risk ofprofile specifications. o Added Section 5.5 ona malicious RS impersonating therelation toclient 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 22: Token Request and Response using Client Credentials. The information contained in theOAuth2 grant types. o Added CBOR abbreviations for errorRequest-Payload and theerror codes definedResponse- Payload is shown inOAuth2. o Added clarification about token expirationFigure 23. Request-Payload: { "client_id" : "keyfob", "audience" : "PACS1337" } Response-Payload: { "access_token" : b64'VGVzdCB0b2tlbg==', "cnf" : { "COSE_Key" : { "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', "kty" : "oct", "alg" : "HS256", "k": b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE' } } } Figure 23: Request andlong-running requests in Section 5.10.3 o Added security considerations about tokens with symmetric PoP keys validResponse Payload formore than one RS. o Added privacy considerations section. o Added IANA registry mappingC offline The access token in this case is just an opaque byte string referencing theconfirmation types from RFC 7800 to equivalent COSE types. o Added appendix D, describing assumptions about whatauthorization information at theAS knows aboutAS. C: Next, the clientand the RS. F.19. Version -03 to -04 o Added a description ofPOSTs theterms "framework" and "profiles" as used in this document. o Clarified protection ofaccesstokens in section 3.1. o Clarified uses oftoken to the"cnf" parameter in section 6.4.5. o Clarified intended use of Client Tokenauthz-info endpoint insection 7.4. F.20. Version -02 to -03 o Removed references to draft-ietf-oauth-pop-key-distribution sincethestatus of this draftRS. This isunclear. o Copieda plain CoAP request, i.e., no DTLS between client andadapted security considerations from draft-ietf-oauth- pop-key-distribution. o Renamed "client information" to "RS information" since it is information about theRS.o Clarified the requirements on profiles of this framework. o ClarifiedSince the tokenendpoint protocol and removed negotiation of "profile" and "alg" (section 6). o Renumberedis an opaque string, theabbreviations for claimsRS cannot verify it on its own, andparametersthus defers togetrespond the client with aconsistent numbering across different endpoints. o Clarifiedstatus code until after step E. D: The RS sends theintrospection endpoint. o Renamed token, introspection and authz-info to "endpoint" instead of "resource"token tomirror the OAuth 2.0 terminology. o Updatedtheexamples inintrospection endpoint on theappendices. F.21. Version -01 to -02 o RestructuredAS using a CoAP POST request. In this example RS and AS are assumed toremove communicationhave performed mutual authentication using a pre shared securityparts. These shall now be defined in profiles. o Restructured section 5 to create new sections oncontext (psk, rpk or certificate) with the RS acting as DTLS client. E: The AS provides theOAuth endpoints token,introspectionand authz-info. o Pulled in material from draft-ietf-oauth-pop-key-distribution in order to define proof-of-possession key distribution. o Introducedresponse (2.05 Content) containing parameters about the"cnf"token. This includes the confirmation key (cnf) parameteras defined in RFC7800that allows the RS toreference or transport keys used forverify the client's proof ofpossession. o Introducedpossession in step F. Note that our example in Figure 25 assumes a pre-established key (e.g. one used by the"client-token" to transportclientinformation from the AS toand theclient viaRS 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 inconjunctionstep C withintrospection. o ExpandedtheIANA section to define parametersCoAP 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 24: Token Introspection fortoken request, introspection and CWT claims. o Moved deployment scenarios toC offline The information contained in theappendix as examples. F.22. Version -00 to -01 o Changed 5.1. from "Communication Security Protocol" to "Client Information". o Major rewrite of 5.1 to clarifyRequest-Payload and theinformation exchanged between CResponse- Payload is shown in Figure 25. Request-Payload: { "token" : b64'VGVzdCB0b2tlbg==', "client_id" : "FrontDoor", } Response-Payload: { "active" : true, "aud" : "lockOfDoor4711", "scope" : "open, close", "iat" : 1563454000, "cnf" : { "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk' } } Figure 25: Request andAS in the PoP access token request profileResponse Payload forIoT. * Allow theIntrospection The clientto indicate preferences for the communication security protocol. * Defined the term "Client Information" foruses theadditional information returnedsymmetric PoP key tothe client in additionestablish a DTLS PreSharedKey secure connection to theaccess token. * Require thatRS. The CoAP request PUT is sent to themessages between AS and client are secured, either with (D)TLS or with COSE_Encrypted wrappers. * Removed dependencyuri-path /state onOSCOAP and added generic text about object security instead. * Defined the "rpk" parameter intheclient information to transmitRS, changing theraw public keystate of theRS from ASdoor toclient. * (D)TLS MUST use the PoP key in the handshake (either as PSK or as client RPKlocked. F: The RS responds withclient authentication). * Defined the use of x5c, x5t and x5tS256 parameters whenaclient certificate is used for proof of possession. * Defined "tktn" parameter for signaling for how to transfer the access token. o Added 5.2.appropriate over theCoAP Access-Token optionsecure DTLS channel. Resource Client Server | | |<=======>| DTLS Connection Establishment | | using Pre Shared Key | | +-------->| Header: PUT (Code=0.03) | PUT | Uri-Path: "state" | | Payload: <new state fortransferring access tokens in messages that do not have payload. o 5.3.2. Defined success and error responses from the RS when receiving an access token. o 5.6.:Added section giving guidance on how to handle token expiration intheabsence of reliable time. o Appendix B Added list of roles and responsibilitieslock> | | F: |<--------+ Header: 2.04 Changed | 2.04 | Payload: <new state forC, ASthe lock> | | Figure 26: Resource request andRS.response protected by OSCORE Authors' Addresses Ludwig Seitz Combitech Djaeknegatan 31 Malmoe 211 35 Sweden Email: ludwig.seitz@combitech.se Goeran Selander Ericsson Faroegatan 6 Kista 164 80 Sweden Email: goran.selander@ericsson.com Erik Wahlstroem Sweden Email: erik@wahlstromstekniska.se Samuel Erdtman Spotify AB Birger Jarlsgatan 61, 4tr Stockholm 113 56 Sweden Email: erdtman@spotify.com Hannes Tschofenig Arm Ltd. Absam 6067 Austria Email: Hannes.Tschofenig@arm.com