idnits 2.17.1 draft-ietf-ace-oauth-authz-38.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 8, 2021) is 1138 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-16) exists of draft-ietf-ace-oauth-params-13 ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) == Outdated reference: A later version (-43) exists of draft-ietf-tls-dtls13-40 -- Obsolete informational reference (is this intentional?): RFC 7231 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 7540 (Obsoleted by RFC 9113) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 ACE Working Group L. Seitz 3 Internet-Draft Combitech 4 Intended status: Standards Track G. Selander 5 Expires: September 9, 2021 Ericsson 6 E. Wahlstroem 8 S. Erdtman 9 Spotify AB 10 H. Tschofenig 11 Arm Ltd. 12 March 8, 2021 14 Authentication and Authorization for Constrained Environments (ACE) 15 using the OAuth 2.0 Framework (ACE-OAuth) 16 draft-ietf-ace-oauth-authz-38 18 Abstract 20 This specification defines a framework for authentication and 21 authorization in Internet of Things (IoT) environments called ACE- 22 OAuth. The framework is based on a set of building blocks including 23 OAuth 2.0 and the Constrained Application Protocol (CoAP), thus 24 transforming a well-known and widely used authorization solution into 25 a form suitable for IoT devices. Existing specifications are used 26 where possible, but extensions are added and profiles are defined to 27 better serve the IoT use cases. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on September 9, 2021. 46 Copyright Notice 48 Copyright (c) 2021 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 64 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 66 3.1. OAuth 2.0 . . . . . . . . . . . . . . . . . . . . . . . . 7 67 3.2. CoAP . . . . . . . . . . . . . . . . . . . . . . . . . . 10 68 4. Protocol Interactions . . . . . . . . . . . . . . . . . . . . 11 69 5. Framework . . . . . . . . . . . . . . . . . . . . . . . . . . 15 70 5.1. Discovering Authorization Servers . . . . . . . . . . . . 16 71 5.2. Unauthorized Resource Request Message . . . . . . . . . . 17 72 5.3. AS Request Creation Hints . . . . . . . . . . . . . . . . 17 73 5.3.1. The Client-Nonce Parameter . . . . . . . . . . . . . 19 74 5.4. Authorization Grants . . . . . . . . . . . . . . . . . . 20 75 5.5. Client Credentials . . . . . . . . . . . . . . . . . . . 21 76 5.6. AS Authentication . . . . . . . . . . . . . . . . . . . . 21 77 5.7. The Authorization Endpoint . . . . . . . . . . . . . . . 21 78 5.8. The Token Endpoint . . . . . . . . . . . . . . . . . . . 22 79 5.8.1. Client-to-AS Request . . . . . . . . . . . . . . . . 22 80 5.8.2. AS-to-Client Response . . . . . . . . . . . . . . . . 25 81 5.8.3. Error Response . . . . . . . . . . . . . . . . . . . 27 82 5.8.4. Request and Response Parameters . . . . . . . . . . . 28 83 5.8.4.1. Grant Type . . . . . . . . . . . . . . . . . . . 29 84 5.8.4.2. Token Type . . . . . . . . . . . . . . . . . . . 29 85 5.8.4.3. Profile . . . . . . . . . . . . . . . . . . . . . 29 86 5.8.4.4. Client-Nonce . . . . . . . . . . . . . . . . . . 30 87 5.8.5. Mapping Parameters to CBOR . . . . . . . . . . . . . 30 88 5.9. The Introspection Endpoint . . . . . . . . . . . . . . . 31 89 5.9.1. Introspection Request . . . . . . . . . . . . . . . . 32 90 5.9.2. Introspection Response . . . . . . . . . . . . . . . 33 91 5.9.3. Error Response . . . . . . . . . . . . . . . . . . . 34 92 5.9.4. Mapping Introspection parameters to CBOR . . . . . . 35 93 5.10. The Access Token . . . . . . . . . . . . . . . . . . . . 35 94 5.10.1. The Authorization Information Endpoint . . . . . . . 36 95 5.10.1.1. Verifying an Access Token . . . . . . . . . . . 37 96 5.10.1.2. Protecting the Authorization Information 97 Endpoint . . . . . . . . . . . . . . . . . . . . 39 98 5.10.2. Client Requests to the RS . . . . . . . . . . . . . 39 99 5.10.3. Token Expiration . . . . . . . . . . . . . . . . . . 40 100 5.10.4. Key Expiration . . . . . . . . . . . . . . . . . . . 41 101 6. Security Considerations . . . . . . . . . . . . . . . . . . . 42 102 6.1. Protecting Tokens . . . . . . . . . . . . . . . . . . . . 42 103 6.2. Communication Security . . . . . . . . . . . . . . . . . 43 104 6.3. Long-Term Credentials . . . . . . . . . . . . . . . . . . 44 105 6.4. Unprotected AS Request Creation Hints . . . . . . . . . . 44 106 6.5. Minimal security requirements for communication . 45 107 6.6. Token Freshness and Expiration . . . . . . . . . . . . . 46 108 6.7. Combining profiles . . . . . . . . . . . . . . . . . . . 46 109 6.8. Unprotected Information . . . . . . . . . . . . . . . . . 47 110 6.9. Identifying audiences . . . . . . . . . . . . . . . . . . 47 111 6.10. Denial of service against or with Introspection . . 48 112 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 49 113 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 50 114 8.1. ACE Authorization Server Request Creation Hints . . . . . 50 115 8.2. CoRE Resource Type registry . . . . . . . . . . . . . . . 50 116 8.3. OAuth Extensions Error Registration . . . . . . . . . . . 51 117 8.4. OAuth Error Code CBOR Mappings Registry . . . . . . . . . 51 118 8.5. OAuth Grant Type CBOR Mappings . . . . . . . . . . . . . 51 119 8.6. OAuth Access Token Types . . . . . . . . . . . . . . . . 52 120 8.7. OAuth Access Token Type CBOR Mappings . . . . . . . . . . 52 121 8.7.1. Initial Registry Contents . . . . . . . . . . . . . . 53 122 8.8. ACE Profile Registry . . . . . . . . . . . . . . . . . . 53 123 8.9. OAuth Parameter Registration . . . . . . . . . . . . . . 53 124 8.10. OAuth Parameters CBOR Mappings Registry . . . . . . . . . 54 125 8.11. OAuth Introspection Response Parameter Registration . . . 54 126 8.12. OAuth Token Introspection Response CBOR Mappings Registry 55 127 8.13. JSON Web Token Claims . . . . . . . . . . . . . . . . . . 55 128 8.14. CBOR Web Token Claims . . . . . . . . . . . . . . . . . . 56 129 8.15. Media Type Registrations . . . . . . . . . . . . . . . . 57 130 8.16. CoAP Content-Format Registry . . . . . . . . . . . . . . 57 131 8.17. Expert Review Instructions . . . . . . . . . . . . . . . 58 132 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 59 133 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 59 134 10.1. Normative References . . . . . . . . . . . . . . . . . . 59 135 10.2. Informative References . . . . . . . . . . . . . . . . . 62 136 Appendix A. Design Justification . . . . . . . . . . . . . . . . 65 137 Appendix B. Roles and Responsibilities . . . . . . . . . . . . . 68 138 Appendix C. Requirements on Profiles . . . . . . . . . . . . . . 71 139 Appendix D. Assumptions on AS knowledge about C and RS . . . . . 71 140 Appendix E. Deployment Examples . . . . . . . . . . . . . . . . 72 141 E.1. Local Token Validation . . . . . . . . . . . . . . . . . 72 142 E.2. Introspection Aided Token Validation . . . . . . . . . . 76 143 Appendix F. Document Updates . . . . . . . . . . . . . . . . . . 80 144 F.1. Version -21 to 22 . . . . . . . . . . . . . . . . . . . . 81 145 F.2. Version -20 to 21 . . . . . . . . . . . . . . . . . . . . 81 146 F.3. Version -19 to 20 . . . . . . . . . . . . . . . . . . . . 81 147 F.4. Version -18 to -19 . . . . . . . . . . . . . . . . . . . 81 148 F.5. Version -17 to -18 . . . . . . . . . . . . . . . . . . . 81 149 F.6. Version -16 to -17 . . . . . . . . . . . . . . . . . . . 81 150 F.7. Version -15 to -16 . . . . . . . . . . . . . . . . . . . 82 151 F.8. Version -14 to -15 . . . . . . . . . . . . . . . . . . . 82 152 F.9. Version -13 to -14 . . . . . . . . . . . . . . . . . . . 82 153 F.10. Version -12 to -13 . . . . . . . . . . . . . . . . . . . 82 154 F.11. Version -11 to -12 . . . . . . . . . . . . . . . . . . . 83 155 F.12. Version -10 to -11 . . . . . . . . . . . . . . . . . . . 83 156 F.13. Version -09 to -10 . . . . . . . . . . . . . . . . . . . 83 157 F.14. Version -08 to -09 . . . . . . . . . . . . . . . . . . . 83 158 F.15. Version -07 to -08 . . . . . . . . . . . . . . . . . . . 83 159 F.16. Version -06 to -07 . . . . . . . . . . . . . . . . . . . 84 160 F.17. Version -05 to -06 . . . . . . . . . . . . . . . . . . . 84 161 F.18. Version -04 to -05 . . . . . . . . . . . . . . . . . . . 84 162 F.19. Version -03 to -04 . . . . . . . . . . . . . . . . . . . 85 163 F.20. Version -02 to -03 . . . . . . . . . . . . . . . . . . . 85 164 F.21. Version -01 to -02 . . . . . . . . . . . . . . . . . . . 85 165 F.22. Version -00 to -01 . . . . . . . . . . . . . . . . . . . 86 166 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 86 168 1. Introduction 170 Authorization is the process for granting approval to an entity to 171 access a generic resource [RFC4949]. The authorization task itself 172 can best be described as granting access to a requesting client, for 173 a resource hosted on a device, the resource server (RS). This 174 exchange is mediated by one or multiple authorization servers (AS). 175 Managing authorization for a large number of devices and users can be 176 a complex task. 178 While prior work on authorization solutions for the Web and for the 179 mobile environment also applies to the Internet of Things (IoT) 180 environment, many IoT devices are constrained, for example, in terms 181 of processing capabilities, available memory, etc. For web 182 applications on constrained nodes, this specification RECOMMENDS the 183 use of the Constrained Application Protocol (CoAP) [RFC7252] as 184 replacement for HTTP. 186 Appendix A gives an overview of the constraints considered in this 187 design, and a more detailed treatment of constraints can be found in 188 [RFC7228]. This design aims to accommodate different IoT deployments 189 and thus a continuous range of device and network capabilities. 191 Taking energy consumption as an example: At one end there are energy- 192 harvesting or battery powered devices which have a tight power 193 budget, on the other end there are mains-powered devices, and all 194 levels in between. 196 Hence, IoT devices may be very different in terms of available 197 processing and message exchange capabilities and there is a need to 198 support many different authorization use cases [RFC7744]. 200 This specification describes a framework for authentication and 201 authorization in constrained environments (ACE) built on re-use of 202 OAuth 2.0 [RFC6749], thereby extending authorization to Internet of 203 Things devices. This specification contains the necessary building 204 blocks for adjusting OAuth 2.0 to IoT environments. 206 More detailed, interoperable specifications can be found in separate 207 profile specifications. Implementations may claim conformance with a 208 specific profile, whereby implementations utilizing the same profile 209 interoperate while implementations of different profiles are not 210 expected to be interoperable. Some devices, such as mobile phones 211 and tablets, may implement multiple profiles and will therefore be 212 able to interact with a wider range of low end devices. Requirements 213 on profiles are described at contextually appropriate places 214 throughout this specification, and also summarized in Appendix C. 216 2. Terminology 218 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 219 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 220 "OPTIONAL" in this document are to be interpreted as described in BCP 221 14 [RFC2119] [RFC8174] when, and only when, they appear in all 222 capitals, as shown here. 224 Certain security-related terms such as "authentication", 225 "authorization", "confidentiality", "(data) integrity", "message 226 authentication code", and "verify" are taken from [RFC4949]. 228 Since exchanges in this specification are described as RESTful 229 protocol interactions, HTTP [RFC7231] offers useful terminology. 231 Terminology for entities in the architecture is defined in OAuth 2.0 232 [RFC6749] such as client (C), resource server (RS), and authorization 233 server (AS). 235 Note that the term "endpoint" is used here following its OAuth 236 definition, which is to denote resources such as token and 237 introspection at the AS and authz-info at the RS (see Section 5.10.1 238 for a definition of the authz-info endpoint). The CoAP [RFC7252] 239 definition, which is "An entity participating in the CoAP protocol" 240 is not used in this specification. 242 The specifications in this document is called the "framework" or "ACE 243 framework". When referring to "profiles of this framework" it refers 244 to additional specifications that define the use of this 245 specification with concrete transport and communication security 246 protocols (e.g., CoAP over DTLS). 248 We use the term "Access Information" for parameters other than the 249 access token provided to the client by the AS to enable it to access 250 the RS (e.g. public key of the RS, profile supported by RS). 252 We use the term "Authorization Information" to denote all 253 information, including the claims of relevant access tokens, that an 254 RS uses to determine whether an access request should be granted. 256 3. Overview 258 This specification defines the ACE framework for authorization in the 259 Internet of Things environment. It consists of a set of building 260 blocks. 262 The basic block is the OAuth 2.0 [RFC6749] framework, which enjoys 263 widespread deployment. Many IoT devices can support OAuth 2.0 264 without any additional extensions, but for certain constrained 265 settings additional profiling is needed. 267 Another building block is the lightweight web transfer protocol CoAP 268 [RFC7252], for those communication environments where HTTP is not 269 appropriate. CoAP typically runs on top of UDP, which further 270 reduces overhead and message exchanges. While this specification 271 defines extensions for the use of OAuth over CoAP, other underlying 272 protocols are not prohibited from being supported in the future, such 273 as HTTP/2 [RFC7540], Message Queuing Telemetry Transport (MQTT) 274 [MQTT5.0], Bluetooth Low Energy (BLE) [BLE] and QUIC 275 [I-D.ietf-quic-transport]. Note that this document specifies 276 protocol exchanges in terms of RESTful verbs such as GET and POST. 277 Future profiles using protocols that do not support these verbs MUST 278 specify how the corresponding protocol messages are transmitted 279 instead. 281 A third building block is the Concise Binary Object Representation 282 (CBOR) [RFC8949], for encodings where JSON [RFC8259] is not 283 sufficiently compact. CBOR is a binary encoding designed for small 284 code and message size, which may be used for encoding of self 285 contained tokens, and also for encoding payloads transferred in 286 protocol messages. 288 A fourth building block is CBOR Object Signing and Encryption (COSE) 289 [RFC8152], which enables object-level layer security as an 290 alternative or complement to transport layer security (DTLS [RFC6347] 291 or TLS [RFC8446]). COSE is used to secure self-contained tokens such 292 as proof-of-possession (PoP) tokens, which are an extension to the 293 OAuth bearer tokens. The default token format is defined in CBOR web 294 token (CWT) [RFC8392]. Application layer security for CoAP using 295 COSE can be provided with OSCORE [RFC8613]. 297 With the building blocks listed above, solutions satisfying various 298 IoT device and network constraints are possible. A list of 299 constraints is described in detail in [RFC7228] and a description of 300 how the building blocks mentioned above relate to the various 301 constraints can be found in Appendix A. 303 Luckily, not every IoT device suffers from all constraints. The ACE 304 framework nevertheless takes all these aspects into account and 305 allows several different deployment variants to co-exist, rather than 306 mandating a one-size-fits-all solution. It is important to cover the 307 wide range of possible interworking use cases and the different 308 requirements from a security point of view. Once IoT deployments 309 mature, popular deployment variants will be documented in the form of 310 ACE profiles. 312 3.1. OAuth 2.0 314 The OAuth 2.0 authorization framework enables a client to obtain 315 scoped access to a resource with the permission of a resource owner. 316 Authorization information, or references to it, is passed between the 317 nodes using access tokens. These access tokens are issued to clients 318 by an authorization server with the approval of the resource owner. 319 The client uses the access token to access the protected resources 320 hosted by the resource server. 322 A number of OAuth 2.0 terms are used within this specification: 324 The token and introspection Endpoints: 325 The AS hosts the token endpoint that allows a client to request 326 access tokens. The client makes a POST request to the token 327 endpoint on the AS and receives the access token in the response 328 (if the request was successful). 329 In some deployments, a token introspection endpoint is provided by 330 the AS, which can be used by the RS if it needs to request 331 additional information regarding a received access token. The RS 332 makes a POST request to the introspection endpoint on the AS and 333 receives information about the access token in the response. (See 334 "Introspection" below.) 336 Access Tokens: 337 Access tokens are credentials needed to access protected 338 resources. An access token is a data structure representing 339 authorization permissions issued by the AS to the client. Access 340 tokens are generated by the AS and consumed by the RS. The access 341 token content is opaque to the client. 343 Access tokens can have different formats, and various methods of 344 utilization e.g., cryptographic properties) based on the security 345 requirements of the given deployment. 347 Refresh Tokens: 348 Refresh tokens are credentials used to obtain access tokens. 349 Refresh tokens are issued to the client by the authorization 350 server and are used to obtain a new access token when the current 351 access token becomes invalid or expires, or to obtain additional 352 access tokens with identical or narrower scope (such access tokens 353 may have a shorter lifetime and fewer permissions than authorized 354 by the resource owner). Issuing a refresh token is optional at 355 the discretion of the authorization server. If the authorization 356 server issues a refresh token, it is included when issuing an 357 access token (i.e., step (B) in Figure 1). 359 A refresh token in OAuth 2.0 is a string representing the 360 authorization granted to the client by the resource owner. The 361 string is usually opaque to the client. The token denotes an 362 identifier used to retrieve the authorization information. Unlike 363 access tokens, refresh tokens are intended for use only with 364 authorization servers and are never sent to resource servers. In 365 this framework, refresh tokens are encoded in binary instead of 366 strings, if used. 368 Proof of Possession Tokens: 369 A token may be bound to a cryptographic key, which is then used to 370 bind the token to a request authorized by the token. Such tokens 371 are called proof-of-possession tokens (or PoP tokens). 373 The proof-of-possession (PoP) security concept used here assumes 374 that the AS acts as a trusted third party that binds keys to 375 tokens. In the case of access tokens, these so called PoP keys 376 are then used by the client to demonstrate the possession of the 377 secret to the RS when accessing the resource. The RS, when 378 receiving an access token, needs to verify that the key used by 379 the client matches the one bound to the access token. When this 380 specification uses the term "access token" it is assumed to be a 381 PoP access token token unless specifically stated otherwise. 383 The key bound to the token (the PoP key) may use either symmetric 384 or asymmetric cryptography. The appropriate choice of the kind of 385 cryptography depends on the constraints of the IoT devices as well 386 as on the security requirements of the use case. 388 Symmetric PoP key: 389 The AS generates a random symmetric PoP key. The key is either 390 stored to be returned on introspection calls or encrypted and 391 included in the token. The PoP key is also encrypted for the 392 token recipient and sent to the recipient together with the 393 token. 395 Asymmetric PoP key: 396 An asymmetric key pair is generated on the token's recipient 397 and the public key is sent to the AS (if it does not already 398 have knowledge of the recipient's public key). Information 399 about the public key, which is the PoP key in this case, is 400 either stored to be returned on introspection calls or included 401 inside the token and sent back to the requesting party. The 402 consumer of the token can identify the public key from the 403 information in the token, which allows the recipient of the 404 token to use the corresponding private key for the proof of 405 possession. 407 The token is either a simple reference, or a structured 408 information object (e.g., CWT [RFC8392]) protected by a 409 cryptographic wrapper (e.g., COSE [RFC8152]). The choice of PoP 410 key does not necessarily imply a specific credential type for the 411 integrity protection of the token. 413 Scopes and Permissions: 414 In OAuth 2.0, the client specifies the type of permissions it is 415 seeking to obtain (via the scope parameter) in the access token 416 request. In turn, the AS may use the scope response parameter to 417 inform the client of the scope of the access token issued. As the 418 client could be a constrained device as well, this specification 419 defines the use of CBOR encoding, see Section 5, for such requests 420 and responses. 422 The values of the scope parameter in OAuth 2.0 are expressed as a 423 list of space-delimited, case-sensitive strings, with a semantic 424 that is well-known to the AS and the RS. More details about the 425 concept of scopes is found under Section 3.3 in [RFC6749]. 427 Claims: 428 Information carried in the access token or returned from 429 introspection, called claims, is in the form of name-value pairs. 430 An access token may, for example, include a claim identifying the 431 AS that issued the token (via the "iss" claim) and what audience 432 the access token is intended for (via the "aud" claim). The 433 audience of an access token can be a specific resource or one or 434 many resource servers. The resource owner policies influence what 435 claims are put into the access token by the authorization server. 437 While the structure and encoding of the access token varies 438 throughout deployments, a standardized format has been defined 439 with the JSON Web Token (JWT) [RFC7519] where claims are encoded 440 as a JSON object. In [RFC8392], an equivalent format using CBOR 441 encoding (CWT) has been defined. 443 Introspection: 444 Introspection is a method for a resource server to query the 445 authorization server for the active state and content of a 446 received access token. This is particularly useful in those cases 447 where the authorization decisions are very dynamic and/or where 448 the received access token itself is an opaque reference rather 449 than a self-contained token. More information about introspection 450 in OAuth 2.0 can be found in [RFC7662]. 452 3.2. CoAP 454 CoAP is an application layer protocol similar to HTTP, but 455 specifically designed for constrained environments. CoAP typically 456 uses datagram-oriented transport, such as UDP, where reordering and 457 loss of packets can occur. A security solution needs to take the 458 latter aspects into account. 460 While HTTP uses headers and query strings to convey additional 461 information about a request, CoAP encodes such information into 462 header parameters called 'options'. 464 CoAP supports application-layer fragmentation of the CoAP payloads 465 through blockwise transfers [RFC7959]. However, blockwise transfer 466 does not increase the size limits of CoAP options, therefore data 467 encoded in options has to be kept small. 469 Transport layer security for CoAP can be provided by DTLS or TLS 470 [RFC6347][RFC8446] [I-D.ietf-tls-dtls13]. CoAP defines a number of 471 proxy operations that require transport layer security to be 472 terminated at the proxy. One approach for protecting CoAP 473 communication end-to-end through proxies, and also to support 474 security for CoAP over a different transport in a uniform way, is to 475 provide security at the application layer using an object-based 476 security mechanism such as COSE [RFC8152]. 478 One application of COSE is OSCORE [RFC8613], which provides end-to- 479 end confidentiality, integrity and replay protection, and a secure 480 binding between CoAP request and response messages. In OSCORE, the 481 CoAP messages are wrapped in COSE objects and sent using CoAP. 483 This framework RECOMMENDS the use of CoAP as replacement for HTTP for 484 use in constrained environments. For communication security this 485 framework does not make an explicit protocol recommendation, since 486 the choice depends on the requirements of the specific application. 487 DTLS [RFC6347], [I-D.ietf-tls-dtls13] and OSCORE [RFC8613] are 488 mentioned as examples, other protocols fulfilling the requirements 489 from Section 6.5 are also applicable. 491 4. Protocol Interactions 493 The ACE framework is based on the OAuth 2.0 protocol interactions 494 using the token endpoint and optionally the introspection endpoint. 495 A client obtains an access token, and optionally a refresh token, 496 from an AS using the token endpoint and subsequently presents the 497 access token to an RS to gain access to a protected resource. In 498 most deployments the RS can process the access token locally, however 499 in some cases the RS may present it to the AS via the introspection 500 endpoint to get fresh information. These interactions are shown in 501 Figure 1. An overview of various OAuth concepts is provided in 502 Section 3.1. 504 The OAuth 2.0 framework defines a number of "protocol flows" via 505 grant types, which have been extended further with extensions to 506 OAuth 2.0 (such as [RFC7521] and [RFC8628]). What grant types works 507 best depends on the usage scenario and [RFC7744] describes many 508 different IoT use cases but there are two preferred grant types, 509 namely the Authorization Code Grant (described in Section 4.1 of 510 [RFC7521]) and the Client Credentials Grant (described in Section 4.4 511 of [RFC7521]). The Authorization Code Grant is a good fit for use 512 with apps running on smart phones and tablets that request access to 513 IoT devices, a common scenario in the smart home environment, where 514 users need to go through an authentication and authorization phase 515 (at least during the initial setup phase). The native apps 516 guidelines described in [RFC8252] are applicable to this use case. 517 The Client Credential Grant is a good fit for use with IoT devices 518 where the OAuth client itself is constrained. In such a case, the 519 resource owner has pre-arranged access rights for the client with the 520 authorization server, which is often accomplished using a 521 commissioning tool. 523 The consent of the resource owner, for giving a client access to a 524 protected resource, can be provided dynamically as in the traditional 525 OAuth flows, or it could be pre-configured by the resource owner as 526 authorization policies at the AS, which the AS evaluates when a token 527 request arrives. The resource owner and the requesting party (i.e., 528 client owner) are not shown in Figure 1. 530 This framework supports a wide variety of communication security 531 mechanisms between the ACE entities, such as client, AS, and RS. It 532 is assumed that the client has been registered (also called enrolled 533 or onboarded) to an AS using a mechanism defined outside the scope of 534 this document. In practice, various techniques for onboarding have 535 been used, such as factory-based provisioning or the use of 536 commissioning tools. Regardless of the onboarding technique, this 537 provisioning procedure implies that the client and the AS exchange 538 credentials and configuration parameters. These credentials are used 539 to mutually authenticate each other and to protect messages exchanged 540 between the client and the AS. 542 It is also assumed that the RS has been registered with the AS, 543 potentially in a similar way as the client has been registered with 544 the AS. Established keying material between the AS and the RS allows 545 the AS to apply cryptographic protection to the access token to 546 ensure that its content cannot be modified, and if needed, that the 547 content is confidentiality protected. 549 The keying material necessary for establishing communication security 550 between C and RS is dynamically established as part of the protocol 551 described in this document. 553 At the start of the protocol, there is an optional discovery step 554 where the client discovers the resource server and the resources this 555 server hosts. In this step, the client might also determine what 556 permissions are needed to access the protected resource. A generic 557 procedure is described in Section 5.1; profiles MAY define other 558 procedures for discovery. 560 In Bluetooth Low Energy, for example, advertisements are broadcasted 561 by a peripheral, including information about the primary services. 563 In CoAP, as a second example, a client can make a request to "/.well- 564 known/core" to obtain information about available resources, which 565 are returned in a standardized format as described in [RFC6690]. 567 +--------+ +---------------+ 568 | |---(A)-- Token Request ------->| | 569 | | | Authorization | 570 | |<--(B)-- Access Token ---------| Server | 571 | | + Access Information | | 572 | | + Refresh Token (optional) +---------------+ 573 | | ^ | 574 | | Introspection Request (D)| | 575 | Client | (optional) | | 576 | | Response | |(E) 577 | | (optional) | v 578 | | +--------------+ 579 | |---(C)-- Token + Request ----->| | 580 | | | Resource | 581 | |<--(F)-- Protected Resource ---| Server | 582 | | | | 583 +--------+ +--------------+ 585 Figure 1: Basic Protocol Flow. 587 Requesting an Access Token (A): 588 The client makes an access token request to the token endpoint at 589 the AS. This framework assumes the use of PoP access tokens (see 590 Section 3.1 for a short description) wherein the AS binds a key to 591 an access token. The client may include permissions it seeks to 592 obtain, and information about the credentials it wants to use 593 (e.g., symmetric/asymmetric cryptography or a reference to a 594 specific credential). 596 Access Token Response (B): 597 If the AS successfully processes the request from the client, it 598 returns an access token and optionally a refresh token (note that 599 only certain grant types support refresh tokens). It can also 600 return additional parameters, referred to as "Access Information". 601 In addition to the response parameters defined by OAuth 2.0 and 602 the PoP access token extension, this framework defines parameters 603 that can be used to inform the client about capabilities of the 604 RS, e.g. the profiles the RS supports. More information about 605 these parameters can be found in Section 5.8.4. 607 Resource Request (C): 608 The client interacts with the RS to request access to the 609 protected resource and provides the access token. The protocol to 610 use between the client and the RS is not restricted to CoAP. 611 HTTP, HTTP/2, QUIC, MQTT, Bluetooth Low Energy, etc., are also 612 viable candidates. 614 Depending on the device limitations and the selected protocol, 615 this exchange may be split up into two parts: 617 (1) the client sends the access token containing, or 618 referencing, the authorization information to the RS, that may 619 be used for subsequent resource requests by the client, and 621 (2) the client makes the resource access request, using the 622 communication security protocol and other Access Information 623 obtained from the AS. 625 The Client and the RS mutually authenticate using the security 626 protocol specified in the profile (see step B) and the keys 627 obtained in the access token or the Access Information. The RS 628 verifies that the token is integrity protected and originated by 629 the AS. It then compares the claims contained in the access token 630 with the resource request. If the RS is online, validation can be 631 handed over to the AS using token introspection (see messages D 632 and E) over HTTP or CoAP. 634 Token Introspection Request (D): 635 A resource server may be configured to introspect the access token 636 by including it in a request to the introspection endpoint at that 637 AS. Token introspection over CoAP is defined in Section 5.9 and 638 for HTTP in [RFC7662]. 640 Note that token introspection is an optional step and can be 641 omitted if the token is self-contained and the resource server is 642 prepared to perform the token validation on its own. 644 Token Introspection Response (E): 645 The AS validates the token and returns the most recent parameters, 646 such as scope, audience, validity etc. associated with it back to 647 the RS. The RS then uses the received parameters to process the 648 request to either accept or to deny it. 650 Protected Resource (F): 651 If the request from the client is authorized, the RS fulfills the 652 request and returns a response with the appropriate response code. 653 The RS uses the dynamically established keys to protect the 654 response, according to the communication security protocol used. 656 5. Framework 658 The following sections detail the profiling and extensions of OAuth 659 2.0 for constrained environments, which constitutes the ACE 660 framework. 662 Credential Provisioning 663 For IoT, it cannot be assumed that the client and RS are part of a 664 common key infrastructure, so the AS provisions credentials or 665 associated information to allow mutual authentication between 666 client and RS. The resulting security association between client 667 and RS may then also be used to bind these credentials to the 668 access tokens the client uses. 670 Proof-of-Possession 671 The ACE framework, by default, implements proof-of-possession for 672 access tokens, i.e., that the token holder can prove being a 673 holder of the key bound to the token. The binding is provided by 674 the "cnf" claim [RFC8747] indicating what key is used for proof- 675 of-possession. If a client needs to submit a new access token, 676 e.g., to obtain additional access rights, they can request that 677 the AS binds this token to the same key as the previous one. 679 ACE Profiles 680 The client or RS may be limited in the encodings or protocols it 681 supports. To support a variety of different deployment settings, 682 specific interactions between client and RS are defined in an ACE 683 profile. In ACE framework the AS is expected to manage the 684 matching of compatible profile choices between a client and an RS. 685 The AS informs the client of the selected profile using the 686 "ace_profile" parameter in the token response. 688 OAuth 2.0 requires the use of TLS both to protect the communication 689 between AS and client when requesting an access token; between client 690 and RS when accessing a resource and between AS and RS if 691 introspection is used. In constrained settings TLS is not always 692 feasible, or desirable. Nevertheless it is REQUIRED that the 693 communications named above are encrypted, integrity protected and 694 protected against message replay. It is also REQUIRED that the 695 communicating endpoints perform mutual authentication. Furthermore 696 it MUST be assured that responses are bound to the requests in the 697 sense that the receiver of a response can be certain that the 698 response actually belongs to a certain request. Note that setting up 699 such a secure communication may require some unprotected messages to 700 be exchanged first (e.g. sending the token from the client to the 701 RS). 703 Profiles MUST specify a communication security protocol between 704 client and RS that provides the features required above. Profiles 705 MUST specify a communication security protocol RECOMMENDED to be used 706 between client and AS that provides the features required above. 707 Profiles MUST specify for introspection a communication security 708 protocol RECOMMENDED to be used between RS and AS that provides the 709 features required above. These recommendations enable 710 interoperability between different implementations without the need 711 to define a new profile if the communication between C and AS, or 712 between RS and AS, is protected with a different security protocol 713 complying with the security requirements above. 715 In OAuth 2.0 the communication with the Token and the Introspection 716 endpoints at the AS is assumed to be via HTTP and may use Uri-query 717 parameters. When profiles of this framework use CoAP instead, it is 718 REQUIRED to use of the following alternative instead of Uri-query 719 parameters: The sender (client or RS) encodes the parameters of its 720 request as a CBOR map and submits that map as the payload of the POST 721 request. 723 Profiles that use CBOR encoding of protocol message parameters at the 724 outermost encoding layer MUST use the media format 'application/ 725 ace+cbor'. If CoAP is used for communication, the Content-Format 726 MUST be abbreviated with the ID: 19 (see Section 8.16). 728 The OAuth 2.0 AS uses a JSON structure in the payload of its 729 responses both to client and RS. If CoAP is used, it is REQUIRED to 730 use CBOR [RFC8949] instead of JSON. Depending on the profile, the 731 CBOR payload MAY be enclosed in a non-CBOR cryptographic wrapper. 733 5.1. Discovering Authorization Servers 735 C must discover the AS in charge of RS to determine where to request 736 the access token. To do so, C must 1. find out the AS URI to which 737 the token request message must be sent and 2. MUST validate that the 738 AS with this URI is authorized to provide access tokens for this RS. 740 In order to determine the AS URI, C MAY send an initial Unauthorized 741 Resource Request message to RS. RS then denies the request and sends 742 the address of its AS back to C (see Section 5.2). How C validates 743 the AS authorization is not in scope for this document. C may, e.g., 744 ask it's owner if this AS is authorized for this RS. C may also use 745 a mechanism that addresses both problems at once. 747 5.2. Unauthorized Resource Request Message 749 An Unauthorized Resource Request message is a request for any 750 resource hosted by RS for which the client does not have 751 authorization granted. RSes MUST treat any request for a protected 752 resource as an Unauthorized Resource Request message when any of the 753 following hold: 755 o The request has been received on an unprotected channel. 757 o The RS has no valid access token for the sender of the request 758 regarding the requested action on that resource. 760 o The RS has a valid access token for the sender of the request, but 761 that token does not authorize the requested action on the 762 requested resource. 764 Note: These conditions ensure that the RS can handle requests 765 autonomously once access was granted and a secure channel has been 766 established between C and RS. The authz-info endpoint, as part of 767 the process for authorizing to protected resources, is not itself a 768 protected resource and MUST NOT be protected as specified above (cf. 769 Section 5.10.1). 771 Unauthorized Resource Request messages MUST be denied with an 772 "unauthorized_client" error response. In this response, the Resource 773 Server SHOULD provide proper AS Request Creation Hints to enable the 774 Client to request an access token from RS's AS as described in 775 Section 5.3. 777 The handling of all client requests (including unauthorized ones) by 778 the RS is described in Section 5.10.2. 780 5.3. AS Request Creation Hints 782 The AS Request Creation Hints message is sent by an RS as a response 783 to an Unauthorized Resource Request message (see Section 5.2) to help 784 the sender of the Unauthorized Resource Request message acquire a 785 valid access token. The AS Request Creation Hints message is a CBOR 786 map, with an OPTIONAL element "AS" specifying an absolute URI (see 787 Section 4.3 of [RFC3986]) that identifies the appropriate AS for the 788 RS. 790 The message can also contain the following OPTIONAL parameters: 792 o A "audience" element containing a suggested audience that the 793 client should request at the AS. 795 o A "kid" element containing the key identifier of a key used in an 796 existing security association between the client and the RS. The 797 RS expects the client to request an access token bound to this 798 key, in order to avoid having to re-establish the security 799 association. 801 o A "cnonce" element containing a client-nonce. See Section 5.3.1. 803 o A "scope" element containing the suggested scope that the client 804 should request towards the AS. 806 Figure 2 summarizes the parameters that may be part of the AS Request 807 Creation Hints. 809 /-----------+----------+---------------------\ 810 | Name | CBOR Key | Value Type | 811 |-----------+----------+---------------------| 812 | AS | 1 | text string | 813 | kid | 2 | byte string | 814 | audience | 5 | text string | 815 | scope | 9 | text or byte string | 816 | cnonce | 39 | byte string | 817 \-----------+----------+---------------------/ 819 Figure 2: AS Request Creation Hints 821 Note that the schema part of the AS parameter may need to be adapted 822 to the security protocol that is used between the client and the AS. 823 Thus the example AS value "coap://as.example.com/token" might need to 824 be transformed to "coaps://as.example.com/token". It is assumed that 825 the client can determine the correct schema part on its own depending 826 on the way it communicates with the AS. 828 Figure 3 shows an example for an AS Request Creation Hints message 829 payload using CBOR [RFC8949] diagnostic notation, using the parameter 830 names instead of the CBOR keys for better human readability. 832 4.01 Unauthorized 833 Content-Format: application/ace+cbor 834 Payload : 835 { 836 "AS" : "coaps://as.example.com/token", 837 "audience" : "coaps://rs.example.com" 838 "scope" : "rTempC", 839 "cnonce" : h'e0a156bb3f' 840 } 842 Figure 3: AS Request Creation Hints payload example 844 In the example above, the response parameter "AS" points the receiver 845 of this message to the URI "coaps://as.example.com/token" to request 846 access tokens. The RS sending this response (i.e., RS) uses an 847 internal clock that is only loosely synchronized with the clock of 848 the AS. Therefore it can not reliably verify the expiration time of 849 access tokens it receives. To ensure a certain level of access token 850 freshness nevetheless, the RS has included a "cnonce" parameter (see 851 Section 5.3.1) in the response. 853 Figure 4 illustrates the mandatory to use binary encoding of the 854 message payload shown in Figure 3. 856 a4 # map(4) 857 01 # unsigned(1) (=AS) 858 78 1c # text(28) 859 636f6170733a2f2f61732e657861 860 6d706c652e636f6d2f746f6b656e # "coaps://as.example.com/token" 861 05 # unsigned(5) (=audience) 862 76 # text(22) 863 636f6170733a2f2f72732e657861 864 6d706c652e636f6d # "coaps://rs.example.com" 865 09 # unsigned(9) (=scope) 866 66 # text(6) 867 7254656d7043 # "rTempC" 868 18 27 # unsigned(39) (=cnonce) 869 45 # bytes(5) 870 e0a156bb3f # 872 Figure 4: AS Request Creation Hints example encoded in CBOR 874 5.3.1. The Client-Nonce Parameter 876 If the RS does not synchronize its clock with the AS, it could be 877 tricked into accepting old access tokens, that are either expired or 878 have been compromised. In order to ensure some level of token 879 freshness in that case, the RS can use the "cnonce" (client-nonce) 880 parameter. The processing requirements for this parameter are as 881 follows: 883 o An RS sending a "cnonce" parameter in an AS Request Creation Hints 884 message MUST store information to validate that a given cnonce is 885 fresh. How this is implemented internally is out of scope for 886 this specification. Expiration of client-nonces should be based 887 roughly on the time it would take a client to obtain an access 888 token after receiving the AS Request Creation Hints message, with 889 some allowance for unexpected delays. 891 o A client receiving a "cnonce" parameter in an AS Request Creation 892 Hints message MUST include this in the parameters when requesting 893 an access token at the AS, using the "cnonce" parameter from 894 Section 5.8.4.4. 896 o If an AS grants an access token request containing a "cnonce" 897 parameter, it MUST include this value in the access token, using 898 the "cnonce" claim specified in Section 5.10. 900 o An RS that is using the client-nonce mechanism and that receives 901 an access token MUST verify that this token contains a cnonce 902 claim, with a client-nonce value that is fresh according to the 903 information stored at the first step above. If the cnonce claim 904 is not present or if the cnonce claim value is not fresh, the RS 905 MUST discard the access token. If this was an interaction with 906 the authz-info endpoint the RS MUST also respond with an error 907 message using a response code equivalent to the CoAP code 4.01 908 (Unauthorized). 910 5.4. Authorization Grants 912 To request an access token, the client obtains authorization from the 913 resource owner or uses its client credentials as a grant. The 914 authorization is expressed in the form of an authorization grant. 916 The OAuth framework [RFC6749] defines four grant types. The grant 917 types can be split up into two groups, those granted on behalf of the 918 resource owner (password, authorization code, implicit) and those for 919 the client (client credentials). Further grant types have been added 920 later, such as [RFC7521] defining an assertion-based authorization 921 grant. 923 The grant type is selected depending on the use case. In cases where 924 the client acts on behalf of the resource owner, the authorization 925 code grant is recommended. If the client acts on behalf of the 926 resource owner, but does not have any display or has very limited 927 interaction possibilities, it is recommended to use the device code 928 grant defined in [RFC8628]. In cases where the client acts 929 autonomously the client credentials grant is recommended. 931 For details on the different grant types, see section 1.3 of 932 [RFC6749]. The OAuth 2.0 framework provides an extension mechanism 933 for defining additional grant types, so profiles of this framework 934 MAY define additional grant types, if needed. 936 5.5. Client Credentials 938 Authentication of the client is mandatory independent of the grant 939 type when requesting an access token from the token endpoint. In the 940 case of the client credentials grant type, the authentication and 941 grant coincide. 943 Client registration and provisioning of client credentials to the 944 client is out of scope for this specification. 946 The OAuth framework defines one client credential type in section 947 2.3.1 of [RFC6749]: client id and client secret. 948 [I-D.erdtman-ace-rpcc] adds raw-public-key and pre-shared-key to the 949 client credentials types. Profiles of this framework MAY extend with 950 an additional client credentials type using client certificates. 952 5.6. AS Authentication 954 The client credential grant does not, by default, authenticate the AS 955 that the client connects to. In classic OAuth, the AS is 956 authenticated with a TLS server certificate. 958 Profiles of this framework MUST specify how clients authenticate the 959 AS and how communication security is implemented. By default, server 960 side TLS certificates, as defined by OAuth 2.0, are required. 962 5.7. The Authorization Endpoint 964 The OAuth 2.0 authorization endpoint is used to interact with the 965 resource owner and obtain an authorization grant, in certain grant 966 flows. The primary use case for the ACE-OAuth framework is for 967 machine-to-machine interactions that do not involve the resource 968 owner in the authorization flow; therefore, this endpoint is out of 969 scope here. Future profiles may define constrained adaptation 970 mechanisms for this endpoint as well. Non-constrained clients 971 interacting with constrained resource servers can use the 972 specification in section 3.1 of [RFC6749] and the attack 973 countermeasures suggested in section 4.2 of [RFC6819]. 975 5.8. The Token Endpoint 977 In standard OAuth 2.0, the AS provides the token endpoint for 978 submitting access token requests. This framework extends the 979 functionality of the token endpoint, giving the AS the possibility to 980 help the client and RS to establish shared keys or to exchange their 981 public keys. Furthermore, this framework defines encodings using 982 CBOR, as a substitute for JSON. 984 The endpoint may, however, be exposed over HTTPS as in classical 985 OAuth or even other transports. A profile MUST define the details of 986 the mapping between the fields described below, and these transports. 987 If HTTPS is used, JSON or CBOR payloads may be supported. If JSON 988 payloads are used, the semantics of Section 4 of the OAuth 2.0 989 specification MUST be followed (with additions as described below). 990 If CBOR payload is supported, the semantics described below MUST be 991 followed. 993 For the AS to be able to issue a token, the client MUST be 994 authenticated and present a valid grant for the scopes requested. 995 Profiles of this framework MUST specify how the AS authenticates the 996 client and how the communication between client and AS is protected, 997 fulfilling the requirements specified in Section 5. 999 The default name of this endpoint in an url-path is '/token', however 1000 implementations are not required to use this name and can define 1001 their own instead. 1003 The figures of this section use CBOR diagnostic notation without the 1004 integer abbreviations for the parameters or their values for 1005 illustrative purposes. Note that implementations MUST use the 1006 integer abbreviations and the binary CBOR encoding, if the CBOR 1007 encoding is used. 1009 5.8.1. Client-to-AS Request 1011 The client sends a POST request to the token endpoint at the AS. The 1012 profile MUST specify how the communication is protected. The content 1013 of the request consists of the parameters specified in the relevant 1014 subsection of section 4 of the OAuth 2.0 specification [RFC6749], 1015 depending on the grant type, with the following exceptions and 1016 additions: 1018 o The parameter "grant_type" is OPTIONAL in the context of this 1019 framework (as opposed to REQUIRED in RFC6749). If that parameter 1020 is missing, the default value "client_credentials" is implied. 1022 o The "audience" parameter from [RFC8693] is OPTIONAL to request an 1023 access token bound to a specific audience. 1025 o The "cnonce" parameter defined in Section 5.8.4.4 is REQUIRED if 1026 the RS provided a client-nonce in the "AS Request Creation Hints" 1027 message Section 5.3 1029 o The "scope" parameter MAY be encoded as a byte string instead of 1030 the string encoding specified in section 3.3 of [RFC6749], in 1031 order allow compact encoding of complex scopes. The syntax of 1032 such a binary encoding is explicitly not specified here and left 1033 to profiles or applications, specifically note that a binary 1034 encoded scope does not necessarily use the space character '0x20' 1035 to delimit scope-tokens. 1037 o The client can send an empty (null value) "ace_profile" parameter 1038 to indicate that it wants the AS to include the "ace_profile" 1039 parameter in the response. See Section 5.8.4.3. 1041 o A client MUST be able to use the parameters from 1042 [I-D.ietf-ace-oauth-params] in an access token request to the 1043 token endpoint and the AS MUST be able to process these additional 1044 parameters. 1046 The default behavior, is that the AS generates a symmetric proof-of- 1047 possession key for the client. In order to use an asymmetric key 1048 pair or to re-use a key previously established with the RS, the 1049 client is supposed to use the "req_cnf" parameter from 1050 [I-D.ietf-ace-oauth-params]. 1052 If CBOR is used then these parameters MUST be provided as a CBOR map. 1054 When HTTP is used as a transport then the client makes a request to 1055 the token endpoint by sending the parameters using the "application/ 1056 x-www-form-urlencoded" format with a character encoding of UTF-8 in 1057 the HTTP request entity-body, as defined in section 3.2 of [RFC6749]. 1059 The following examples illustrate different types of requests for 1060 proof-of-possession tokens. 1062 Figure 5 shows a request for a token with a symmetric proof-of- 1063 possession key. The content is displayed in CBOR diagnostic 1064 notation, without abbreviations for better readability. 1066 Header: POST (Code=0.02) 1067 Uri-Host: "as.example.com" 1068 Uri-Path: "token" 1069 Content-Format: "application/ace+cbor" 1070 Payload: 1071 { 1072 "client_id" : "myclient", 1073 "audience" : "tempSensor4711" 1074 } 1076 Figure 5: Example request for an access token bound to a symmetric 1077 key. 1079 Figure 6 shows a request for a token with an asymmetric proof-of- 1080 possession key. Note that in this example OSCORE [RFC8613] is used 1081 to provide object-security, therefore the Content-Format is 1082 "application/oscore" wrapping the "application/ace+cbor" type 1083 content. The OSCORE option has a decoded interpretation appended in 1084 parentheses for the reader's convenience. Also note that in this 1085 example the audience is implicitly known by both client and AS. 1086 Furthermore note that this example uses the "req_cnf" parameter from 1087 [I-D.ietf-ace-oauth-params]. 1089 Header: POST (Code=0.02) 1090 Uri-Host: "as.example.com" 1091 Uri-Path: "token" 1092 OSCORE: 0x09, 0x05, 0x44, 0x6C 1093 (h=0, k=1, n=001, partialIV= 0x05, kid=[0x44, 0x6C]) 1094 Content-Format: "application/oscore" 1095 Payload: 1096 0x44025d1 ... (full payload omitted for brevity) ... 68b3825e 1098 Decrypted payload: 1099 { 1100 "client_id" : "myclient", 1101 "req_cnf" : { 1102 "COSE_Key" : { 1103 "kty" : "EC", 1104 "kid" : h'11', 1105 "crv" : "P-256", 1106 "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', 1107 "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' 1108 } 1109 } 1110 } 1112 Figure 6: Example token request bound to an asymmetric key. 1114 Figure 7 shows a request for a token where a previously communicated 1115 proof-of-possession key is only referenced using the "req_cnf" 1116 parameter from [I-D.ietf-ace-oauth-params]. 1118 Header: POST (Code=0.02) 1119 Uri-Host: "as.example.com" 1120 Uri-Path: "token" 1121 Content-Format: "application/ace+cbor" 1122 Payload: 1123 { 1124 "client_id" : "myclient", 1125 "audience" : "valve424", 1126 "scope" : "read", 1127 "req_cnf" : { 1128 "kid" : b64'6kg0dXJM13U' 1129 } 1130 }W 1132 Figure 7: Example request for an access token bound to a key 1133 reference. 1135 Refresh tokens are typically not stored as securely as proof-of- 1136 possession keys in requesting clients. Proof-of-possession based 1137 refresh token requests MUST NOT request different proof-of-possession 1138 keys or different audiences in token requests. Refresh token 1139 requests can only use to request access tokens bound to the same 1140 proof-of-possession key and the same audience as access tokens issued 1141 in the initial token request. 1143 5.8.2. AS-to-Client Response 1145 If the access token request has been successfully verified by the AS 1146 and the client is authorized to obtain an access token corresponding 1147 to its access token request, the AS sends a response with the 1148 response code equivalent to the CoAP response code 2.01 (Created). 1149 If client request was invalid, or not authorized, the AS returns an 1150 error response as described in Section 5.8.3. 1152 Note that the AS decides which token type and profile to use when 1153 issuing a successful response. It is assumed that the AS has prior 1154 knowledge of the capabilities of the client and the RS (see 1155 Appendix D). This prior knowledge may, for example, be set by the 1156 use of a dynamic client registration protocol exchange [RFC7591]. If 1157 the client has requested a specific proof-of-possession key using the 1158 "req_cnf" parameter from [I-D.ietf-ace-oauth-params], this may also 1159 influence which profile the AS selects, as it needs to support the 1160 use of the key type requested the client. 1162 The content of the successful reply is the Access Information. When 1163 using CBOR payloads, the content MUST be encoded as a CBOR map, 1164 containing parameters as specified in Section 5.1 of [RFC6749], with 1165 the following additions and changes: 1167 ace_profile: 1168 OPTIONAL unless the request included an empty ace_profile 1169 parameter in which case it is MANDATORY. This indicates the 1170 profile that the client MUST use towards the RS. See 1171 Section 5.8.4.3 for the formatting of this parameter. If this 1172 parameter is absent, the AS assumes that the client implicitly 1173 knows which profile to use towards the RS. 1175 token_type: 1176 This parameter is OPTIONAL, as opposed to 'required' in [RFC6749]. 1177 By default implementations of this framework SHOULD assume that 1178 the token_type is "PoP". If a specific use case requires another 1179 token_type (e.g., "Bearer") to be used then this parameter is 1180 REQUIRED. 1182 Furthermore [I-D.ietf-ace-oauth-params] defines additional parameters 1183 that the AS MUST be able to use when responding to a request to the 1184 token endpoint. 1186 Figure 8 summarizes the parameters that can currently be part of the 1187 Access Information. Future extensions may define additional 1188 parameters. 1190 /-------------------+-------------------------------\ 1191 | Parameter name | Specified in | 1192 |-------------------+-------------------------------| 1193 | access_token | RFC 6749 | 1194 | token_type | RFC 6749 | 1195 | expires_in | RFC 6749 | 1196 | refresh_token | RFC 6749 | 1197 | scope | RFC 6749 | 1198 | state | RFC 6749 | 1199 | error | RFC 6749 | 1200 | error_description | RFC 6749 | 1201 | error_uri | RFC 6749 | 1202 | ace_profile | [this document] | 1203 | cnf | [I-D.ietf-ace-oauth-params] | 1204 | rs_cnf | [I-D.ietf-ace-oauth-params] | 1205 \-------------------+-------------------------------/ 1207 Figure 8: Access Information parameters 1209 Figure 9 shows a response containing a token and a "cnf" parameter 1210 with a symmetric proof-of-possession key, which is defined in 1211 [I-D.ietf-ace-oauth-params]. Note that the key identifier 'kid' is 1212 only used to simplify indexing and retrieving the key, and no 1213 assumptions should be made that it is unique in the domains of either 1214 the client or the RS. 1216 Header: Created (Code=2.01) 1217 Content-Format: "application/ace+cbor" 1218 Payload: 1219 { 1220 "access_token" : b64'SlAV32hkKG ... 1221 (remainder of CWT omitted for brevity; 1222 CWT contains COSE_Key in the "cnf" claim)', 1223 "ace_profile" : "coap_dtls", 1224 "expires_in" : "3600", 1225 "cnf" : { 1226 "COSE_Key" : { 1227 "kty" : "Symmetric", 1228 "kid" : b64'39Gqlw', 1229 "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' 1230 } 1231 } 1232 } 1234 Figure 9: Example AS response with an access token bound to a 1235 symmetric key. 1237 5.8.3. Error Response 1239 The error responses for CoAP-based interactions with the AS are 1240 generally equivalent to the ones for HTTP-based interactions as 1241 defined in Section 5.2 of [RFC6749], with the following exceptions: 1243 o When using CBOR the raw payload before being processed by the 1244 communication security protocol MUST be encoded as a CBOR map. 1246 o A response code equivalent to the CoAP code 4.00 (Bad Request) 1247 MUST be used for all error responses, except for invalid_client 1248 where a response code equivalent to the CoAP code 4.01 1249 (Unauthorized) MAY be used under the same conditions as specified 1250 in Section 5.2 of [RFC6749]. 1252 o The Content-Format (for CoAP-based interactions) or media type 1253 (for HTTP-based interactions) "application/ace+cbor" MUST be used 1254 for the error response. 1256 o The parameters "error", "error_description" and "error_uri" MUST 1257 be abbreviated using the codes specified in Figure 12, when a CBOR 1258 encoding is used. 1260 o The error code (i.e., value of the "error" parameter) MUST be 1261 abbreviated as specified in Figure 10, when a CBOR encoding is 1262 used. 1264 /---------------------------+-------------\ 1265 | Name | CBOR Values | 1266 |---------------------------+-------------| 1267 | invalid_request | 1 | 1268 | invalid_client | 2 | 1269 | invalid_grant | 3 | 1270 | unauthorized_client | 4 | 1271 | unsupported_grant_type | 5 | 1272 | invalid_scope | 6 | 1273 | unsupported_pop_key | 7 | 1274 | incompatible_ace_profiles | 8 | 1275 \---------------------------+-------------/ 1277 Figure 10: CBOR abbreviations for common error codes 1279 In addition to the error responses defined in OAuth 2.0, the 1280 following behavior MUST be implemented by the AS: 1282 o If the client submits an asymmetric key in the token request that 1283 the RS cannot process, the AS MUST reject that request with a 1284 response code equivalent to the CoAP code 4.00 (Bad Request) 1285 including the error code "unsupported_pop_key" defined in 1286 Figure 10. 1288 o If the client and the RS it has requested an access token for do 1289 not share a common profile, the AS MUST reject that request with a 1290 response code equivalent to the CoAP code 4.00 (Bad Request) 1291 including the error code "incompatible_ace_profiles" defined in 1292 Figure 10. 1294 5.8.4. Request and Response Parameters 1296 This section provides more detail about the new parameters that can 1297 be used in access token requests and responses, as well as 1298 abbreviations for more compact encoding of existing parameters and 1299 common parameter values. 1301 5.8.4.1. Grant Type 1303 The abbreviations specified in the registry defined in Section 8.5 1304 MUST be used in CBOR encodings instead of the string values defined 1305 in [RFC6749], if CBOR payloads are used. 1307 /--------------------+------------+------------------------\ 1308 | Name | CBOR Value | Original Specification | 1309 |--------------------+------------+------------------------| 1310 | password | 0 | [RFC6749] | 1311 | authorization_code | 1 | [RFC6749] | 1312 | client_credentials | 2 | [RFC6749] | 1313 | refresh_token | 3 | [RFC6749] | 1314 \--------------------+------------+------------------------/ 1316 Figure 11: CBOR abbreviations for common grant types 1318 5.8.4.2. Token Type 1320 The "token_type" parameter, defined in section 5.1 of [RFC6749], 1321 allows the AS to indicate to the client which type of access token it 1322 is receiving (e.g., a bearer token). 1324 This document registers the new value "PoP" for the OAuth Access 1325 Token Types registry, specifying a proof-of-possession token. How 1326 the proof-of-possession by the client to the RS is performed MUST be 1327 specified by the profiles. 1329 The values in the "token_type" parameter MUST use the CBOR 1330 abbreviations defined in the registry specified by Section 8.7, if a 1331 CBOR encoding is used. 1333 In this framework the "pop" value for the "token_type" parameter is 1334 the default. The AS may, however, provide a different value. 1336 5.8.4.3. Profile 1338 Profiles of this framework MUST define the communication protocol and 1339 the communication security protocol between the client and the RS. 1340 The security protocol MUST provide encryption, integrity and replay 1341 protection. It MUST also provide a binding between requests and 1342 responses. Furthermore profiles MUST define a list of allowed proof- 1343 of-possession methods, if they support proof-of-possession tokens. 1345 A profile MUST specify an identifier that MUST be used to uniquely 1346 identify itself in the "ace_profile" parameter. The textual 1347 representation of the profile identifier is intended for human 1348 readability and for JSON-based interactions, it MUST NOT be used for 1349 CBOR-based interactions. Profiles MUST register their identifier in 1350 the registry defined in Section 8.8. 1352 Profiles MAY define additional parameters for both the token request 1353 and the Access Information in the access token response in order to 1354 support negotiation or signaling of profile specific parameters. 1356 Clients that want the AS to provide them with the "ace_profile" 1357 parameter in the access token response can indicate that by sending a 1358 ace_profile parameter with a null value (for CBOR-based interactions) 1359 or an empty string (for JSON based interactions) in the access token 1360 request. 1362 5.8.4.4. Client-Nonce 1364 This parameter MUST be sent from the client to the AS, if it 1365 previously received a "cnonce" parameter in the AS Request Creation 1366 Hints Section 5.3. The parameter is encoded as a byte string for 1367 CBOR-based interactions, and as a string (Base64 encoded binary) for 1368 JSON-based interactions. It MUST copy the value from the cnonce 1369 parameter in the AS Request Creation Hints. 1371 5.8.5. Mapping Parameters to CBOR 1373 If CBOR encoding is used, all OAuth parameters in access token 1374 requests and responses MUST be mapped to CBOR types as specified in 1375 the registry defined by Section 8.10, using the given integer 1376 abbreviation for the map keys. 1378 Note that we have aligned the abbreviations corresponding to claims 1379 with the abbreviations defined in [RFC8392]. 1381 Note also that abbreviations from -24 to 23 have a 1 byte encoding 1382 size in CBOR. We have thus chosen to assign abbreviations in that 1383 range to parameters we expect to be used most frequently in 1384 constrained scenarios. 1386 /-------------------+----------+---------------------\ 1387 | Name | CBOR Key | Value Type | 1388 |-------------------+----------+---------------------| 1389 | access_token | 1 | byte string | 1390 | expires_in | 2 | unsigned integer | 1391 | audience | 5 | text string | 1392 | scope | 9 | text or byte string | 1393 | client_id | 24 | text string | 1394 | client_secret | 25 | byte string | 1395 | response_type | 26 | text string | 1396 | redirect_uri | 27 | text string | 1397 | state | 28 | text string | 1398 | code | 29 | byte string | 1399 | error | 30 | integer | 1400 | error_description | 31 | text string | 1401 | error_uri | 32 | text string | 1402 | grant_type | 33 | unsigned integer | 1403 | token_type | 34 | integer | 1404 | username | 35 | text string | 1405 | password | 36 | text string | 1406 | refresh_token | 37 | byte string | 1407 | ace_profile | 38 | integer | 1408 | cnonce | 39 | byte string | 1409 \-------------------+----------+---------------------/ 1411 Figure 12: CBOR mappings used in token requests and responses 1413 5.9. The Introspection Endpoint 1415 Token introspection [RFC7662] can be OPTIONALLY provided by the AS, 1416 and is then used by the RS and potentially the client to query the AS 1417 for metadata about a given token, e.g., validity or scope. Analogous 1418 to the protocol defined in [RFC7662] for HTTP and JSON, this section 1419 defines adaptations to more constrained environments using CBOR and 1420 leaving the choice of the application protocol to the profile. 1422 Communication between the requesting entity and the introspection 1423 endpoint at the AS MUST be integrity protected and encrypted. The 1424 communication security protocol MUST also provide a binding between 1425 requests and responses. Furthermore the two interacting parties MUST 1426 perform mutual authentication. Finally the AS SHOULD verify that the 1427 requesting entity has the right to access introspection information 1428 about the provided token. Profiles of this framework that support 1429 introspection MUST specify how authentication and communication 1430 security between the requesting entity and the AS is implemented. 1432 The default name of this endpoint in an url-path is '/introspect', 1433 however implementations are not required to use this name and can 1434 define their own instead. 1436 The figures of this section uses CBOR diagnostic notation without the 1437 integer abbreviations for the parameters or their values for better 1438 readability. 1440 Note that supporting introspection is OPTIONAL for implementations of 1441 this framework. 1443 5.9.1. Introspection Request 1445 The requesting entity sends a POST request to the introspection 1446 endpoint at the AS. The profile MUST specify how the communication 1447 is protected. If CBOR is used, the payload MUST be encoded as a CBOR 1448 map with a "token" entry containing the access token. Further 1449 optional parameters representing additional context that is known by 1450 the requesting entity to aid the AS in its response MAY be included. 1452 For CoAP-based interaction, all messages MUST use the content type 1453 "application/ace+cbor", while for HTTP-based interactions the 1454 equivalent media type "application/ace+cbor" MUST be used. 1456 The same parameters are required and optional as in Section 2.1 of 1457 [RFC7662]. 1459 For example, Figure 13 shows an RS calling the token introspection 1460 endpoint at the AS to query about an OAuth 2.0 proof-of-possession 1461 token. Note that object security based on OSCORE [RFC8613] is 1462 assumed in this example, therefore the Content-Format is 1463 "application/oscore". Figure 14 shows the decoded payload. 1465 Header: POST (Code=0.02) 1466 Uri-Host: "as.example.com" 1467 Uri-Path: "introspect" 1468 OSCORE: 0x09, 0x05, 0x25 1469 Content-Format: "application/oscore" 1470 Payload: 1471 ... COSE content ... 1473 Figure 13: Example introspection request. 1475 { 1476 "token" : b64'7gj0dXJQ43U', 1477 "token_type_hint" : "PoP" 1478 } 1480 Figure 14: Decoded payload. 1482 5.9.2. Introspection Response 1484 If the introspection request is authorized and successfully 1485 processed, the AS sends a response with the response code equivalent 1486 to the CoAP code 2.01 (Created). If the introspection request was 1487 invalid, not authorized or couldn't be processed the AS returns an 1488 error response as described in Section 5.9.3. 1490 In a successful response, the AS encodes the response parameters in a 1491 map including with the same required and optional parameters as in 1492 Section 2.2 of [RFC7662] with the following addition: 1494 ace_profile OPTIONAL. This indicates the profile that the RS MUST 1495 use with the client. See Section 5.8.4.3 for more details on the 1496 formatting of this parameter. 1498 cnonce OPTIONAL. A client-nonce provided to the AS by the client. 1499 The RS MUST verify that this corresponds to the client-nonce 1500 previously provided to the client in the AS Request Creation 1501 Hints. See Section 5.3 and Section 5.8.4.4. 1503 exi OPTIONAL. The "expires-in" claim associated to this access 1504 token. See Section 5.10.3. 1506 Furthermore [I-D.ietf-ace-oauth-params] defines more parameters that 1507 the AS MUST be able to use when responding to a request to the 1508 introspection endpoint. 1510 For example, Figure 15 shows an AS response to the introspection 1511 request in Figure 13. Note that this example contains the "cnf" 1512 parameter defined in [I-D.ietf-ace-oauth-params]. 1514 Header: Created (Code=2.01) 1515 Content-Format: "application/ace+cbor" 1516 Payload: 1517 { 1518 "active" : true, 1519 "scope" : "read", 1520 "ace_profile" : "coap_dtls", 1521 "cnf" : { 1522 "COSE_Key" : { 1523 "kty" : "Symmetric", 1524 "kid" : b64'39Gqlw', 1525 "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' 1526 } 1527 } 1528 } 1530 Figure 15: Example introspection response. 1532 5.9.3. Error Response 1534 The error responses for CoAP-based interactions with the AS are 1535 equivalent to the ones for HTTP-based interactions as defined in 1536 Section 2.3 of [RFC7662], with the following differences: 1538 o If content is sent and CBOR is used the payload MUST be encoded as 1539 a CBOR map and the Content-Format "application/ace+cbor" MUST be 1540 used. 1542 o If the credentials used by the requesting entity (usually the RS) 1543 are invalid the AS MUST respond with the response code equivalent 1544 to the CoAP code 4.01 (Unauthorized) and use the required and 1545 optional parameters from Section 5.2 in [RFC6749]. 1547 o If the requesting entity does not have the right to perform this 1548 introspection request, the AS MUST respond with a response code 1549 equivalent to the CoAP code 4.03 (Forbidden). In this case no 1550 payload is returned. 1552 o The parameters "error", "error_description" and "error_uri" MUST 1553 be abbreviated using the codes specified in Figure 12. 1555 o The error codes MUST be abbreviated using the codes specified in 1556 the registry defined by Section 8.4. 1558 Note that a properly formed and authorized query for an inactive or 1559 otherwise invalid token does not warrant an error response by this 1560 specification. In these cases, the authorization server MUST instead 1561 respond with an introspection response with the "active" field set to 1562 "false". 1564 5.9.4. Mapping Introspection parameters to CBOR 1566 If CBOR is used, the introspection request and response parameters 1567 MUST be mapped to CBOR types as specified in the registry defined by 1568 Section 8.12, using the given integer abbreviation for the map key. 1570 Note that we have aligned abbreviations that correspond to a claim 1571 with the abbreviations defined in [RFC8392] and the abbreviations of 1572 parameters with the same name from Section 5.8.5. 1574 /-------------------+----------+-------------------------\ 1575 | Parameter name | CBOR Key | Value Type | 1576 |-------------------+----------+-------------------------| 1577 | iss | 1 | text string | 1578 | sub | 2 | text string | 1579 | aud | 3 | text string | 1580 | exp | 4 | integer or | 1581 | | | floating-point number | 1582 | nbf | 5 | integer or | 1583 | | | floating-point number | 1584 | iat | 6 | integer or | 1585 | | | floating-point number | 1586 | cti | 7 | byte string | 1587 | scope | 9 | text or byte string | 1588 | active | 10 | True or False | 1589 | token | 11 | byte string | 1590 | client_id | 24 | text string | 1591 | error | 30 | integer | 1592 | error_description | 31 | text string | 1593 | error_uri | 32 | text string | 1594 | token_type_hint | 33 | text string | 1595 | token_type | 34 | integer | 1596 | username | 35 | text string | 1597 | ace_profile | 38 | integer | 1598 | cnonce | 39 | byte string | 1599 | exi | 40 | unsigned integer | 1600 \-------------------+----------+-------------------------/ 1602 Figure 16: CBOR Mappings to Token Introspection Parameters. 1604 5.10. The Access Token 1606 This framework RECOMMENDS the use of CBOR web token (CWT) as 1607 specified in [RFC8392]. 1609 In order to facilitate offline processing of access tokens, this 1610 document uses the "cnf" claim from [RFC8747] and the "scope" claim 1611 from [RFC8693] for JWT- and CWT-encoded tokens. In addition to 1612 string encoding specified for the "scope" claim, a binary encoding 1613 MAY be used. The syntax of such an encoding is explicitly not 1614 specified here and left to profiles or applications, specifically 1615 note that a binary encoded scope does not necessarily use the space 1616 character '0x20' to delimit scope-tokens. 1618 If the AS needs to convey a hint to the RS about which profile it 1619 should use to communicate with the client, the AS MAY include an 1620 "ace_profile" claim in the access token, with the same syntax and 1621 semantics as defined in Section 5.8.4.3. 1623 If the client submitted a client-nonce parameter in the access token 1624 request Section 5.8.4.4, the AS MUST include the value of this 1625 parameter in the "cnonce" claim specified here. The "cnonce" claim 1626 uses binary encoding. 1628 5.10.1. The Authorization Information Endpoint 1630 The access token, containing authorization information and 1631 information about the proof-of-possession method used by the client, 1632 needs to be transported to the RS so that the RS can authenticate and 1633 authorize the client request. 1635 This section defines a method for transporting the access token to 1636 the RS using a RESTful protocol such as CoAP. Profiles of this 1637 framework MAY define other methods for token transport. 1639 The method consists of an authz-info endpoint, implemented by the RS. 1640 A client using this method MUST make a POST request to the authz-info 1641 endpoint at the RS with the access token in the payload. The RS 1642 receiving the token MUST verify the validity of the token. If the 1643 token is valid, the RS MUST respond to the POST request with 2.01 1644 (Created). Section Section 5.10.1.1 outlines how an RS MUST proceed 1645 to verify the validity of an access token. 1647 The RS MUST be prepared to store at least one access token for future 1648 use. This is a difference to how access tokens are handled in OAuth 1649 2.0, where the access token is typically sent along with each 1650 request, and therefore not stored at the RS. 1652 This specification RECOMMENDS that an RS stores only one token per 1653 proof-of-possession key. This means that an additional token linked 1654 to the same key will supersede any existing token at the RS, by 1655 replacing the corresponding authorization information. The reason is 1656 that this greatly simplifies (constrained) implementations, with 1657 respect to required storage and resolving a request to the applicable 1658 token. 1660 If the payload sent to the authz-info endpoint does not parse to a 1661 token, the RS MUST respond with a response code equivalent to the 1662 CoAP code 4.00 (Bad Request). 1664 The RS MAY make an introspection request to validate the token before 1665 responding to the POST request to the authz-info endpoint, e.g. if 1666 the token is an opaque reference. Some transport protocols may 1667 provide a way to indicate that the RS is busy and the client should 1668 retry after an interval; this type of status update would be 1669 appropriate while the RS is waiting for an introspection response. 1671 Profiles MUST specify whether the authz-info endpoint is protected, 1672 including whether error responses from this endpoint are protected. 1673 Note that since the token contains information that allow the client 1674 and the RS to establish a security context in the first place, mutual 1675 authentication may not be possible at this point. 1677 The default name of this endpoint in an url-path is '/authz-info', 1678 however implementations are not required to use this name and can 1679 define their own instead. 1681 5.10.1.1. Verifying an Access Token 1683 When an RS receives an access token, it MUST verify it before storing 1684 it. The details of token verification depends on various aspects, 1685 including the token encoding, the type of token, the security 1686 protection applied to the token, and the claims. The token encoding 1687 matters since the security wrapper differs between the token 1688 encodings. For example, a CWT token uses COSE while a JWT token uses 1689 JOSE. The type of token also has an influence on the verification 1690 procedure since tokens may be self-contained whereby token 1691 verification may happen locally at the RS while a token-by-reference 1692 requires further interaction with the authorization server, for 1693 example using token introspection, to obtain the claims associated 1694 with the token reference. Self-contained tokens MUST, at a minimum, 1695 be integrity protected but they MAY also be encrypted. 1697 For self-contained tokens the RS MUST process the security protection 1698 of the token first, as specified by the respective token format. For 1699 CWT the description can be found in [RFC8392] and for JWT the 1700 relevant specification is [RFC7519]. This MUST include a 1701 verification that security protection (and thus the token) was 1702 generated by an AS that has the right to issue access tokens for this 1703 RS. 1705 In case the token is communicated by reference the RS needs to obtain 1706 the claims first. When the RS uses token introspection the relevant 1707 specification is [RFC7662] with CoAP transport specified in 1708 Section 5.9. 1710 Errors may happen during this initial processing stage: 1712 o If token or claim verification fails, the RS MUST discard the 1713 token and, if this was an interaction with authz-info, return an 1714 error message with a response code equivalent to the CoAP code 1715 4.01 (Unauthorized). 1717 o If the claims cannot be obtained the RS MUST discard the token 1718 and, in case of an interaction via the authz-info endpoint, return 1719 an error message with a response code equivalent to the CoAP code 1720 4.00 (Bad Request). 1722 Next, the RS MUST verify claims, if present, contained in the access 1723 token. Errors are returned when claim checks fail, in the order of 1724 priority of this list: 1726 iss The issuer claim must identify an AS that has the authority to 1727 issue access tokens for the receiving RS. If that is not the case 1728 the RS MUST discard the token. If this was an interaction with 1729 authz-info, the RS MUST also respond with a response code 1730 equivalent to the CoAP code 4.01 (Unauthorized). 1732 exp The expiration date must be in the future. If that is not the 1733 case the RS MUST discard the token. If this was an interaction 1734 with authz-info the RS MUST also respond with a response code 1735 equivalent to the CoAP code 4.01 (Unauthorized). Note that the RS 1736 has to terminate access rights to the protected resources at the 1737 time when the tokens expire. 1739 aud The audience claim must refer to an audience that the RS 1740 identifies with. If that is not the case the RS MUST discard the 1741 token. If this was an interaction with authz-info, the RS MUST 1742 also respond with a response code equivalent to the CoAP code 4.03 1743 (Forbidden). 1745 scope The RS must recognize value of the scope claim. If that is 1746 not the case the RS MUST discard the token. If this was an 1747 interaction with authz-info, the RS MUST also respond with a 1748 response code equivalent to the CoAP code 4.00 (Bad Request). The 1749 RS MAY provide additional information in the error response, to 1750 clarify what went wrong. 1752 Additional processing may be needed for other claims in a way 1753 specific to a profile or the underlying application. 1755 Note that the Subject (sub) claim cannot always be verified when the 1756 token is submitted to the RS since the client may not have 1757 authenticated yet. Also note that a counter for the expires_in (exi) 1758 claim MUST be initialized when the RS first verifies this token. 1760 Also note that profiles of this framework may define access token 1761 transport mechanisms that do not allow for error responses. 1762 Therefore the error messages specified here only apply if the token 1763 was sent to the authz-info endpoint. 1765 When sending error responses, the RS MAY use the error codes from 1766 Section 3.1 of [RFC6750], to provide additional details to the 1767 client. 1769 5.10.1.2. Protecting the Authorization Information Endpoint 1771 As this framework can be used in RESTful environments, it is 1772 important to make sure that attackers cannot perform unauthorized 1773 requests on the authz-info endpoints, other than submitting access 1774 tokens. 1776 Specifically it SHOULD NOT be possible to perform GET, DELETE or PUT 1777 on the authz-info endpoint and on it's children (if any). 1779 The POST method SHOULD NOT be allowed on children of the authz-info 1780 endpoint. 1782 The RS SHOULD implement rate limiting measures to mitigate attacks 1783 aiming to overload the processing capacity of the RS by repeatedly 1784 submitting tokens. For CoAP-based communication the RS could use the 1785 mechanisms from [RFC8516] to indicate that it is overloaded. 1787 5.10.2. Client Requests to the RS 1789 Before sending a request to an RS, the client MUST verify that the 1790 keys used to protect this communication are still valid. See 1791 Section 5.10.4 for details on how the client determines the validity 1792 of the keys used. 1794 If an RS receives a request from a client, and the target resource 1795 requires authorization, the RS MUST first verify that it has an 1796 access token that authorizes this request, and that the client has 1797 performed the proof-of-possession binding that token to the request. 1799 The response code MUST be 4.01 (Unauthorized) in case the client has 1800 not performed the proof-of-possession, or if RS has no valid access 1801 token for the client. If RS has an access token for the client but 1802 the token does not authorize access for the resource that was 1803 requested, RS MUST reject the request with a 4.03 (Forbidden). If RS 1804 has an access token for the client but it does not cover the action 1805 that was requested on the resource, RS MUST reject the request with a 1806 4.05 (Method Not Allowed). 1808 Note: The use of the response codes 4.03 and 4.05 is intended to 1809 prevent infinite loops where a dumb Client optimistically tries to 1810 access a requested resource with any access token received from AS. 1811 As malicious clients could pretend to be C to determine C's 1812 privileges, these detailed response codes must be used only when a 1813 certain level of security is already available which can be achieved 1814 only when the Client is authenticated. 1816 Note: The RS MAY use introspection for timely validation of an access 1817 token, at the time when a request is presented. 1819 Note: Matching the claims of the access token (e.g., scope) to a 1820 specific request is application specific. 1822 If the request matches a valid token and the client has performed the 1823 proof-of-possession for that token, the RS continues to process the 1824 request as specified by the underlying application. 1826 5.10.3. Token Expiration 1828 Depending on the capabilities of the RS, there are various ways in 1829 which it can verify the expiration of a received access token. Here 1830 follows a list of the possibilities including what functionality they 1831 require of the RS. 1833 o The token is a CWT and includes an "exp" claim and possibly the 1834 "nbf" claim. The RS verifies these by comparing them to values 1835 from its internal clock as defined in [RFC7519]. In this case the 1836 RS's internal clock must reflect the current date and time, or at 1837 least be synchronized with the AS's clock. How this clock 1838 synchronization would be performed is out of scope for this 1839 specification. 1841 o The RS verifies the validity of the token by performing an 1842 introspection request as specified in Section 5.9. This requires 1843 the RS to have a reliable network connection to the AS and to be 1844 able to handle two secure sessions in parallel (C to RS and RS to 1845 AS). 1847 o In order to support token expiration for devices that have no 1848 reliable way of synchronizing their internal clocks, this 1849 specification defines the following approach: The claim "exi" 1850 ("expires in") can be used, to provide the RS with the lifetime of 1851 the token in seconds from the time the RS first receives the 1852 token. For CBOR-based interaction this parameter is encoded as 1853 unsigned integer, while JSON-based interactions encode this as 1854 JSON number. 1856 o Processing this claim requires that the RS does the following: 1858 * For each token the RS receives, that contains an "exi" claim: 1859 Keep track of the time it received that token and revisit that 1860 list regularly to expunge expired tokens. 1862 * Keep track of the identifiers of tokens containing the "exi" 1863 claim that have expired (in order to avoid accepting them 1864 again). In order to avoid an unbounded memory usage growth, 1865 this MUST be implemented in the following way when the "exi" 1866 claim is used: 1868 + When creating the token, the AS MUST add a 'cti' claim ( or 1869 'jti' for JWTs) to the access token. The value of this 1870 claim MUST be created as the binary representation of the 1871 concatenation of the identifier of the RS with a sequence 1872 number counting the tokens containing an 'exi' claim, issued 1873 by this AS for the RS. 1875 + The RS MUST store the highest sequence number of an expired 1876 token containing the "exi" claim that it has seen, and treat 1877 tokens with lower sequence numbers as expired. 1879 If a token that authorizes a long running request such as a CoAP 1880 Observe [RFC7641] expires, the RS MUST send an error response with 1881 the response code equivalent to the CoAP code 4.01 (Unauthorized) to 1882 the client and then terminate processing the long running request. 1884 5.10.4. Key Expiration 1886 The AS provides the client with key material that the RS uses. This 1887 can either be a common symmetric PoP-key, or an asymmetric key used 1888 by the RS to authenticate towards the client. Since there is 1889 currently no expiration metadata associated to those keys, the client 1890 has no way of knowing if these keys are still valid. This may lead 1891 to situations where the client sends requests containing sensitive 1892 information to the RS using a key that is expired and possibly in the 1893 hands of an attacker, or accepts responses from the RS that are not 1894 properly protected and could possibly have been forged by an 1895 attacker. 1897 In order to prevent this, the client must assume that those keys are 1898 only valid as long as the related access token is. Since the access 1899 token is opaque to the client, one of the following methods MUST be 1900 used to inform the client about the validity of an access token: 1902 o The client knows a default validity time for all tokens it is 1903 using (i.e. how long a token is valid after being issued). This 1904 information could be provisioned to the client when it is 1905 registered at the AS, or published by the AS in a way that the 1906 client can query. 1908 o The AS informs the client about the token validity using the 1909 "expires_in" parameter in the Access Information. 1911 A client that is not able to obtain information about the expiration 1912 of a token MUST NOT use this token. 1914 6. Security Considerations 1916 Security considerations applicable to authentication and 1917 authorization in RESTful environments provided in OAuth 2.0 [RFC6749] 1918 apply to this work. Furthermore [RFC6819] provides additional 1919 security considerations for OAuth which apply to IoT deployments as 1920 well. If the introspection endpoint is used, the security 1921 considerations from [RFC7662] also apply. 1923 The following subsections address issues specific to this document 1924 and it's use in constrained environments. 1926 6.1. Protecting Tokens 1928 A large range of threats can be mitigated by protecting the contents 1929 of the access token by using a digital signature or a keyed message 1930 digest (MAC) or an Authenticated Encryption with Associated Data 1931 (AEAD) algorithm. Consequently, the token integrity protection MUST 1932 be applied to prevent the token from being modified, particularly 1933 since it contains a reference to the symmetric key or the asymmetric 1934 key used for proof-of-possession. If the access token contains the 1935 symmetric key, this symmetric key MUST be encrypted by the 1936 authorization server so that only the resource server can decrypt it. 1937 Note that using an AEAD algorithm is preferable over using a MAC 1938 unless the token needs to be publicly readable. 1940 If the token is intended for multiple recipients (i.e. an audience 1941 that is a group), integrity protection of the token with a symmetric 1942 key, shared between the AS and the recipients, is not sufficient, 1943 since any of the recipients could modify the token undetected by the 1944 other recipients. Therefore a token with a multi-recipient audience 1945 MUST be protected with an asymmetric signature. 1947 It is important for the authorization server to include the identity 1948 of the intended recipient (the audience), typically a single resource 1949 server (or a list of resource servers), in the token. The same 1950 shared secret MUST NOT be used as proof-of-possession key with 1951 multiple resource servers since the benefit from using the proof-of- 1952 possession concept is then significantly reduced. 1954 If clients are capable of doing so, they should frequently request 1955 fresh access tokens, as this allows the AS to keep the lifetime of 1956 the tokens short. This allows the AS to use shorter proof-of- 1957 possession key sizes, which translate to a performance benefit for 1958 the client and for the resource server. Shorter keys also lead to 1959 shorter messages (particularly with asymmetric keying material). 1961 When authorization servers bind symmetric keys to access tokens, they 1962 SHOULD scope these access tokens to a specific permission. 1964 In certain situations it may be necessary to revoke an access token 1965 that is still valid. Client-initiated revocation is specified in 1966 [RFC7009] for OAuth 2.0. Other revocation mechanisms are currently 1967 not specified, as the underlying assumption in OAuth is that access 1968 tokens are issued with a relatively short lifetime. This may not 1969 hold true for disconnected constrained devices, needing access tokens 1970 with relatively long lifetimes, and would therefore necessitate 1971 further standardization work that is out of scope for this document. 1973 6.2. Communication Security 1975 Communication with the authorization server MUST use confidentiality 1976 protection. This step is extremely important since the client or the 1977 RS may obtain the proof-of-possession key from the authorization 1978 server for use with a specific access token. Not using 1979 confidentiality protection exposes this secret (and the access token) 1980 to an eavesdropper thereby completely negating proof-of-possession 1981 security. The requirements for communication security of profiles 1982 are specified in Section 5. 1984 Additional protection for the access token can be applied by 1985 encrypting it, for example encryption of CWTs is specified in 1986 Section 5.1 of [RFC8392]. Such additional protection can be 1987 necessary if the token is later transferred over an insecure 1988 connection (e.g. when it is sent to the authz-info endpoint). 1990 Developers MUST ensure that the ephemeral credentials (i.e., the 1991 private key or the session key) are not leaked to third parties. An 1992 adversary in possession of the ephemeral credentials bound to the 1993 access token will be able to impersonate the client. Be aware that 1994 this is a real risk with many constrained environments, since 1995 adversaries can often easily get physical access to the devices. 1996 This risk can also be mitigated to some extent by making sure that 1997 keys are refreshed more frequently. 1999 6.3. Long-Term Credentials 2001 Both clients and RSs have long-term credentials that are used to 2002 secure communications, and authenticate to the AS. These credentials 2003 need to be protected against unauthorized access. In constrained 2004 devices, deployed in publicly accessible places, such protection can 2005 be difficult to achieve without specialized hardware (e.g. secure key 2006 storage memory). 2008 If credentials are lost or compromised, the operator of the affected 2009 devices needs to have procedures to invalidate any access these 2010 credentials give and to revoke tokens linked to such credentials. 2011 The loss of a credential linked to a specific device MUST NOT lead to 2012 a compromise of other credentials not linked to that device, 2013 therefore secret keys used for authentication MUST NOT be shared 2014 between more than two parties. 2016 Operators of clients or RS SHOULD have procedures in place to replace 2017 credentials that are suspected to have been compromised or that have 2018 been lost. 2020 Operators also SHOULD have procedures for decommissioning devices, 2021 that include securely erasing credentials and other security critical 2022 material in the devices being decommissioned. 2024 6.4. Unprotected AS Request Creation Hints 2026 Initially, no secure channel exists to protect the communication 2027 between C and RS. Thus, C cannot determine if the AS Request 2028 Creation Hints contained in an unprotected response from RS to an 2029 unauthorized request (see Section 5.3) are authentic. C therefore 2030 MUST determine if an AS is authorized to provide access tokens for a 2031 certain RS. 2033 A compromised RS may use the hints for attempting to trick a client 2034 into contacting an AS that is not supposed to be in charge of that 2035 RS. Therefore, C must not communicate with an AS if it cannot 2036 determine that this AS has the authority to issue access tokens for 2037 this RS. Otherwise, a compromised RS may use this to perform a 2038 denial of service attack against a specific AS, by redirecting a 2039 large number of client requests to that AS. 2041 6.5. Minimal security requirements for communication 2043 This section summarizes the minimal requirements for the 2044 communication security of the different protocol interactions. 2046 C-AS All communication between the client and the Authorization 2047 Server MUST be encrypted, integrity and replay protected. 2048 Furthermore responses from the AS to the client MUST be bound to 2049 the client's request to avoid attacks where the attacker swaps the 2050 intended response for an older one valid for a previous request. 2051 This requires that the client and the Authorization Server have 2052 previously exchanged either a shared secret or their public keys 2053 in order to negotiate a secure communication. Furthermore the 2054 client MUST be able to determine whether an AS has the authority 2055 to issue access tokens for a certain RS. This can for example be 2056 done through pre-configured lists, or through an online lookup 2057 mechanism that in turn also must be secured. 2059 RS-AS The communication between the Resource Server and the 2060 Authorization Server via the introspection endpoint MUST be 2061 encrypted, integrity and replay protected. Furthermore responses 2062 from the AS to the RS MUST be bound to the RS's request. This 2063 requires that the RS and the Authorization Server have previously 2064 exchanged either a shared secret, or their public keys in order to 2065 negotiate a secure communication. Furthermore the RS MUST be able 2066 to determine whether an AS has the authority to issue access 2067 tokens itself. This is usually configured out of band, but could 2068 also be performed through an online lookup mechanism provided that 2069 it is also secured in the same way. 2071 C-RS The initial communication between the client and the Resource 2072 Server can not be secured in general, since the RS is not in 2073 possession of on access token for that client, which would carry 2074 the necessary parameters. If both parties support DTLS without 2075 client authentication it is RECOMMEND to use this mechanism for 2076 protecting the initial communication. After the client has 2077 successfully transmitted the access token to the RS, a secure 2078 communication protocol MUST be established between client and RS 2079 for the actual resource request. This protocol MUST provide 2080 confidentiality, integrity and replay protection as well as a 2081 binding between requests and responses. This requires that the 2082 client learned either the RS's public key or received a symmetric 2083 proof-of-possession key bound to the access token from the AS. 2084 The RS must have learned either the client's public key or a 2085 shared symmetric key from the claims in the token or an 2086 introspection request. Since ACE does not provide profile 2087 negotiation between C and RS, the client MUST have learned what 2088 profile the RS supports (e.g. from the AS or pre-configured) and 2089 initiate the communication accordingly. 2091 6.6. Token Freshness and Expiration 2093 An RS that is offline faces the problem of clock drift. Since it 2094 cannot synchronize its clock with the AS, it may be tricked into 2095 accepting old access tokens that are no longer valid or have been 2096 compromised. In order to prevent this, an RS may use the nonce-based 2097 mechanism defined in Section 5.3 to ensure freshness of an Access 2098 Token subsequently presented to this RS. 2100 Another problem with clock drift is that evaluating the standard 2101 token expiration claim "exp" can give unpredictable results. 2103 Acceptable ranges of clock drift are highly dependent on the concrete 2104 application. Important factors are how long access tokens are valid, 2105 and how critical timely expiration of access token is. 2107 The expiration mechanism implemented by the "exi" claim, based on the 2108 first time the RS sees the token was defined to provide a more 2109 predictable alternative. The "exi" approach has some drawbacks that 2110 need to be considered: 2112 A malicious client may hold back tokens with the "exi" claim in 2113 order to prolong their lifespan. 2115 If an RS loses state (e.g. due to an unscheduled reboot), it may 2116 loose the current values of counters tracking the "exi" claims of 2117 tokens it is storing. 2119 The first drawback is inherent to the deployment scenario and the 2120 "exi" solution. It can therefore not be mitigated without requiring 2121 the the RS be online at times. The second drawback can be mitigated 2122 by regularly storing the value of "exi" counters to persistent 2123 memory. 2125 6.7. Combining profiles 2127 There may be use cases were different profiles of this framework are 2128 combined. For example, an MQTT-TLS profile is used between the 2129 client and the RS in combination with a CoAP-DTLS profile for 2130 interactions between the client and the AS. The security of a 2131 profile MUST NOT depend on the assumption that the profile is used 2132 for all the different types of interactions in this framework. 2134 6.8. Unprotected Information 2136 Communication with the authz-info endpoint, as well as the various 2137 error responses defined in this framework, all potentially include 2138 sending information over an unprotected channel. These messages may 2139 leak information to an adversary, or may be manipulated by active 2140 attackers to induce incorrect behavior. For example error responses 2141 for requests to the Authorization Information endpoint can reveal 2142 information about an otherwise opaque access token to an adversary 2143 who has intercepted this token. 2145 As far as error messages are concerned, this framework is written 2146 under the assumption that, in general, the benefits of detailed error 2147 messages outweigh the risk due to information leakage. For 2148 particular use cases, where this assessment does not apply, detailed 2149 error messages can be replaced by more generic ones. 2151 In some scenarios it may be possible to protect the communication 2152 with the authz-info endpoint (e.g. through DTLS with only server-side 2153 authentication). In cases where this is not possible this framework 2154 RECOMMENDS to use encrypted CWTs or tokens that are opaque references 2155 and need to be subjected to introspection by the RS. 2157 If the initial unauthorized resource request message (see 2158 Section 5.2) is used, the client MUST make sure that it is not 2159 sending sensitive content in this request. While GET and DELETE 2160 requests only reveal the target URI of the resource, POST and PUT 2161 requests would reveal the whole payload of the intended operation. 2163 Since the client is not authenticated at the point when it is 2164 submitting an access token to the authz-info endpoint, attackers may 2165 be pretending to be a client and trying to trick an RS to use an 2166 obsolete profile that in turn specifies a vulnerable security 2167 mechanism via the authz-info endpoint. Such an attack would require 2168 a valid access token containing an "ace_profile" claim requesting the 2169 use of said obsolete profile. Resource Owners should update the 2170 configuration of their RS's to prevent them from using such obsolete 2171 profiles. 2173 6.9. Identifying audiences 2175 The audience claim as defined in [RFC7519] and the equivalent 2176 "audience" parameter from [RFC8693] are intentionally vague on how to 2177 match the audience value to a specific RS. This is intended to allow 2178 application specific semantics to be used. This section attempts to 2179 give some general guidance for the use of audiences in constrained 2180 environments. 2182 URLs are not a good way of identifying mobile devices that can switch 2183 networks and thus be associated with new URLs. If the audience 2184 represents a single RS, and asymmetric keys are used, the RS can be 2185 uniquely identified by a hash of its public key. If this approach is 2186 used this framework RECOMMENDS to apply the procedure from section 3 2187 of [RFC6920]. 2189 If the audience addresses a group of resource servers, the mapping of 2190 group identifier to individual RS has to be provisioned to each RS 2191 before the group-audience is usable. Managing dynamic groups could 2192 be an issue, if any RS is not always reachable when the groups' 2193 memberships change. Furthermore, issuing access tokens bound to 2194 symmetric proof-of-possession keys that apply to a group-audience is 2195 problematic, as an RS that is in possession of the access token can 2196 impersonate the client towards the other RSs that are part of the 2197 group. It is therefore NOT RECOMMENDED to issue access tokens bound 2198 to a group audience and symmetric proof-of possession keys. 2200 Even the client must be able to determine the correct values to put 2201 into the "audience" parameter, in order to obtain a token for the 2202 intended RS. Errors in this process can lead to the client 2203 inadvertently obtaining a token for the wrong RS. The correct values 2204 for "audience" can either be provisioned to the client as part of its 2205 configuration, or dynamically looked up by the client in some 2206 directory. In the latter case the integrity and correctness of the 2207 directory data must be assured. Note that the "audience" hint 2208 provided by the RS as part of the "AS Request Creation Hints" 2209 Section 5.3 is not typically source authenticated and integrity 2210 protected, and should therefore not be treated a trusted value. 2212 6.10. Denial of service against or with Introspection 2214 The optional introspection mechanism provided by OAuth and supported 2215 in the ACE framework allows for two types of attacks that need to be 2216 considered by implementers. 2218 First, an attacker could perform a denial of service attack against 2219 the introspection endpoint at the AS in order to prevent validation 2220 of access tokens. To maintain the security of the system, an RS that 2221 is configured to use introspection MUST NOT allow access based on a 2222 token for which it couldn't reach the introspection endpoint. 2224 Second, an attacker could use the fact that an RS performs 2225 introspection to perform a denial of service attack against that RS 2226 by repeatedly sending tokens to its authz-info endpoint that require 2227 an introspection call. RS can mitigate such attacks by implementing 2228 rate limits on how many introspection requests they perform in a 2229 given time interval for a certain client IP address submitting tokens 2230 to /authz-info. When that limit has been reached, incoming requests 2231 from that address are rejected for a certain amount of time. A 2232 general rate limit on the introspection requests should also be 2233 considered, to mitigate distributed attacks. 2235 7. Privacy Considerations 2237 Implementers and users should be aware of the privacy implications of 2238 the different possible deployments of this framework. 2240 The AS is in a very central position and can potentially learn 2241 sensitive information about the clients requesting access tokens. If 2242 the client credentials grant is used, the AS can track what kind of 2243 access the client intends to perform. With other grants this can be 2244 prevented by the Resource Owner. To do so, the resource owner needs 2245 to bind the grants it issues to anonymous, ephemeral credentials that 2246 do not allow the AS to link different grants and thus different 2247 access token requests by the same client. 2249 The claims contained in a token can reveal privacy sensitive 2250 information about the client and the RS to any party having access to 2251 them (whether by processing the content of a self-contained token or 2252 by introspection). The AS SHOULD be configured to minimize the 2253 information about clients and RSs disclosed in the tokens it issues. 2255 If tokens are only integrity protected and not encrypted, they may 2256 reveal information to attackers listening on the wire, or able to 2257 acquire the access tokens in some other way. In the case of CWTs the 2258 token may, e.g., reveal the audience, the scope and the confirmation 2259 method used by the client. The latter may reveal the identity of the 2260 device or application running the client. This may be linkable to 2261 the identity of the person using the client (if there is a person and 2262 not a machine-to-machine interaction). 2264 Clients using asymmetric keys for proof-of-possession should be aware 2265 of the consequences of using the same key pair for proof-of- 2266 possession towards different RSs. A set of colluding RSs or an 2267 attacker able to obtain the access tokens will be able to link the 2268 requests, or even to determine the client's identity. 2270 An unprotected response to an unauthorized request (see Section 5.3) 2271 may disclose information about RS and/or its existing relationship 2272 with C. It is advisable to include as little information as possible 2273 in an unencrypted response. Even the absolute URI of the AS may 2274 reveal sensitive information about the service that RS provides. 2275 Developers must ensure that the RS does not disclose information that 2276 has an impact on the privacy of the stakeholders in the AS Request 2277 Creation Hints. They may choose to use a different mechanism for the 2278 discovery of the AS if necessary. If means of encrypting 2279 communication between C and RS already exist, more detailed 2280 information may be included with an error response to provide C with 2281 sufficient information to react on that particular error. 2283 8. IANA Considerations 2285 This document creates several registries with a registration policy 2286 of "Expert Review"; guidelines to the experts are given in 2287 Section 8.17. 2289 8.1. ACE Authorization Server Request Creation Hints 2291 This specification establishes the IANA "ACE Authorization Server 2292 Request Creation Hints" registry. The registry has been created to 2293 use the "Expert Review" registration procedure [RFC8126]. It should 2294 be noted that, in addition to the expert review, some portions of the 2295 registry require a specification, potentially a Standards Track RFC, 2296 be supplied as well. 2298 The columns of the registry are: 2300 Name The name of the parameter 2302 CBOR Key CBOR map key for the parameter. Different ranges of values 2303 use different registration policies [RFC8126]. Integer values 2304 from -256 to 255 are designated as Standards Action. Integer 2305 values from -65536 to -257 and from 256 to 65535 are designated as 2306 Specification Required. Integer values greater than 65535 are 2307 designated as Expert Review. Integer values less than -65536 are 2308 marked as Private Use. 2310 Value Type The CBOR data types allowable for the values of this 2311 parameter. 2313 Reference This contains a pointer to the public specification of the 2314 request creation hint abbreviation, if one exists. 2316 This registry will be initially populated by the values in Figure 2. 2317 The Reference column for all of these entries will be this document. 2319 8.2. CoRE Resource Type registry 2321 IANA is requested to register a new Resource Type (rt=) Link Target 2322 Attribute in the "Resource Type (rt=) Link Target Attribute Values" 2323 subregistry under the "Constrained RESTful Environments (CoRE) 2324 Parameters" [IANA.CoreParameters] registry: 2326 rt="ace.ai". This resource type describes an ACE-OAuth authz-info 2327 endpoint resource. 2329 Specific ACE-OAuth profiles can use this common resource type for 2330 defining their profile-specific discovery processes. 2332 8.3. OAuth Extensions Error Registration 2334 This specification registers the following error values in the OAuth 2335 Extensions Error registry [IANA.OAuthExtensionsErrorRegistry]. 2337 o Error name: "unsupported_pop_key" 2338 o Error usage location: token error response 2339 o Related protocol extension: [this document] 2340 o Change Controller: IESG 2341 o Specification document(s): Section 5.8.3 of [this document] 2343 o Error name: "incompatible_ace_profiles" 2344 o Error usage location: token error response 2345 o Related protocol extension: [this document] 2346 o Change Controller: IESG 2347 o Specification document(s): Section 5.8.3 of [this document] 2349 8.4. OAuth Error Code CBOR Mappings Registry 2351 This specification establishes the IANA "OAuth Error Code CBOR 2352 Mappings" registry. The registry has been created to use the "Expert 2353 Review" registration procedure [RFC8126], except for the value range 2354 designated for private use. 2356 The columns of the registry are: 2358 Name The OAuth Error Code name, refers to the name in Section 5.2. 2359 of [RFC6749], e.g., "invalid_request". 2360 CBOR Value CBOR abbreviation for this error code. Integer values 2361 less than -65536 are marked as "Private Use", all other values use 2362 the registration policy "Expert Review" [RFC8126]. 2363 Reference This contains a pointer to the public specification of the 2364 error code abbreviation, if one exists. 2366 This registry will be initially populated by the values in Figure 10. 2367 The Reference column for all of these entries will be this document. 2369 8.5. OAuth Grant Type CBOR Mappings 2371 This specification establishes the IANA "OAuth Grant Type CBOR 2372 Mappings" registry. The registry has been created to use the "Expert 2373 Review" registration procedure [RFC8126], except for the value range 2374 designated for private use. 2376 The columns of this registry are: 2378 Name The name of the grant type as specified in Section 1.3 of 2379 [RFC6749]. 2380 CBOR Value CBOR abbreviation for this grant type. Integer values 2381 less than -65536 are marked as "Private Use", all other values use 2382 the registration policy "Expert Review" [RFC8126]. 2383 Reference This contains a pointer to the public specification of the 2384 grant type abbreviation, if one exists. 2385 Original Specification This contains a pointer to the public 2386 specification of the grant type, if one exists. 2388 This registry will be initially populated by the values in Figure 11. 2389 The Reference column for all of these entries will be this document. 2391 8.6. OAuth Access Token Types 2393 This section registers the following new token type in the "OAuth 2394 Access Token Types" registry [IANA.OAuthAccessTokenTypes]. 2396 o Type name: "PoP" 2397 o Additional Token Endpoint Response Parameters: "cnf", "rs_cnf" see 2398 section 3.3 of [I-D.ietf-ace-oauth-params]. 2399 o HTTP Authentication Scheme(s): N/A 2400 o Change Controller: IETF 2401 o Specification document(s): [this document] 2403 8.7. OAuth Access Token Type CBOR Mappings 2405 This specification established the IANA "OAuth Access Token Type CBOR 2406 Mappings" registry. The registry has been created to use the "Expert 2407 Review" registration procedure [RFC8126], except for the value range 2408 designated for private use. 2410 The columns of this registry are: 2412 Name The name of token type as registered in the OAuth Access Token 2413 Types registry, e.g., "Bearer". 2414 CBOR Value CBOR abbreviation for this token type. Integer values 2415 less than -65536 are marked as "Private Use", all other values use 2416 the registration policy "Expert Review" [RFC8126]. 2417 Reference This contains a pointer to the public specification of the 2418 OAuth token type abbreviation, if one exists. 2419 Original Specification This contains a pointer to the public 2420 specification of the OAuth token type, if one exists. 2422 8.7.1. Initial Registry Contents 2424 o Name: "Bearer" 2425 o Value: 1 2426 o Reference: [this document] 2427 o Original Specification: [RFC6749] 2429 o Name: "PoP" 2430 o Value: 2 2431 o Reference: [this document] 2432 o Original Specification: [this document] 2434 8.8. ACE Profile Registry 2436 This specification establishes the IANA "ACE Profile" registry. The 2437 registry has been created to use the "Expert Review" registration 2438 procedure [RFC8126]. It should be noted that, in addition to the 2439 expert review, some portions of the registry require a specification, 2440 potentially a Standards Track RFC, be supplied as well. 2442 The columns of this registry are: 2444 Name The name of the profile, to be used as value of the profile 2445 attribute. 2446 Description Text giving an overview of the profile and the context 2447 it is developed for. 2448 CBOR Value CBOR abbreviation for this profile name. Different 2449 ranges of values use different registration policies [RFC8126]. 2450 Integer values from -256 to 255 are designated as Standards 2451 Action. Integer values from -65536 to -257 and from 256 to 65535 2452 are designated as Specification Required. Integer values greater 2453 than 65535 are designated as "Expert Review". Integer values less 2454 than -65536 are marked as Private Use. 2455 Reference This contains a pointer to the public specification of the 2456 profile abbreviation, if one exists. 2458 This registry will be initially empty and will be populated by the 2459 registrations from the ACE framework profiles. 2461 8.9. OAuth Parameter Registration 2463 This specification registers the following parameter in the "OAuth 2464 Parameters" registry [IANA.OAuthParameters]: 2466 o Name: "ace_profile" 2467 o Parameter Usage Location: token response 2468 o Change Controller: IESG 2469 o Reference: Section 5.8.2 and Section 5.8.4.3 of [this document] 2471 8.10. OAuth Parameters CBOR Mappings Registry 2473 This specification establishes the IANA "OAuth Parameters CBOR 2474 Mappings" registry. The registry has been created to use the "Expert 2475 Review" registration procedure [RFC8126], except for the value range 2476 designated for private use. 2478 The columns of this registry are: 2480 Name The OAuth Parameter name, refers to the name in the OAuth 2481 parameter registry, e.g., "client_id". 2482 CBOR Key CBOR map key for this parameter. Integer values less than 2483 -65536 are marked as "Private Use", all other values use the 2484 registration policy "Expert Review" [RFC8126]. 2485 Value Type The allowable CBOR data types for values of this 2486 parameter. 2487 Reference This contains a pointer to the public specification of the 2488 OAuth parameter abbreviation, if one exists. 2490 This registry will be initially populated by the values in Figure 12. 2491 The Reference column for all of these entries will be this document. 2493 8.11. OAuth Introspection Response Parameter Registration 2495 This specification registers the following parameters in the OAuth 2496 Token Introspection Response registry 2497 [IANA.TokenIntrospectionResponse]. 2499 o Name: "ace_profile" 2500 o Description: The ACE profile used between client and RS. 2501 o Change Controller: IESG 2502 o Reference: Section 5.9.2 of [this document] 2504 o Name: "cnonce" 2505 o Description: "client-nonce". A nonce previously provided to the 2506 AS by the RS via the client. Used to verify token freshness when 2507 the RS cannot synchronize its clock with the AS. 2508 o Change Controller: IESG 2509 o Reference: Section 5.9.2 of [this document] 2511 o Name: "exi" 2512 o Description: "Expires in". Lifetime of the token in seconds from 2513 the time the RS first sees it. Used to implement a weaker from of 2514 token expiration for devices that cannot synchronize their 2515 internal clocks. 2516 o Change Controller: IESG 2517 o Reference: Section 5.9.2 of [this document] 2519 8.12. OAuth Token Introspection Response CBOR Mappings Registry 2521 This specification establishes the IANA "OAuth Token Introspection 2522 Response CBOR Mappings" registry. The registry has been created to 2523 use the "Expert Review" registration procedure [RFC8126], except for 2524 the value range designated for private use. 2526 The columns of this registry are: 2528 Name The OAuth Parameter name, refers to the name in the OAuth 2529 parameter registry, e.g., "client_id". 2530 CBOR Key CBOR map key for this parameter. Integer values less than 2531 -65536 are marked as "Private Use", all other values use the 2532 registration policy "Expert Review" [RFC8126]. 2533 Value Type The allowable CBOR data types for values of this 2534 parameter. 2535 Reference This contains a pointer to the public specification of the 2536 introspection response parameter abbreviation, if one exists. 2538 This registry will be initially populated by the values in Figure 16. 2539 The Reference column for all of these entries will be this document. 2541 Note that the mappings of parameters corresponding to claim names 2542 intentionally coincide with the CWT claim name mappings from 2543 [RFC8392]. 2545 8.13. JSON Web Token Claims 2547 This specification registers the following new claims in the JSON Web 2548 Token (JWT) registry of JSON Web Token Claims 2549 [IANA.JsonWebTokenClaims]: 2551 o Claim Name: "ace_profile" 2552 o Claim Description: The ACE profile a token is supposed to be used 2553 with. 2554 o Change Controller: IESG 2555 o Reference: Section 5.10 of [this document] 2557 o Claim Name: "cnonce" 2558 o Claim Description: "client-nonce". A nonce previously provided to 2559 the AS by the RS via the client. Used to verify token freshness 2560 when the RS cannot synchronize its clock with the AS. 2561 o Change Controller: IESG 2562 o Reference: Section 5.10 of [this document] 2564 o Claim Name: "exi" 2565 o Claim Description: "Expires in". Lifetime of the token in seconds 2566 from the time the RS first sees it. Used to implement a weaker 2567 from of token expiration for devices that cannot synchronize their 2568 internal clocks. 2569 o Change Controller: IESG 2570 o Reference: Section 5.10.3 of [this document] 2572 8.14. CBOR Web Token Claims 2574 This specification registers the following new claims in the "CBOR 2575 Web Token (CWT) Claims" registry [IANA.CborWebTokenClaims]. 2577 o Claim Name: "ace_profile" 2578 o Claim Description: The ACE profile a token is supposed to be used 2579 with. 2580 o JWT Claim Name: ace_profile 2581 o Claim Key: TBD (suggested: 38) 2582 o Claim Value Type(s): integer 2583 o Change Controller: IESG 2584 o Specification Document(s): Section 5.10 of [this document] 2586 o Claim Name: "cnonce" 2587 o Claim Description: The client-nonce sent to the AS by the RS via 2588 the client. 2589 o JWT Claim Name: cnonce 2590 o Claim Key: TBD (suggested: 39) 2591 o Claim Value Type(s): byte string 2592 o Change Controller: IESG 2593 o Specification Document(s): Section 5.10 of [this document] 2595 o Claim Name: "exi" 2596 o Claim Description: The expiration time of a token measured from 2597 when it was received at the RS in seconds. 2598 o JWT Claim Name: exi 2599 o Claim Key: TBD (suggested: 40) 2600 o Claim Value Type(s): integer 2601 o Change Controller: IESG 2602 o Specification Document(s): Section 5.10.3 of [this document] 2604 o Claim Name: "scope" 2605 o Claim Description: The scope of an access token as defined in 2606 [RFC6749]. 2607 o JWT Claim Name: scope 2608 o Claim Key: TBD (suggested: 9) 2609 o Claim Value Type(s): byte string or text string 2610 o Change Controller: IESG 2611 o Specification Document(s): Section 4.2 of [RFC8693] 2613 8.15. Media Type Registrations 2615 This specification registers the 'application/ace+cbor' media type 2616 for messages of the protocols defined in this document carrying 2617 parameters encoded in CBOR. This registration follows the procedures 2618 specified in [RFC6838]. 2620 Type name: application 2622 Subtype name: ace+cbor 2624 Required parameters: N/A 2626 Optional parameters: N/A 2628 Encoding considerations: Must be encoded as CBOR map containing the 2629 protocol parameters defined in [this document]. 2631 Security considerations: See Section 6 of [this document] 2633 Interoperability considerations: N/A 2635 Published specification: [this document] 2637 Applications that use this media type: The type is used by 2638 authorization servers, clients and resource servers that support the 2639 ACE framework as specified in [this document]. 2641 Fragment identifier considerations: N/A 2643 Additional information: N/A 2645 Person & email address to contact for further information: 2646 2648 Intended usage: COMMON 2650 Restrictions on usage: none 2652 Author: Ludwig Seitz 2654 Change controller: IESG 2656 8.16. CoAP Content-Format Registry 2658 This specification registers the following entry to the "CoAP 2659 Content-Formats" registry: 2661 Media Type: application/ace+cbor 2663 Encoding: - 2665 ID: TBD (suggested: 19) 2667 Reference: [this document] 2669 8.17. Expert Review Instructions 2671 All of the IANA registries established in this document are defined 2672 to use a registration policy of Expert Review. This section gives 2673 some general guidelines for what the experts should be looking for, 2674 but they are being designated as experts for a reason, so they should 2675 be given substantial latitude. 2677 Expert reviewers should take into consideration the following points: 2679 o Point squatting should be discouraged. Reviewers are encouraged 2680 to get sufficient information for registration requests to ensure 2681 that the usage is not going to duplicate one that is already 2682 registered, and that the point is likely to be used in 2683 deployments. The zones tagged as private use are intended for 2684 testing purposes and closed environments; code points in other 2685 ranges should not be assigned for testing. 2686 o Specifications are needed for the first-come, first-serve range if 2687 they are expected to be used outside of closed environments in an 2688 interoperable way. When specifications are not provided, the 2689 description provided needs to have sufficient information to 2690 identify what the point is being used for. 2691 o Experts should take into account the expected usage of fields when 2692 approving point assignment. The fact that there is a range for 2693 standards track documents does not mean that a standards track 2694 document cannot have points assigned outside of that range. The 2695 length of the encoded value should be weighed against how many 2696 code points of that length are left, the size of device it will be 2697 used on. 2698 o Since a high degree of overlap is expected between these 2699 registries and the contents of the OAuth parameters 2700 [IANA.OAuthParameters] registries, experts should require new 2701 registrations to maintain alignment with parameters from OAuth 2702 that have comparable functionality. Deviation from this alignment 2703 should only be allowed if there are functional differences, that 2704 are motivated by the use case and that cannot be easily or 2705 efficiently addressed by comparable OAuth parameters. 2707 9. Acknowledgments 2709 This document is a product of the ACE working group of the IETF. 2711 Thanks to Eve Maler for her contributions to the use of OAuth 2.0 and 2712 UMA in IoT scenarios, Robert Taylor for his discussion input, and 2713 Malisa Vucinic for his input on the predecessors of this proposal. 2715 Thanks to the authors of draft-ietf-oauth-pop-key-distribution, from 2716 where large parts of the security considerations where copied. 2718 Thanks to Stefanie Gerdes, Olaf Bergmann, and Carsten Bormann for 2719 contributing their work on AS discovery from draft-gerdes-ace-dcaf- 2720 authorize (see Section 5.1). 2722 Thanks to Jim Schaad and Mike Jones for their comprehensive reviews. 2724 Thanks to Benjamin Kaduk for his input on various questions related 2725 to this work. 2727 Thanks to Cigdem Sengul for some very useful review comments. 2729 Thanks to Carsten Bormann for contributing the text for the CoRE 2730 Resource Type registry. 2732 Ludwig Seitz and Goeran Selander worked on this document as part of 2733 the CelticPlus project CyberWI, with funding from Vinnova. Ludwig 2734 Seitz was also received further funding for this work by Vinnova in 2735 the context of the CelticNext project Critisec. 2737 10. References 2739 10.1. Normative References 2741 [I-D.ietf-ace-oauth-params] 2742 Seitz, L., "Additional OAuth Parameters for Authorization 2743 in Constrained Environments (ACE)", draft-ietf-ace-oauth- 2744 params-13 (work in progress), April 2020. 2746 [IANA.CborWebTokenClaims] 2747 IANA, "CBOR Web Token (CWT) Claims", 2748 . 2751 [IANA.CoreParameters] 2752 IANA, "Constrained RESTful Environments (CoRE) 2753 Parameters", . 2756 [IANA.JsonWebTokenClaims] 2757 IANA, "JSON Web Token Claims", 2758 . 2760 [IANA.OAuthAccessTokenTypes] 2761 IANA, "OAuth Access Token Types", 2762 . 2765 [IANA.OAuthExtensionsErrorRegistry] 2766 IANA, "OAuth Extensions Error Registry", 2767 . 2770 [IANA.OAuthParameters] 2771 IANA, "OAuth Parameters", 2772 . 2775 [IANA.TokenIntrospectionResponse] 2776 IANA, "OAuth Token Introspection Response", 2777 . 2780 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2781 Requirement Levels", BCP 14, RFC 2119, 2782 DOI 10.17487/RFC2119, March 1997, 2783 . 2785 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2786 Resource Identifier (URI): Generic Syntax", STD 66, 2787 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2788 . 2790 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 2791 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 2792 January 2012, . 2794 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 2795 RFC 6749, DOI 10.17487/RFC6749, October 2012, 2796 . 2798 [RFC6750] Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 2799 Framework: Bearer Token Usage", RFC 6750, 2800 DOI 10.17487/RFC6750, October 2012, 2801 . 2803 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 2804 Specifications and Registration Procedures", BCP 13, 2805 RFC 6838, DOI 10.17487/RFC6838, January 2013, 2806 . 2808 [RFC6920] Farrell, S., Kutscher, D., Dannewitz, C., Ohlman, B., 2809 Keranen, A., and P. Hallam-Baker, "Naming Things with 2810 Hashes", RFC 6920, DOI 10.17487/RFC6920, April 2013, 2811 . 2813 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2814 Application Protocol (CoAP)", RFC 7252, 2815 DOI 10.17487/RFC7252, June 2014, 2816 . 2818 [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 2819 (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, 2820 . 2822 [RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection", 2823 RFC 7662, DOI 10.17487/RFC7662, October 2015, 2824 . 2826 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2827 Writing an IANA Considerations Section in RFCs", BCP 26, 2828 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2829 . 2831 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 2832 RFC 8152, DOI 10.17487/RFC8152, July 2017, 2833 . 2835 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2836 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2837 May 2017, . 2839 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 2840 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 2841 May 2018, . 2843 [RFC8693] Jones, M., Nadalin, A., Campbell, B., Ed., Bradley, J., 2844 and C. Mortimore, "OAuth 2.0 Token Exchange", RFC 8693, 2845 DOI 10.17487/RFC8693, January 2020, 2846 . 2848 [RFC8747] Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. 2849 Tschofenig, "Proof-of-Possession Key Semantics for CBOR 2850 Web Tokens (CWTs)", RFC 8747, DOI 10.17487/RFC8747, March 2851 2020, . 2853 [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object 2854 Representation (CBOR)", STD 94, RFC 8949, 2855 DOI 10.17487/RFC8949, December 2020, 2856 . 2858 10.2. Informative References 2860 [BLE] Bluetooth SIG, "Bluetooth Core Specification v5.1", 2861 Section 4.4, January 2019, 2862 . 2865 [I-D.erdtman-ace-rpcc] 2866 Seitz, L. and S. Erdtman, "Raw-Public-Key and Pre-Shared- 2867 Key as OAuth client credentials", draft-erdtman-ace- 2868 rpcc-02 (work in progress), October 2017. 2870 [I-D.ietf-quic-transport] 2871 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 2872 and Secure Transport", draft-ietf-quic-transport-34 (work 2873 in progress), January 2021. 2875 [I-D.ietf-tls-dtls13] 2876 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 2877 Datagram Transport Layer Security (DTLS) Protocol Version 2878 1.3", draft-ietf-tls-dtls13-40 (work in progress), January 2879 2021. 2881 [Margi10impact] 2882 Margi, C., de Oliveira, B., de Sousa, G., Simplicio Jr, 2883 M., Barreto, P., Carvalho, T., Naeslund, M., and R. Gold, 2884 "Impact of Operating Systems on Wireless Sensor Networks 2885 (Security) Applications and Testbeds", Proceedings of 2886 the 19th International Conference on Computer 2887 Communications and Networks (ICCCN), August 2010. 2889 [MQTT5.0] Banks, A., Briggs, E., Borgendale, K., and R. Gupta, "MQTT 2890 Version 5.0", OASIS Standard, March 2019, 2891 . 2894 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2895 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 2896 . 2898 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 2899 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 2900 . 2902 [RFC6819] Lodderstedt, T., Ed., McGloin, M., and P. Hunt, "OAuth 2.0 2903 Threat Model and Security Considerations", RFC 6819, 2904 DOI 10.17487/RFC6819, January 2013, 2905 . 2907 [RFC7009] Lodderstedt, T., Ed., Dronia, S., and M. Scurtescu, "OAuth 2908 2.0 Token Revocation", RFC 7009, DOI 10.17487/RFC7009, 2909 August 2013, . 2911 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2912 Constrained-Node Networks", RFC 7228, 2913 DOI 10.17487/RFC7228, May 2014, 2914 . 2916 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2917 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 2918 DOI 10.17487/RFC7231, June 2014, 2919 . 2921 [RFC7521] Campbell, B., Mortimore, C., Jones, M., and Y. Goland, 2922 "Assertion Framework for OAuth 2.0 Client Authentication 2923 and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521, 2924 May 2015, . 2926 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 2927 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 2928 DOI 10.17487/RFC7540, May 2015, 2929 . 2931 [RFC7591] Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and 2932 P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol", 2933 RFC 7591, DOI 10.17487/RFC7591, July 2015, 2934 . 2936 [RFC7641] Hartke, K., "Observing Resources in the Constrained 2937 Application Protocol (CoAP)", RFC 7641, 2938 DOI 10.17487/RFC7641, September 2015, 2939 . 2941 [RFC7744] Seitz, L., Ed., Gerdes, S., Ed., Selander, G., Mani, M., 2942 and S. Kumar, "Use Cases for Authentication and 2943 Authorization in Constrained Environments", RFC 7744, 2944 DOI 10.17487/RFC7744, January 2016, 2945 . 2947 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 2948 the Constrained Application Protocol (CoAP)", RFC 7959, 2949 DOI 10.17487/RFC7959, August 2016, 2950 . 2952 [RFC8252] Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps", 2953 BCP 212, RFC 8252, DOI 10.17487/RFC8252, October 2017, 2954 . 2956 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2957 Interchange Format", STD 90, RFC 8259, 2958 DOI 10.17487/RFC8259, December 2017, 2959 . 2961 [RFC8414] Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0 2962 Authorization Server Metadata", RFC 8414, 2963 DOI 10.17487/RFC8414, June 2018, 2964 . 2966 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 2967 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 2968 . 2970 [RFC8516] Keranen, A., ""Too Many Requests" Response Code for the 2971 Constrained Application Protocol", RFC 8516, 2972 DOI 10.17487/RFC8516, January 2019, 2973 . 2975 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 2976 "Object Security for Constrained RESTful Environments 2977 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 2978 . 2980 [RFC8628] Denniss, W., Bradley, J., Jones, M., and H. Tschofenig, 2981 "OAuth 2.0 Device Authorization Grant", RFC 8628, 2982 DOI 10.17487/RFC8628, August 2019, 2983 . 2985 Appendix A. Design Justification 2987 This section provides further insight into the design decisions of 2988 the solution documented in this document. Section 3 lists several 2989 building blocks and briefly summarizes their importance. The 2990 justification for offering some of those building blocks, as opposed 2991 to using OAuth 2.0 as is, is given below. 2993 Common IoT constraints are: 2995 Low Power Radio: 2997 Many IoT devices are equipped with a small battery which needs to 2998 last for a long time. For many constrained wireless devices, the 2999 highest energy cost is associated to transmitting or receiving 3000 messages (roughly by a factor of 10 compared to AES) 3001 [Margi10impact]. It is therefore important to keep the total 3002 communication overhead low, including minimizing the number and 3003 size of messages sent and received, which has an impact of choice 3004 on the message format and protocol. By using CoAP over UDP and 3005 CBOR encoded messages, some of these aspects are addressed. 3006 Security protocols contribute to the communication overhead and 3007 can, in some cases, be optimized. For example, authentication and 3008 key establishment may, in certain cases where security 3009 requirements allow, be replaced by provisioning of security 3010 context by a trusted third party, using transport or application 3011 layer security. 3013 Low CPU Speed: 3015 Some IoT devices are equipped with processors that are 3016 significantly slower than those found in most current devices on 3017 the Internet. This typically has implications on what timely 3018 cryptographic operations a device is capable of performing, which 3019 in turn impacts, e.g., protocol latency. Symmetric key 3020 cryptography may be used instead of the computationally more 3021 expensive public key cryptography where the security requirements 3022 so allow, but this may also require support for trusted-third- 3023 party-assisted secret key establishment using transport- or 3024 application-layer security. 3025 Small Amount of Memory: 3027 Microcontrollers embedded in IoT devices are often equipped with 3028 only a small amount of RAM and flash memory, which places 3029 limitations on what kind of processing can be performed and how 3030 much code can be put on those devices. To reduce code size, fewer 3031 and smaller protocol implementations can be put on the firmware of 3032 such a device. In this case, CoAP may be used instead of HTTP, 3033 symmetric-key cryptography instead of public-key cryptography, and 3034 CBOR instead of JSON. An authentication and key establishment 3035 protocol, e.g., the DTLS handshake, in comparison with assisted 3036 key establishment, also has an impact on memory and code 3037 footprints. 3039 User Interface Limitations: 3041 Protecting access to resources is both an important security as 3042 well as privacy feature. End users and enterprise customers may 3043 not want to give access to the data collected by their IoT device 3044 or to functions it may offer to third parties. Since the 3045 classical approach of requesting permissions from end users via a 3046 rich user interface does not work in many IoT deployment 3047 scenarios, these functions need to be delegated to user-controlled 3048 devices that are better suitable for such tasks, such as smart 3049 phones and tablets. 3051 Communication Constraints: 3053 In certain constrained settings an IoT device may not be able to 3054 communicate with a given device at all times. Devices may be 3055 sleeping, or just disconnected from the Internet because of 3056 general lack of connectivity in the area, for cost reasons, or for 3057 security reasons, e.g., to avoid an entry point for Denial-of- 3058 Service attacks. 3060 The communication interactions this framework builds upon (as 3061 shown graphically in Figure 1) may be accomplished using a variety 3062 of different protocols, and not all parts of the message flow are 3063 used in all applications due to the communication constraints. 3064 Deployments making use of CoAP are expected, but this framework is 3065 not limited to them. Other protocols such as HTTP, or even 3066 protocols such as Bluetooth Smart communication that do not 3067 necessarily use IP, could also be used. The latter raises the 3068 need for application layer security over the various interfaces. 3070 In the light of these constraints we have made the following design 3071 decisions: 3073 CBOR, COSE, CWT: 3075 This framework RECOMMENDS the use of CBOR [RFC8949] as data 3076 format. Where CBOR data needs to be protected, the use of COSE 3077 [RFC8152] is RECOMMENDED. Furthermore, where self-contained 3078 tokens are needed, this framework RECOMMENDS the use of CWT 3079 [RFC8392]. These measures aim at reducing the size of messages 3080 sent over the wire, the RAM size of data objects that need to be 3081 kept in memory and the size of libraries that devices need to 3082 support. 3084 CoAP: 3086 This framework RECOMMENDS the use of CoAP [RFC7252] instead of 3087 HTTP. This does not preclude the use of other protocols 3088 specifically aimed at constrained devices, like, e.g., Bluetooth 3089 Low Energy (see Section 3.2). This aims again at reducing the 3090 size of messages sent over the wire, the RAM size of data objects 3091 that need to be kept in memory and the size of libraries that 3092 devices need to support. 3094 Access Information: 3096 This framework defines the name "Access Information" for data 3097 concerning the RS that the AS returns to the client in an access 3098 token response (see Section 5.8.2). This aims at enabling 3099 scenarios where a powerful client, supporting multiple profiles, 3100 needs to interact with an RS for which it does not know the 3101 supported profiles and the raw public key. 3103 Proof-of-Possession: 3105 This framework makes use of proof-of-possession tokens, using the 3106 "cnf" claim [RFC8747]. A request parameter "cnf" and a Response 3107 parameter "cnf", both having a value space semantically and 3108 syntactically identical to the "cnf" claim, are defined for the 3109 token endpoint, to allow requesting and stating confirmation keys. 3110 This aims at making token theft harder. Token theft is 3111 specifically relevant in constrained use cases, as communication 3112 often passes through middle-boxes, which could be able to steal 3113 bearer tokens and use them to gain unauthorized access. 3115 Authz-Info endpoint: 3117 This framework introduces a new way of providing access tokens to 3118 an RS by exposing a authz-info endpoint, to which access tokens 3119 can be POSTed. This aims at reducing the size of the request 3120 message and the code complexity at the RS. The size of the 3121 request message is problematic, since many constrained protocols 3122 have severe message size limitations at the physical layer (e.g., 3123 in the order of 100 bytes). This means that larger packets get 3124 fragmented, which in turn combines badly with the high rate of 3125 packet loss, and the need to retransmit the whole message if one 3126 packet gets lost. Thus separating sending of the request and 3127 sending of the access tokens helps to reduce fragmentation. 3129 Client Credentials Grant: 3131 This framework RECOMMENDS the use of the client credentials grant 3132 for machine-to-machine communication use cases, where manual 3133 intervention of the resource owner to produce a grant token is not 3134 feasible. The intention is that the resource owner would instead 3135 pre-arrange authorization with the AS, based on the client's own 3136 credentials. The client can then (without manual intervention) 3137 obtain access tokens from the AS. 3139 Introspection: 3141 This framework RECOMMENDS the use of access token introspection in 3142 cases where the client is constrained in a way that it can not 3143 easily obtain new access tokens (i.e. it has connectivity issues 3144 that prevent it from communicating with the AS). In that case 3145 this framework RECOMMENDS the use of a long-term token, that could 3146 be a simple reference. The RS is assumed to be able to 3147 communicate with the AS, and can therefore perform introspection, 3148 in order to learn the claims associated with the token reference. 3149 The advantage of such an approach is that the resource owner can 3150 change the claims associated to the token reference without having 3151 to be in contact with the client, thus granting or revoking access 3152 rights. 3154 Appendix B. Roles and Responsibilities 3156 Resource Owner 3158 * Make sure that the RS is registered at the AS. This includes 3159 making known to the AS which profiles, token_type, scopes, and 3160 key types (symmetric/asymmetric) the RS supports. Also making 3161 it known to the AS which audience(s) the RS identifies itself 3162 with. 3163 * Make sure that clients can discover the AS that is in charge of 3164 the RS. 3165 * If the client-credentials grant is used, make sure that the AS 3166 has the necessary, up-to-date, access control policies for the 3167 RS. 3169 Requesting Party 3171 * Make sure that the client is provisioned the necessary 3172 credentials to authenticate to the AS. 3173 * Make sure that the client is configured to follow the security 3174 requirements of the Requesting Party when issuing requests 3175 (e.g., minimum communication security requirements, trust 3176 anchors). 3177 * Register the client at the AS. This includes making known to 3178 the AS which profiles, token_types, and key types (symmetric/ 3179 asymmetric) the client. 3181 Authorization Server 3183 * Register the RS and manage corresponding security contexts. 3184 * Register clients and authentication credentials. 3185 * Allow Resource Owners to configure and update access control 3186 policies related to their registered RSs. 3187 * Expose the token endpoint to allow clients to request tokens. 3188 * Authenticate clients that wish to request a token. 3189 * Process a token request using the authorization policies 3190 configured for the RS. 3191 * Optionally: Expose the introspection endpoint that allows RS's 3192 to submit token introspection requests. 3193 * If providing an introspection endpoint: Authenticate RSs that 3194 wish to get an introspection response. 3195 * If providing an introspection endpoint: Process token 3196 introspection requests. 3197 * Optionally: Handle token revocation. 3198 * Optionally: Provide discovery metadata. See [RFC8414] 3199 * Optionally: Handle refresh tokens. 3201 Client 3203 * Discover the AS in charge of the RS that is to be targeted with 3204 a request. 3205 * Submit the token request (see step (A) of Figure 1). 3207 + Authenticate to the AS. 3208 + Optionally (if not pre-configured): Specify which RS, which 3209 resource(s), and which action(s) the request(s) will target. 3210 + If raw public keys (rpk) or certificates are used, make sure 3211 the AS has the right rpk or certificate for this client. 3212 * Process the access token and Access Information (see step (B) 3213 of Figure 1). 3215 + Check that the Access Information provides the necessary 3216 security parameters (e.g., PoP key, information on 3217 communication security protocols supported by the RS). 3218 + Safely store the proof-of-possession key. 3219 + If provided by the AS: Safely store the refresh token. 3220 * Send the token and request to the RS (see step (C) of 3221 Figure 1). 3223 + Authenticate towards the RS (this could coincide with the 3224 proof of possession process). 3225 + Transmit the token as specified by the AS (default is to the 3226 authz-info endpoint, alternative options are specified by 3227 profiles). 3228 + Perform the proof-of-possession procedure as specified by 3229 the profile in use (this may already have been taken care of 3230 through the authentication procedure). 3231 * Process the RS response (see step (F) of Figure 1) of the RS. 3233 Resource Server 3235 * Expose a way to submit access tokens. By default this is the 3236 authz-info endpoint. 3237 * Process an access token. 3239 + Verify the token is from a recognized AS. 3240 + Check the token's integrity. 3241 + Verify that the token applies to this RS. 3242 + Check that the token has not expired (if the token provides 3243 expiration information). 3244 + Store the token so that it can be retrieved in the context 3245 of a matching request. 3247 Note: The order proposed here is not normative, any process 3248 that arrives at an equivalent result can be used. A noteworthy 3249 consideration is whether one can use cheap operations early on 3250 to quickly discard non-applicable or invalid tokens, before 3251 performing expensive cryptographic operations (e.g. doing an 3252 expiration check before verifying a signature). 3254 * Process a request. 3256 + Set up communication security with the client. 3257 + Authenticate the client. 3258 + Match the client against existing tokens. 3259 + Check that tokens belonging to the client actually authorize 3260 the requested action. 3261 + Optionally: Check that the matching tokens are still valid, 3262 using introspection (if this is possible.) 3263 * Send a response following the agreed upon communication 3264 security mechanism(s). 3265 * Safely store credentials such as raw public keys for 3266 authentication or proof-of-possession keys linked to access 3267 tokens. 3269 Appendix C. Requirements on Profiles 3271 This section lists the requirements on profiles of this framework, 3272 for the convenience of profile designers. 3274 o Optionally define new methods for the client to discover the 3275 necessary permissions and AS for accessing a resource, different 3276 from the one proposed in Section 5.1. Section 4 3277 o Optionally specify new grant types. Section 5.4 3278 o Optionally define the use of client certificates as client 3279 credential type. Section 5.5 3280 o Specify the communication protocol the client and RS the must use 3281 (e.g., CoAP). Section 5 and Section 5.8.4.3 3282 o Specify the security protocol the client and RS must use to 3283 protect their communication (e.g., OSCORE or DTLS). This must 3284 provide encryption, integrity and replay protection. 3285 Section 5.8.4.3 3286 o Specify how the client and the RS mutually authenticate. 3287 Section 4 3288 o Specify the proof-of-possession protocol(s) and how to select one, 3289 if several are available. Also specify which key types (e.g., 3290 symmetric/asymmetric) are supported by a specific proof-of- 3291 possession protocol. Section 5.8.4.2 3292 o Specify a unique ace_profile identifier. Section 5.8.4.3 3293 o If introspection is supported: Specify the communication and 3294 security protocol for introspection. Section 5.9 3295 o Specify the communication and security protocol for interactions 3296 between client and AS. This must provide encryption, integrity 3297 protection, replay protection and a binding between requests and 3298 responses. Section 5 and Section 5.8 3299 o Specify how/if the authz-info endpoint is protected, including how 3300 error responses are protected. Section 5.10.1 3301 o Optionally define other methods of token transport than the authz- 3302 info endpoint. Section 5.10.1 3304 Appendix D. Assumptions on AS knowledge about C and RS 3306 This section lists the assumptions on what an AS should know about a 3307 client and an RS in order to be able to respond to requests to the 3308 token and introspection endpoints. How this information is 3309 established is out of scope for this document. 3311 o The identifier of the client or RS. 3312 o The profiles that the client or RS supports. 3313 o The scopes that the RS supports. 3314 o The audiences that the RS identifies with. 3315 o The key types (e.g., pre-shared symmetric key, raw public key, key 3316 length, other key parameters) that the client or RS supports. 3318 o The types of access tokens the RS supports (e.g., CWT). 3319 o If the RS supports CWTs, the COSE parameters for the crypto 3320 wrapper (e.g., algorithm, key-wrap algorithm, key-length) that the 3321 RS supports. 3322 o The expiration time for access tokens issued to this RS (unless 3323 the RS accepts a default time chosen by the AS). 3324 o The symmetric key shared between client and AS (if any). 3325 o The symmetric key shared between RS and AS (if any). 3326 o The raw public key of the client or RS (if any). 3327 o Whether the RS has synchronized time (and thus is able to use the 3328 'exp' claim) or not. 3330 Appendix E. Deployment Examples 3332 There is a large variety of IoT deployments, as is indicated in 3333 Appendix A, and this section highlights a few common variants. This 3334 section is not normative but illustrates how the framework can be 3335 applied. 3337 For each of the deployment variants, there are a number of possible 3338 security setups between clients, resource servers and authorization 3339 servers. The main focus in the following subsections is on how 3340 authorization of a client request for a resource hosted by an RS is 3341 performed. This requires the security of the requests and responses 3342 between the clients and the RS to be considered. 3344 Note: CBOR diagnostic notation is used for examples of requests and 3345 responses. 3347 E.1. Local Token Validation 3349 In this scenario, the case where the resource server is offline is 3350 considered, i.e., it is not connected to the AS at the time of the 3351 access request. This access procedure involves steps A, B, C, and F 3352 of Figure 1. 3354 Since the resource server must be able to verify the access token 3355 locally, self-contained access tokens must be used. 3357 This example shows the interactions between a client, the 3358 authorization server and a temperature sensor acting as a resource 3359 server. Message exchanges A and B are shown in Figure 17. 3361 A: The client first generates a public-private key pair used for 3362 communication security with the RS. 3363 The client sends a CoAP POST request to the token endpoint at the 3364 AS. The security of this request can be transport or application 3365 layer. It is up the the communication security profile to define. 3367 In the example it is assumed that both client and AS have 3368 performed mutual authentication e.g. via DTLS. The request 3369 contains the public key of the client and the Audience parameter 3370 set to "tempSensorInLivingRoom", a value that the temperature 3371 sensor identifies itself with. The AS evaluates the request and 3372 authorizes the client to access the resource. 3373 B: The AS responds with a 2.05 Content response containing the 3374 Access Information, including the access token. The PoP access 3375 token contains the public key of the client, and the Access 3376 Information contains the public key of the RS. For communication 3377 security this example uses DTLS RawPublicKey between the client 3378 and the RS. The issued token will have a short validity time, 3379 i.e., "exp" close to "iat", in order to mitigate attacks using 3380 stolen client credentials. The token includes the claim such as 3381 "scope" with the authorized access that an owner of the 3382 temperature device can enjoy. In this example, the "scope" claim, 3383 issued by the AS, informs the RS that the owner of the token, that 3384 can prove the possession of a key is authorized to make a GET 3385 request against the /temperature resource and a POST request on 3386 the /firmware resource. Note that the syntax and semantics of the 3387 scope claim are application specific. 3388 Note: In this example it is assumed that the client knows what 3389 resource it wants to access, and is therefore able to request 3390 specific audience and scope claims for the access token. 3392 Authorization 3393 Client Server 3394 | | 3395 |<=======>| DTLS Connection Establishment 3396 | | and mutual authentication 3397 | | 3398 A: +-------->| Header: POST (Code=0.02) 3399 | POST | Uri-Path:"token" 3400 | | Content-Format: application/ace+cbor 3401 | | Payload: 3402 | | 3403 B: |<--------+ Header: 2.05 Content 3404 | 2.05 | Content-Format: application/ace+cbor 3405 | | Payload: 3406 | | 3408 Figure 17: Token Request and Response Using Client Credentials. 3410 The information contained in the Request-Payload and the Response- 3411 Payload is shown in Figure 18 Note that the parameter "rs_cnf" from 3412 [I-D.ietf-ace-oauth-params] is used to inform the client about the 3413 resource server's public key. 3415 Request-Payload : 3416 { 3417 "audience" : "tempSensorInLivingRoom", 3418 "client_id" : "myclient", 3419 "req_cnf" : { 3420 "COSE_Key" : { 3421 "kid" : b64'1Bg8vub9tLe1gHMzV76e8', 3422 "kty" : "EC", 3423 "crv" : "P-256", 3424 "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', 3425 "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' 3426 } 3427 } 3428 } 3430 Response-Payload : 3431 { 3432 "access_token" : b64'0INDoQEKoQVNKkXfb7xaWqMTf6 ...', 3433 "rs_cnf" : { 3434 "COSE_Key" : { 3435 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', 3436 "kty" : "EC", 3437 "crv" : "P-256", 3438 "x" : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4', 3439 "y" : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM' 3440 } 3441 } 3442 } 3444 Figure 18: Request and Response Payload Details. 3446 The content of the access token is shown in Figure 19. 3448 { 3449 "aud" : "tempSensorInLivingRoom", 3450 "iat" : "1563451500", 3451 "exp" : "1563453000", 3452 "scope" : "temperature_g firmware_p", 3453 "cnf" : { 3454 "COSE_Key" : { 3455 "kid" : b64'1Bg8vub9tLe1gHMzV76e8', 3456 "kty" : "EC", 3457 "crv" : "P-256", 3458 "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', 3459 "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' 3460 } 3461 } 3462 } 3464 Figure 19: Access Token including Public Key of the Client. 3466 Messages C and F are shown in Figure 20 - Figure 21. 3468 C: The client then sends the PoP access token to the authz-info 3469 endpoint at the RS. This is a plain CoAP POST request, i.e., no 3470 transport or application layer security is used between client and 3471 RS since the token is integrity protected between the AS and RS. 3472 The RS verifies that the PoP access token was created by a known 3473 and trusted AS, that it applies to this RS, and that it is valid. 3474 The RS caches the security context together with authorization 3475 information about this client contained in the PoP access token. 3477 Resource 3478 Client Server 3479 | | 3480 C: +-------->| Header: POST (Code=0.02) 3481 | POST | Uri-Path:"authz-info" 3482 | | Payload: 0INDoQEKoQVN ... 3483 | | 3484 |<--------+ Header: 2.04 Changed 3485 | 2.04 | 3486 | | 3488 Figure 20: Access Token provisioning to RS 3489 The client and the RS runs the DTLS handshake using the raw public 3490 keys established in step B and C. 3491 The client sends a CoAP GET request to /temperature on RS over 3492 DTLS. The RS verifies that the request is authorized, based on 3493 previously established security context. 3495 F: The RS responds over the same DTLS channel with a CoAP 2.05 3496 Content response, containing a resource representation as payload. 3498 Resource 3499 Client Server 3500 | | 3501 |<=======>| DTLS Connection Establishment 3502 | | using Raw Public Keys 3503 | | 3504 +-------->| Header: GET (Code=0.01) 3505 | GET | Uri-Path: "temperature" 3506 | | 3507 | | 3508 | | 3509 F: |<--------+ Header: 2.05 Content 3510 | 2.05 | Payload: 3511 | | 3513 Figure 21: Resource Request and Response protected by DTLS. 3515 E.2. Introspection Aided Token Validation 3517 In this deployment scenario it is assumed that a client is not able 3518 to access the AS at the time of the access request, whereas the RS is 3519 assumed to be connected to the back-end infrastructure. Thus the RS 3520 can make use of token introspection. This access procedure involves 3521 steps A-F of Figure 1, but assumes steps A and B have been carried 3522 out during a phase when the client had connectivity to AS. 3524 Since the client is assumed to be offline, at least for a certain 3525 period of time, a pre-provisioned access token has to be long-lived. 3526 Since the client is constrained, the token will not be self contained 3527 (i.e. not a CWT) but instead just a reference. The resource server 3528 uses its connectivity to learn about the claims associated to the 3529 access token by using introspection, which is shown in the example 3530 below. 3532 In the example interactions between an offline client (key fob), an 3533 RS (online lock), and an AS is shown. It is assumed that there is a 3534 provisioning step where the client has access to the AS. This 3535 corresponds to message exchanges A and B which are shown in 3536 Figure 22. 3538 Authorization consent from the resource owner can be pre-configured, 3539 but it can also be provided via an interactive flow with the resource 3540 owner. An example of this for the key fob case could be that the 3541 resource owner has a connected car, he buys a generic key that he 3542 wants to use with the car. To authorize the key fob he connects it 3543 to his computer that then provides the UI for the device. After that 3544 OAuth 2.0 implicit flow can used to authorize the key for his car at 3545 the the car manufacturers AS. 3547 Note: In this example the client does not know the exact door it will 3548 be used to access since the token request is not send at the time of 3549 access. So the scope and audience parameters are set quite wide to 3550 start with, while tailored values narrowing down the claims to the 3551 specific RS being accessed can be provided to that RS during an 3552 introspection step. 3554 A: The client sends a CoAP POST request to the token endpoint at 3555 AS. The request contains the Audience parameter set to "PACS1337" 3556 (PACS, Physical Access System), a value the that identifies the 3557 physical access control system to which the individual doors are 3558 connected. The AS generates an access token as an opaque string, 3559 which it can match to the specific client and the targeted 3560 audience. It furthermore generates a symmetric proof-of- 3561 possession key. The communication security and authentication 3562 between client and AS is assumed to have been provided at 3563 transport layer (e.g. via DTLS) using a pre-shared security 3564 context (psk, rpk or certificate). 3565 B: The AS responds with a CoAP 2.05 Content response, containing 3566 as playload the Access Information, including the access token and 3567 the symmetric proof-of-possession key. Communication security 3568 between C and RS will be DTLS and PreSharedKey. The PoP key is 3569 used as the PreSharedKey. 3571 Note: In this example we are using a symmetric key for a multi-RS 3572 audience, which is not recommended normally (see Section 6.9). 3573 However in this case the risk is deemed to be acceptable, since all 3574 the doors are part of the same physical access control system, and 3575 therefore the risk of a malicious RS impersonating the client towards 3576 another RS is low. 3578 Authorization 3579 Client Server 3580 | | 3581 |<=======>| DTLS Connection Establishment 3582 | | and mutual authentication 3583 | | 3584 A: +-------->| Header: POST (Code=0.02) 3585 | POST | Uri-Path:"token" 3586 | | Content-Format: application/ace+cbor 3587 | | Payload: 3588 | | 3589 B: |<--------+ Header: 2.05 Content 3590 | | Content-Format: application/ace+cbor 3591 | 2.05 | Payload: 3592 | | 3594 Figure 22: Token Request and Response using Client Credentials. 3596 The information contained in the Request-Payload and the Response- 3597 Payload is shown in Figure 23. 3599 Request-Payload: 3600 { 3601 "client_id" : "keyfob", 3602 "audience" : "PACS1337" 3603 } 3605 Response-Payload: 3606 { 3607 "access_token" : b64'VGVzdCB0b2tlbg==', 3608 "cnf" : { 3609 "COSE_Key" : { 3610 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', 3611 "kty" : "oct", 3612 "alg" : "HS256", 3613 "k": b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE' 3614 } 3615 } 3616 } 3618 Figure 23: Request and Response Payload for C offline 3620 The access token in this case is just an opaque byte string 3621 referencing the authorization information at the AS. 3623 C: Next, the client POSTs the access token to the authz-info 3624 endpoint in the RS. This is a plain CoAP request, i.e., no DTLS 3625 between client and RS. Since the token is an opaque string, the 3626 RS cannot verify it on its own, and thus defers to respond the 3627 client with a status code until after step E. 3628 D: The RS sends the token to the introspection endpoint on the AS 3629 using a CoAP POST request. In this example RS and AS are assumed 3630 to have performed mutual authentication using a pre shared 3631 security context (psk, rpk or certificate) with the RS acting as 3632 DTLS client. 3633 E: The AS provides the introspection response (2.05 Content) 3634 containing parameters about the token. This includes the 3635 confirmation key (cnf) parameter that allows the RS to verify the 3636 client's proof of possession in step F. Note that our example in 3637 Figure 25 assumes a pre-established key (e.g. one used by the 3638 client and the RS for a previous token) that is now only 3639 referenced by its key-identifier 'kid'. 3640 After receiving message E, the RS responds to the client's POST in 3641 step C with the CoAP response code 2.01 (Created). 3643 Resource 3644 Client Server 3645 | | 3646 C: +-------->| Header: POST (T=CON, Code=0.02) 3647 | POST | Uri-Path:"authz-info" 3648 | | Payload: b64'VGVzdCB0b2tlbg==' 3649 | | 3650 | | Authorization 3651 | | Server 3652 | | | 3653 | D: +--------->| Header: POST (Code=0.02) 3654 | | POST | Uri-Path: "introspect" 3655 | | | Content-Format: "application/ace+cbor" 3656 | | | Payload: 3657 | | | 3658 | E: |<---------+ Header: 2.05 Content 3659 | | 2.05 | Content-Format: "application/ace+cbor" 3660 | | | Payload: 3661 | | | 3662 | | 3663 |<--------+ Header: 2.01 Created 3664 | 2.01 | 3665 | | 3667 Figure 24: Token Introspection for C offline 3668 The information contained in the Request-Payload and the Response- 3669 Payload is shown in Figure 25. 3671 Request-Payload: 3672 { 3673 "token" : b64'VGVzdCB0b2tlbg==', 3674 "client_id" : "FrontDoor", 3675 } 3677 Response-Payload: 3678 { 3679 "active" : true, 3680 "aud" : "lockOfDoor4711", 3681 "scope" : "open, close", 3682 "iat" : 1563454000, 3683 "cnf" : { 3684 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk' 3685 } 3686 } 3688 Figure 25: Request and Response Payload for Introspection 3690 The client uses the symmetric PoP key to establish a DTLS 3691 PreSharedKey secure connection to the RS. The CoAP request PUT is 3692 sent to the uri-path /state on the RS, changing the state of the 3693 door to locked. 3694 F: The RS responds with a appropriate over the secure DTLS 3695 channel. 3697 Resource 3698 Client Server 3699 | | 3700 |<=======>| DTLS Connection Establishment 3701 | | using Pre Shared Key 3702 | | 3703 +-------->| Header: PUT (Code=0.03) 3704 | PUT | Uri-Path: "state" 3705 | | Payload: 3706 | | 3707 F: |<--------+ Header: 2.04 Changed 3708 | 2.04 | Payload: 3709 | | 3711 Figure 26: Resource request and response protected by OSCORE 3713 Appendix F. Document Updates 3715 RFC EDITOR: PLEASE REMOVE THIS SECTION. 3717 F.1. Version -21 to 22 3719 o Provided section numbers in references to OAuth RFC. 3720 o Updated IANA mapping registries to only use "Private Use" and 3721 "Expert Review". 3722 o Made error messages optional for RS at token submission since it 3723 may not be able to send them depending on the profile. 3724 o Corrected errors in examples. 3726 F.2. Version -20 to 21 3728 o Added text about expiration of RS keys. 3730 F.3. Version -19 to 20 3732 o Replaced "req_aud" with "audience" from the OAuth token exchange 3733 draft. 3734 o Updated examples to remove unnecessary elements. 3736 F.4. Version -18 to -19 3738 o Added definition of "Authorization Information". 3739 o Explicitly state that ACE allows encoding refresh tokens in binary 3740 format in addition to strings. 3741 o Renamed "AS Information" to "AS Request Creation Hints" and added 3742 the possibility to specify req_aud and scope as hints. 3743 o Added the "kid" parameter to AS Request Creation Hints. 3744 o Added security considerations about the integrity protection of 3745 tokens with multi-RS audiences. 3746 o Renamed IANA registries mapping OAuth parameters to reflect the 3747 mapped registry. 3748 o Added JWT claim names to CWT claim registrations. 3749 o Added expert review instructions. 3750 o Updated references to TLS from 1.2 to 1.3. 3752 F.5. Version -17 to -18 3754 o Added OSCORE options in examples involving OSCORE. 3755 o Removed requirement for the client to send application/cwt, since 3756 the client has no way to know. 3757 o Clarified verification of tokens by the RS. 3758 o Added exi claim CWT registration. 3760 F.6. Version -16 to -17 3762 o Added references to (D)TLS 1.3. 3763 o Added requirement that responses are bound to requests. 3765 o Specify that grant_type is OPTIONAL in C2AS requests (as opposed 3766 to REQUIRED in OAuth). 3767 o Replaced examples with hypothetical COSE profile with OSCORE. 3768 o Added requirement for content type application/ace+cbor in error 3769 responses for token and introspection requests and responses. 3770 o Reworked abbreviation space for claims, request and response 3771 parameters. 3772 o Added text that the RS may indicate that it is busy at the authz- 3773 info resource. 3774 o Added section that specifies how the RS verifies an access token. 3775 o Added section on the protection of the authz-info endpoint. 3776 o Removed the expiration mechanism based on sequence numbers. 3777 o Added reference to RFC7662 security considerations. 3778 o Added considerations on minimal security requirements for 3779 communication. 3780 o Added security considerations on unprotected information sent to 3781 authz-info and in the error responses. 3783 F.7. Version -15 to -16 3785 o Added text the RS using RFC6750 error codes. 3786 o Defined an error code for incompatible token request parameters. 3787 o Removed references to the actors draft. 3788 o Fixed errors in examples. 3790 F.8. Version -14 to -15 3792 o Added text about refresh tokens. 3793 o Added text about protection of credentials. 3794 o Rephrased introspection so that other entities than RS can do it. 3795 o Editorial improvements. 3797 F.9. Version -13 to -14 3799 o Split out the 'aud', 'cnf' and 'rs_cnf' parameters to 3800 [I-D.ietf-ace-oauth-params] 3801 o Introduced the "application/ace+cbor" Content-Type. 3802 o Added claim registrations from 'profile' and 'rs_cnf'. 3803 o Added note on schema part of AS Information Section 5.3 3804 o Realigned the parameter abbreviations to push rarely used ones to 3805 the 2-byte encoding size of CBOR integers. 3807 F.10. Version -12 to -13 3809 o Changed "Resource Information" to "Access Information" to avoid 3810 confusion. 3811 o Clarified section about AS discovery. 3812 o Editorial changes 3814 F.11. Version -11 to -12 3816 o Moved the Request error handling to a section of its own. 3817 o Require the use of the abbreviation for profile identifiers. 3818 o Added rs_cnf parameter in the introspection response, to inform 3819 RS' with several RPKs on which key to use. 3820 o Allowed use of rs_cnf as claim in the access token in order to 3821 inform an RS with several RPKs on which key to use. 3822 o Clarified that profiles must specify if/how error responses are 3823 protected. 3824 o Fixed label number range to align with COSE/CWT. 3825 o Clarified the requirements language in order to allow profiles to 3826 specify other payload formats than CBOR if they do not use CoAP. 3828 F.12. Version -10 to -11 3830 o Fixed some CBOR data type errors. 3831 o Updated boilerplate text 3833 F.13. Version -09 to -10 3835 o Removed CBOR major type numbers. 3836 o Removed the client token design. 3837 o Rephrased to clarify that other protocols than CoAP can be used. 3838 o Clarifications regarding the use of HTTP 3840 F.14. Version -08 to -09 3842 o Allowed scope to be byte strings. 3843 o Defined default names for endpoints. 3844 o Refactored the IANA section for briefness and consistency. 3845 o Refactored tables that define IANA registry contents for 3846 consistency. 3847 o Created IANA registry for CBOR mappings of error codes, grant 3848 types and Authorization Server Information. 3849 o Added references to other document sections defining IANA entries 3850 in the IANA section. 3852 F.15. Version -07 to -08 3854 o Moved AS discovery from the DTLS profile to the framework, see 3855 Section 5.1. 3856 o Made the use of CBOR mandatory. If you use JSON you can use 3857 vanilla OAuth. 3858 o Made it mandatory for profiles to specify C-AS security and RS-AS 3859 security (the latter only if introspection is supported). 3860 o Made the use of CBOR abbreviations mandatory. 3862 o Added text to clarify the use of token references as an 3863 alternative to CWTs. 3864 o Added text to clarify that introspection must not be delayed, in 3865 case the RS has to return a client token. 3866 o Added security considerations about leakage through unprotected AS 3867 discovery information, combining profiles and leakage through 3868 error responses. 3869 o Added privacy considerations about leakage through unprotected AS 3870 discovery. 3871 o Added text that clarifies that introspection is optional. 3872 o Made profile parameter optional since it can be implicit. 3873 o Clarified that CoAP is not mandatory and other protocols can be 3874 used. 3875 o Clarified the design justification for specific features of the 3876 framework in appendix A. 3877 o Clarified appendix E.2. 3878 o Removed specification of the "cnf" claim for CBOR/COSE, and 3879 replaced with references to [RFC8747] 3881 F.16. Version -06 to -07 3883 o Various clarifications added. 3884 o Fixed erroneous author email. 3886 F.17. Version -05 to -06 3888 o Moved sections that define the ACE framework into a subsection of 3889 the framework Section 5. 3890 o Split section on client credentials and grant into two separate 3891 sections, Section 5.4, and Section 5.5. 3892 o Added Section 5.6 on AS authentication. 3893 o Added Section 5.7 on the Authorization endpoint. 3895 F.18. Version -04 to -05 3897 o Added RFC 2119 language to the specification of the required 3898 behavior of profile specifications. 3899 o Added Section 5.5 on the relation to the OAuth2 grant types. 3900 o Added CBOR abbreviations for error and the error codes defined in 3901 OAuth2. 3902 o Added clarification about token expiration and long-running 3903 requests in Section 5.10.3 3904 o Added security considerations about tokens with symmetric PoP keys 3905 valid for more than one RS. 3906 o Added privacy considerations section. 3907 o Added IANA registry mapping the confirmation types from RFC 7800 3908 to equivalent COSE types. 3910 o Added appendix D, describing assumptions about what the AS knows 3911 about the client and the RS. 3913 F.19. Version -03 to -04 3915 o Added a description of the terms "framework" and "profiles" as 3916 used in this document. 3917 o Clarified protection of access tokens in section 3.1. 3918 o Clarified uses of the "cnf" parameter in section 6.4.5. 3919 o Clarified intended use of Client Token in section 7.4. 3921 F.20. Version -02 to -03 3923 o Removed references to draft-ietf-oauth-pop-key-distribution since 3924 the status of this draft is unclear. 3925 o Copied and adapted security considerations from draft-ietf-oauth- 3926 pop-key-distribution. 3927 o Renamed "client information" to "RS information" since it is 3928 information about the RS. 3929 o Clarified the requirements on profiles of this framework. 3930 o Clarified the token endpoint protocol and removed negotiation of 3931 "profile" and "alg" (section 6). 3932 o Renumbered the abbreviations for claims and parameters to get a 3933 consistent numbering across different endpoints. 3934 o Clarified the introspection endpoint. 3935 o Renamed token, introspection and authz-info to "endpoint" instead 3936 of "resource" to mirror the OAuth 2.0 terminology. 3937 o Updated the examples in the appendices. 3939 F.21. Version -01 to -02 3941 o Restructured to remove communication security parts. These shall 3942 now be defined in profiles. 3943 o Restructured section 5 to create new sections on the OAuth 3944 endpoints token, introspection and authz-info. 3945 o Pulled in material from draft-ietf-oauth-pop-key-distribution in 3946 order to define proof-of-possession key distribution. 3947 o Introduced the "cnf" parameter as defined in RFC7800 to reference 3948 or transport keys used for proof of possession. 3949 o Introduced the "client-token" to transport client information from 3950 the AS to the client via the RS in conjunction with introspection. 3951 o Expanded the IANA section to define parameters for token request, 3952 introspection and CWT claims. 3953 o Moved deployment scenarios to the appendix as examples. 3955 F.22. Version -00 to -01 3957 o Changed 5.1. from "Communication Security Protocol" to "Client 3958 Information". 3959 o Major rewrite of 5.1 to clarify the information exchanged between 3960 C and AS in the PoP access token request profile for IoT. 3962 * Allow the client to indicate preferences for the communication 3963 security protocol. 3964 * Defined the term "Client Information" for the additional 3965 information returned to the client in addition to the access 3966 token. 3967 * Require that the messages between AS and client are secured, 3968 either with (D)TLS or with COSE_Encrypted wrappers. 3969 * Removed dependency on OSCOAP and added generic text about 3970 object security instead. 3971 * Defined the "rpk" parameter in the client information to 3972 transmit the raw public key of the RS from AS to client. 3973 * (D)TLS MUST use the PoP key in the handshake (either as PSK or 3974 as client RPK with client authentication). 3975 * Defined the use of x5c, x5t and x5tS256 parameters when a 3976 client certificate is used for proof of possession. 3977 * Defined "tktn" parameter for signaling for how to transfer the 3978 access token. 3979 o Added 5.2. the CoAP Access-Token option for transferring access 3980 tokens in messages that do not have payload. 3981 o 5.3.2. Defined success and error responses from the RS when 3982 receiving an access token. 3983 o 5.6.:Added section giving guidance on how to handle token 3984 expiration in the absence of reliable time. 3985 o Appendix B Added list of roles and responsibilities for C, AS and 3986 RS. 3988 Authors' Addresses 3990 Ludwig Seitz 3991 Combitech 3992 Djaeknegatan 31 3993 Malmoe 211 35 3994 Sweden 3996 Email: ludwig.seitz@combitech.se 3997 Goeran Selander 3998 Ericsson 3999 Faroegatan 6 4000 Kista 164 80 4001 Sweden 4003 Email: goran.selander@ericsson.com 4005 Erik Wahlstroem 4006 Sweden 4008 Email: erik@wahlstromstekniska.se 4010 Samuel Erdtman 4011 Spotify AB 4012 Birger Jarlsgatan 61, 4tr 4013 Stockholm 113 56 4014 Sweden 4016 Email: erdtman@spotify.com 4018 Hannes Tschofenig 4019 Arm Ltd. 4020 Absam 6067 4021 Austria 4023 Email: Hannes.Tschofenig@arm.com