idnits 2.17.1 draft-ietf-ace-oauth-authz-29.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 (December 14, 2019) is 1594 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-06 ** Downref: Normative reference to an Informational RFC: RFC 4949 ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-24 == Outdated reference: A later version (-43) exists of draft-ietf-tls-dtls13-34 -- 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: 4 errors (**), 0 flaws (~~), 4 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: June 16, 2020 Ericsson 6 E. Wahlstroem 8 S. Erdtman 9 Spotify AB 10 H. Tschofenig 11 Arm Ltd. 12 December 14, 2019 14 Authentication and Authorization for Constrained Environments (ACE) 15 using the OAuth 2.0 Framework (ACE-OAuth) 16 draft-ietf-ace-oauth-authz-29 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 June 16, 2020. 46 Copyright Notice 48 Copyright (c) 2019 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.1.1. Unauthorized Resource Request Message . . . . . . . . 16 72 5.1.2. AS Request Creation Hints . . . . . . . . . . . . . . 17 73 5.1.2.1. The Client-Nonce Parameter . . . . . . . . . . . 19 74 5.2. Authorization Grants . . . . . . . . . . . . . . . . . . 20 75 5.3. Client Credentials . . . . . . . . . . . . . . . . . . . 20 76 5.4. AS Authentication . . . . . . . . . . . . . . . . . . . . 21 77 5.5. The Authorization Endpoint . . . . . . . . . . . . . . . 21 78 5.6. The Token Endpoint . . . . . . . . . . . . . . . . . . . 21 79 5.6.1. Client-to-AS Request . . . . . . . . . . . . . . . . 22 80 5.6.2. AS-to-Client Response . . . . . . . . . . . . . . . . 25 81 5.6.3. Error Response . . . . . . . . . . . . . . . . . . . 27 82 5.6.4. Request and Response Parameters . . . . . . . . . . . 28 83 5.6.4.1. Grant Type . . . . . . . . . . . . . . . . . . . 28 84 5.6.4.2. Token Type . . . . . . . . . . . . . . . . . . . 29 85 5.6.4.3. Profile . . . . . . . . . . . . . . . . . . . . . 29 86 5.6.4.4. Client-Nonce . . . . . . . . . . . . . . . . . . 30 87 5.6.5. Mapping Parameters to CBOR . . . . . . . . . . . . . 30 88 5.7. The Introspection Endpoint . . . . . . . . . . . . . . . 31 89 5.7.1. Introspection Request . . . . . . . . . . . . . . . . 32 90 5.7.2. Introspection Response . . . . . . . . . . . . . . . 33 91 5.7.3. Error Response . . . . . . . . . . . . . . . . . . . 34 92 5.7.4. Mapping Introspection parameters to CBOR . . . . . . 35 93 5.8. The Access Token . . . . . . . . . . . . . . . . . . . . 35 94 5.8.1. The Authorization Information Endpoint . . . . . . . 36 95 5.8.1.1. Verifying an Access Token . . . . . . . . . . . . 37 96 5.8.1.2. Protecting the Authorization Information 97 Endpoint . . . . . . . . . . . . . . . . . . . . 39 98 5.8.2. Client Requests to the RS . . . . . . . . . . . . . . 39 99 5.8.3. Token Expiration . . . . . . . . . . . . . . . . . . 40 100 5.8.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 . . . . . . . . . . . . . . . . . . 43 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 . . . . . . . . . . . . . . . . . . . 47 109 6.8. Unprotected Information . . . . . . . . . . . . . . . . . 47 110 6.9. Identifying audiences . . . . . . . . . . . . . . . . . . 48 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. OAuth Extensions Error Registration . . . . . . . . . . . 51 116 8.3. OAuth Error Code CBOR Mappings Registry . . . . . . . . . 51 117 8.4. OAuth Grant Type CBOR Mappings . . . . . . . . . . . . . 51 118 8.5. OAuth Access Token Types . . . . . . . . . . . . . . . . 52 119 8.6. OAuth Access Token Type CBOR Mappings . . . . . . . . . . 52 120 8.6.1. Initial Registry Contents . . . . . . . . . . . . . . 52 121 8.7. ACE Profile Registry . . . . . . . . . . . . . . . . . . 53 122 8.8. OAuth Parameter Registration . . . . . . . . . . . . . . 53 123 8.9. OAuth Parameters CBOR Mappings Registry . . . . . . . . . 53 124 8.10. OAuth Introspection Response Parameter Registration . . . 54 125 8.11. OAuth Token Introspection Response CBOR Mappings Registry 54 126 8.12. JSON Web Token Claims . . . . . . . . . . . . . . . . . . 55 127 8.13. CBOR Web Token Claims . . . . . . . . . . . . . . . . . . 55 128 8.14. Media Type Registrations . . . . . . . . . . . . . . . . 56 129 8.15. CoAP Content-Format Registry . . . . . . . . . . . . . . 57 130 8.16. Expert Review Instructions . . . . . . . . . . . . . . . 57 131 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 58 132 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 59 133 10.1. Normative References . . . . . . . . . . . . . . . . . . 59 134 10.2. Informative References . . . . . . . . . . . . . . . . . 61 135 Appendix A. Design Justification . . . . . . . . . . . . . . . . 64 136 Appendix B. Roles and Responsibilities . . . . . . . . . . . . . 68 137 Appendix C. Requirements on Profiles . . . . . . . . . . . . . . 70 138 Appendix D. Assumptions on AS knowledge about C and RS . . . . . 71 139 Appendix E. Deployment Examples . . . . . . . . . . . . . . . . 71 140 E.1. Local Token Validation . . . . . . . . . . . . . . . . . 72 141 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. 190 Taking energy consumption as an example: At one end there are energy- 191 harvesting or battery powered devices which have a tight power 192 budget, on the other end there are mains-powered devices, and all 193 levels in between. 195 Hence, IoT devices may be very different in terms of available 196 processing and message exchange capabilities and there is a need to 197 support many different authorization use cases [RFC7744]. 199 This specification describes a framework for authentication and 200 authorization in constrained environments (ACE) built on re-use of 201 OAuth 2.0 [RFC6749], thereby extending authorization to Internet of 202 Things devices. This specification contains the necessary building 203 blocks for adjusting OAuth 2.0 to IoT environments. 205 More detailed, interoperable specifications can be found in separate 206 profile specifications. Implementations may claim conformance with a 207 specific profile, whereby implementations utilizing the same profile 208 interoperate while implementations of different profiles are not 209 expected to be interoperable. Some devices, such as mobile phones 210 and tablets, may implement multiple profiles and will therefore be 211 able to interact with a wider range of low end devices. Requirements 212 on profiles are described at contextually appropriate places 213 throughout this specification, and also summarized in Appendix C. 215 2. Terminology 217 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 218 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 219 "OPTIONAL" in this document are to be interpreted as described in BCP 220 14 [RFC2119] [RFC8174] when, and only when, they appear in all 221 capitals, as shown here. 223 Certain security-related terms such as "authentication", 224 "authorization", "confidentiality", "(data) integrity", "message 225 authentication code", and "verify" are taken from [RFC4949]. 227 Since exchanges in this specification are described as RESTful 228 protocol interactions, HTTP [RFC7231] offers useful terminology. 230 Terminology for entities in the architecture is defined in OAuth 2.0 231 [RFC6749] such as client (C), resource server (RS), and authorization 232 server (AS). 234 Note that the term "endpoint" is used here following its OAuth 235 definition, which is to denote resources such as token and 236 introspection at the AS and authz-info at the RS (see Section 5.8.1 237 for a definition of the authz-info endpoint). The CoAP [RFC7252] 238 definition, which is "An entity participating in the CoAP protocol" 239 is not used in this specification. 241 The specifications in this document is called the "framework" or "ACE 242 framework". When referring to "profiles of this framework" it refers 243 to additional specifications that define the use of this 244 specification with concrete transport and communication security 245 protocols (e.g., CoAP over DTLS). 247 We use the term "Access Information" for parameters other than the 248 access token provided to the client by the AS to enable it to access 249 the RS (e.g. public key of the RS, profile supported by RS). 251 We use the term "Authorization Information" to denote all 252 information, including the claims of relevant access tokens, that an 253 RS uses to determine whether an access request should be granted. 255 3. Overview 257 This specification defines the ACE framework for authorization in the 258 Internet of Things environment. It consists of a set of building 259 blocks. 261 The basic block is the OAuth 2.0 [RFC6749] framework, which enjoys 262 widespread deployment. Many IoT devices can support OAuth 2.0 263 without any additional extensions, but for certain constrained 264 settings additional profiling is needed. 266 Another building block is the lightweight web transfer protocol CoAP 267 [RFC7252], for those communication environments where HTTP is not 268 appropriate. CoAP typically runs on top of UDP, which further 269 reduces overhead and message exchanges. While this specification 270 defines extensions for the use of OAuth over CoAP, other underlying 271 protocols are not prohibited from being supported in the future, such 272 as HTTP/2 [RFC7540], Message Queuing Telemetry Transport (MQTT) 273 [MQTT5.0], Bluetooth Low Energy (BLE) [BLE] and QUIC 274 [I-D.ietf-quic-transport]. Note that this document specifies 275 protocol exchanges in terms of RESTful verbs such as GET and POST. 276 Future profiles using protocols that do not support these verbs MUST 277 specify how the corresponding protocol messages are transmitted 278 instead. 280 A third building block is the Concise Binary Object Representation 281 (CBOR) [RFC7049], for encodings where JSON [RFC8259] is not 282 sufficiently compact. CBOR is a binary encoding designed for small 283 code and message size, which may be used for encoding of self 284 contained tokens, and also for encoding payloads transferred in 285 protocol messages. 287 A fourth building block is CBOR Object Signing and Encryption (COSE) 288 [RFC8152], which enables object-level layer security as an 289 alternative or complement to transport layer security (DTLS [RFC6347] 290 or TLS [RFC8446]). COSE is used to secure self-contained tokens such 291 as proof-of-possession (PoP) tokens, which are an extension to the 292 OAuth bearer tokens. The default token format is defined in CBOR web 293 token (CWT) [RFC8392]. Application layer security for CoAP using 294 COSE can be provided with OSCORE [RFC8613]. 296 With the building blocks listed above, solutions satisfying various 297 IoT device and network constraints are possible. A list of 298 constraints is described in detail in [RFC7228] and a description of 299 how the building blocks mentioned above relate to the various 300 constraints can be found in Appendix A. 302 Luckily, not every IoT device suffers from all constraints. The ACE 303 framework nevertheless takes all these aspects into account and 304 allows several different deployment variants to co-exist, rather than 305 mandating a one-size-fits-all solution. It is important to cover the 306 wide range of possible interworking use cases and the different 307 requirements from a security point of view. Once IoT deployments 308 mature, popular deployment variants will be documented in the form of 309 ACE profiles. 311 3.1. OAuth 2.0 313 The OAuth 2.0 authorization framework enables a client to obtain 314 scoped access to a resource with the permission of a resource owner. 315 Authorization information, or references to it, is passed between the 316 nodes using access tokens. These access tokens are issued to clients 317 by an authorization server with the approval of the resource owner. 318 The client uses the access token to access the protected resources 319 hosted by the resource server. 321 A number of OAuth 2.0 terms are used within this specification: 323 The token and introspection Endpoints: 324 The AS hosts the token endpoint that allows a client to request 325 access tokens. The client makes a POST request to the token 326 endpoint on the AS and receives the access token in the response 327 (if the request was successful). 328 In some deployments, a token introspection endpoint is provided by 329 the AS, which can be used by the RS if it needs to request 330 additional information regarding a received access token. The RS 331 makes a POST request to the introspection endpoint on the AS and 332 receives information about the access token in the response. (See 333 "Introspection" below.) 335 Access Tokens: 336 Access tokens are credentials needed to access protected 337 resources. An access token is a data structure representing 338 authorization permissions issued by the AS to the client. Access 339 tokens are generated by the AS and consumed by the RS. The access 340 token content is opaque to the client. 342 Access tokens can have different formats, and various methods of 343 utilization e.g., cryptographic properties) based on the security 344 requirements of the given deployment. 346 Refresh Tokens: 347 Refresh tokens are credentials used to obtain access tokens. 348 Refresh tokens are issued to the client by the authorization 349 server and are used to obtain a new access token when the current 350 access token becomes invalid or expires, or to obtain additional 351 access tokens with identical or narrower scope (such access tokens 352 may have a shorter lifetime and fewer permissions than authorized 353 by the resource owner). Issuing a refresh token is optional at 354 the discretion of the authorization server. If the authorization 355 server issues a refresh token, it is included when issuing an 356 access token (i.e., step (B) in Figure 1). 358 A refresh token in OAuth 2.0 is a string representing the 359 authorization granted to the client by the resource owner. The 360 string is usually opaque to the client. The token denotes an 361 identifier used to retrieve the authorization information. Unlike 362 access tokens, refresh tokens are intended for use only with 363 authorization servers and are never sent to resource servers. In 364 this framework, refresh tokens are encoded in binary instead of 365 strings, if used. 367 Proof of Possession Tokens: 368 A token may be bound to a cryptographic key, which is then used to 369 bind the token to a request authorized by the token. Such tokens 370 are called proof-of-possession tokens (or PoP tokens). 372 The proof-of-possession (PoP) security concept used here assumes 373 that the AS acts as a trusted third party that binds keys to 374 tokens. In the case of access tokens, these so called PoP keys 375 are then used by the client to demonstrate the possession of the 376 secret to the RS when accessing the resource. The RS, when 377 receiving an access token, needs to verify that the key used by 378 the client matches the one bound to the access token. When this 379 specification uses the term "access token" it is assumed to be a 380 PoP access token token unless specifically stated otherwise. 382 The key bound to the token (the PoP key) may use either symmetric 383 or asymmetric cryptography. The appropriate choice of the kind of 384 cryptography depends on the constraints of the IoT devices as well 385 as on the security requirements of the use case. 387 Symmetric PoP key: 388 The AS generates a random symmetric PoP key. The key is either 389 stored to be returned on introspection calls or encrypted and 390 included in the token. The PoP key is also encrypted for the 391 token recipient and sent to the recipient together with the 392 token. 394 Asymmetric PoP key: 395 An asymmetric key pair is generated on the token's recipient 396 and the public key is sent to the AS (if it does not already 397 have knowledge of the recipient's public key). Information 398 about the public key, which is the PoP key in this case, is 399 either stored to be returned on introspection calls or included 400 inside the token and sent back to the requesting party. The 401 consumer of the token can identify the public key from the 402 information in the token, which allows the recipient of the 403 token to use the corresponding private key for the proof of 404 possession. 406 The token is either a simple reference, or a structured 407 information object (e.g., CWT [RFC8392]) protected by a 408 cryptographic wrapper (e.g., COSE [RFC8152]). The choice of PoP 409 key does not necessarily imply a specific credential type for the 410 integrity protection of the token. 412 Scopes and Permissions: 413 In OAuth 2.0, the client specifies the type of permissions it is 414 seeking to obtain (via the scope parameter) in the access token 415 request. In turn, the AS may use the scope response parameter to 416 inform the client of the scope of the access token issued. As the 417 client could be a constrained device as well, this specification 418 defines the use of CBOR encoding, see Section 5, for such requests 419 and responses. 421 The values of the scope parameter in OAuth 2.0 are expressed as a 422 list of space-delimited, case-sensitive strings, with a semantic 423 that is well-known to the AS and the RS. More details about the 424 concept of scopes is found under Section 3.3 in [RFC6749]. 426 Claims: 427 Information carried in the access token or returned from 428 introspection, called claims, is in the form of name-value pairs. 429 An access token may, for example, include a claim identifying the 430 AS that issued the token (via the "iss" claim) and what audience 431 the access token is intended for (via the "aud" claim). The 432 audience of an access token can be a specific resource or one or 433 many resource servers. The resource owner policies influence what 434 claims are put into the access token by the authorization server. 436 While the structure and encoding of the access token varies 437 throughout deployments, a standardized format has been defined 438 with the JSON Web Token (JWT) [RFC7519] where claims are encoded 439 as a JSON object. In [RFC8392], an equivalent format using CBOR 440 encoding (CWT) has been defined. 442 Introspection: 443 Introspection is a method for a resource server to query the 444 authorization server for the active state and content of a 445 received access token. This is particularly useful in those cases 446 where the authorization decisions are very dynamic and/or where 447 the received access token itself is an opaque reference rather 448 than a self-contained token. More information about introspection 449 in OAuth 2.0 can be found in [RFC7662]. 451 3.2. CoAP 453 CoAP is an application layer protocol similar to HTTP, but 454 specifically designed for constrained environments. CoAP typically 455 uses datagram-oriented transport, such as UDP, where reordering and 456 loss of packets can occur. A security solution needs to take the 457 latter aspects into account. 459 While HTTP uses headers and query strings to convey additional 460 information about a request, CoAP encodes such information into 461 header parameters called 'options'. 463 CoAP supports application-layer fragmentation of the CoAP payloads 464 through blockwise transfers [RFC7959]. However, blockwise transfer 465 does not increase the size limits of CoAP options, therefore data 466 encoded in options has to be kept small. 468 Transport layer security for CoAP can be provided by DTLS or TLS 469 [RFC6347][RFC8446] [I-D.ietf-tls-dtls13]. CoAP defines a number of 470 proxy operations that require transport layer security to be 471 terminated at the proxy. One approach for protecting CoAP 472 communication end-to-end through proxies, and also to support 473 security for CoAP over a different transport in a uniform way, is to 474 provide security at the application layer using an object-based 475 security mechanism such as COSE [RFC8152]. 477 One application of COSE is OSCORE [RFC8613], which provides end-to- 478 end confidentiality, integrity and replay protection, and a secure 479 binding between CoAP request and response messages. In OSCORE, the 480 CoAP messages are wrapped in COSE objects and sent using CoAP. 482 This framework RECOMMENDS the use of CoAP as replacement for HTTP for 483 use in constrained environments. For communication security this 484 framework does not make an explicit protocol recommendation, since 485 the choice depends on the requirements of the specific application. 486 DTLS [RFC6347], [I-D.ietf-tls-dtls13] and OSCORE [RFC8613] are 487 mentioned as examples, other protocols fulfilling the requirements 488 from Section 6.5 are also applicable. 490 4. Protocol Interactions 492 The ACE framework is based on the OAuth 2.0 protocol interactions 493 using the token endpoint and optionally the introspection endpoint. 494 A client obtains an access token, and optionally a refresh token, 495 from an AS using the token endpoint and subsequently presents the 496 access token to a RS to gain access to a protected resource. In most 497 deployments the RS can process the access token locally, however in 498 some cases the RS may present it to the AS via the introspection 499 endpoint to get fresh information. These interactions are shown in 500 Figure 1. An overview of various OAuth concepts is provided in 501 Section 3.1. 503 The OAuth 2.0 framework defines a number of "protocol flows" via 504 grant types, which have been extended further with extensions to 505 OAuth 2.0 (such as [RFC7521] and [RFC8628]). What grant types works 506 best depends on the usage scenario and [RFC7744] describes many 507 different IoT use cases but there are two preferred grant types, 508 namely the Authorization Code Grant (described in Section 4.1 of 509 [RFC7521]) and the Client Credentials Grant (described in Section 4.4 510 of [RFC7521]). The Authorization Code Grant is a good fit for use 511 with apps running on smart phones and tablets that request access to 512 IoT devices, a common scenario in the smart home environment, where 513 users need to go through an authentication and authorization phase 514 (at least during the initial setup phase). The native apps 515 guidelines described in [RFC8252] are applicable to this use case. 516 The Client Credential Grant is a good fit for use with IoT devices 517 where the OAuth client itself is constrained. In such a case, the 518 resource owner has pre-arranged access rights for the client with the 519 authorization server, which is often accomplished using a 520 commissioning tool. 522 The consent of the resource owner, for giving a client access to a 523 protected resource, can be provided dynamically as in the traditional 524 OAuth flows, or it could be pre-configured by the resource owner as 525 authorization policies at the AS, which the AS evaluates when a token 526 request arrives. The resource owner and the requesting party (i.e., 527 client owner) are not shown in Figure 1. 529 This framework supports a wide variety of communication security 530 mechanisms between the ACE entities, such as client, AS, and RS. It 531 is assumed that the client has been registered (also called enrolled 532 or onboarded) to an AS using a mechanism defined outside the scope of 533 this document. In practice, various techniques for onboarding have 534 been used, such as factory-based provisioning or the use of 535 commissioning tools. Regardless of the onboarding technique, this 536 provisioning procedure implies that the client and the AS exchange 537 credentials and configuration parameters. These credentials are used 538 to mutually authenticate each other and to protect messages exchanged 539 between the client and the AS. 541 It is also assumed that the RS has been registered with the AS, 542 potentially in a similar way as the client has been registered with 543 the AS. Established keying material between the AS and the RS allows 544 the AS to apply cryptographic protection to the access token to 545 ensure that its content cannot be modified, and if needed, that the 546 content is confidentiality protected. 548 The keying material necessary for establishing communication security 549 between C and RS is dynamically established as part of the protocol 550 described in this document. 552 At the start of the protocol, there is an optional discovery step 553 where the client discovers the resource server and the resources this 554 server hosts. In this step, the client might also determine what 555 permissions are needed to access the protected resource. A generic 556 procedure is described in Section 5.1; profiles MAY define other 557 procedures for discovery. 559 In Bluetooth Low Energy, for example, advertisements are broadcasted 560 by a peripheral, including information about the primary services. 562 In CoAP, as a second example, a client can make a request to "/.well- 563 known/core" to obtain information about available resources, which 564 are returned in a standardized format as described in [RFC6690]. 566 +--------+ +---------------+ 567 | |---(A)-- Token Request ------->| | 568 | | | Authorization | 569 | |<--(B)-- Access Token ---------| Server | 570 | | + Access Information | | 571 | | + Refresh Token (optional) +---------------+ 572 | | ^ | 573 | | Introspection Request (D)| | 574 | Client | (optional) | | 575 | | Response | |(E) 576 | | (optional) | v 577 | | +--------------+ 578 | |---(C)-- Token + Request ----->| | 579 | | | Resource | 580 | |<--(F)-- Protected Resource ---| Server | 581 | | | | 582 +--------+ +--------------+ 584 Figure 1: Basic Protocol Flow. 586 Requesting an Access Token (A): 587 The client makes an access token request to the token endpoint at 588 the AS. This framework assumes the use of PoP access tokens (see 589 Section 3.1 for a short description) wherein the AS binds a key to 590 an access token. The client may include permissions it seeks to 591 obtain, and information about the credentials it wants to use 592 (e.g., symmetric/asymmetric cryptography or a reference to a 593 specific credential). 595 Access Token Response (B): 596 If the AS successfully processes the request from the client, it 597 returns an access token and optionally a refresh token (note that 598 only certain grant types support refresh tokens). It can also 599 return additional parameters, referred to as "Access Information". 600 In addition to the response parameters defined by OAuth 2.0 and 601 the PoP access token extension, this framework defines parameters 602 that can be used to inform the client about capabilities of the 603 RS, e.g. the profiles the RS supports. More information about 604 these parameters can be found in Section 5.6.4. 606 Resource Request (C): 607 The client interacts with the RS to request access to the 608 protected resource and provides the access token. The protocol to 609 use between the client and the RS is not restricted to CoAP. 610 HTTP, HTTP/2, QUIC, MQTT, Bluetooth Low Energy, etc., are also 611 viable candidates. 613 Depending on the device limitations and the selected protocol, 614 this exchange may be split up into two parts: 616 (1) the client sends the access token containing, or 617 referencing, the authorization information to the RS, that may 618 be used for subsequent resource requests by the client, and 620 (2) the client makes the resource access request, using the 621 communication security protocol and other Access Information 622 obtained from the AS. 624 The Client and the RS mutually authenticate using the security 625 protocol specified in the profile (see step B) and the keys 626 obtained in the access token or the Access Information. The RS 627 verifies that the token is integrity protected and originated by 628 the AS. It then compares the claims contained in the access token 629 with the resource request. If the RS is online, validation can be 630 handed over to the AS using token introspection (see messages D 631 and E) over HTTP or CoAP. 633 Token Introspection Request (D): 634 A resource server may be configured to introspect the access token 635 by including it in a request to the introspection endpoint at that 636 AS. Token introspection over CoAP is defined in Section 5.7 and 637 for HTTP in [RFC7662]. 639 Note that token introspection is an optional step and can be 640 omitted if the token is self-contained and the resource server is 641 prepared to perform the token validation on its own. 643 Token Introspection Response (E): 644 The AS validates the token and returns the most recent parameters, 645 such as scope, audience, validity etc. associated with it back to 646 the RS. The RS then uses the received parameters to process the 647 request to either accept or to deny it. 649 Protected Resource (F): 650 If the request from the client is authorized, the RS fulfills the 651 request and returns a response with the appropriate response code. 652 The RS uses the dynamically established keys to protect the 653 response, according to the communication security protocol used. 655 5. Framework 657 The following sections detail the profiling and extensions of OAuth 658 2.0 for constrained environments, which constitutes the ACE 659 framework. 661 Credential Provisioning 662 For IoT, it cannot be assumed that the client and RS are part of a 663 common key infrastructure, so the AS provisions credentials or 664 associated information to allow mutual authentication between 665 client and RS. The resulting security association between client 666 and RS may then also be used to bind these credentials to the 667 access tokens the client uses. 669 Proof-of-Possession 670 The ACE framework, by default, implements proof-of-possession for 671 access tokens, i.e., that the token holder can prove being a 672 holder of the key bound to the token. The binding is provided by 673 the "cnf" claim [I-D.ietf-ace-cwt-proof-of-possession] indicating 674 what key is used for proof-of-possession. If a client needs to 675 submit a new access token, e.g., to obtain additional access 676 rights, they can request that the AS binds this token to the same 677 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 that provides 704 the features required above. 706 In OAuth 2.0 the communication with the Token and the Introspection 707 endpoints at the AS is assumed to be via HTTP and may use Uri-query 708 parameters. When profiles of this framework use CoAP instead, it is 709 REQUIRED to use of the following alternative instead of Uri-query 710 parameters: The sender (client or RS) encodes the parameters of its 711 request as a CBOR map and submits that map as the payload of the POST 712 request. 714 Profiles that use CBOR encoding of protocol message parameters at the 715 outermost encoding layer MUST use the media format 'application/ 716 ace+cbor'. If CoAP is used for communication, the Content-Format 717 MUST be abbreviated with the ID: 19 (see Section 8.15). 719 The OAuth 2.0 AS uses a JSON structure in the payload of its 720 responses both to client and RS. If CoAP is used, it is REQUIRED to 721 use CBOR [RFC7049] instead of JSON. Depending on the profile, the 722 CBOR payload MAY be enclosed in a non-CBOR cryptographic wrapper. 724 5.1. Discovering Authorization Servers 726 In order to determine the AS in charge of a resource hosted at the 727 RS, C MAY send an initial Unauthorized Resource Request message to 728 RS. RS then denies the request and sends the address of its AS back 729 to C. 731 Instead of the initial Unauthorized Resource Request message, other 732 discovery methods may be used, or the client may be pre-provisioned 733 with an RS-to-AS mapping. 735 5.1.1. Unauthorized Resource Request Message 737 An Unauthorized Resource Request message is a request for any 738 resource hosted by RS for which the client does not have 739 authorization granted. RSes MUST treat any request for a protected 740 resource as an Unauthorized Resource Request message when any of the 741 following hold: 743 o The request has been received on an unprotected channel. 745 o The RS has no valid access token for the sender of the request 746 regarding the requested action on that resource. 748 o The RS has a valid access token for the sender of the request, but 749 that token does not authorize the requested action on the 750 requested resource. 752 Note: These conditions ensure that the RS can handle requests 753 autonomously once access was granted and a secure channel has been 754 established between C and RS. The authz-info endpoint, as part of 755 the process for authorizing to protected resources, is not itself a 756 protected resource and MUST NOT be protected as specified above (cf. 757 Section 5.8.1). 759 Unauthorized Resource Request messages MUST be denied with an 760 "unauthorized_client" error response. In this response, the Resource 761 Server SHOULD provide proper AS Request Creation Hints to enable the 762 Client to request an access token from RS's AS as described in 763 Section 5.1.2. 765 The handling of all client requests (including unauthorized ones) by 766 the RS is described in Section 5.8.2. 768 5.1.2. AS Request Creation Hints 770 The AS Request Creation Hints message is sent by an RS as a response 771 to an Unauthorized Resource Request message (see Section 5.1.1) to 772 help the sender of the Unauthorized Resource Request message acquire 773 a valid access token. The AS Request Creation Hints message is a 774 CBOR map, with a MANDATORY element "AS" specifying an absolute URI 775 (see Section 4.3 of [RFC3986]) that identifies the appropriate AS for 776 the RS. 778 The message can also contain the following OPTIONAL parameters: 780 o A "audience" element containing a suggested audience that the 781 client should request at the AS. 783 o A "kid" element containing the key identifier of a key used in an 784 existing security association between the client and the RS. The 785 RS expects the client to request an access token bound to this 786 key, in order to avoid having to re-establish the security 787 association. 789 o A "cnonce" element containing a client-nonce. See 790 Section 5.1.2.1. 792 o A "scope" element containing the suggested scope that the client 793 should request towards the AS. 795 Figure 2 summarizes the parameters that may be part of the AS Request 796 Creation Hints. 798 /-----------+----------+---------------------\ 799 | Name | CBOR Key | Value Type | 800 |-----------+----------+---------------------| 801 | AS | 1 | text string | 802 | kid | 2 | byte string | 803 | audience | 5 | text string | 804 | scope | 9 | text or byte string | 805 | cnonce | 39 | byte string | 806 \-----------+----------+---------------------/ 808 Figure 2: AS Request Creation Hints 810 Note that the schema part of the AS parameter may need to be adapted 811 to the security protocol that is used between the client and the AS. 812 Thus the example AS value "coap://as.example.com/token" might need to 813 be transformed to "coaps://as.example.com/token". It is assumed that 814 the client can determine the correct schema part on its own depending 815 on the way it communicates with the AS. 817 Figure 3 shows an example for an AS Request Creation Hints message 818 payload using CBOR [RFC7049] diagnostic notation, using the parameter 819 names instead of the CBOR keys for better human readability. 821 4.01 Unauthorized 822 Content-Format: application/ace+cbor 823 Payload : 824 { 825 "AS" : "coaps://as.example.com/token", 826 "audience" : "coaps://rs.example.com" 827 "scope" : "rTempC", 828 "cnonce" : h'e0a156bb3f' 829 } 831 Figure 3: AS Request Creation Hints payload example 833 In the example above, the response parameter "AS" points the receiver 834 of this message to the URI "coaps://as.example.com/token" to request 835 access tokens. The RS sending this response (i.e., RS) uses an 836 internal clock that is only loosely synchronized with the clock of 837 the AS. Therefore it can not reliably verify the expiration time of 838 access tokens it receives. To ensure a certain level of access token 839 freshness nevetheless, the RS has included a "cnonce" parameter (see 840 Section 5.1.2.1) in the response. 842 Figure 4 illustrates the mandatory to use binary encoding of the 843 message payload shown in Figure 3. 845 a4 # map(4) 846 01 # unsigned(1) (=AS) 847 78 1c # text(28) 848 636f6170733a2f2f61732e657861 849 6d706c652e636f6d2f746f6b656e # "coaps://as.example.com/token" 850 05 # unsigned(5) (=audience) 851 76 # text(22) 852 636f6170733a2f2f72732e657861 853 6d706c652e636f6d # "coaps://rs.example.com" 854 09 # unsigned(9) (=scope) 855 66 # text(6) 856 7254656d7043 # "rTempC" 857 18 27 # unsigned(39) (=cnonce) 858 45 # bytes(5) 859 e0a156bb3f # 861 Figure 4: AS Request Creation Hints example encoded in CBOR 863 5.1.2.1. The Client-Nonce Parameter 865 If the RS does not synchronize its clock with the AS, it could be 866 tricked into accepting old access tokens, that are either expired or 867 have been compromised. In order to ensure some level of token 868 freshness in that case, the RS can use the "cnonce" (client-nonce) 869 parameter. The processing requirements for this parameter are as 870 follows: 872 o A RS sending a "cnonce" parameter in an AS Request Creation Hints 873 message MUST store information to validate that a given cnonce is 874 fresh. How this is implemented internally is out of scope for 875 this specification. Expiration of client-nonces should be based 876 roughly on the time it would take a client to obtain an access 877 token after receiving the AS Request Creation Hints message, with 878 some allowance for unexpected delays. 880 o A client receiving a "cnonce" parameter in an AS Request Creation 881 Hints message MUST include this in the parameters when requesting 882 an access token at the AS, using the "cnonce" parameter from 883 Section 5.6.4.4. 885 o If an AS grants an access token request containing a "cnonce" 886 parameter, it MUST include this value in the access token, using 887 the "cnonce" claim specified in Section 5.8. 889 o A RS that is using the client-nonce mechanism and that receives an 890 access token MUST verify that this token contains a cnonce claim, 891 with a client-nonce value that is fresh according to the 892 information stored at the first step above. If the cnonce claim 893 is not present or if the cnonce claim value is not fresh, the RS 894 MUST discard the access token. If this was an interaction with 895 the authz-info endpoint the RS MUST also respond with an error 896 message using a response code equivalent to the CoAP code 4.01 897 (Unauthorized). 899 5.2. Authorization Grants 901 To request an access token, the client obtains authorization from the 902 resource owner or uses its client credentials as a grant. The 903 authorization is expressed in the form of an authorization grant. 905 The OAuth framework [RFC6749] defines four grant types. The grant 906 types can be split up into two groups, those granted on behalf of the 907 resource owner (password, authorization code, implicit) and those for 908 the client (client credentials). Further grant types have been added 909 later, such as [RFC7521] defining an assertion-based authorization 910 grant. 912 The grant type is selected depending on the use case. In cases where 913 the client acts on behalf of the resource owner, the authorization 914 code grant is recommended. If the client acts on behalf of the 915 resource owner, but does not have any display or has very limited 916 interaction possibilities, it is recommended to use the device code 917 grant defined in [RFC8628]. In cases where the client acts 918 autonomously the client credentials grant is recommended. 920 For details on the different grant types, see section 1.3 of 921 [RFC6749]. The OAuth 2.0 framework provides an extension mechanism 922 for defining additional grant types, so profiles of this framework 923 MAY define additional grant types, if needed. 925 5.3. Client Credentials 927 Authentication of the client is mandatory independent of the grant 928 type when requesting an access token from the token endpoint. In the 929 case of the client credentials grant type, the authentication and 930 grant coincide. 932 Client registration and provisioning of client credentials to the 933 client is out of scope for this specification. 935 The OAuth framework defines one client credential type in section 936 2.3.1 of [RFC6749]: client id and client secret. 937 [I-D.erdtman-ace-rpcc] adds raw-public-key and pre-shared-key to the 938 client credentials types. Profiles of this framework MAY extend with 939 an additional client credentials type using client certificates. 941 5.4. AS Authentication 943 The client credential grant does not, by default, authenticate the AS 944 that the client connects to. In classic OAuth, the AS is 945 authenticated with a TLS server certificate. 947 Profiles of this framework MUST specify how clients authenticate the 948 AS and how communication security is implemented. By default, server 949 side TLS certificates, as defined by OAuth 2.0, are required. 951 5.5. The Authorization Endpoint 953 The OAuth 2.0 authorization endpoint is used to interact with the 954 resource owner and obtain an authorization grant, in certain grant 955 flows. The primary use case for the ACE-OAuth framework is for 956 machine-to-machine interactions that do not involve the resource 957 owner in the authorization flow; therefore, this endpoint is out of 958 scope here. Future profiles may define constrained adaptation 959 mechanisms for this endpoint as well. Non-constrained clients 960 interacting with constrained resource servers can use the 961 specification in section 3.1 of [RFC6749] and the attack 962 countermeasures suggested in section 4.2 of [RFC6819]. 964 5.6. The Token Endpoint 966 In standard OAuth 2.0, the AS provides the token endpoint for 967 submitting access token requests. This framework extends the 968 functionality of the token endpoint, giving the AS the possibility to 969 help the client and RS to establish shared keys or to exchange their 970 public keys. Furthermore, this framework defines encodings using 971 CBOR, as a substitute for JSON. 973 The endpoint may, however, be exposed over HTTPS as in classical 974 OAuth or even other transports. A profile MUST define the details of 975 the mapping between the fields described below, and these transports. 976 If HTTPS is used, JSON or CBOR payloads may be supported. If JSON 977 payloads are used, the semantics of Section 4 of the OAuth 2.0 978 specification MUST be followed (with additions as described below). 980 If CBOR payload is supported, the semantics described below MUST be 981 followed. 983 For the AS to be able to issue a token, the client MUST be 984 authenticated and present a valid grant for the scopes requested. 985 Profiles of this framework MUST specify how the AS authenticates the 986 client and how the communication between client and AS is protected, 987 fulfilling the requirements specified in Section 5. 989 The default name of this endpoint in an url-path is '/token', however 990 implementations are not required to use this name and can define 991 their own instead. 993 The figures of this section use CBOR diagnostic notation without the 994 integer abbreviations for the parameters or their values for 995 illustrative purposes. Note that implementations MUST use the 996 integer abbreviations and the binary CBOR encoding, if the CBOR 997 encoding is used. 999 5.6.1. Client-to-AS Request 1001 The client sends a POST request to the token endpoint at the AS. The 1002 profile MUST specify how the communication is protected. The content 1003 of the request consists of the parameters specified in the relevant 1004 subsection of section 4 of the OAuth 2.0 specification [RFC6749], 1005 depending on the grant type, with the following exceptions and 1006 additions: 1008 o The parameter "grant_type" is OPTIONAL in the context of this 1009 framework (as opposed to REQUIRED in RFC6749). If that parameter 1010 is missing, the default value "client_credentials" is implied. 1012 o The "audience" parameter from [I-D.ietf-oauth-token-exchange] is 1013 OPTIONAL to request an access token bound to a specific audience. 1015 o The "cnonce" parameter defined in Section 5.6.4.4 is REQUIRED if 1016 the RS provided a client-nonce in the "AS Request Creation Hints" 1017 message Section 5.1.2 1019 o The "scope" parameter MAY be encoded as a byte string instead of 1020 the string encoding specified in section 3.3 of [RFC6749], in 1021 order allow compact encoding of complex scopes. The syntax of 1022 such a binary encoding is explicitly not specified here and left 1023 to profiles or applications, specifically note that a binary 1024 encoded scope does not necessarily use the space character '0x20' 1025 to delimit scope-tokens. 1027 o The client can send an empty (null value) "ace_profile" parameter 1028 to indicate that it wants the AS to include the "ace_profile" 1029 parameter in the response. See Section 5.6.4.3. 1031 o A client MUST be able to use the parameters from 1032 [I-D.ietf-ace-oauth-params] in an access token request to the 1033 token endpoint and the AS MUST be able to process these additional 1034 parameters. 1036 The default behavior, is that the AS generates a symmetric proof-of- 1037 possession key for the client. In order to use an asymmetric key 1038 pair or to re-use a key previously established with the RS, the 1039 client is supposed to use the "req_cnf" parameter from 1040 [I-D.ietf-ace-oauth-params]. 1042 If CBOR is used then these parameters MUST be encoded as a CBOR map. 1044 When HTTP is used as a transport then the client makes a request to 1045 the token endpoint by sending the parameters using the "application/ 1046 x-www-form-urlencoded" format with a character encoding of UTF-8 in 1047 the HTTP request entity-body, as defined in section 3.2 of [RFC6749]. 1049 The following examples illustrate different types of requests for 1050 proof-of-possession tokens. 1052 Figure 5 shows a request for a token with a symmetric proof-of- 1053 possession key. The content is displayed in CBOR diagnostic 1054 notation, without abbreviations for better readability. 1056 Header: POST (Code=0.02) 1057 Uri-Host: "as.example.com" 1058 Uri-Path: "token" 1059 Content-Format: "application/ace+cbor" 1060 Payload: 1061 { 1062 "client_id" : "myclient", 1063 "audience" : "tempSensor4711" 1064 } 1066 Figure 5: Example request for an access token bound to a symmetric 1067 key. 1069 Figure 6 shows a request for a token with an asymmetric proof-of- 1070 possession key. Note that in this example OSCORE [RFC8613] is used 1071 to provide object-security, therefore the Content-Format is 1072 "application/oscore" wrapping the "application/ace+cbor" type 1073 content. The OSCORE option has a decoded interpretation appended in 1074 parentheses for the reader's convenience. Also note that in this 1075 example the audience is implicitly known by both client and AS. 1076 Furthermore note that this example uses the "req_cnf" parameter from 1077 [I-D.ietf-ace-oauth-params]. 1079 Header: POST (Code=0.02) 1080 Uri-Host: "as.example.com" 1081 Uri-Path: "token" 1082 OSCORE: 0x09, 0x05, 0x44, 0x6C 1083 (h=0, k=1, n=001, partialIV= 0x05, kid=[0x44, 0x6C]) 1084 Content-Format: "application/oscore" 1085 Payload: 1086 0x44025d1 ... (full payload omitted for brevity) ... 68b3825e 1088 Decrypted payload: 1089 { 1090 "client_id" : "myclient", 1091 "req_cnf" : { 1092 "COSE_Key" : { 1093 "kty" : "EC", 1094 "kid" : h'11', 1095 "crv" : "P-256", 1096 "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', 1097 "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' 1098 } 1099 } 1100 } 1102 Figure 6: Example token request bound to an asymmetric key. 1104 Figure 7 shows a request for a token where a previously communicated 1105 proof-of-possession key is only referenced using the "req_cnf" 1106 parameter from [I-D.ietf-ace-oauth-params]. 1108 Header: POST (Code=0.02) 1109 Uri-Host: "as.example.com" 1110 Uri-Path: "token" 1111 Content-Format: "application/ace+cbor" 1112 Payload: 1113 { 1114 "client_id" : "myclient", 1115 "audience" : "valve424", 1116 "scope" : "read", 1117 "req_cnf" : { 1118 "kid" : b64'6kg0dXJM13U' 1119 } 1120 }W 1122 Figure 7: Example request for an access token bound to a key 1123 reference. 1125 Refresh tokens are typically not stored as securely as proof-of- 1126 possession keys in requesting clients. Proof-of-possession based 1127 refresh token requests MUST NOT request different proof-of-possession 1128 keys or different audiences in token requests. Refresh token 1129 requests can only use to request access tokens bound to the same 1130 proof-of-possession key and the same audience as access tokens issued 1131 in the initial token request. 1133 5.6.2. AS-to-Client Response 1135 If the access token request has been successfully verified by the AS 1136 and the client is authorized to obtain an access token corresponding 1137 to its access token request, the AS sends a response with the 1138 response code equivalent to the CoAP response code 2.01 (Created). 1139 If client request was invalid, or not authorized, the AS returns an 1140 error response as described in Section 5.6.3. 1142 Note that the AS decides which token type and profile to use when 1143 issuing a successful response. It is assumed that the AS has prior 1144 knowledge of the capabilities of the client and the RS (see 1145 Appendix D). This prior knowledge may, for example, be set by the 1146 use of a dynamic client registration protocol exchange [RFC7591]. If 1147 the client has requested a specific proof-of-possession key using the 1148 "req_cnf" parameter from [I-D.ietf-ace-oauth-params], this may also 1149 influence which profile the AS selects, as it needs to support the 1150 use of the key type requested the client. 1152 The content of the successful reply is the Access Information. When 1153 using CBOR payloads, the content MUST be encoded as a CBOR map, 1154 containing parameters as specified in Section 5.1 of [RFC6749], with 1155 the following additions and changes: 1157 ace_profile: 1158 OPTIONAL unless the request included an empty ace_profile 1159 parameter in which case it is MANDATORY. This indicates the 1160 profile that the client MUST use towards the RS. See 1161 Section 5.6.4.3 for the formatting of this parameter. If this 1162 parameter is absent, the AS assumes that the client implicitly 1163 knows which profile to use towards the RS. 1165 token_type: 1166 This parameter is OPTIONAL, as opposed to 'required' in [RFC6749]. 1167 By default implementations of this framework SHOULD assume that 1168 the token_type is "PoP". If a specific use case requires another 1169 token_type (e.g., "Bearer") to be used then this parameter is 1170 REQUIRED. 1172 Furthermore [I-D.ietf-ace-oauth-params] defines additional parameters 1173 that the AS MUST be able to use when responding to a request to the 1174 token endpoint. 1176 Figure 8 summarizes the parameters that can currently be part of the 1177 Access Information. Future extensions may define additional 1178 parameters. 1180 /-------------------+-------------------------------\ 1181 | Parameter name | Specified in | 1182 |-------------------+-------------------------------| 1183 | access_token | RFC 6749 | 1184 | token_type | RFC 6749 | 1185 | expires_in | RFC 6749 | 1186 | refresh_token | RFC 6749 | 1187 | scope | RFC 6749 | 1188 | state | RFC 6749 | 1189 | error | RFC 6749 | 1190 | error_description | RFC 6749 | 1191 | error_uri | RFC 6749 | 1192 | ace_profile | [this document] | 1193 | cnf | [I-D.ietf-ace-oauth-params] | 1194 | rs_cnf | [I-D.ietf-ace-oauth-params] | 1195 \-------------------+-------------------------------/ 1197 Figure 8: Access Information parameters 1199 Figure 9 shows a response containing a token and a "cnf" parameter 1200 with a symmetric proof-of-possession key, which is defined in 1201 [I-D.ietf-ace-oauth-params]. Note that the key identifier 'kid' is 1202 only used to simplify indexing and retrieving the key, and no 1203 assumptions should be made that it is unique in the domains of either 1204 the client or the RS. 1206 Header: Created (Code=2.01) 1207 Content-Format: "application/ace+cbor" 1208 Payload: 1209 { 1210 "access_token" : b64'SlAV32hkKG ... 1211 (remainder of CWT omitted for brevity; 1212 CWT contains COSE_Key in the "cnf" claim)', 1213 "ace_profile" : "coap_dtls", 1214 "expires_in" : "3600", 1215 "cnf" : { 1216 "COSE_Key" : { 1217 "kty" : "Symmetric", 1218 "kid" : b64'39Gqlw', 1219 "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' 1220 } 1221 } 1222 } 1224 Figure 9: Example AS response with an access token bound to a 1225 symmetric key. 1227 5.6.3. Error Response 1229 The error responses for CoAP-based interactions with the AS are 1230 generally equivalent to the ones for HTTP-based interactions as 1231 defined in Section 5.2 of [RFC6749], with the following exceptions: 1233 o When using CBOR the raw payload before being processed by the 1234 communication security protocol MUST be encoded as a CBOR map. 1236 o A response code equivalent to the CoAP code 4.00 (Bad Request) 1237 MUST be used for all error responses, except for invalid_client 1238 where a response code equivalent to the CoAP code 4.01 1239 (Unauthorized) MAY be used under the same conditions as specified 1240 in Section 5.2 of [RFC6749]. 1242 o The Content-Format (for CoAP-based interactions) or media type 1243 (for HTTP-based interactions) "application/ace+cbor" MUST be used 1244 for the error response. 1246 o The parameters "error", "error_description" and "error_uri" MUST 1247 be abbreviated using the codes specified in Figure 12, when a CBOR 1248 encoding is used. 1250 o The error code (i.e., value of the "error" parameter) MUST be 1251 abbreviated as specified in Figure 10, when a CBOR encoding is 1252 used. 1254 /------------------------+-------------\ 1255 | Name | CBOR Values | 1256 |------------------------+-------------| 1257 | invalid_request | 1 | 1258 | invalid_client | 2 | 1259 | invalid_grant | 3 | 1260 | unauthorized_client | 4 | 1261 | unsupported_grant_type | 5 | 1262 | invalid_scope | 6 | 1263 | unsupported_pop_key | 7 | 1264 | incompatible_profiles | 8 | 1265 \------------------------+-------------/ 1267 Figure 10: CBOR abbreviations for common error codes 1269 In addition to the error responses defined in OAuth 2.0, the 1270 following behavior MUST be implemented by the AS: 1272 o If the client submits an asymmetric key in the token request that 1273 the RS cannot process, the AS MUST reject that request with a 1274 response code equivalent to the CoAP code 4.00 (Bad Request) 1275 including the error code "unsupported_pop_key" defined in 1276 Figure 10. 1278 o If the client and the RS it has requested an access token for do 1279 not share a common profile, the AS MUST reject that request with a 1280 response code equivalent to the CoAP code 4.00 (Bad Request) 1281 including the error code "incompatible_profiles" defined in 1282 Figure 10. 1284 5.6.4. Request and Response Parameters 1286 This section provides more detail about the new parameters that can 1287 be used in access token requests and responses, as well as 1288 abbreviations for more compact encoding of existing parameters and 1289 common parameter values. 1291 5.6.4.1. Grant Type 1293 The abbreviations specified in the registry defined in Section 8.4 1294 MUST be used in CBOR encodings instead of the string values defined 1295 in [RFC6749], if CBOR payloads are used. 1297 /--------------------+------------+------------------------\ 1298 | Name | CBOR Value | Original Specification | 1299 |--------------------+------------+------------------------| 1300 | password | 0 | [RFC6749] | 1301 | authorization_code | 1 | [RFC6749] | 1302 | client_credentials | 2 | [RFC6749] | 1303 | refresh_token | 3 | [RFC6749] | 1304 \--------------------+------------+------------------------/ 1306 Figure 11: CBOR abbreviations for common grant types 1308 5.6.4.2. Token Type 1310 The "token_type" parameter, defined in section 5.1 of [RFC6749], 1311 allows the AS to indicate to the client which type of access token it 1312 is receiving (e.g., a bearer token). 1314 This document registers the new value "PoP" for the OAuth Access 1315 Token Types registry, specifying a proof-of-possession token. How 1316 the proof-of-possession by the client to the RS is performed MUST be 1317 specified by the profiles. 1319 The values in the "token_type" parameter MUST use the CBOR 1320 abbreviations defined in the registry specified by Section 8.6, if a 1321 CBOR encoding is used. 1323 In this framework the "pop" value for the "token_type" parameter is 1324 the default. The AS may, however, provide a different value. 1326 5.6.4.3. Profile 1328 Profiles of this framework MUST define the communication protocol and 1329 the communication security protocol between the client and the RS. 1330 The security protocol MUST provide encryption, integrity and replay 1331 protection. It MUST also provide a binding between requests and 1332 responses. Furthermore profiles MUST define a list of allowed proof- 1333 of-possession methods, if they support proof-of-possession tokens. 1335 A profile MUST specify an identifier that MUST be used to uniquely 1336 identify itself in the "ace_profile" parameter. The textual 1337 representation of the profile identifier is just intended for human 1338 readability and MUST NOT be used in parameters and claims. Profiles 1339 MUST register their identifier in the registry defined in 1340 Section 8.7. 1342 Profiles MAY define additional parameters for both the token request 1343 and the Access Information in the access token response in order to 1344 support negotiation or signaling of profile specific parameters. 1346 Clients that want the AS to provide them with the "ace_profile" 1347 parameter in the access token response can indicate that by sending a 1348 ace_profile parameter with a null value in the access token request. 1350 5.6.4.4. Client-Nonce 1352 This parameter MUST be sent from the client to the AS, if it 1353 previously received a "cnonce" parameter in the AS Request Creation 1354 Hints Section 5.1.2. The parameter is encoded as a byte string and 1355 copies the value from the cnonce parameter in the AS Request Creation 1356 Hints. 1358 5.6.5. Mapping Parameters to CBOR 1360 If CBOR encoding is used, all OAuth parameters in access token 1361 requests and responses MUST be mapped to CBOR types as specified in 1362 the registry defined by Section 8.9, using the given integer 1363 abbreviation for the map keys. 1365 Note that we have aligned the abbreviations corresponding to claims 1366 with the abbreviations defined in [RFC8392]. 1368 Note also that abbreviations from -24 to 23 have a 1 byte encoding 1369 size in CBOR. We have thus chosen to assign abbreviations in that 1370 range to parameters we expect to be used most frequently in 1371 constrained scenarios. 1373 /-------------------+----------+---------------------\ 1374 | Name | CBOR Key | Value Type | 1375 |-------------------+----------+---------------------| 1376 | access_token | 1 | byte string | 1377 | expires_in | 2 | unsigned integer | 1378 | audience | 5 | text string | 1379 | scope | 9 | text or byte string | 1380 | client_id | 24 | text string | 1381 | client_secret | 25 | byte string | 1382 | response_type | 26 | text string | 1383 | redirect_uri | 27 | text string | 1384 | state | 28 | text string | 1385 | code | 29 | byte string | 1386 | error | 30 | unsigned integer | 1387 | error_description | 31 | text string | 1388 | error_uri | 32 | text string | 1389 | grant_type | 33 | unsigned integer | 1390 | token_type | 34 | unsigned integer | 1391 | username | 35 | text string | 1392 | password | 36 | text string | 1393 | refresh_token | 37 | byte string | 1394 | ace_profile | 38 | unsigned integer | 1395 | cnonce | 39 | byte string | 1396 \-------------------+----------+---------------------/ 1398 Figure 12: CBOR mappings used in token requests and responses 1400 5.7. The Introspection Endpoint 1402 Token introspection [RFC7662] can be OPTIONALLY provided by the AS, 1403 and is then used by the RS and potentially the client to query the AS 1404 for metadata about a given token, e.g., validity or scope. Analogous 1405 to the protocol defined in [RFC7662] for HTTP and JSON, this section 1406 defines adaptations to more constrained environments using CBOR and 1407 leaving the choice of the application protocol to the profile. 1409 Communication between the requesting entity and the introspection 1410 endpoint at the AS MUST be integrity protected and encrypted. The 1411 communication security protocol MUST also provide a binding between 1412 requests and responses. Furthermore the two interacting parties MUST 1413 perform mutual authentication. Finally the AS SHOULD verify that the 1414 requesting entity has the right to access introspection information 1415 about the provided token. Profiles of this framework that support 1416 introspection MUST specify how authentication and communication 1417 security between the requesting entity and the AS is implemented. 1419 The default name of this endpoint in an url-path is '/introspect', 1420 however implementations are not required to use this name and can 1421 define their own instead. 1423 The figures of this section uses CBOR diagnostic notation without the 1424 integer abbreviations for the parameters or their values for better 1425 readability. 1427 Note that supporting introspection is OPTIONAL for implementations of 1428 this framework. 1430 5.7.1. Introspection Request 1432 The requesting entity sends a POST request to the introspection 1433 endpoint at the AS. The profile MUST specify how the communication 1434 is protected. If CBOR is used, the payload MUST be encoded as a CBOR 1435 map with a "token" entry containing the access token. Further 1436 optional parameters representing additional context that is known by 1437 the requesting entity to aid the AS in its response MAY be included. 1439 For CoAP-based interaction, all messages MUST use the content type 1440 "application/ace+cbor", while for HTTP-based interactions the 1441 equivalent media type "application/ace+cbor" MUST be used. 1443 The same parameters are required and optional as in Section 2.1 of 1444 [RFC7662]. 1446 For example, Figure 13 shows a RS calling the token introspection 1447 endpoint at the AS to query about an OAuth 2.0 proof-of-possession 1448 token. Note that object security based on OSCORE [RFC8613] is 1449 assumed in this example, therefore the Content-Format is 1450 "application/oscore". Figure 14 shows the decoded payload. 1452 Header: POST (Code=0.02) 1453 Uri-Host: "as.example.com" 1454 Uri-Path: "introspect" 1455 OSCORE: 0x09, 0x05, 0x25 1456 Content-Format: "application/oscore" 1457 Payload: 1458 ... COSE content ... 1460 Figure 13: Example introspection request. 1462 { 1463 "token" : b64'7gj0dXJQ43U', 1464 "token_type_hint" : "PoP" 1465 } 1467 Figure 14: Decoded payload. 1469 5.7.2. Introspection Response 1471 If the introspection request is authorized and successfully 1472 processed, the AS sends a response with the response code equivalent 1473 to the CoAP code 2.01 (Created). If the introspection request was 1474 invalid, not authorized or couldn't be processed the AS returns an 1475 error response as described in Section 5.7.3. 1477 In a successful response, the AS encodes the response parameters in a 1478 map including with the same required and optional parameters as in 1479 Section 2.2 of [RFC7662] with the following addition: 1481 ace_profile OPTIONAL. This indicates the profile that the RS MUST 1482 use with the client. See Section 5.6.4.3 for more details on the 1483 formatting of this parameter. 1485 cnonce OPTIONAL. A client-nonce provided to the AS by the client. 1486 The RS MUST verify that this corresponds to the client-nonce 1487 previously provided to the client in the AS Request Creation 1488 Hints. See Section 5.1.2 and Section 5.6.4.4. 1490 exi OPTIONAL. The "expires-in" claim associated to this access 1491 token. See Section 5.8.3. 1493 Furthermore [I-D.ietf-ace-oauth-params] defines more parameters that 1494 the AS MUST be able to use when responding to a request to the 1495 introspection endpoint. 1497 For example, Figure 15 shows an AS response to the introspection 1498 request in Figure 13. Note that this example contains the "cnf" 1499 parameter defined in [I-D.ietf-ace-oauth-params]. 1501 Header: Created (Code=2.01) 1502 Content-Format: "application/ace+cbor" 1503 Payload: 1504 { 1505 "active" : true, 1506 "scope" : "read", 1507 "ace_profile" : "coap_dtls", 1508 "cnf" : { 1509 "COSE_Key" : { 1510 "kty" : "Symmetric", 1511 "kid" : b64'39Gqlw', 1512 "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' 1513 } 1514 } 1515 } 1517 Figure 15: Example introspection response. 1519 5.7.3. Error Response 1521 The error responses for CoAP-based interactions with the AS are 1522 equivalent to the ones for HTTP-based interactions as defined in 1523 Section 2.3 of [RFC7662], with the following differences: 1525 o If content is sent and CBOR is used the payload MUST be encoded as 1526 a CBOR map and the Content-Format "application/ace+cbor" MUST be 1527 used. 1529 o If the credentials used by the requesting entity (usually the RS) 1530 are invalid the AS MUST respond with the response code equivalent 1531 to the CoAP code 4.01 (Unauthorized) and use the required and 1532 optional parameters from Section 5.2 in [RFC6749]. 1534 o If the requesting entity does not have the right to perform this 1535 introspection request, the AS MUST respond with a response code 1536 equivalent to the CoAP code 4.03 (Forbidden). In this case no 1537 payload is returned. 1539 o The parameters "error", "error_description" and "error_uri" MUST 1540 be abbreviated using the codes specified in Figure 12. 1542 o The error codes MUST be abbreviated using the codes specified in 1543 the registry defined by Section 8.3. 1545 Note that a properly formed and authorized query for an inactive or 1546 otherwise invalid token does not warrant an error response by this 1547 specification. In these cases, the authorization server MUST instead 1548 respond with an introspection response with the "active" field set to 1549 "false". 1551 5.7.4. Mapping Introspection parameters to CBOR 1553 If CBOR is used, the introspection request and response parameters 1554 MUST be mapped to CBOR types as specified in the registry defined by 1555 Section 8.11, using the given integer abbreviation for the map key. 1557 Note that we have aligned abbreviations that correspond to a claim 1558 with the abbreviations defined in [RFC8392] and the abbreviations of 1559 parameters with the same name from Section 5.6.5. 1561 /-------------------+----------+-------------------------\ 1562 | Parameter name | CBOR Key | Value Type | 1563 |-------------------+----------+-------------------------| 1564 | iss | 1 | text string | 1565 | sub | 2 | text string | 1566 | aud | 3 | text string | 1567 | exp | 4 | integer or | 1568 | | | floating-point number | 1569 | nbf | 5 | integer or | 1570 | | | floating-point number | 1571 | iat | 6 | integer or | 1572 | | | floating-point number | 1573 | cti | 7 | byte string | 1574 | scope | 9 | text or byte string | 1575 | active | 10 | True or False | 1576 | token | 11 | byte string | 1577 | client_id | 24 | text string | 1578 | error | 30 | unsigned integer | 1579 | error_description | 31 | text string | 1580 | error_uri | 32 | text string | 1581 | token_type_hint | 33 | text string | 1582 | token_type | 34 | text string | 1583 | username | 35 | text string | 1584 | ace_profile | 38 | unsigned integer | 1585 | cnonce | 39 | byte string | 1586 | exi | 40 | unsigned integer | 1587 \-------------------+----------+-------------------------/ 1589 Figure 16: CBOR Mappings to Token Introspection Parameters. 1591 5.8. The Access Token 1593 This framework RECOMMENDS the use of CBOR web token (CWT) as 1594 specified in [RFC8392]. 1596 In order to facilitate offline processing of access tokens, this 1597 document uses the "cnf" claim from 1598 [I-D.ietf-ace-cwt-proof-of-possession] and the "scope" claim from 1599 [I-D.ietf-oauth-token-exchange] for JWT- and CWT-encoded tokens. In 1600 addition to string encoding specified for the "scope" claim, a binary 1601 encoding MAY be used. The syntax of such an encoding is explicitly 1602 not specified here and left to profiles or applications, specifically 1603 note that a binary encoded scope does not necessarily use the space 1604 character '0x20' to delimit scope-tokens. 1606 If the AS needs to convey a hint to the RS about which profile it 1607 should use to communicate with the client, the AS MAY include an 1608 "ace_profile" claim in the access token, with the same syntax and 1609 semantics as defined in Section 5.6.4.3. 1611 If the client submitted a client-nonce parameter in the access token 1612 request Section 5.6.4.4, the AS MUST include the value of this 1613 parameter in the "cnonce" claim specified here. The "cnonce" claim 1614 uses binary encoding. 1616 5.8.1. The Authorization Information Endpoint 1618 The access token, containing authorization information and 1619 information about the proof-of-possession method used by the client, 1620 needs to be transported to the RS so that the RS can authenticate and 1621 authorize the client request. 1623 This section defines a method for transporting the access token to 1624 the RS using a RESTful protocol such as CoAP. Profiles of this 1625 framework MAY define other methods for token transport. 1627 The method consists of an authz-info endpoint, implemented by the RS. 1628 A client using this method MUST make a POST request to the authz-info 1629 endpoint at the RS with the access token in the payload. The RS 1630 receiving the token MUST verify the validity of the token. If the 1631 token is valid, the RS MUST respond to the POST request with 2.01 1632 (Created). Section Section 5.8.1.1 outlines how an RS MUST proceed 1633 to verify the validity of an access token. 1635 The RS MUST be prepared to store at least one access token for future 1636 use. This is a difference to how access tokens are handled in OAuth 1637 2.0, where the access token is typically sent along with each 1638 request, and therefore not stored at the RS. 1640 This specification RECOMMENDS that an RS stores only one token per 1641 proof-of-possession key, meaning that an additional token linked to 1642 the same key will overwrite any existing token at the RS. The reason 1643 is that this greatly simplifies (constrained) implementations, with 1644 respect to required storage and resolving a request to the applicable 1645 token. 1647 If the payload sent to the authz-info endpoint does not parse to a 1648 token, the RS MUST respond with a response code equivalent to the 1649 CoAP code 4.00 (Bad Request). 1651 The RS MAY make an introspection request to validate the token before 1652 responding to the POST request to the authz-info endpoint, e.g. if 1653 the token is an opaque reference. Some transport protocols may 1654 provide a way to indicate that the RS is busy and the client should 1655 retry after an interval; this type of status update would be 1656 appropriate while the RS is waiting for an introspection response. 1658 Profiles MUST specify whether the authz-info endpoint is protected, 1659 including whether error responses from this endpoint are protected. 1660 Note that since the token contains information that allow the client 1661 and the RS to establish a security context in the first place, mutual 1662 authentication may not be possible at this point. 1664 The default name of this endpoint in an url-path is '/authz-info', 1665 however implementations are not required to use this name and can 1666 define their own instead. 1668 5.8.1.1. Verifying an Access Token 1670 When an RS receives an access token, it MUST verify it before storing 1671 it. The details of token verification depends on various aspects, 1672 including the token encoding, the type of token, the security 1673 protection applied to the token, and the claims. The token encoding 1674 matters since the security wrapper differs between the token 1675 encodings. For example, a CWT token uses COSE while a JWT token uses 1676 JOSE. The type of token also has an influence on the verification 1677 procedure since tokens may be self-contained whereby token 1678 verification may happen locally at the RS while a token-by-reference 1679 requires further interaction with the authorization server, for 1680 example using token introspection, to obtain the claims associated 1681 with the token reference. Self-contained tokens MUST, at a minimum, 1682 be integrity protected but they MAY also be encrypted. 1684 For self-contained tokens the RS MUST process the security protection 1685 of the token first, as specified by the respective token format. For 1686 CWT the description can be found in [RFC8392] and for JWT the 1687 relevant specification is [RFC7519]. This MUST include a 1688 verification that security protection (and thus the token) was 1689 generated by an AS that has the right to issue access tokens for this 1690 RS. 1692 In case the token is communicated by reference the RS needs to obtain 1693 the claims first. When the RS uses token introspection the relevant 1694 specification is [RFC7662] with CoAP transport specified in 1695 Section 5.7. 1697 Errors may happen during this initial processing stage: 1699 o If token or claim verification fails, the RS MUST discard the 1700 token and, if this was an interaction with authz-info, return an 1701 error message with a response code equivalent to the CoAP code 1702 4.01 (Unauthorized). 1704 o If the claims cannot be obtained the RS MUST discard the token 1705 and, in case of an interaction via the authz-info endpoint, return 1706 an error message with a response code equivalent to the CoAP code 1707 4.00 (Bad Request). 1709 Next, the RS MUST verify claims, if present, contained in the access 1710 token. Errors are returned when claim checks fail, in the order of 1711 priority of this list: 1713 iss The issuer claim must identify an AS that has the authority to 1714 issue access tokens for the receiving RS. If that is not the case 1715 the RS MUST discard the token. If this was an interaction with 1716 authz-info, the RS MUST also respond with a response code 1717 equivalent to the CoAP code 4.01 (Unauthorized). 1719 exp The expiration date must be in the future. If that is not the 1720 case the RS MUST discard the token. If this was an interaction 1721 with authz-info the RS MUST also respond with a response code 1722 equivalent to the CoAP code 4.01 (Unauthorized). Note that the RS 1723 has to terminate access rights to the protected resources at the 1724 time when the tokens expire. 1726 aud The audience claim must refer to an audience that the RS 1727 identifies with. If that is not the case the RS MUST discard the 1728 token. If this was an interaction with authz-info, the RS MUST 1729 also respond with a response code equivalent to the CoAP code 4.03 1730 (Forbidden). 1732 scope The RS must recognize value of the scope claim. If that is 1733 not the case the RS MUST discard the token. If this was an 1734 interaction with authz-info, the RS MUST also respond with a 1735 response code equivalent to the CoAP code 4.00 (Bad Request). The 1736 RS MAY provide additional information in the error response, to 1737 clarify what went wrong. 1739 Additional processing may be needed for other claims in a way 1740 specific to a profile or the underlying application. 1742 Note that the Subject (sub) claim cannot always be verified when the 1743 token is submitted to the RS since the client may not have 1744 authenticated yet. Also note that a counter for the expires_in (exi) 1745 claim MUST be initialized when the RS first verifies this token. 1747 Also note that profiles of this framework may define access token 1748 transport mechanisms that do not allow for error responses. 1749 Therefore the error messages specified here only apply if the token 1750 was sent to the authz-info endpoint. 1752 When sending error responses, the RS MAY use the error codes from 1753 Section 3.1 of [RFC6750], to provide additional details to the 1754 client. 1756 5.8.1.2. Protecting the Authorization Information Endpoint 1758 As this framework can be used in RESTful environments, it is 1759 important to make sure that attackers cannot perform unauthorized 1760 requests on the authz-info endpoints, other than submitting access 1761 tokens. 1763 Specifically it SHOULD NOT be possible to perform GET, DELETE or PUT 1764 on the authz-info endpoint and on it's children (if any). 1766 The POST method SHOULD NOT be allowed on children of the authz-info 1767 endpoint. 1769 The RS SHOULD implement rate limiting measures to mitigate attacks 1770 aiming to overload the processing capacity of the RS by repeatedly 1771 submitting tokens. For CoAP-based communication the RS could use the 1772 mechanisms from [RFC8516] to indicate that it is overloaded. 1774 5.8.2. Client Requests to the RS 1776 Before sending a request to a RS, the client MUST verify that the 1777 keys used to protect this communication are still valid. See 1778 Section 5.8.4 for details on how the client determines the validity 1779 of the keys used. 1781 If an RS receives a request from a client, and the target resource 1782 requires authorization, the RS MUST first verify that it has an 1783 access token that authorizes this request, and that the client has 1784 performed the proof-of-possession binding that token to the request. 1786 The response code MUST be 4.01 (Unauthorized) in case the client has 1787 not performed the proof-of-possession, or if RS has no valid access 1788 token for the client. If RS has an access token for the client but 1789 the token does not authorize access for the resource that was 1790 requested, RS MUST reject the request with a 4.03 (Forbidden). If RS 1791 has an access token for the client but it does not cover the action 1792 that was requested on the resource, RS MUST reject the request with a 1793 4.05 (Method Not Allowed). 1795 Note: The use of the response codes 4.03 and 4.05 is intended to 1796 prevent infinite loops where a dumb Client optimistically tries to 1797 access a requested resource with any access token received from AS. 1798 As malicious clients could pretend to be C to determine C's 1799 privileges, these detailed response codes must be used only when a 1800 certain level of security is already available which can be achieved 1801 only when the Client is authenticated. 1803 Note: The RS MAY use introspection for timely validation of an access 1804 token, at the time when a request is presented. 1806 Note: Matching the claims of the access token (e.g., scope) to a 1807 specific request is application specific. 1809 If the request matches a valid token and the client has performed the 1810 proof-of-possession for that token, the RS continues to process the 1811 request as specified by the underlying application. 1813 5.8.3. Token Expiration 1815 Depending on the capabilities of the RS, there are various ways in 1816 which it can verify the expiration of a received access token. Here 1817 follows a list of the possibilities including what functionality they 1818 require of the RS. 1820 o The token is a CWT and includes an "exp" claim and possibly the 1821 "nbf" claim. The RS verifies these by comparing them to values 1822 from its internal clock as defined in [RFC7519]. In this case the 1823 RS's internal clock must reflect the current date and time, or at 1824 least be synchronized with the AS's clock. How this clock 1825 synchronization would be performed is out of scope for this 1826 specification. 1828 o The RS verifies the validity of the token by performing an 1829 introspection request as specified in Section 5.7. This requires 1830 the RS to have a reliable network connection to the AS and to be 1831 able to handle two secure sessions in parallel (C to RS and RS to 1832 AS). 1834 o In order to support token expiration for devices that have no 1835 reliable way of synchronizing their internal clocks, this 1836 specification defines the following approach: The claim "exi" 1837 ("expires in") can be used, to provide the RS with the lifetime of 1838 the token in seconds from the time the RS first receives the 1839 token. Processing this claim requires that the RS does the 1840 following: 1842 * For each token the RS receives, that contains an "exi" claim: 1843 Keep track of the time it received that token and revisit that 1844 list regularly to expunge expired tokens. 1846 * Keep track of the identifiers of tokens containing the "exi" 1847 claim that have expired (in order to avoid accepting them 1848 again). 1850 If a token that authorizes a long running request such as a CoAP 1851 Observe [RFC7641] expires, the RS MUST send an error response with 1852 the response code equivalent to the CoAP code 4.01 (Unauthorized) to 1853 the client and then terminate processing the long running request. 1855 5.8.4. Key Expiration 1857 The AS provides the client with key material that the RS uses. This 1858 can either be a common symmetric PoP-key, or an asymmetric key used 1859 by the RS to authenticate towards the client. Since there is 1860 currently no expiration metadata associated to those keys, the client 1861 has no way of knowing if these keys are still valid. This may lead 1862 to situations where the client sends requests containing sensitive 1863 information to the RS using a key that is expired and possibly in the 1864 hands of an attacker, or accepts responses from the RS that are not 1865 properly protected and could possibly have been forged by an 1866 attacker. 1868 In order to prevent this, the client must assume that those keys are 1869 only valid as long as the related access token is. Since the access 1870 token is opaque to the client, one of the following methods MUST be 1871 used to inform the client about the validity of an access token: 1873 o The client knows a default validity time for all tokens it is 1874 using (i.e. how long a token is valid after being issued). This 1875 information could be provisioned to the client when it is 1876 registered at the AS, or published by the AS in a way that the 1877 client can query. 1879 o The AS informs the client about the token validity using the 1880 "expires_in" parameter in the Access Information. 1882 A client that is not able to obtain information about the expiration 1883 of a token MUST NOT use this token. 1885 6. Security Considerations 1887 Security considerations applicable to authentication and 1888 authorization in RESTful environments provided in OAuth 2.0 [RFC6749] 1889 apply to this work. Furthermore [RFC6819] provides additional 1890 security considerations for OAuth which apply to IoT deployments as 1891 well. If the introspection endpoint is used, the security 1892 considerations from [RFC7662] also apply. 1894 The following subsections address issues specific to this document 1895 and it's use in constrained environments. 1897 6.1. Protecting Tokens 1899 A large range of threats can be mitigated by protecting the contents 1900 of the access token by using a digital signature or a keyed message 1901 digest (MAC) or an Authenticated Encryption with Associated Data 1902 (AEAD) algorithm. Consequently, the token integrity protection MUST 1903 be applied to prevent the token from being modified, particularly 1904 since it contains a reference to the symmetric key or the asymmetric 1905 key used for proof-of-possession. If the access token contains the 1906 symmetric key, this symmetric key MUST be encrypted by the 1907 authorization server so that only the resource server can decrypt it. 1908 Note that using an AEAD algorithm is preferable over using a MAC 1909 unless the token needs to be publicly readable. 1911 If the token is intended for multiple recipients (i.e. an audience 1912 that is a group), integrity protection of the token with a symmetric 1913 key, shared between the AS and the recipients, is not sufficient, 1914 since any of the recipients could modify the token undetected by the 1915 other recipients. Therefore a token with a multi-recipient audience 1916 MUST be protected with an asymmetric signature. 1918 It is important for the authorization server to include the identity 1919 of the intended recipient (the audience), typically a single resource 1920 server (or a list of resource servers), in the token. The same 1921 shared secret MUST NOT be used as proof-of-possession key with 1922 multiple resource servers since the benefit from using the proof-of- 1923 possession concept is then significantly reduced. 1925 If clients are capable of doing so, they should frequently request 1926 fresh access tokens, as this allows the AS to keep the lifetime of 1927 the tokens short. This allows the AS to use shorter proof-of- 1928 possession key sizes, which translate to a performance benefit for 1929 the client and for the resource server. Shorter keys also lead to 1930 shorter messages (particularly with asymmetric keying material). 1932 When authorization servers bind symmetric keys to access tokens, they 1933 SHOULD scope these access tokens to a specific permission. 1935 In certain situations it may be necessary to revoke an access token 1936 that is still valid. Client-initiated revocation is specified in 1937 [RFC7009] for OAuth 2.0. Other revocation mechanisms are currently 1938 not specified, as the underlying assumption in OAuth is that access 1939 tokens are issued with a relatively short lifetime. This may not 1940 hold true for disconnected constrained devices, needing access tokens 1941 with relatively long lifetimes, and would therefore necessitate 1942 further standardization work that is out of scope for this document. 1944 6.2. Communication Security 1946 Communication with the authorization server MUST use confidentiality 1947 protection. This step is extremely important since the client or the 1948 RS may obtain the proof-of-possession key from the authorization 1949 server for use with a specific access token. Not using 1950 confidentiality protection exposes this secret (and the access token) 1951 to an eavesdropper thereby completely negating proof-of-possession 1952 security. Profiles MUST specify how communication security according 1953 to the requirements in Section 5 is provided. 1955 Additional protection for the access token can be applied by 1956 encrypting it, for example encryption of CWTs is specified in 1957 Section 5.1 of [RFC8392]. Such additional protection can be 1958 necessary if the token is later transferred over an insecure 1959 connection (e.g. when it is sent to the authz-info endpoint). 1961 Developers MUST ensure that the ephemeral credentials (i.e., the 1962 private key or the session key) are not leaked to third parties. An 1963 adversary in possession of the ephemeral credentials bound to the 1964 access token will be able to impersonate the client. Be aware that 1965 this is a real risk with many constrained environments, since 1966 adversaries can often easily get physical access to the devices. 1967 This risk can also be mitigated to some extent by making sure that 1968 keys are refreshed more frequently. 1970 6.3. Long-Term Credentials 1972 Both clients and RSs have long-term credentials that are used to 1973 secure communications, and authenticate to the AS. These credentials 1974 need to be protected against unauthorized access. In constrained 1975 devices, deployed in publicly accessible places, such protection can 1976 be difficult to achieve without specialized hardware (e.g. secure key 1977 storage memory). 1979 If credentials are lost or compromised, the operator of the affected 1980 devices needs to have procedures to invalidate any access these 1981 credentials give and to revoke tokens linked to such credentials. 1982 The loss of a credential linked to a specific device MUST NOT lead to 1983 a compromise of other credentials not linked to that device, 1984 therefore secret keys used for authentication MUST NOT be shared 1985 between more than two parties. 1987 Operators of clients or RS SHOULD have procedures in place to replace 1988 credentials that are suspected to have been compromised or that have 1989 been lost. 1991 Operators also SHOULD have procedures for decommissioning devices, 1992 that include securely erasing credentials and other security critical 1993 material in the devices being decommissioned. 1995 6.4. Unprotected AS Request Creation Hints 1997 Initially, no secure channel exists to protect the communication 1998 between C and RS. Thus, C cannot determine if the AS Request 1999 Creation Hints contained in an unprotected response from RS to an 2000 unauthorized request (see Section 5.1.2) are authentic. It is 2001 therefore advisable to provide C with a (possibly hard-coded) list of 2002 trustworthy authorization servers, possibly including information 2003 used to authenticate the AS, such as a public key or certificate 2004 fingerprint. AS Request Creation Hints referring to a URI not listed 2005 there would be ignored. 2007 A compromised RS may use the hints to trick a client into contacting 2008 an AS that is not supposed to be in charge of that RS. Since this AS 2009 must be in the hard-coded list of trusted AS no violation of 2010 privileges and or exposure of credentials should happen, since a 2011 trusted AS is expected to refuse requestes for which it is not 2012 applicable and render a corresponding error response. However a 2013 compromised RS may use this to perform a denial of service against a 2014 specific AS, by redirecting a large number of client requests to that 2015 AS. 2017 A compromised client can be made to contact any AS, including 2018 compromised ones. This should not affect the RS, since it is 2019 supposed to keep track of which AS are trusted and have corresponding 2020 credentials to verify the source of access tokens it receives. 2022 6.5. Minimal security requirements for communication 2024 This section summarizes the minimal requirements for the 2025 communication security of the different protocol interactions. 2027 C-AS All communication between the client and the Authorization 2028 Server MUST be encrypted, integrity and replay protected. 2029 Furthermore responses from the AS to the client MUST be bound to 2030 the client's request to avoid attacks where the attacker swaps the 2031 intended response for an older one valid for a previous request. 2032 This requires that the client and the Authorization Server have 2033 previously exchanged either a shared secret or their public keys 2034 in order to negotiate a secure communication. Furthermore the 2035 client MUST be able to determine whether an AS has the authority 2036 to issue access tokens for a certain RS. This can for example be 2037 done through pre-configured lists, or through an online lookup 2038 mechanism that in turn also must be secured. 2040 RS-AS The communication between the Resource Server and the 2041 Authorization Server via the introspection endpoint MUST be 2042 encrypted, integrity and replay protected. Furthermore responses 2043 from the AS to the RS MUST be bound to the RS's request. This 2044 requires that the RS and the Authorization Server have previously 2045 exchanged either a shared secret, or their public keys in order to 2046 negotiate a secure communication. Furthermore the RS MUST be able 2047 to determine whether an AS has the authority to issue access 2048 tokens itself. This is usually configured out of band, but could 2049 also be performed through an online lookup mechanism provided that 2050 it is also secured in the same way. 2052 C-RS The initial communication between the client and the Resource 2053 Server can not be secured in general, since the RS is not in 2054 possession of on access token for that client, which would carry 2055 the necessary parameters. If both parties support DTLS without 2056 client authentication it is RECOMMEND to use this mechanism for 2057 protecting the initial communication. After the client has 2058 successfully transmitted the access token to the RS, a secure 2059 communication protocol MUST be established between client and RS 2060 for the actual resource request. This protocol MUST provide 2061 confidentiality, integrity and replay protection as well as a 2062 binding between requests and responses. This requires that the 2063 client learned either the RS's public key or received a symmetric 2064 proof-of-possession key bound to the access token from the AS. 2065 The RS must have learned either the client's public key or a 2066 shared symmetric key from the claims in the token or an 2067 introspection request. Since ACE does not provide profile 2068 negotiation between C and RS, the client MUST have learned what 2069 profile the RS supports (e.g. from the AS or pre-configured) and 2070 initiate the communication accordingly. 2072 6.6. Token Freshness and Expiration 2074 An RS that is offline faces the problem of clock drift. Since it 2075 cannot synchronize its clock with the AS, it may be tricked into 2076 accepting old access tokens that are no longer valid or have been 2077 compromised. In order to prevent this, an RS may use the nonce-based 2078 mechanism defined in Section 5.1.2 to ensure freshness of an Access 2079 Token subsequently presented to this RS. 2081 Another problem with clock drift is that evaluating the standard 2082 token expiration claim "exp" can give unpredictable results. 2084 Acceptable ranges of clock drift are highly dependent on the concrete 2085 application. Important factors are how long access tokens are valid, 2086 and how critical timely expiration of access token is. 2088 The expiration mechanism implemented by the "exi" claim, based on the 2089 first time the RS sees the token was defined to provide a more 2090 predictable alternative. The "exi" approach has some drawbacks that 2091 need to be considered: 2093 A malicious client may hold back tokens with the "exi" claim in 2094 order to prolong their lifespan. 2096 If an RS loses state (e.g. due to an unscheduled reboot), it may 2097 loose the current values of counters tracking the "exi" claims of 2098 tokens it is storing. 2100 The RS needs to keep state about expired tokens that used "exi" in 2101 order to be sure not to accept it again. Attacker may use this to 2102 deplete the RS's storage resources. 2104 The first drawback is inherent to the deployment scenario and the 2105 "exi" solution. It can therefore not be mitigated without requiring 2106 the the RS be online at times. The second drawback can be mitigated 2107 by regularly storing the value of "exi" counters to persistent 2108 memory. The third problem can be mitigated by the AS, by assigning 2109 identifiers (e.g. 'cti') to the tokens, that include a RS identifier 2110 and a sequence number. The RS would then just have to store the 2111 highest sequence number of an expired token it has seen, thus 2112 limiting the necessary state. 2114 6.7. Combining profiles 2116 There may be use cases were different profiles of this framework are 2117 combined. For example, an MQTT-TLS profile is used between the 2118 client and the RS in combination with a CoAP-DTLS profile for 2119 interactions between the client and the AS. The security of a 2120 profile MUST NOT depend on the assumption that the profile is used 2121 for all the different types of interactions in this framework. 2123 6.8. Unprotected Information 2125 Communication with the authz-info endpoint, as well as the various 2126 error responses defined in this framework, all potentially include 2127 sending information over an unprotected channel. These messages may 2128 leak information to an adversary, or may be manipulated by active 2129 attackers to induce incorrect behavior. For example error responses 2130 for requests to the Authorization Information endpoint can reveal 2131 information about an otherwise opaque access token to an adversary 2132 who has intercepted this token. 2134 As far as error messages are concerned, this framework is written 2135 under the assumption that, in general, the benefits of detailed error 2136 messages outweigh the risk due to information leakage. For 2137 particular use cases, where this assessment does not apply, detailed 2138 error messages can be replaced by more generic ones. 2140 In some scenarios it may be possible to protect the communication 2141 with the authz-info endpoint (e.g. through DTLS with only server-side 2142 authentication). In cases where this is not possible this framework 2143 RECOMMENDS to use encrypted CWTs or tokens that are opaque references 2144 and need to be subjected to introspection by the RS. 2146 If the initial unauthorized resource request message (see 2147 Section 5.1.1) is used, the client MUST make sure that it is not 2148 sending sensitive content in this request. While GET and DELETE 2149 requests only reveal the target URI of the resource, POST and PUT 2150 requests would reveal the whole payload of the intended operation. 2152 Since the client is not authenticated at the point when it is 2153 submitting an access token to the authz-info endpoint, attackers may 2154 be pretending to be a client and trying to trick an RS to use an 2155 obsolete profile that in turn specifies a vulnerable security 2156 mechanism via the authz-info endpoint. Such an attack would require 2157 a valid access token containing an "ace_profile" claim requesting the 2158 use of said obsolete profile. Resource Owners should update the 2159 configuration of their RS's to prevent them from using such obsolete 2160 profiles. 2162 6.9. Identifying audiences 2164 The audience claim as defined in [RFC7519] and the equivalent 2165 "audience" parameter from [I-D.ietf-oauth-token-exchange] are 2166 intentionally vague on how to match the audience value to a specific 2167 RS. This is intended to allow application specific semantics to be 2168 used. This section attempts to give some general guidance for the 2169 use of audiences in constrained environments. 2171 URLs are not a good way of identifying mobile devices that can switch 2172 networks and thus be associated with new URLs. If the audience 2173 represents a single RS, and asymmetric keys are used, the RS can be 2174 uniquely identified by a hash of its public key. If this approach is 2175 used this framework RECOMMENDS to apply the procedure from section 3 2176 of [RFC6920]. 2178 If the audience addresses a group of resource servers, the mapping of 2179 group identifier to individual RS has to be provisioned to each RS 2180 before the group-audience is usable. Managing dynamic groups could 2181 be an issue, if any RS is not always reachable when the groups' 2182 memberships change. Furthermore, issuing access tokens bound to 2183 symmetric proof-of-possession keys that apply to a group-audience is 2184 problematic, as an RS that is in possession of the access token can 2185 impersonate the client towards the other RSs that are part of the 2186 group. It is therefore NOT RECOMMENDED to issue access tokens bound 2187 to a group audience and symmetric proof-of possession keys. 2189 Even the client must be able to determine the correct values to put 2190 into the "audience" parameter, in order to obtain a token for the 2191 intended RS. Errors in this process can lead to the client 2192 inadvertently obtaining a token for the wrong RS. The correct values 2193 for "audience" can either be provisioned to the client as part of its 2194 configuration, or dynamically looked up by the client in some 2195 directory. In the latter case the integrity and correctness of the 2196 directory data must be assured. Note that the "audience" hint 2197 provided by the RS as part of the "AS Request Creation Hints" 2198 Section 5.1.2 is not typically source authenticated and integrity 2199 protected, and should therefore not be treated a trusted value. 2201 6.10. Denial of service against or with Introspection 2203 The optional introspection mechanism provided by OAuth and supported 2204 in the ACE framework allows for two types of attacks that need to be 2205 considered by implementers. 2207 First, an attacker could perform a denial of service attack against 2208 the introspection endpoint at the AS in order to prevent validation 2209 of access tokens. To maintain the security of the system, an RS that 2210 is configured to use introspection MUST NOT allow access based on a 2211 token for which it couldn't reach the introspection endpoint. 2213 Second, an attacker could use the fact that an RS performs 2214 introspection to perform a denial of service attack against that RS 2215 by repeatedly sending tokens to its authz-info endpoint that require 2216 an introspection call. RS can mitigate such attacks by implementing 2217 rate limits on how many introspection requests they perform in a 2218 given time interval for a certain client IP address submitting tokens 2219 to /authz-info. When that limit has been reached, incoming requests 2220 from that address are rejected for a certain amount of time. A 2221 general rate limit on the introspection requests should also be 2222 considered, to mitigate distributed attacks. 2224 7. Privacy Considerations 2226 Implementers and users should be aware of the privacy implications of 2227 the different possible deployments of this framework. 2229 The AS is in a very central position and can potentially learn 2230 sensitive information about the clients requesting access tokens. If 2231 the client credentials grant is used, the AS can track what kind of 2232 access the client intends to perform. With other grants this can be 2233 prevented by the Resource Owner. To do so, the resource owner needs 2234 to bind the grants it issues to anonymous, ephemeral credentials that 2235 do not allow the AS to link different grants and thus different 2236 access token requests by the same client. 2238 The claims contained in a token can reveal privacy sensitive 2239 information about the client and the RS to any party having access to 2240 them (whether by processing the content of a self-contained token or 2241 by introspection). The AS SHOULD be configured to minimize the 2242 information about clients and RSs disclosed in the tokens it issues. 2244 If tokens are only integrity protected and not encrypted, they may 2245 reveal information to attackers listening on the wire, or able to 2246 acquire the access tokens in some other way. In the case of CWTs the 2247 token may, e.g., reveal the audience, the scope and the confirmation 2248 method used by the client. The latter may reveal the identity of the 2249 device or application running the client. This may be linkable to 2250 the identity of the person using the client (if there is a person and 2251 not a machine-to-machine interaction). 2253 Clients using asymmetric keys for proof-of-possession should be aware 2254 of the consequences of using the same key pair for proof-of- 2255 possession towards different RSs. A set of colluding RSs or an 2256 attacker able to obtain the access tokens will be able to link the 2257 requests, or even to determine the client's identity. 2259 An unprotected response to an unauthorized request (see 2260 Section 5.1.2) may disclose information about RS and/or its existing 2261 relationship with C. It is advisable to include as little 2262 information as possible in an unencrypted response. If means of 2263 encrypting communication between C and RS already exist, more 2264 detailed information may be included with an error response to 2265 provide C with sufficient information to react on that particular 2266 error. 2268 8. IANA Considerations 2270 This document creates several registries with a registration policy 2271 of "Expert Review"; guidelines to the experts are given in 2272 Section 8.16. 2274 8.1. ACE Authorization Server Request Creation Hints 2276 This specification establishes the IANA "ACE Authorization Server 2277 Request Creation Hints" registry. The registry has been created to 2278 use the "Expert Review" registration procedure [RFC8126]. It should 2279 be noted that, in addition to the expert review, some portions of the 2280 registry require a specification, potentially a Standards Track RFC, 2281 be supplied as well. 2283 The columns of the registry are: 2285 Name The name of the parameter 2287 CBOR Key CBOR map key for the parameter. Different ranges of values 2288 use different registration policies [RFC8126]. Integer values 2289 from -256 to 255 are designated as Standards Action. Integer 2290 values from -65536 to -257 and from 256 to 65535 are designated as 2291 Specification Required. Integer values greater than 65535 are 2292 designated as Expert Review. Integer values less than -65536 are 2293 marked as Private Use. 2295 Value Type The CBOR data types allowable for the values of this 2296 parameter. 2298 Reference This contains a pointer to the public specification of the 2299 request creation hint abbreviation, if one exists. 2301 This registry will be initially populated by the values in Figure 2. 2302 The Reference column for all of these entries will be this document. 2304 8.2. OAuth Extensions Error Registration 2306 This specification registers the following error values in the OAuth 2307 Extensions Error registry [IANA.OAuthExtensionsErrorRegistry]. 2309 o Error name: "unsupported_pop_key" 2310 o Error usage location: token error response 2311 o Related protocol extension: The ACE framework [this document] 2312 o Change Controller: IESG 2313 o Specification document(s): Section 5.6.3 of [this document] 2315 o Error name: "incompatible_profiles" 2316 o Error usage location: token error response 2317 o Related protocol extension: The ACE framework [this document] 2318 o Change Controller: IESG 2319 o Specification document(s): Section 5.6.3 of [this document] 2321 8.3. OAuth Error Code CBOR Mappings Registry 2323 This specification establishes the IANA "OAuth Error Code CBOR 2324 Mappings" registry. The registry has been created to use the "Expert 2325 Review" registration procedure [RFC8126], except for the value range 2326 designated for private use. 2328 The columns of the registry are: 2330 Name The OAuth Error Code name, refers to the name in Section 5.2. 2331 of [RFC6749], e.g., "invalid_request". 2332 CBOR Value CBOR abbreviation for this error code. Integer values 2333 less than -65536 are marked as "Private Use", all other values use 2334 the registration policy "Expert Review" [RFC8126]. 2335 Reference This contains a pointer to the public specification of the 2336 error code abbreviation, if one exists. 2338 This registry will be initially populated by the values in Figure 10. 2339 The Reference column for all of these entries will be this document. 2341 8.4. OAuth Grant Type CBOR Mappings 2343 This specification establishes the IANA "OAuth Grant Type CBOR 2344 Mappings" registry. The registry has been created to use the "Expert 2345 Review" registration procedure [RFC8126], except for the value range 2346 designated for private use. 2348 The columns of this registry are: 2350 Name The name of the grant type as specified in Section 1.3 of 2351 [RFC6749]. 2353 CBOR Value CBOR abbreviation for this grant type. Integer values 2354 less than -65536 are marked as "Private Use", all other values use 2355 the registration policy "Expert Review" [RFC8126]. 2356 Reference This contains a pointer to the public specification of the 2357 grant type abbreviation, if one exists. 2358 Original Specification This contains a pointer to the public 2359 specification of the grant type, if one exists. 2361 This registry will be initially populated by the values in Figure 11. 2362 The Reference column for all of these entries will be this document. 2364 8.5. OAuth Access Token Types 2366 This section registers the following new token type in the "OAuth 2367 Access Token Types" registry [IANA.OAuthAccessTokenTypes]. 2369 o Type name: "PoP" 2370 o Additional Token Endpoint Response Parameters: "cnf", "rs_cnf" see 2371 section 3.3 of [I-D.ietf-ace-oauth-params]. 2372 o HTTP Authentication Scheme(s): N/A 2373 o Change Controller: IETF 2374 o Specification document(s): [this document] 2376 8.6. OAuth Access Token Type CBOR Mappings 2378 This specification established the IANA "OAuth Access Token Type CBOR 2379 Mappings" registry. The registry has been created to use the "Expert 2380 Review" registration procedure [RFC8126], except for the value range 2381 designated for private use. 2383 The columns of this registry are: 2385 Name The name of token type as registered in the OAuth Access Token 2386 Types registry, e.g., "Bearer". 2387 CBOR Value CBOR abbreviation for this token type. Integer values 2388 less than -65536 are marked as "Private Use", all other values use 2389 the registration policy "Expert Review" [RFC8126]. 2390 Reference This contains a pointer to the public specification of the 2391 OAuth token type abbreviation, if one exists. 2392 Original Specification This contains a pointer to the public 2393 specification of the OAuth token type, if one exists. 2395 8.6.1. Initial Registry Contents 2397 o Name: "Bearer" 2398 o Value: 1 2399 o Reference: [this document] 2400 o Original Specification: [RFC6749] 2401 o Name: "PoP" 2402 o Value: 2 2403 o Reference: [this document] 2404 o Original Specification: [this document] 2406 8.7. ACE Profile Registry 2408 This specification establishes the IANA "ACE Profile" registry. The 2409 registry has been created to use the "Expert Review" registration 2410 procedure [RFC8126]. It should be noted that, in addition to the 2411 expert review, some portions of the registry require a specification, 2412 potentially a Standards Track RFC, be supplied as well. 2414 The columns of this registry are: 2416 Name The name of the profile, to be used as value of the profile 2417 attribute. 2418 Description Text giving an overview of the profile and the context 2419 it is developed for. 2420 CBOR Value CBOR abbreviation for this profile name. Different 2421 ranges of values use different registration policies [RFC8126]. 2422 Integer values from -256 to 255 are designated as Standards 2423 Action. Integer values from -65536 to -257 and from 256 to 65535 2424 are designated as Specification Required. Integer values greater 2425 than 65535 are designated as "Expert Review". Integer values less 2426 than -65536 are marked as Private Use. 2427 Reference This contains a pointer to the public specification of the 2428 profile abbreviation, if one exists. 2430 This registry will be initially empty and will be populated by the 2431 registrations from the ACE framework profiles. 2433 8.8. OAuth Parameter Registration 2435 This specification registers the following parameter in the "OAuth 2436 Parameters" registry [IANA.OAuthParameters]: 2438 o Name: "ace_profile" 2439 o Parameter Usage Location: token response 2440 o Change Controller: IESG 2441 o Reference: Section 5.6.4.3 of [this document] 2443 8.9. OAuth Parameters CBOR Mappings Registry 2445 This specification establishes the IANA "OAuth Parameters CBOR 2446 Mappings" registry. The registry has been created to use the "Expert 2447 Review" registration procedure [RFC8126], except for the value range 2448 designated for private use. 2450 The columns of this registry are: 2452 Name The OAuth Parameter name, refers to the name in the OAuth 2453 parameter registry, e.g., "client_id". 2454 CBOR Key CBOR map key for this parameter. Integer values less than 2455 -65536 are marked as "Private Use", all other values use the 2456 registration policy "Expert Review" [RFC8126]. 2457 Value Type The allowable CBOR data types for values of this 2458 parameter. 2459 Reference This contains a pointer to the public specification of the 2460 OAuth parameter abbreviation, if one exists. 2462 This registry will be initially populated by the values in Figure 12. 2463 The Reference column for all of these entries will be this document. 2465 8.10. OAuth Introspection Response Parameter Registration 2467 This specification registers the following parameter in the OAuth 2468 Token Introspection Response registry 2469 [IANA.TokenIntrospectionResponse]. 2471 o Name: "ace_profile" 2472 o Description: The communication and communication security profile 2473 used between client and RS, as defined in ACE profiles. 2474 o Change Controller: IESG 2475 o Reference: Section 5.7.2 of [this document] 2477 8.11. OAuth Token Introspection Response CBOR Mappings Registry 2479 This specification establishes the IANA "OAuth Token Introspection 2480 Response CBOR Mappings" registry. The registry has been created to 2481 use the "Expert Review" registration procedure [RFC8126], except for 2482 the value range designated for private use. 2484 The columns of this registry are: 2486 Name The OAuth Parameter name, refers to the name in the OAuth 2487 parameter registry, e.g., "client_id". 2488 CBOR Key CBOR map key for this parameter. Integer values less than 2489 -65536 are marked as "Private Use", all other values use the 2490 registration policy "Expert Review" [RFC8126]. 2491 Value Type The allowable CBOR data types for values of this 2492 parameter. 2493 Reference This contains a pointer to the public specification of the 2494 introspection response parameter abbreviation, if one exists. 2496 This registry will be initially populated by the values in Figure 16. 2497 The Reference column for all of these entries will be this document. 2499 Note that the mappings of parameters corresponding to claim names 2500 intentionally coincide with the CWT claim name mappings from 2501 [RFC8392]. 2503 8.12. JSON Web Token Claims 2505 This specification registers the following new claims in the JSON Web 2506 Token (JWT) registry of JSON Web Token Claims 2507 [IANA.JsonWebTokenClaims]: 2509 o Claim Name: "ace_profile" 2510 o Claim Description: The profile a token is supposed to be used 2511 with. 2512 o Change Controller: IESG 2513 o Reference: Section 5.8 of [this document] 2515 o Claim Name: "exi" 2516 o Claim Description: "Expires in". Lifetime of the token in seconds 2517 from the time the RS first sees it. Used to implement a weaker 2518 from of token expiration for devices that cannot synchronize their 2519 internal clocks. 2520 o Change Controller: IESG 2521 o Reference: Section 5.8.3 of [this document] 2523 o Claim Name: "cnonce" 2524 o Claim Description: "client-nonce". A nonce previously provided to 2525 the AS by the RS via the client. Used to verify token freshness 2526 when the RS cannot synchronize its clock with the AS. 2527 o Change Controller: IESG 2528 o Reference: Section 5.8 of [this document] 2530 8.13. CBOR Web Token Claims 2532 This specification registers the following new claims in the "CBOR 2533 Web Token (CWT) Claims" registry [IANA.CborWebTokenClaims]. 2535 o Claim Name: "scope" 2536 o Claim Description: The scope of an access token as defined in 2537 [RFC6749]. 2538 o JWT Claim Name: scope 2539 o Claim Key: TBD (suggested: 9) 2540 o Claim Value Type(s): byte string or text string 2541 o Change Controller: IESG 2542 o Specification Document(s): Section 4.2 of 2543 [I-D.ietf-oauth-token-exchange] 2545 o Claim Name: "ace_profile" 2546 o Claim Description: The profile a token is supposed to be used 2547 with. 2548 o JWT Claim Name: ace_profile 2549 o Claim Key: TBD (suggested: 38) 2550 o Claim Value Type(s): integer 2551 o Change Controller: IESG 2552 o Specification Document(s): Section 5.8 of [this document] 2554 o Claim Name: "exi" 2555 o Claim Description: The expiration time of a token measured from 2556 when it was received at the RS in seconds. 2557 o JWT Claim Name: exi 2558 o Claim Key: TBD (suggested: 40) 2559 o Claim Value Type(s): integer 2560 o Change Controller: IESG 2561 o Specification Document(s): Section 5.8.3 of [this document] 2563 o Claim Name: "cnonce" 2564 o Claim Description: The client-nonce sent to the AS by the RS via 2565 the client. 2566 o JWT Claim Name: cnonce 2567 o Claim Key: TBD (suggested: 39) 2568 o Claim Value Type(s): byte string 2569 o Change Controller: IESG 2570 o Specification Document(s): Section 5.8 of [this document] 2572 8.14. Media Type Registrations 2574 This specification registers the 'application/ace+cbor' media type 2575 for messages of the protocols defined in this document carrying 2576 parameters encoded in CBOR. This registration follows the procedures 2577 specified in [RFC6838]. 2579 Type name: application 2581 Subtype name: ace+cbor 2583 Required parameters: none 2585 Optional parameters: none 2587 Encoding considerations: Must be encoded as CBOR map containing the 2588 protocol parameters defined in [this document]. 2590 Security considerations: See Section 6 of this document. 2592 Interoperability considerations: n/a 2593 Published specification: [this document] 2595 Applications that use this media type: The type is used by 2596 authorization servers, clients and resource servers that support the 2597 ACE framework as specified in [this document]. 2599 Additional information: 2601 Magic number(s): n/a 2603 File extension(s): .ace 2605 Macintosh file type code(s): n/a 2607 Person & email address to contact for further information: 2608 2610 Intended usage: COMMON 2612 Restrictions on usage: None 2614 Author: Ludwig Seitz 2616 Change controller: IESG 2618 8.15. CoAP Content-Format Registry 2620 This specification registers the following entry to the "CoAP 2621 Content-Formats" registry: 2623 Media Type: application/ace+cbor 2625 Encoding 2627 ID: 19 2629 Reference: [this document] 2631 8.16. Expert Review Instructions 2633 All of the IANA registries established in this document are defined 2634 to use a registration policy of Expert Review. This section gives 2635 some general guidelines for what the experts should be looking for, 2636 but they are being designated as experts for a reason, so they should 2637 be given substantial latitude. 2639 Expert reviewers should take into consideration the following points: 2641 o Point squatting should be discouraged. Reviewers are encouraged 2642 to get sufficient information for registration requests to ensure 2643 that the usage is not going to duplicate one that is already 2644 registered, and that the point is likely to be used in 2645 deployments. The zones tagged as private use are intended for 2646 testing purposes and closed environments; code points in other 2647 ranges should not be assigned for testing. 2648 o Specifications are needed for the first-come, first-serve range if 2649 they are expected to be used outside of closed environments in an 2650 interoperable way. When specifications are not provided, the 2651 description provided needs to have sufficient information to 2652 identify what the point is being used for. 2653 o Experts should take into account the expected usage of fields when 2654 approving point assignment. The fact that there is a range for 2655 standards track documents does not mean that a standards track 2656 document cannot have points assigned outside of that range. The 2657 length of the encoded value should be weighed against how many 2658 code points of that length are left, the size of device it will be 2659 used on. 2660 o Since a high degree of overlap is expected between these 2661 registries and the contents of the OAuth parameters 2662 [IANA.OAuthParameters] registries, experts should require new 2663 registrations to maintain alignment with parameters from OAuth 2664 that have comparable functionality. Deviation from this alignment 2665 should only be allowed if there are functional differences, that 2666 are motivated by the use case and that cannot be easily or 2667 efficiently addressed by comparable OAuth parameters. 2669 9. Acknowledgments 2671 This document is a product of the ACE working group of the IETF. 2673 Thanks to Eve Maler for her contributions to the use of OAuth 2.0 and 2674 UMA in IoT scenarios, Robert Taylor for his discussion input, and 2675 Malisa Vucinic for his input on the predecessors of this proposal. 2677 Thanks to the authors of draft-ietf-oauth-pop-key-distribution, from 2678 where large parts of the security considerations where copied. 2680 Thanks to Stefanie Gerdes, Olaf Bergmann, and Carsten Bormann for 2681 contributing their work on AS discovery from draft-gerdes-ace-dcaf- 2682 authorize (see Section 5.1). 2684 Thanks to Jim Schaad and Mike Jones for their comprehensive reviews. 2686 Thanks to Benjamin Kaduk for his input on various questions related 2687 to this work. 2689 Thanks to Cigdem Sengul for some very useful review comments. 2691 Ludwig Seitz and Goeran Selander worked on this document as part of 2692 the CelticPlus project CyberWI, with funding from Vinnova. Ludwig 2693 Seitz was also received further funding for this work by Vinnova in 2694 the context of the CelticNext project Critisec. 2696 10. References 2698 10.1. Normative References 2700 [I-D.ietf-ace-cwt-proof-of-possession] 2701 Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. 2702 Tschofenig, "Proof-of-Possession Key Semantics for CBOR 2703 Web Tokens (CWTs)", draft-ietf-ace-cwt-proof-of- 2704 possession-11 (work in progress), October 2019. 2706 [I-D.ietf-ace-oauth-params] 2707 Seitz, L., "Additional OAuth Parameters for Authorization 2708 in Constrained Environments (ACE)", draft-ietf-ace-oauth- 2709 params-06 (work in progress), November 2019. 2711 [I-D.ietf-oauth-token-exchange] 2712 Jones, M., Nadalin, A., Campbell, B., Bradley, J., and C. 2713 Mortimore, "OAuth 2.0 Token Exchange", draft-ietf-oauth- 2714 token-exchange-19 (work in progress), July 2019. 2716 [IANA.CborWebTokenClaims] 2717 IANA, "CBOR Web Token (CWT) Claims", 2718 . 2721 [IANA.JsonWebTokenClaims] 2722 IANA, "JSON Web Token Claims", 2723 . 2725 [IANA.OAuthAccessTokenTypes] 2726 IANA, "OAuth Access Token Types", 2727 . 2730 [IANA.OAuthExtensionsErrorRegistry] 2731 IANA, "OAuth Extensions Error Registry", 2732 . 2735 [IANA.OAuthParameters] 2736 IANA, "OAuth Parameters", 2737 . 2740 [IANA.TokenIntrospectionResponse] 2741 IANA, "OAuth Token Introspection Response", 2742 . 2745 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2746 Requirement Levels", BCP 14, RFC 2119, 2747 DOI 10.17487/RFC2119, March 1997, 2748 . 2750 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2751 Resource Identifier (URI): Generic Syntax", STD 66, 2752 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2753 . 2755 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2756 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 2757 . 2759 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 2760 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 2761 January 2012, . 2763 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 2764 RFC 6749, DOI 10.17487/RFC6749, October 2012, 2765 . 2767 [RFC6750] Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 2768 Framework: Bearer Token Usage", RFC 6750, 2769 DOI 10.17487/RFC6750, October 2012, 2770 . 2772 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 2773 Specifications and Registration Procedures", BCP 13, 2774 RFC 6838, DOI 10.17487/RFC6838, January 2013, 2775 . 2777 [RFC6920] Farrell, S., Kutscher, D., Dannewitz, C., Ohlman, B., 2778 Keranen, A., and P. Hallam-Baker, "Naming Things with 2779 Hashes", RFC 6920, DOI 10.17487/RFC6920, April 2013, 2780 . 2782 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 2783 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 2784 October 2013, . 2786 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2787 Application Protocol (CoAP)", RFC 7252, 2788 DOI 10.17487/RFC7252, June 2014, 2789 . 2791 [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 2792 (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, 2793 . 2795 [RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection", 2796 RFC 7662, DOI 10.17487/RFC7662, October 2015, 2797 . 2799 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2800 Writing an IANA Considerations Section in RFCs", BCP 26, 2801 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2802 . 2804 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 2805 RFC 8152, DOI 10.17487/RFC8152, July 2017, 2806 . 2808 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2809 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2810 May 2017, . 2812 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 2813 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 2814 May 2018, . 2816 10.2. Informative References 2818 [BLE] Bluetooth SIG, "Bluetooth Core Specification v5.1", 2819 Section 4.4, January 2019, 2820 . 2823 [I-D.erdtman-ace-rpcc] 2824 Seitz, L. and S. Erdtman, "Raw-Public-Key and Pre-Shared- 2825 Key as OAuth client credentials", draft-erdtman-ace- 2826 rpcc-02 (work in progress), October 2017. 2828 [I-D.ietf-quic-transport] 2829 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 2830 and Secure Transport", draft-ietf-quic-transport-24 (work 2831 in progress), November 2019. 2833 [I-D.ietf-tls-dtls13] 2834 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 2835 Datagram Transport Layer Security (DTLS) Protocol Version 2836 1.3", draft-ietf-tls-dtls13-34 (work in progress), 2837 November 2019. 2839 [Margi10impact] 2840 Margi, C., de Oliveira, B., de Sousa, G., Simplicio Jr, 2841 M., Barreto, P., Carvalho, T., Naeslund, M., and R. Gold, 2842 "Impact of Operating Systems on Wireless Sensor Networks 2843 (Security) Applications and Testbeds", Proceedings of 2844 the 19th International Conference on Computer 2845 Communications and Networks (ICCCN), August 2010. 2847 [MQTT5.0] Banks, A., Briggs, E., Borgendale, K., and R. Gupta, "MQTT 2848 Version 5.0", OASIS Standard, March 2019, 2849 . 2852 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 2853 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 2854 . 2856 [RFC6819] Lodderstedt, T., Ed., McGloin, M., and P. Hunt, "OAuth 2.0 2857 Threat Model and Security Considerations", RFC 6819, 2858 DOI 10.17487/RFC6819, January 2013, 2859 . 2861 [RFC7009] Lodderstedt, T., Ed., Dronia, S., and M. Scurtescu, "OAuth 2862 2.0 Token Revocation", RFC 7009, DOI 10.17487/RFC7009, 2863 August 2013, . 2865 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2866 Constrained-Node Networks", RFC 7228, 2867 DOI 10.17487/RFC7228, May 2014, 2868 . 2870 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2871 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 2872 DOI 10.17487/RFC7231, June 2014, 2873 . 2875 [RFC7521] Campbell, B., Mortimore, C., Jones, M., and Y. Goland, 2876 "Assertion Framework for OAuth 2.0 Client Authentication 2877 and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521, 2878 May 2015, . 2880 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 2881 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 2882 DOI 10.17487/RFC7540, May 2015, 2883 . 2885 [RFC7591] Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and 2886 P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol", 2887 RFC 7591, DOI 10.17487/RFC7591, July 2015, 2888 . 2890 [RFC7641] Hartke, K., "Observing Resources in the Constrained 2891 Application Protocol (CoAP)", RFC 7641, 2892 DOI 10.17487/RFC7641, September 2015, 2893 . 2895 [RFC7744] Seitz, L., Ed., Gerdes, S., Ed., Selander, G., Mani, M., 2896 and S. Kumar, "Use Cases for Authentication and 2897 Authorization in Constrained Environments", RFC 7744, 2898 DOI 10.17487/RFC7744, January 2016, 2899 . 2901 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 2902 the Constrained Application Protocol (CoAP)", RFC 7959, 2903 DOI 10.17487/RFC7959, August 2016, 2904 . 2906 [RFC8252] Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps", 2907 BCP 212, RFC 8252, DOI 10.17487/RFC8252, October 2017, 2908 . 2910 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2911 Interchange Format", STD 90, RFC 8259, 2912 DOI 10.17487/RFC8259, December 2017, 2913 . 2915 [RFC8414] Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0 2916 Authorization Server Metadata", RFC 8414, 2917 DOI 10.17487/RFC8414, June 2018, 2918 . 2920 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 2921 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 2922 . 2924 [RFC8516] Keranen, A., ""Too Many Requests" Response Code for the 2925 Constrained Application Protocol", RFC 8516, 2926 DOI 10.17487/RFC8516, January 2019, 2927 . 2929 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 2930 "Object Security for Constrained RESTful Environments 2931 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 2932 . 2934 [RFC8628] Denniss, W., Bradley, J., Jones, M., and H. Tschofenig, 2935 "OAuth 2.0 Device Authorization Grant", RFC 8628, 2936 DOI 10.17487/RFC8628, August 2019, 2937 . 2939 Appendix A. Design Justification 2941 This section provides further insight into the design decisions of 2942 the solution documented in this document. Section 3 lists several 2943 building blocks and briefly summarizes their importance. The 2944 justification for offering some of those building blocks, as opposed 2945 to using OAuth 2.0 as is, is given below. 2947 Common IoT constraints are: 2949 Low Power Radio: 2951 Many IoT devices are equipped with a small battery which needs to 2952 last for a long time. For many constrained wireless devices, the 2953 highest energy cost is associated to transmitting or receiving 2954 messages (roughly by a factor of 10 compared to AES) 2955 [Margi10impact]. It is therefore important to keep the total 2956 communication overhead low, including minimizing the number and 2957 size of messages sent and received, which has an impact of choice 2958 on the message format and protocol. By using CoAP over UDP and 2959 CBOR encoded messages, some of these aspects are addressed. 2960 Security protocols contribute to the communication overhead and 2961 can, in some cases, be optimized. For example, authentication and 2962 key establishment may, in certain cases where security 2963 requirements allow, be replaced by provisioning of security 2964 context by a trusted third party, using transport or application 2965 layer security. 2967 Low CPU Speed: 2969 Some IoT devices are equipped with processors that are 2970 significantly slower than those found in most current devices on 2971 the Internet. This typically has implications on what timely 2972 cryptographic operations a device is capable of performing, which 2973 in turn impacts, e.g., protocol latency. Symmetric key 2974 cryptography may be used instead of the computationally more 2975 expensive public key cryptography where the security requirements 2976 so allow, but this may also require support for trusted-third- 2977 party-assisted secret key establishment using transport- or 2978 application-layer security. 2979 Small Amount of Memory: 2981 Microcontrollers embedded in IoT devices are often equipped with 2982 only a small amount of RAM and flash memory, which places 2983 limitations on what kind of processing can be performed and how 2984 much code can be put on those devices. To reduce code size, fewer 2985 and smaller protocol implementations can be put on the firmware of 2986 such a device. In this case, CoAP may be used instead of HTTP, 2987 symmetric-key cryptography instead of public-key cryptography, and 2988 CBOR instead of JSON. An authentication and key establishment 2989 protocol, e.g., the DTLS handshake, in comparison with assisted 2990 key establishment, also has an impact on memory and code 2991 footprints. 2993 User Interface Limitations: 2995 Protecting access to resources is both an important security as 2996 well as privacy feature. End users and enterprise customers may 2997 not want to give access to the data collected by their IoT device 2998 or to functions it may offer to third parties. Since the 2999 classical approach of requesting permissions from end users via a 3000 rich user interface does not work in many IoT deployment 3001 scenarios, these functions need to be delegated to user-controlled 3002 devices that are better suitable for such tasks, such as smart 3003 phones and tablets. 3005 Communication Constraints: 3007 In certain constrained settings an IoT device may not be able to 3008 communicate with a given device at all times. Devices may be 3009 sleeping, or just disconnected from the Internet because of 3010 general lack of connectivity in the area, for cost reasons, or for 3011 security reasons, e.g., to avoid an entry point for Denial-of- 3012 Service attacks. 3014 The communication interactions this framework builds upon (as 3015 shown graphically in Figure 1) may be accomplished using a variety 3016 of different protocols, and not all parts of the message flow are 3017 used in all applications due to the communication constraints. 3018 Deployments making use of CoAP are expected, but this framework is 3019 not limited to them. Other protocols such as HTTP, or even 3020 protocols such as Bluetooth Smart communication that do not 3021 necessarily use IP, could also be used. The latter raises the 3022 need for application layer security over the various interfaces. 3024 In the light of these constraints we have made the following design 3025 decisions: 3027 CBOR, COSE, CWT: 3029 This framework RECOMMENDS the use of CBOR [RFC7049] as data 3030 format. Where CBOR data needs to be protected, the use of COSE 3031 [RFC8152] is RECOMMENDED. Furthermore, where self-contained 3032 tokens are needed, this framework RECOMMENDS the use of CWT 3033 [RFC8392]. These measures aim at reducing the size of messages 3034 sent over the wire, the RAM size of data objects that need to be 3035 kept in memory and the size of libraries that devices need to 3036 support. 3038 CoAP: 3040 This framework RECOMMENDS the use of CoAP [RFC7252] instead of 3041 HTTP. This does not preclude the use of other protocols 3042 specifically aimed at constrained devices, like, e.g., Bluetooth 3043 Low Energy (see Section 3.2). This aims again at reducing the 3044 size of messages sent over the wire, the RAM size of data objects 3045 that need to be kept in memory and the size of libraries that 3046 devices need to support. 3048 Access Information: 3050 This framework defines the name "Access Information" for data 3051 concerning the RS that the AS returns to the client in an access 3052 token response (see Section 5.6.2). This aims at enabling 3053 scenarios where a powerful client, supporting multiple profiles, 3054 needs to interact with a RS for which it does not know the 3055 supported profiles and the raw public key. 3057 Proof-of-Possession: 3059 This framework makes use of proof-of-possession tokens, using the 3060 "cnf" claim [I-D.ietf-ace-cwt-proof-of-possession]. A request 3061 parameter "cnf" and a Response parameter "cnf", both having a 3062 value space semantically and syntactically identical to the "cnf" 3063 claim, are defined for the token endpoint, to allow requesting and 3064 stating confirmation keys. This aims at making token theft 3065 harder. Token theft is specifically relevant in constrained use 3066 cases, as communication often passes through middle-boxes, which 3067 could be able to steal bearer tokens and use them to gain 3068 unauthorized access. 3070 Authz-Info endpoint: 3072 This framework introduces a new way of providing access tokens to 3073 a RS by exposing a authz-info endpoint, to which access tokens can 3074 be POSTed. This aims at reducing the size of the request message 3075 and the code complexity at the RS. The size of the request 3076 message is problematic, since many constrained protocols have 3077 severe message size limitations at the physical layer (e.g., in 3078 the order of 100 bytes). This means that larger packets get 3079 fragmented, which in turn combines badly with the high rate of 3080 packet loss, and the need to retransmit the whole message if one 3081 packet gets lost. Thus separating sending of the request and 3082 sending of the access tokens helps to reduce fragmentation. 3084 Client Credentials Grant: 3086 This framework RECOMMENDS the use of the client credentials grant 3087 for machine-to-machine communication use cases, where manual 3088 intervention of the resource owner to produce a grant token is not 3089 feasible. The intention is that the resource owner would instead 3090 pre-arrange authorization with the AS, based on the client's own 3091 credentials. The client can then (without manual intervention) 3092 obtain access tokens from the AS. 3094 Introspection: 3096 This framework RECOMMENDS the use of access token introspection in 3097 cases where the client is constrained in a way that it can not 3098 easily obtain new access tokens (i.e. it has connectivity issues 3099 that prevent it from communicating with the AS). In that case 3100 this framework RECOMMENDS the use of a long-term token, that could 3101 be a simple reference. The RS is assumed to be able to 3102 communicate with the AS, and can therefore perform introspection, 3103 in order to learn the claims associated with the token reference. 3104 The advantage of such an approach is that the resource owner can 3105 change the claims associated to the token reference without having 3106 to be in contact with the client, thus granting or revoking access 3107 rights. 3109 Appendix B. Roles and Responsibilities 3111 Resource Owner 3113 * Make sure that the RS is registered at the AS. This includes 3114 making known to the AS which profiles, token_type, scopes, and 3115 key types (symmetric/asymmetric) the RS supports. Also making 3116 it known to the AS which audience(s) the RS identifies itself 3117 with. 3118 * Make sure that clients can discover the AS that is in charge of 3119 the RS. 3120 * If the client-credentials grant is used, make sure that the AS 3121 has the necessary, up-to-date, access control policies for the 3122 RS. 3124 Requesting Party 3126 * Make sure that the client is provisioned the necessary 3127 credentials to authenticate to the AS. 3128 * Make sure that the client is configured to follow the security 3129 requirements of the Requesting Party when issuing requests 3130 (e.g., minimum communication security requirements, trust 3131 anchors). 3132 * Register the client at the AS. This includes making known to 3133 the AS which profiles, token_types, and key types (symmetric/ 3134 asymmetric) the client. 3136 Authorization Server 3138 * Register the RS and manage corresponding security contexts. 3139 * Register clients and authentication credentials. 3140 * Allow Resource Owners to configure and update access control 3141 policies related to their registered RSs. 3142 * Expose the token endpoint to allow clients to request tokens. 3143 * Authenticate clients that wish to request a token. 3144 * Process a token request using the authorization policies 3145 configured for the RS. 3146 * Optionally: Expose the introspection endpoint that allows RS's 3147 to submit token introspection requests. 3148 * If providing an introspection endpoint: Authenticate RSs that 3149 wish to get an introspection response. 3150 * If providing an introspection endpoint: Process token 3151 introspection requests. 3152 * Optionally: Handle token revocation. 3153 * Optionally: Provide discovery metadata. See [RFC8414] 3154 * Optionally: Handle refresh tokens. 3156 Client 3157 * Discover the AS in charge of the RS that is to be targeted with 3158 a request. 3159 * Submit the token request (see step (A) of Figure 1). 3161 + Authenticate to the AS. 3162 + Optionally (if not pre-configured): Specify which RS, which 3163 resource(s), and which action(s) the request(s) will target. 3164 + If raw public keys (rpk) or certificates are used, make sure 3165 the AS has the right rpk or certificate for this client. 3166 * Process the access token and Access Information (see step (B) 3167 of Figure 1). 3169 + Check that the Access Information provides the necessary 3170 security parameters (e.g., PoP key, information on 3171 communication security protocols supported by the RS). 3172 + Safely store the proof-of-possession key. 3173 + If provided by the AS: Safely store the refresh token. 3174 * Send the token and request to the RS (see step (C) of 3175 Figure 1). 3177 + Authenticate towards the RS (this could coincide with the 3178 proof of possession process). 3179 + Transmit the token as specified by the AS (default is to the 3180 authz-info endpoint, alternative options are specified by 3181 profiles). 3182 + Perform the proof-of-possession procedure as specified by 3183 the profile in use (this may already have been taken care of 3184 through the authentication procedure). 3185 * Process the RS response (see step (F) of Figure 1) of the RS. 3187 Resource Server 3189 * Expose a way to submit access tokens. By default this is the 3190 authz-info endpoint. 3191 * Process an access token. 3193 + Verify the token is from a recognized AS. 3194 + Check the token's integrity. 3195 + Verify that the token applies to this RS. 3196 + Check that the token has not expired (if the token provides 3197 expiration information). 3198 + Store the token so that it can be retrieved in the context 3199 of a matching request. 3201 Note: The order proposed here is not normative, any process 3202 that arrives at an equivalent result can be used. A noteworthy 3203 consideration is whether one can use cheap operations early on 3204 to quickly discard non-applicable or invalid tokens, before 3205 performing expensive cryptographic operations (e.g. doing an 3206 expiration check before verifying a signature). 3208 * Process a request. 3210 + Set up communication security with the client. 3211 + Authenticate the client. 3212 + Match the client against existing tokens. 3213 + Check that tokens belonging to the client actually authorize 3214 the requested action. 3215 + Optionally: Check that the matching tokens are still valid, 3216 using introspection (if this is possible.) 3217 * Send a response following the agreed upon communication 3218 security mechanism(s). 3219 * Safely store credentials such as raw public keys for 3220 authentication or proof-of-possession keys linked to access 3221 tokens. 3223 Appendix C. Requirements on Profiles 3225 This section lists the requirements on profiles of this framework, 3226 for the convenience of profile designers. 3228 o Optionally define new methods for the client to discover the 3229 necessary permissions and AS for accessing a resource, different 3230 from the one proposed in Section 5.1. Section 4 3231 o Optionally specify new grant types. Section 5.2 3232 o Optionally define the use of client certificates as client 3233 credential type. Section 5.3 3234 o Specify the communication protocol the client and RS the must use 3235 (e.g., CoAP). Section 5 and Section 5.6.4.3 3236 o Specify the security protocol the client and RS must use to 3237 protect their communication (e.g., OSCORE or DTLS). This must 3238 provide encryption, integrity and replay protection. 3239 Section 5.6.4.3 3240 o Specify how the client and the RS mutually authenticate. 3241 Section 4 3242 o Specify the proof-of-possession protocol(s) and how to select one, 3243 if several are available. Also specify which key types (e.g., 3244 symmetric/asymmetric) are supported by a specific proof-of- 3245 possession protocol. Section 5.6.4.2 3246 o Specify a unique ace_profile identifier. Section 5.6.4.3 3247 o If introspection is supported: Specify the communication and 3248 security protocol for introspection. Section 5.7 3249 o Specify the communication and security protocol for interactions 3250 between client and AS. This must provide encryption, integrity 3251 protection, replay protection and a binding between requests and 3252 responses. Section 5 and Section 5.6 3254 o Specify how/if the authz-info endpoint is protected, including how 3255 error responses are protected. Section 5.8.1 3256 o Optionally define other methods of token transport than the authz- 3257 info endpoint. Section 5.8.1 3259 Appendix D. Assumptions on AS knowledge about C and RS 3261 This section lists the assumptions on what an AS should know about a 3262 client and a RS in order to be able to respond to requests to the 3263 token and introspection endpoints. How this information is 3264 established is out of scope for this document. 3266 o The identifier of the client or RS. 3267 o The profiles that the client or RS supports. 3268 o The scopes that the RS supports. 3269 o The audiences that the RS identifies with. 3270 o The key types (e.g., pre-shared symmetric key, raw public key, key 3271 length, other key parameters) that the client or RS supports. 3272 o The types of access tokens the RS supports (e.g., CWT). 3273 o If the RS supports CWTs, the COSE parameters for the crypto 3274 wrapper (e.g., algorithm, key-wrap algorithm, key-length) that the 3275 RS supports. 3276 o The expiration time for access tokens issued to this RS (unless 3277 the RS accepts a default time chosen by the AS). 3278 o The symmetric key shared between client and AS (if any). 3279 o The symmetric key shared between RS and AS (if any). 3280 o The raw public key of the client or RS (if any). 3281 o Whether the RS has synchronized time (and thus is able to use the 3282 'exp' claim) or not. 3284 Appendix E. Deployment Examples 3286 There is a large variety of IoT deployments, as is indicated in 3287 Appendix A, and this section highlights a few common variants. This 3288 section is not normative but illustrates how the framework can be 3289 applied. 3291 For each of the deployment variants, there are a number of possible 3292 security setups between clients, resource servers and authorization 3293 servers. The main focus in the following subsections is on how 3294 authorization of a client request for a resource hosted by a RS is 3295 performed. This requires the security of the requests and responses 3296 between the clients and the RS to be considered. 3298 Note: CBOR diagnostic notation is used for examples of requests and 3299 responses. 3301 E.1. Local Token Validation 3303 In this scenario, the case where the resource server is offline is 3304 considered, i.e., it is not connected to the AS at the time of the 3305 access request. This access procedure involves steps A, B, C, and F 3306 of Figure 1. 3308 Since the resource server must be able to verify the access token 3309 locally, self-contained access tokens must be used. 3311 This example shows the interactions between a client, the 3312 authorization server and a temperature sensor acting as a resource 3313 server. Message exchanges A and B are shown in Figure 17. 3315 A: The client first generates a public-private key pair used for 3316 communication security with the RS. 3317 The client sends a CoAP POST request to the token endpoint at the 3318 AS. The security of this request can be transport or application 3319 layer. It is up the the communication security profile to define. 3320 In the example it is assumed that both client and AS have 3321 performed mutual authentication e.g. via DTLS. The request 3322 contains the public key of the client and the Audience parameter 3323 set to "tempSensorInLivingRoom", a value that the temperature 3324 sensor identifies itself with. The AS evaluates the request and 3325 authorizes the client to access the resource. 3326 B: The AS responds with a 2.05 Content response containing the 3327 Access Information, including the access token. The PoP access 3328 token contains the public key of the client, and the Access 3329 Information contains the public key of the RS. For communication 3330 security this example uses DTLS RawPublicKey between the client 3331 and the RS. The issued token will have a short validity time, 3332 i.e., "exp" close to "iat", in order to mitigate attacks using 3333 stolen client credentials. The token includes the claim such as 3334 "scope" with the authorized access that an owner of the 3335 temperature device can enjoy. In this example, the "scope" claim, 3336 issued by the AS, informs the RS that the owner of the token, that 3337 can prove the possession of a key is authorized to make a GET 3338 request against the /temperature resource and a POST request on 3339 the /firmware resource. Note that the syntax and semantics of the 3340 scope claim are application specific. 3341 Note: In this example it is assumed that the client knows what 3342 resource it wants to access, and is therefore able to request 3343 specific audience and scope claims for the access token. 3345 Authorization 3346 Client Server 3347 | | 3348 |<=======>| DTLS Connection Establishment 3349 | | and mutual authentication 3350 | | 3351 A: +-------->| Header: POST (Code=0.02) 3352 | POST | Uri-Path:"token" 3353 | | Content-Format: application/ace+cbor 3354 | | Payload: 3355 | | 3356 B: |<--------+ Header: 2.05 Content 3357 | 2.05 | Content-Format: application/ace+cbor 3358 | | Payload: 3359 | | 3361 Figure 17: Token Request and Response Using Client Credentials. 3363 The information contained in the Request-Payload and the Response- 3364 Payload is shown in Figure 18 Note that the parameter "rs_cnf" from 3365 [I-D.ietf-ace-oauth-params] is used to inform the client about the 3366 resource server's public key. 3368 Request-Payload : 3369 { 3370 "audience" : "tempSensorInLivingRoom", 3371 "client_id" : "myclient", 3372 "req_cnf" : { 3373 "COSE_Key" : { 3374 "kid" : b64'1Bg8vub9tLe1gHMzV76e8', 3375 "kty" : "EC", 3376 "crv" : "P-256", 3377 "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', 3378 "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' 3379 } 3380 } 3381 } 3383 Response-Payload : 3384 { 3385 "access_token" : b64'0INDoQEKoQVNKkXfb7xaWqMTf6 ...', 3386 "rs_cnf" : { 3387 "COSE_Key" : { 3388 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', 3389 "kty" : "EC", 3390 "crv" : "P-256", 3391 "x" : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4', 3392 "y" : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM' 3393 } 3394 } 3395 } 3397 Figure 18: Request and Response Payload Details. 3399 The content of the access token is shown in Figure 19. 3401 { 3402 "aud" : "tempSensorInLivingRoom", 3403 "iat" : "1563451500", 3404 "exp" : "1563453000", 3405 "scope" : "temperature_g firmware_p", 3406 "cnf" : { 3407 "COSE_Key" : { 3408 "kid" : b64'1Bg8vub9tLe1gHMzV76e8', 3409 "kty" : "EC", 3410 "crv" : "P-256", 3411 "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', 3412 "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' 3413 } 3414 } 3415 } 3417 Figure 19: Access Token including Public Key of the Client. 3419 Messages C and F are shown in Figure 20 - Figure 21. 3421 C: The client then sends the PoP access token to the authz-info 3422 endpoint at the RS. This is a plain CoAP POST request, i.e., no 3423 transport or application layer security is used between client and 3424 RS since the token is integrity protected between the AS and RS. 3425 The RS verifies that the PoP access token was created by a known 3426 and trusted AS, that it applies to this RS, and that it is valid. 3427 The RS caches the security context together with authorization 3428 information about this client contained in the PoP access token. 3430 Resource 3431 Client Server 3432 | | 3433 C: +-------->| Header: POST (Code=0.02) 3434 | POST | Uri-Path:"authz-info" 3435 | | Payload: 0INDoQEKoQVN ... 3436 | | 3437 |<--------+ Header: 2.04 Changed 3438 | 2.04 | 3439 | | 3441 Figure 20: Access Token provisioning to RS 3442 The client and the RS runs the DTLS handshake using the raw public 3443 keys established in step B and C. 3444 The client sends a CoAP GET request to /temperature on RS over 3445 DTLS. The RS verifies that the request is authorized, based on 3446 previously established security context. 3448 F: The RS responds over the same DTLS channel with a CoAP 2.05 3449 Content response, containing a resource representation as payload. 3451 Resource 3452 Client Server 3453 | | 3454 |<=======>| DTLS Connection Establishment 3455 | | using Raw Public Keys 3456 | | 3457 +-------->| Header: GET (Code=0.01) 3458 | GET | Uri-Path: "temperature" 3459 | | 3460 | | 3461 | | 3462 F: |<--------+ Header: 2.05 Content 3463 | 2.05 | Payload: 3464 | | 3466 Figure 21: Resource Request and Response protected by DTLS. 3468 E.2. Introspection Aided Token Validation 3470 In this deployment scenario it is assumed that a client is not able 3471 to access the AS at the time of the access request, whereas the RS is 3472 assumed to be connected to the back-end infrastructure. Thus the RS 3473 can make use of token introspection. This access procedure involves 3474 steps A-F of Figure 1, but assumes steps A and B have been carried 3475 out during a phase when the client had connectivity to AS. 3477 Since the client is assumed to be offline, at least for a certain 3478 period of time, a pre-provisioned access token has to be long-lived. 3479 Since the client is constrained, the token will not be self contained 3480 (i.e. not a CWT) but instead just a reference. The resource server 3481 uses its connectivity to learn about the claims associated to the 3482 access token by using introspection, which is shown in the example 3483 below. 3485 In the example interactions between an offline client (key fob), a RS 3486 (online lock), and an AS is shown. It is assumed that there is a 3487 provisioning step where the client has access to the AS. This 3488 corresponds to message exchanges A and B which are shown in 3489 Figure 22. 3491 Authorization consent from the resource owner can be pre-configured, 3492 but it can also be provided via an interactive flow with the resource 3493 owner. An example of this for the key fob case could be that the 3494 resource owner has a connected car, he buys a generic key that he 3495 wants to use with the car. To authorize the key fob he connects it 3496 to his computer that then provides the UI for the device. After that 3497 OAuth 2.0 implicit flow can used to authorize the key for his car at 3498 the the car manufacturers AS. 3500 Note: In this example the client does not know the exact door it will 3501 be used to access since the token request is not send at the time of 3502 access. So the scope and audience parameters are set quite wide to 3503 start with, while tailored values narrowing down the claims to the 3504 specific RS being accessed can be provided to that RS during an 3505 introspection step. 3507 A: The client sends a CoAP POST request to the token endpoint at 3508 AS. The request contains the Audience parameter set to "PACS1337" 3509 (PACS, Physical Access System), a value the that identifies the 3510 physical access control system to which the individual doors are 3511 connected. The AS generates an access token as an opaque string, 3512 which it can match to the specific client and the targeted 3513 audience. It furthermore generates a symmetric proof-of- 3514 possession key. The communication security and authentication 3515 between client and AS is assumed to have been provided at 3516 transport layer (e.g. via DTLS) using a pre-shared security 3517 context (psk, rpk or certificate). 3518 B: The AS responds with a CoAP 2.05 Content response, containing 3519 as playload the Access Information, including the access token and 3520 the symmetric proof-of-possession key. Communication security 3521 between C and RS will be DTLS and PreSharedKey. The PoP key is 3522 used as the PreSharedKey. 3524 Note: In this example we are using a symmetric key for a multi-RS 3525 audience, which is not recommended normally (see Section 6.9). 3526 However in this case the risk is deemed to be acceptable, since all 3527 the doors are part of the same physical access control system, and 3528 therefore the risk of a malicious RS impersonating the client towards 3529 another RS is low. 3531 Authorization 3532 Client Server 3533 | | 3534 |<=======>| DTLS Connection Establishment 3535 | | and mutual authentication 3536 | | 3537 A: +-------->| Header: POST (Code=0.02) 3538 | POST | Uri-Path:"token" 3539 | | Content-Format: application/ace+cbor 3540 | | Payload: 3541 | | 3542 B: |<--------+ Header: 2.05 Content 3543 | | Content-Format: application/ace+cbor 3544 | 2.05 | Payload: 3545 | | 3547 Figure 22: Token Request and Response using Client Credentials. 3549 The information contained in the Request-Payload and the Response- 3550 Payload is shown in Figure 23. 3552 Request-Payload: 3553 { 3554 "client_id" : "keyfob", 3555 "audience" : "PACS1337" 3556 } 3558 Response-Payload: 3559 { 3560 "access_token" : b64'VGVzdCB0b2tlbg==', 3561 "cnf" : { 3562 "COSE_Key" : { 3563 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', 3564 "kty" : "oct", 3565 "alg" : "HS256", 3566 "k": b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE' 3567 } 3568 } 3569 } 3571 Figure 23: Request and Response Payload for C offline 3573 The access token in this case is just an opaque byte string 3574 referencing the authorization information at the AS. 3576 C: Next, the client POSTs the access token to the authz-info 3577 endpoint in the RS. This is a plain CoAP request, i.e., no DTLS 3578 between client and RS. Since the token is an opaque string, the 3579 RS cannot verify it on its own, and thus defers to respond the 3580 client with a status code until after step E. 3581 D: The RS sends the token to the introspection endpoint on the AS 3582 using a CoAP POST request. In this example RS and AS are assumed 3583 to have performed mutual authentication using a pre shared 3584 security context (psk, rpk or certificate) with the RS acting as 3585 DTLS client. 3586 E: The AS provides the introspection response (2.05 Content) 3587 containing parameters about the token. This includes the 3588 confirmation key (cnf) parameter that allows the RS to verify the 3589 client's proof of possession in step F. Note that our example in 3590 Figure 25 assumes a pre-established key (e.g. one used by the 3591 client and the RS for a previous token) that is now only 3592 referenced by its key-identifier 'kid'. 3593 After receiving message E, the RS responds to the client's POST in 3594 step C with the CoAP response code 2.01 (Created). 3596 Resource 3597 Client Server 3598 | | 3599 C: +-------->| Header: POST (T=CON, Code=0.02) 3600 | POST | Uri-Path:"authz-info" 3601 | | Payload: b64'VGVzdCB0b2tlbg==' 3602 | | 3603 | | Authorization 3604 | | Server 3605 | | | 3606 | D: +--------->| Header: POST (Code=0.02) 3607 | | POST | Uri-Path: "introspect" 3608 | | | Content-Format: "application/ace+cbor" 3609 | | | Payload: 3610 | | | 3611 | E: |<---------+ Header: 2.05 Content 3612 | | 2.05 | Content-Format: "application/ace+cbor" 3613 | | | Payload: 3614 | | | 3615 | | 3616 |<--------+ Header: 2.01 Created 3617 | 2.01 | 3618 | | 3620 Figure 24: Token Introspection for C offline 3621 The information contained in the Request-Payload and the Response- 3622 Payload is shown in Figure 25. 3624 Request-Payload: 3625 { 3626 "token" : b64'VGVzdCB0b2tlbg==', 3627 "client_id" : "FrontDoor", 3628 } 3630 Response-Payload: 3631 { 3632 "active" : true, 3633 "aud" : "lockOfDoor4711", 3634 "scope" : "open, close", 3635 "iat" : 1563454000, 3636 "cnf" : { 3637 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk' 3638 } 3639 } 3641 Figure 25: Request and Response Payload for Introspection 3643 The client uses the symmetric PoP key to establish a DTLS 3644 PreSharedKey secure connection to the RS. The CoAP request PUT is 3645 sent to the uri-path /state on the RS, changing the state of the 3646 door to locked. 3647 F: The RS responds with a appropriate over the secure DTLS 3648 channel. 3650 Resource 3651 Client Server 3652 | | 3653 |<=======>| DTLS Connection Establishment 3654 | | using Pre Shared Key 3655 | | 3656 +-------->| Header: PUT (Code=0.03) 3657 | PUT | Uri-Path: "state" 3658 | | Payload: 3659 | | 3660 F: |<--------+ Header: 2.04 Changed 3661 | 2.04 | Payload: 3662 | | 3664 Figure 26: Resource request and response protected by OSCORE 3666 Appendix F. Document Updates 3668 RFC EDITOR: PLEASE REMOVE THIS SECTION. 3670 F.1. Version -21 to 22 3672 o Provided section numbers in references to OAuth RFC. 3673 o Updated IANA mapping registries to only use "Private Use" and 3674 "Expert Review". 3675 o Made error messages optional for RS at token submission since it 3676 may not be able to send them depending on the profile. 3677 o Corrected errors in examples. 3679 F.2. Version -20 to 21 3681 o Added text about expiration of RS keys. 3683 F.3. Version -19 to 20 3685 o Replaced "req_aud" with "audience" from the OAuth token exchange 3686 draft. 3687 o Updated examples to remove unnecessary elements. 3689 F.4. Version -18 to -19 3691 o Added definition of "Authorization Information". 3692 o Explicitly state that ACE allows encoding refresh tokens in binary 3693 format in addition to strings. 3694 o Renamed "AS Information" to "AS Request Creation Hints" and added 3695 the possibility to specify req_aud and scope as hints. 3696 o Added the "kid" parameter to AS Request Creation Hints. 3697 o Added security considerations about the integrity protection of 3698 tokens with multi-RS audiences. 3699 o Renamed IANA registries mapping OAuth parameters to reflect the 3700 mapped registry. 3701 o Added JWT claim names to CWT claim registrations. 3702 o Added expert review instructions. 3703 o Updated references to TLS from 1.2 to 1.3. 3705 F.5. Version -17 to -18 3707 o Added OSCORE options in examples involving OSCORE. 3708 o Removed requirement for the client to send application/cwt, since 3709 the client has no way to know. 3710 o Clarified verification of tokens by the RS. 3711 o Added exi claim CWT registration. 3713 F.6. Version -16 to -17 3715 o Added references to (D)TLS 1.3. 3716 o Added requirement that responses are bound to requests. 3718 o Specify that grant_type is OPTIONAL in C2AS requests (as opposed 3719 to REQUIRED in OAuth). 3720 o Replaced examples with hypothetical COSE profile with OSCORE. 3721 o Added requirement for content type application/ace+cbor in error 3722 responses for token and introspection requests and responses. 3723 o Reworked abbreviation space for claims, request and response 3724 parameters. 3725 o Added text that the RS may indicate that it is busy at the authz- 3726 info resource. 3727 o Added section that specifies how the RS verifies an access token. 3728 o Added section on the protection of the authz-info endpoint. 3729 o Removed the expiration mechanism based on sequence numbers. 3730 o Added reference to RFC7662 security considerations. 3731 o Added considerations on minimal security requirements for 3732 communication. 3733 o Added security considerations on unprotected information sent to 3734 authz-info and in the error responses. 3736 F.7. Version -15 to -16 3738 o Added text the RS using RFC6750 error codes. 3739 o Defined an error code for incompatible token request parameters. 3740 o Removed references to the actors draft. 3741 o Fixed errors in examples. 3743 F.8. Version -14 to -15 3745 o Added text about refresh tokens. 3746 o Added text about protection of credentials. 3747 o Rephrased introspection so that other entities than RS can do it. 3748 o Editorial improvements. 3750 F.9. Version -13 to -14 3752 o Split out the 'aud', 'cnf' and 'rs_cnf' parameters to 3753 [I-D.ietf-ace-oauth-params] 3754 o Introduced the "application/ace+cbor" Content-Type. 3755 o Added claim registrations from 'profile' and 'rs_cnf'. 3756 o Added note on schema part of AS Information Section 5.1.2 3757 o Realigned the parameter abbreviations to push rarely used ones to 3758 the 2-byte encoding size of CBOR integers. 3760 F.10. Version -12 to -13 3762 o Changed "Resource Information" to "Access Information" to avoid 3763 confusion. 3764 o Clarified section about AS discovery. 3765 o Editorial changes 3767 F.11. Version -11 to -12 3769 o Moved the Request error handling to a section of its own. 3770 o Require the use of the abbreviation for profile identifiers. 3771 o Added rs_cnf parameter in the introspection response, to inform 3772 RS' with several RPKs on which key to use. 3773 o Allowed use of rs_cnf as claim in the access token in order to 3774 inform an RS with several RPKs on which key to use. 3775 o Clarified that profiles must specify if/how error responses are 3776 protected. 3777 o Fixed label number range to align with COSE/CWT. 3778 o Clarified the requirements language in order to allow profiles to 3779 specify other payload formats than CBOR if they do not use CoAP. 3781 F.12. Version -10 to -11 3783 o Fixed some CBOR data type errors. 3784 o Updated boilerplate text 3786 F.13. Version -09 to -10 3788 o Removed CBOR major type numbers. 3789 o Removed the client token design. 3790 o Rephrased to clarify that other protocols than CoAP can be used. 3791 o Clarifications regarding the use of HTTP 3793 F.14. Version -08 to -09 3795 o Allowed scope to be byte strings. 3796 o Defined default names for endpoints. 3797 o Refactored the IANA section for briefness and consistency. 3798 o Refactored tables that define IANA registry contents for 3799 consistency. 3800 o Created IANA registry for CBOR mappings of error codes, grant 3801 types and Authorization Server Information. 3802 o Added references to other document sections defining IANA entries 3803 in the IANA section. 3805 F.15. Version -07 to -08 3807 o Moved AS discovery from the DTLS profile to the framework, see 3808 Section 5.1. 3809 o Made the use of CBOR mandatory. If you use JSON you can use 3810 vanilla OAuth. 3811 o Made it mandatory for profiles to specify C-AS security and RS-AS 3812 security (the latter only if introspection is supported). 3813 o Made the use of CBOR abbreviations mandatory. 3815 o Added text to clarify the use of token references as an 3816 alternative to CWTs. 3817 o Added text to clarify that introspection must not be delayed, in 3818 case the RS has to return a client token. 3819 o Added security considerations about leakage through unprotected AS 3820 discovery information, combining profiles and leakage through 3821 error responses. 3822 o Added privacy considerations about leakage through unprotected AS 3823 discovery. 3824 o Added text that clarifies that introspection is optional. 3825 o Made profile parameter optional since it can be implicit. 3826 o Clarified that CoAP is not mandatory and other protocols can be 3827 used. 3828 o Clarified the design justification for specific features of the 3829 framework in appendix A. 3830 o Clarified appendix E.2. 3831 o Removed specification of the "cnf" claim for CBOR/COSE, and 3832 replaced with references to [I-D.ietf-ace-cwt-proof-of-possession] 3834 F.16. Version -06 to -07 3836 o Various clarifications added. 3837 o Fixed erroneous author email. 3839 F.17. Version -05 to -06 3841 o Moved sections that define the ACE framework into a subsection of 3842 the framework Section 5. 3843 o Split section on client credentials and grant into two separate 3844 sections, Section 5.2, and Section 5.3. 3845 o Added Section 5.4 on AS authentication. 3846 o Added Section 5.5 on the Authorization endpoint. 3848 F.18. Version -04 to -05 3850 o Added RFC 2119 language to the specification of the required 3851 behavior of profile specifications. 3852 o Added Section 5.3 on the relation to the OAuth2 grant types. 3853 o Added CBOR abbreviations for error and the error codes defined in 3854 OAuth2. 3855 o Added clarification about token expiration and long-running 3856 requests in Section 5.8.3 3857 o Added security considerations about tokens with symmetric PoP keys 3858 valid for more than one RS. 3859 o Added privacy considerations section. 3860 o Added IANA registry mapping the confirmation types from RFC 7800 3861 to equivalent COSE types. 3863 o Added appendix D, describing assumptions about what the AS knows 3864 about the client and the RS. 3866 F.19. Version -03 to -04 3868 o Added a description of the terms "framework" and "profiles" as 3869 used in this document. 3870 o Clarified protection of access tokens in section 3.1. 3871 o Clarified uses of the "cnf" parameter in section 6.4.5. 3872 o Clarified intended use of Client Token in section 7.4. 3874 F.20. Version -02 to -03 3876 o Removed references to draft-ietf-oauth-pop-key-distribution since 3877 the status of this draft is unclear. 3878 o Copied and adapted security considerations from draft-ietf-oauth- 3879 pop-key-distribution. 3880 o Renamed "client information" to "RS information" since it is 3881 information about the RS. 3882 o Clarified the requirements on profiles of this framework. 3883 o Clarified the token endpoint protocol and removed negotiation of 3884 "profile" and "alg" (section 6). 3885 o Renumbered the abbreviations for claims and parameters to get a 3886 consistent numbering across different endpoints. 3887 o Clarified the introspection endpoint. 3888 o Renamed token, introspection and authz-info to "endpoint" instead 3889 of "resource" to mirror the OAuth 2.0 terminology. 3890 o Updated the examples in the appendices. 3892 F.21. Version -01 to -02 3894 o Restructured to remove communication security parts. These shall 3895 now be defined in profiles. 3896 o Restructured section 5 to create new sections on the OAuth 3897 endpoints token, introspection and authz-info. 3898 o Pulled in material from draft-ietf-oauth-pop-key-distribution in 3899 order to define proof-of-possession key distribution. 3900 o Introduced the "cnf" parameter as defined in RFC7800 to reference 3901 or transport keys used for proof of possession. 3902 o Introduced the "client-token" to transport client information from 3903 the AS to the client via the RS in conjunction with introspection. 3904 o Expanded the IANA section to define parameters for token request, 3905 introspection and CWT claims. 3906 o Moved deployment scenarios to the appendix as examples. 3908 F.22. Version -00 to -01 3910 o Changed 5.1. from "Communication Security Protocol" to "Client 3911 Information". 3912 o Major rewrite of 5.1 to clarify the information exchanged between 3913 C and AS in the PoP access token request profile for IoT. 3915 * Allow the client to indicate preferences for the communication 3916 security protocol. 3917 * Defined the term "Client Information" for the additional 3918 information returned to the client in addition to the access 3919 token. 3920 * Require that the messages between AS and client are secured, 3921 either with (D)TLS or with COSE_Encrypted wrappers. 3922 * Removed dependency on OSCOAP and added generic text about 3923 object security instead. 3924 * Defined the "rpk" parameter in the client information to 3925 transmit the raw public key of the RS from AS to client. 3926 * (D)TLS MUST use the PoP key in the handshake (either as PSK or 3927 as client RPK with client authentication). 3928 * Defined the use of x5c, x5t and x5tS256 parameters when a 3929 client certificate is used for proof of possession. 3930 * Defined "tktn" parameter for signaling for how to transfer the 3931 access token. 3932 o Added 5.2. the CoAP Access-Token option for transferring access 3933 tokens in messages that do not have payload. 3934 o 5.3.2. Defined success and error responses from the RS when 3935 receiving an access token. 3936 o 5.6.:Added section giving guidance on how to handle token 3937 expiration in the absence of reliable time. 3938 o Appendix B Added list of roles and responsibilities for C, AS and 3939 RS. 3941 Authors' Addresses 3943 Ludwig Seitz 3944 Combitech 3945 Djaeknegatan 31 3946 Malmoe 211 35 3947 Sweden 3949 Email: ludwig.seitz@combitech.se 3950 Goeran Selander 3951 Ericsson 3952 Faroegatan 6 3953 Kista 164 80 3954 Sweden 3956 Email: goran.selander@ericsson.com 3958 Erik Wahlstroem 3959 Sweden 3961 Email: erik@wahlstromstekniska.se 3963 Samuel Erdtman 3964 Spotify AB 3965 Birger Jarlsgatan 61, 4tr 3966 Stockholm 113 56 3967 Sweden 3969 Email: erdtman@spotify.com 3971 Hannes Tschofenig 3972 Arm Ltd. 3973 Absam 6067 3974 Austria 3976 Email: Hannes.Tschofenig@arm.com