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