idnits 2.17.00 (12 Aug 2021) /tmp/idnits26507/draft-ietf-ace-oauth-authz-25.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 30, 2019) is 933 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) -- No information found for draft-ietf-ace-cwt-proof-of-possession - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-ace-cwt-proof-of-possession' -- No information found for draft-ietf-ace-oauth-params - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-ace-oauth-params' -- No information found for draft-ietf-oauth-token-exchange - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-oauth-token-exchange' ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) -- No information found for draft-erdtman-ace-rpcc - is the name correct? == Outdated reference: draft-ietf-quic-transport has been published as RFC 9000 == Outdated reference: draft-ietf-tls-dtls13 has been published as RFC 9147 Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 8 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 2, 2020 Ericsson 6 E. Wahlstroem 8 S. Erdtman 9 Spotify AB 10 H. Tschofenig 11 Arm Ltd. 12 October 30, 2019 14 Authentication and Authorization for Constrained Environments (ACE) 15 using the OAuth 2.0 Framework (ACE-OAuth) 16 draft-ietf-ace-oauth-authz-25 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 2, 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 . 44 106 6.6. Token Freshness and Expiration . . . . . . . . . . . . . 46 107 6.7. Combining profiles . . . . . . . . . . . . . . . . . . . 46 108 6.8. Unprotected Information . . . . . . . . . . . . . . . . . 46 109 6.9. Identifying audiences . . . . . . . . . . . . . . . . . . 47 110 6.10. Denial of service against or with Introspection . . 48 111 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 48 112 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 49 113 8.1. ACE Authorization Server Request Creation Hints . . . . . 49 114 8.2. OAuth Extensions Error Registration . . . . . . . . . . . 50 115 8.3. OAuth Error Code CBOR Mappings Registry . . . . . . . . . 50 116 8.4. OAuth Grant Type CBOR Mappings . . . . . . . . . . . . . 51 117 8.5. OAuth Access Token Types . . . . . . . . . . . . . . . . 51 118 8.6. OAuth Access Token Type CBOR Mappings . . . . . . . . . . 51 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 . . . 53 124 8.11. OAuth Token Introspection Response CBOR Mappings Registry 54 125 8.12. JSON Web Token Claims . . . . . . . . . . . . . . . . . . 54 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 . . . . . . . . . . . . . . . . . . . . . . . . . 58 132 10.1. Normative References . . . . . . . . . . . . . . . . . . 58 133 10.2. Informative References . . . . . . . . . . . . . . . . . 61 134 Appendix A. Design Justification . . . . . . . . . . . . . . . . 63 135 Appendix B. Roles and Responsibilities . . . . . . . . . . . . . 67 136 Appendix C. Requirements on Profiles . . . . . . . . . . . . . . 69 137 Appendix D. Assumptions on AS knowledge about C and RS . . . . . 70 138 Appendix E. Deployment Examples . . . . . . . . . . . . . . . . 70 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 resource [RFC4949]. The authorization task itself can best 171 be described as granting access to a requesting client, for a 172 resource hosted on a device, the resource server (RS). This exchange 173 is mediated by one or multiple authorization servers (AS). Managing 174 authorization for a large number of devices and users can be a 175 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. 479 4. Protocol Interactions 481 The ACE framework is based on the OAuth 2.0 protocol interactions 482 using the token endpoint and optionally the introspection endpoint. 483 A client obtains an access token, and optionally a refresh token, 484 from an AS using the token endpoint and subsequently presents the 485 access token to a RS to gain access to a protected resource. In most 486 deployments the RS can process the access token locally, however in 487 some cases the RS may present it to the AS via the introspection 488 endpoint to get fresh information. These interactions are shown in 489 Figure 1. An overview of various OAuth concepts is provided in 490 Section 3.1. 492 The OAuth 2.0 framework defines a number of "protocol flows" via 493 grant types, which have been extended further with extensions to 494 OAuth 2.0 (such as [RFC7521] and [RFC8628]). What grant types works 495 best depends on the usage scenario and [RFC7744] describes many 496 different IoT use cases but there are two preferred grant types, 497 namely the Authorization Code Grant (described in Section 4.1 of 498 [RFC7521]) and the Client Credentials Grant (described in Section 4.4 499 of [RFC7521]). The Authorization Code Grant is a good fit for use 500 with apps running on smart phones and tablets that request access to 501 IoT devices, a common scenario in the smart home environment, where 502 users need to go through an authentication and authorization phase 503 (at least during the initial setup phase). The native apps 504 guidelines described in [RFC8252] are applicable to this use case. 505 The Client Credential Grant is a good fit for use with IoT devices 506 where the OAuth client itself is constrained. In such a case, the 507 resource owner has pre-arranged access rights for the client with the 508 authorization server, which is often accomplished using a 509 commissioning tool. 511 The consent of the resource owner, for giving a client access to a 512 protected resource, can be provided dynamically as in the traditional 513 OAuth flows, or it could be pre-configured by the resource owner as 514 authorization policies at the AS, which the AS evaluates when a token 515 request arrives. The resource owner and the requesting party (i.e., 516 client owner) are not shown in Figure 1. 518 This framework supports a wide variety of communication security 519 mechanisms between the ACE entities, such as client, AS, and RS. It 520 is assumed that the client has been registered (also called enrolled 521 or onboarded) to an AS using a mechanism defined outside the scope of 522 this document. In practice, various techniques for onboarding have 523 been used, such as factory-based provisioning or the use of 524 commissioning tools. Regardless of the onboarding technique, this 525 provisioning procedure implies that the client and the AS exchange 526 credentials and configuration parameters. These credentials are used 527 to mutually authenticate each other and to protect messages exchanged 528 between the client and the AS. 530 It is also assumed that the RS has been registered with the AS, 531 potentially in a similar way as the client has been registered with 532 the AS. Established keying material between the AS and the RS allows 533 the AS to apply cryptographic protection to the access token to 534 ensure that its content cannot be modified, and if needed, that the 535 content is confidentiality protected. 537 The keying material necessary for establishing communication security 538 between C and RS is dynamically established as part of the protocol 539 described in this document. 541 At the start of the protocol, there is an optional discovery step 542 where the client discovers the resource server and the resources this 543 server hosts. In this step, the client might also determine what 544 permissions are needed to access the protected resource. A generic 545 procedure is described in Section 5.1; profiles MAY define other 546 procedures for discovery. 548 In Bluetooth Low Energy, for example, advertisements are broadcasted 549 by a peripheral, including information about the primary services. 550 In CoAP, as a second example, a client can make a request to "/.well- 551 known/core" to obtain information about available resources, which 552 are returned in a standardized format as described in [RFC6690]. 554 +--------+ +---------------+ 555 | |---(A)-- Token Request ------->| | 556 | | | Authorization | 557 | |<--(B)-- Access Token ---------| Server | 558 | | + Access Information | | 559 | | + Refresh Token (optional) +---------------+ 560 | | ^ | 561 | | Introspection Request (D)| | 562 | Client | (optional) | | 563 | | Response | |(E) 564 | | (optional) | v 565 | | +--------------+ 566 | |---(C)-- Token + Request ----->| | 567 | | | Resource | 568 | |<--(F)-- Protected Resource ---| Server | 569 | | | | 570 +--------+ +--------------+ 572 Figure 1: Basic Protocol Flow. 574 Requesting an Access Token (A): 575 The client makes an access token request to the token endpoint at 576 the AS. This framework assumes the use of PoP access tokens (see 577 Section 3.1 for a short description) wherein the AS binds a key to 578 an access token. The client may include permissions it seeks to 579 obtain, and information about the credentials it wants to use 580 (e.g., symmetric/asymmetric cryptography or a reference to a 581 specific credential). 583 Access Token Response (B): 584 If the AS successfully processes the request from the client, it 585 returns an access token and optionally a refresh token (note that 586 only certain grant types support refresh tokens). It can also 587 return additional parameters, referred to as "Access Information". 588 In addition to the response parameters defined by OAuth 2.0 and 589 the PoP access token extension, this framework defines parameters 590 that can be used to inform the client about capabilities of the 591 RS, e.g. the profiles the RS supports. More information about 592 these parameters can be found in Section 5.6.4. 594 Resource Request (C): 595 The client interacts with the RS to request access to the 596 protected resource and provides the access token. The protocol to 597 use between the client and the RS is not restricted to CoAP. 599 HTTP, HTTP/2, QUIC, MQTT, Bluetooth Low Energy, etc., are also 600 viable candidates. 602 Depending on the device limitations and the selected protocol, 603 this exchange may be split up into two parts: 605 (1) the client sends the access token containing, or 606 referencing, the authorization information to the RS, that may 607 be used for subsequent resource requests by the client, and 609 (2) the client makes the resource access request, using the 610 communication security protocol and other Access Information 611 obtained from the AS. 613 The Client and the RS mutually authenticate using the security 614 protocol specified in the profile (see step B) and the keys 615 obtained in the access token or the Access Information. The RS 616 verifies that the token is integrity protected and originated by 617 the AS. It then compares the claims contained in the access token 618 with the resource request. If the RS is online, validation can be 619 handed over to the AS using token introspection (see messages D 620 and E) over HTTP or CoAP. 622 Token Introspection Request (D): 623 A resource server may be configured to introspect the access token 624 by including it in a request to the introspection endpoint at that 625 AS. Token introspection over CoAP is defined in Section 5.7 and 626 for HTTP in [RFC7662]. 628 Note that token introspection is an optional step and can be 629 omitted if the token is self-contained and the resource server is 630 prepared to perform the token validation on its own. 632 Token Introspection Response (E): 633 The AS validates the token and returns the most recent parameters, 634 such as scope, audience, validity etc. associated with it back to 635 the RS. The RS then uses the received parameters to process the 636 request to either accept or to deny it. 638 Protected Resource (F): 639 If the request from the client is authorized, the RS fulfills the 640 request and returns a response with the appropriate response code. 642 The RS uses the dynamically established keys to protect the 643 response, according to the communication security protocol used. 645 5. Framework 647 The following sections detail the profiling and extensions of OAuth 648 2.0 for constrained environments, which constitutes the ACE 649 framework. 651 Credential Provisioning 652 For IoT, it cannot be assumed that the client and RS are part of a 653 common key infrastructure, so the AS provisions credentials or 654 associated information to allow mutual authentication between 655 client and RS. The resulting security association between client 656 and RS may then be re-used by binding these credentials to 657 additional access tokens. 659 Proof-of-Possession 660 The ACE framework, by default, implements proof-of-possession for 661 access tokens, i.e., that the token holder can prove being a 662 holder of the key bound to the token. The binding is provided by 663 the "cnf" claim [I-D.ietf-ace-cwt-proof-of-possession] indicating 664 what key is used for proof-of-possession. If a client needs to 665 submit a new access token, e.g., to obtain additional access 666 rights, they can request that the AS binds this token to the same 667 key as the previous one. 669 ACE Profiles 670 The client or RS may be limited in the encodings or protocols it 671 supports. To support a variety of different deployment settings, 672 specific interactions between client and RS are defined in an ACE 673 profile. In ACE framework the AS is expected to manage the 674 matching of compatible profile choices between a client and an RS. 675 The AS informs the client of the selected profile using the 676 "ace_profile" parameter in the token response. 678 OAuth 2.0 requires the use of TLS both to protect the communication 679 between AS and client when requesting an access token; between client 680 and RS when accessing a resource and between AS and RS if 681 introspection is used. In constrained settings TLS is not always 682 feasible, or desirable. Nevertheless it is REQUIRED that the 683 communications named above are encrypted, integrity protected and 684 protected against message replay. It is also REQUIRED that the 685 communicating endpoints perform mutual authentication. Furthermore 686 it MUST be assured that responses are bound to the requests in the 687 sense that the receiver of a response can be certain that the 688 response actually belongs to a certain request. Note that setting up 689 such a secure communication may require some unprotected messages to 690 be exchanged first (e.g. sending the token from the client to the 691 RS). 693 Profiles MUST specify a communication security protocol that provides 694 the features required above. 696 In OAuth 2.0 the communication with the Token and the Introspection 697 endpoints at the AS is assumed to be via HTTP and may use Uri-query 698 parameters. When profiles of this framework use CoAP instead, it is 699 REQUIRED to use of the following alternative instead of Uri-query 700 parameters: The sender (client or RS) encodes the parameters of its 701 request as a CBOR map and submits that map as the payload of the POST 702 request. 704 Profiles that use CBOR encoding of protocol message parameters at the 705 outermost encoding layer MUST use the media format 'application/ 706 ace+cbor'. If CoAP is used for communication, the Content-Format 707 MUST be abbreviated with the ID: 19 (see Section 8.15). 709 The OAuth 2.0 AS uses a JSON structure in the payload of its 710 responses both to client and RS. If CoAP is used, it is REQUIRED to 711 use CBOR [RFC7049] instead of JSON. Depending on the profile, the 712 CBOR payload MAY be enclosed in a non-CBOR cryptographic wrapper. 714 5.1. Discovering Authorization Servers 716 In order to determine the AS in charge of a resource hosted at the 717 RS, C MAY send an initial Unauthorized Resource Request message to 718 RS. RS then denies the request and sends the address of its AS back 719 to C. 721 Instead of the initial Unauthorized Resource Request message, other 722 discovery methods may be used, or the client may be pre-provisioned 723 with an RS-to-AS mapping. 725 5.1.1. Unauthorized Resource Request Message 727 An Unauthorized Resource Request message is a request for any 728 resource hosted by RS for which the client does not have 729 authorization granted. RSes MUST treat any request for a protected 730 resource as an Unauthorized Resource Request message when any of the 731 following hold: 733 o The request has been received on an unprotected channel. 735 o The RS has no valid access token for the sender of the request 736 regarding the requested action on that resource. 738 o The RS has a valid access token for the sender of the request, but 739 that token does not authorize the requested action on the 740 requested resource. 742 Note: These conditions ensure that the RS can handle requests 743 autonomously once access was granted and a secure channel has been 744 established between C and RS. The authz-info endpoint, as part of 745 the process for authorizing to protected resources, is not itself a 746 protected resource and MUST NOT be protected as specified above (cf. 747 Section 5.8.1). 749 Unauthorized Resource Request messages MUST be denied with an 750 "unauthorized_client" error response. In this response, the Resource 751 Server SHOULD provide proper AS Request Creation Hints to enable the 752 Client to request an access token from RS's AS as described in 753 Section 5.1.2. 755 The handling of all client requests (including unauthorized ones) by 756 the RS is described in Section 5.8.2. 758 5.1.2. AS Request Creation Hints 760 The AS Request Creation Hints message is sent by an RS as a response 761 to an Unauthorized Resource Request message (see Section 5.1.1) to 762 help the sender of the Unauthorized Resource Request message acquire 763 a valid access token. The AS Request Creation Hints message is a 764 CBOR map, with a MANDATORY element "AS" specifying an absolute URI 765 (see Section 4.3 of [RFC3986]) that identifies the appropriate AS for 766 the RS. 768 The message can also contain the following OPTIONAL parameters: 770 o A "audience" element containing a suggested audience that the 771 client should request at the AS. 773 o A "kid" element containing the key identifier of a key used in an 774 existing security association between the client and the RS. The 775 RS expects the client to request an access token bound to this 776 key, in order to avoid having to re-establish the security 777 association. 779 o A "cnonce" element containing a client-nonce. See 780 Section 5.1.2.1. 782 o A "scope" element containing the suggested scope that the client 783 should request towards the AS. 785 Figure 2 summarizes the parameters that may be part of the AS Request 786 Creation Hints. 788 /-----------+----------+---------------------\ 789 | Name | CBOR Key | Value Type | 790 |-----------+----------+---------------------| 791 | AS | 1 | text string | 792 | kid | 2 | byte string | 793 | audience | 5 | text string | 794 | scope | 9 | text or byte string | 795 | cnonce | 39 | byte string | 796 \-----------+----------+---------------------/ 798 Figure 2: AS Request Creation Hints 800 Note that the schema part of the AS parameter may need to be adapted 801 to the security protocol that is used between the client and the AS. 802 Thus the example AS value "coap://as.example.com/token" might need to 803 be transformed to "coaps://as.example.com/token". It is assumed that 804 the client can determine the correct schema part on its own depending 805 on the way it communicates with the AS. 807 Figure 3 shows an example for an AS Request Creation Hints message 808 payload using CBOR [RFC7049] diagnostic notation, using the parameter 809 names instead of the CBOR keys for better human readability. 811 4.01 Unauthorized 812 Content-Format: application/ace+cbor 813 Payload : 814 { 815 "AS" : "coaps://as.example.com/token", 816 "audience" : "coaps://rs.example.com" 817 "scope" : "rTempC", 818 "cnonce" : h'e0a156bb3f' 819 } 821 Figure 3: AS Request Creation Hints payload example 823 In this example, the attribute AS points the receiver of this message 824 to the URI "coaps://as.example.com/token" to request access 825 permissions. The originator of the AS Request Creation Hints payload 826 (i.e., RS) uses a local clock that is loosely synchronized with a 827 time scale common between RS and AS (e.g., wall clock time). 828 Therefore, it has included a parameter "nonce" (see Section 5.1.2.1). 830 Figure 4 illustrates the mandatory to use binary encoding of the 831 message payload shown in Figure 3. 833 a4 # map(4) 834 01 # unsigned(1) (=AS) 835 78 1c # text(28) 836 636f6170733a2f2f61732e657861 837 6d706c652e636f6d2f746f6b656e # "coaps://as.example.com/token" 838 05 # unsigned(5) (=audience) 839 76 # text(22) 840 636f6170733a2f2f72732e657861 841 6d706c652e636f6d # "coaps://rs.example.com" 842 09 # unsigned(9) (=scope) 843 66 # text(6) 844 7254656d7043 # "rTempC" 845 18 27 # unsigned(39) (=cnonce) 846 45 # bytes(5) 847 e0a156bb3f # 849 Figure 4: AS Request Creation Hints example encoded in CBOR 851 5.1.2.1. The Client-Nonce Parameter 853 If the RS does not synchronize its clock with the AS, it could be 854 tricked into accepting old access tokens, that are either expired or 855 have been compromised. In order to ensure some level of token 856 freshness in that case, the RS can use the "cnonce" (client-nonce) 857 parameter. The processing requirements for this parameter are as 858 follows: 860 o A RS sending a "cnonce" parameter in an an AS Request Creation 861 Hints message MUST store information to validate that a given 862 cnonce is fresh. How this is implemented internally is out of 863 scope for this specification. Expiration of client-nonces should 864 be based roughly on the time it would take a client to obtain an 865 access token after receiving the AS Request Creation Hints 866 message, with some allowance for unexpected delays. 868 o A client receiving a "cnonce" parameter in an AS Request Creation 869 Hints message MUST include this in the parameters when requesting 870 an access token at the AS, using the "cnonce" parameter from 871 Section 5.6.4.4. 873 o If an AS grants an access token request containing a "cnonce" 874 parameter, it MUST include this value in the access token, using 875 the "cnonce" claim specified in Section 5.8. 877 o A RS that is using the client-nonce mechanism and that receives an 878 access token MUST verify that this token contains a cnonce claim, 879 with a client-nonce value that is fresh according to the 880 information stored at the first step above. If the cnonce claim 881 is not present or if the cnonce claim value is not fresh, the RS 882 MUST discard the access token. If this was an interaction with 883 the authz-info endpoint the RS MUST also respond with an error 884 message using a response code equivalent to the CoAP code 4.01 885 (Unauthorized). 887 5.2. Authorization Grants 889 To request an access token, the client obtains authorization from the 890 resource owner or uses its client credentials as a grant. The 891 authorization is expressed in the form of an authorization grant. 893 The OAuth framework [RFC6749] defines four grant types. The grant 894 types can be split up into two groups, those granted on behalf of the 895 resource owner (password, authorization code, implicit) and those for 896 the client (client credentials). Further grant types have been added 897 later, such as [RFC7521] defining an assertion-based authorization 898 grant. 900 The grant type is selected depending on the use case. In cases where 901 the client acts on behalf of the resource owner, the authorization 902 code grant is recommended. If the client acts on behalf of the 903 resource owner, but does not have any display or has very limited 904 interaction possibilities, it is recommended to use the device code 905 grant defined in [RFC8628]. In cases where the client acts 906 autonomously the client credentials grant is recommended. 908 For details on the different grant types, see section 1.3 of 909 [RFC6749]. The OAuth 2.0 framework provides an extension mechanism 910 for defining additional grant types, so profiles of this framework 911 MAY define additional grant types, if needed. 913 5.3. Client Credentials 915 Authentication of the client is mandatory independent of the grant 916 type when requesting an access token from the token endpoint. In the 917 case of the client credentials grant type, the authentication and 918 grant coincide. 920 Client registration and provisioning of client credentials to the 921 client is out of scope for this specification. 923 The OAuth framework defines one client credential type in section 924 2.3.1 of [RFC6749]: client id and client secret. 926 [I-D.erdtman-ace-rpcc] adds raw-public-key and pre-shared-key to the 927 client credentials types. Profiles of this framework MAY extend with 928 an additional client credentials type using client certificates. 930 5.4. AS Authentication 932 The client credential grant does not, by default, authenticate the AS 933 that the client connects to. In classic OAuth, the AS is 934 authenticated with a TLS server certificate. 936 Profiles of this framework MUST specify how clients authenticate the 937 AS and how communication security is implemented. By default, server 938 side TLS certificates, as defined by OAuth 2.0, are required. 940 5.5. The Authorization Endpoint 942 The OAuth 2.0 authorization endpoint is used to interact with the 943 resource owner and obtain an authorization grant, in certain grant 944 flows. The primary use case for the ACE-OAuth framework is for 945 machine-to-machine interactions that do not involve the resource 946 owner in the authorization flow; therefore, this endpoint is out of 947 scope here. Future profiles may define constrained adaptation 948 mechanisms for this endpoint as well. Non-constrained clients 949 interacting with constrained resource servers can use the 950 specification in section 3.1 of [RFC6749] and the attack 951 countermeasures suggested in section 4.2 of [RFC6819]. 953 5.6. The Token Endpoint 955 In standard OAuth 2.0, the AS provides the token endpoint for 956 submitting access token requests. This framework extends the 957 functionality of the token endpoint, giving the AS the possibility to 958 help the client and RS to establish shared keys or to exchange their 959 public keys. Furthermore, this framework defines encodings using 960 CBOR, as a substitute for JSON. 962 The endpoint may, however, be exposed over HTTPS as in classical 963 OAuth or even other transports. A profile MUST define the details of 964 the mapping between the fields described below, and these transports. 965 If HTTPS is used, JSON or CBOR payloads may be supported. If JSON 966 payloads are used, the semantics of Section 4 of the OAuth 2.0 967 specification MUST be followed (with additions as described below). 968 If CBOR payload is supported, the semantics described below MUST be 969 followed. 971 For the AS to be able to issue a token, the client MUST be 972 authenticated and present a valid grant for the scopes requested. 973 Profiles of this framework MUST specify how the AS authenticates the 974 client and how the communication between client and AS is protected, 975 fulfilling the requirements specified in Section 5. 977 The default name of this endpoint in an url-path is '/token', however 978 implementations are not required to use this name and can define 979 their own instead. 981 The figures of this section use CBOR diagnostic notation without the 982 integer abbreviations for the parameters or their values for 983 illustrative purposes. Note that implementations MUST use the 984 integer abbreviations and the binary CBOR encoding, if the CBOR 985 encoding is used. 987 5.6.1. Client-to-AS Request 989 The client sends a POST request to the token endpoint at the AS. The 990 profile MUST specify how the communication is protected. The content 991 of the request consists of the parameters specified in the relevant 992 subsection of section 4 of the OAuth 2.0 specification [RFC6749], 993 depending on the grant type, with the following exceptions and 994 additions: 996 o The parameter "grant_type" is OPTIONAL in the context of this 997 framework (as opposed to REQUIRED in RFC6749). If that parameter 998 is missing, the default value "client_credentials" is implied. 1000 o The "audience" parameter from [I-D.ietf-oauth-token-exchange] is 1001 OPTIONAL to request an access token bound to a specific audience. 1003 o The "cnonce" parameter defined in Section 5.6.4.4 is REQUIRED if 1004 the RS provided a client-nonce in the "AS Request Creation Hints" 1005 message Section 5.1.2 1007 o The "scope" parameter MAY be encoded as a byte string instead of 1008 the string encoding specified in section 3.3 of [RFC6749], in 1009 order allow compact encoding of complex scopes. The syntax of 1010 such a binary encoding is explicitly not specified here and left 1011 to profiles or applications, specifically note that a binary 1012 encoded scope does not necessarily use the space character '0x20' 1013 to delimit scope-tokens. 1015 o The client can send an empty (null value) "ace_profile" parameter 1016 to indicate that it wants the AS to include the "ace_profile" 1017 parameter in the response. See Section 5.6.4.3. 1019 o A client MUST be able to use the parameters from 1020 [I-D.ietf-ace-oauth-params] in an access token request to the 1021 token endpoint and the AS MUST be able to process these additional 1022 parameters. 1024 The default behavior, is that the AS generates a symmetric proof-of- 1025 possession key for the client. In order to use an asymmetric key 1026 pair or to re-use a key previously established with the RS, the 1027 client is supposed to use the "req_cnf" parameter from 1028 [I-D.ietf-ace-oauth-params]. 1030 If CBOR is used then these parameters MUST be encoded as a CBOR map. 1032 When HTTP is used as a transport then the client makes a request to 1033 the token endpoint by sending the parameters using the "application/ 1034 x-www-form-urlencoded" format with a character encoding of UTF-8 in 1035 the HTTP request entity-body, as defined in section 3.2 of [RFC6749]. 1037 The following examples illustrate different types of requests for 1038 proof-of-possession tokens. 1040 Figure 5 shows a request for a token with a symmetric proof-of- 1041 possession key. The content is displayed in CBOR diagnostic 1042 notation, without abbreviations for better readability. 1044 Header: POST (Code=0.02) 1045 Uri-Host: "as.example.com" 1046 Uri-Path: "token" 1047 Content-Format: "application/ace+cbor" 1048 Payload: 1049 { 1050 "client_id" : "myclient", 1051 "audience" : "tempSensor4711" 1052 } 1054 Figure 5: Example request for an access token bound to a symmetric 1055 key. 1057 Figure 6 shows a request for a token with an asymmetric proof-of- 1058 possession key. Note that in this example OSCORE [RFC8613] is used 1059 to provide object-security, therefore the Content-Format is 1060 "application/oscore" wrapping the "application/ace+cbor" type 1061 content. The OSCORE option has a decoded interpretation appended in 1062 parentheses for the reader's convenience. Also note that in this 1063 example the audience is implicitly known by both client and AS. 1064 Furthermore note that this example uses the "req_cnf" parameter from 1065 [I-D.ietf-ace-oauth-params]. 1067 Header: POST (Code=0.02) 1068 Uri-Host: "as.example.com" 1069 Uri-Path: "token" 1070 OSCORE: 0x09, 0x05, 0x44, 0x6C 1071 (h=0, k=1, n=001, partialIV= 0x05, kid=[0x44, 0x6C]) 1072 Content-Format: "application/oscore" 1073 Payload: 1074 0x44025d1 ... (full payload omitted for brevity) ... 68b3825e 1076 Decrypted payload: 1077 { 1078 "client_id" : "myclient", 1079 "req_cnf" : { 1080 "COSE_Key" : { 1081 "kty" : "EC", 1082 "kid" : h'11', 1083 "crv" : "P-256", 1084 "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', 1085 "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' 1086 } 1087 } 1088 } 1090 Figure 6: Example token request bound to an asymmetric key. 1092 Figure 7 shows a request for a token where a previously communicated 1093 proof-of-possession key is only referenced using the "req_cnf" 1094 parameter from [I-D.ietf-ace-oauth-params]. 1096 Header: POST (Code=0.02) 1097 Uri-Host: "as.example.com" 1098 Uri-Path: "token" 1099 Content-Format: "application/ace+cbor" 1100 Payload: 1101 { 1102 "client_id" : "myclient", 1103 "audience" : "valve424", 1104 "scope" : "read", 1105 "req_cnf" : { 1106 "kid" : b64'6kg0dXJM13U' 1107 } 1108 }W 1110 Figure 7: Example request for an access token bound to a key 1111 reference. 1113 Refresh tokens are typically not stored as securely as proof-of- 1114 possession keys in requesting clients. Proof-of-possession based 1115 refresh token requests MUST NOT request different proof-of-possession 1116 keys or different audiences in token requests. Refresh token 1117 requests can only use to request access tokens bound to the same 1118 proof-of-possession key and the same audience as access tokens issued 1119 in the initial token request. 1121 5.6.2. AS-to-Client Response 1123 If the access token request has been successfully verified by the AS 1124 and the client is authorized to obtain an access token corresponding 1125 to its access token request, the AS sends a response with the 1126 response code equivalent to the CoAP response code 2.01 (Created). 1127 If client request was invalid, or not authorized, the AS returns an 1128 error response as described in Section 5.6.3. 1130 Note that the AS decides which token type and profile to use when 1131 issuing a successful response. It is assumed that the AS has prior 1132 knowledge of the capabilities of the client and the RS (see 1133 Appendix D). This prior knowledge may, for example, be set by the 1134 use of a dynamic client registration protocol exchange [RFC7591]. If 1135 the client has requested a specific proof-of-possession key using the 1136 "req_cnf" parameter from [I-D.ietf-ace-oauth-params], this may also 1137 influence which profile the AS selects, as it needs to support the 1138 use of the key type requested the client. 1140 The content of the successful reply is the Access Information. When 1141 using CBOR payloads, the content MUST be encoded as a CBOR map, 1142 containing parameters as specified in Section 5.1 of [RFC6749], with 1143 the following additions and changes: 1145 ace_profile: 1146 OPTIONAL unless the request included an empty ace_profile 1147 parameter in which case it is MANDATORY. This indicates the 1148 profile that the client MUST use towards the RS. See 1149 Section 5.6.4.3 for the formatting of this parameter. If this 1150 parameter is absent, the AS assumes that the client implicitly 1151 knows which profile to use towards the RS. 1153 token_type: 1154 This parameter is OPTIONAL, as opposed to 'required' in [RFC6749]. 1155 By default implementations of this framework SHOULD assume that 1156 the token_type is "PoP". If a specific use case requires another 1157 token_type (e.g., "Bearer") to be used then this parameter is 1158 REQUIRED. 1160 Furthermore [I-D.ietf-ace-oauth-params] defines additional parameters 1161 that the AS MUST be able to use when responding to a request to the 1162 token endpoint. 1164 Figure 8 summarizes the parameters that can currently be part of the 1165 Access Information. Future extensions may define additional 1166 parameters. 1168 /-------------------+-------------------------------\ 1169 | Parameter name | Specified in | 1170 |-------------------+-------------------------------| 1171 | access_token | RFC 6749 | 1172 | token_type | RFC 6749 | 1173 | expires_in | RFC 6749 | 1174 | refresh_token | RFC 6749 | 1175 | scope | RFC 6749 | 1176 | state | RFC 6749 | 1177 | error | RFC 6749 | 1178 | error_description | RFC 6749 | 1179 | error_uri | RFC 6749 | 1180 | ace_profile | [this document] | 1181 | cnf | [I-D.ietf-ace-oauth-params] | 1182 | rs_cnf | [I-D.ietf-ace-oauth-params] | 1183 \-------------------+-------------------------------/ 1185 Figure 8: Access Information parameters 1187 Figure 9 shows a response containing a token and a "cnf" parameter 1188 with a symmetric proof-of-possession key, which is defined in 1189 [I-D.ietf-ace-oauth-params]. Note that the key identifier 'kid' is 1190 only used to simplify indexing and retrieving the key, and no 1191 assumptions should be made that it is unique in the domains of either 1192 the client or the RS. 1194 Header: Created (Code=2.01) 1195 Content-Format: "application/ace+cbor" 1196 Payload: 1197 { 1198 "access_token" : b64'SlAV32hkKG ... 1199 (remainder of CWT omitted for brevity; 1200 CWT contains COSE_Key in the "cnf" claim)', 1201 "ace_profile" : "coap_dtls", 1202 "expires_in" : "3600", 1203 "cnf" : { 1204 "COSE_Key" : { 1205 "kty" : "Symmetric", 1206 "kid" : b64'39Gqlw', 1207 "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' 1208 } 1209 } 1210 } 1212 Figure 9: Example AS response with an access token bound to a 1213 symmetric key. 1215 5.6.3. Error Response 1217 The error responses for CoAP-based interactions with the AS are 1218 generally equivalent to the ones for HTTP-based interactions as 1219 defined in Section 5.2 of [RFC6749], with the following exceptions: 1221 o When using CBOR the raw payload before being processed by the 1222 communication security protocol MUST be encoded as a CBOR map. 1224 o A response code equivalent to the CoAP code 4.00 (Bad Request) 1225 MUST be used for all error responses, except for invalid_client 1226 where a response code equivalent to the CoAP code 4.01 1227 (Unauthorized) MAY be used under the same conditions as specified 1228 in Section 5.2 of [RFC6749]. 1230 o The Content-Format (for CoAP-based interactions) or media type 1231 (for HTTP-based interactions) "application/ace+cbor" MUST be used 1232 for the error response. 1234 o The parameters "error", "error_description" and "error_uri" MUST 1235 be abbreviated using the codes specified in Figure 12, when a CBOR 1236 encoding is used. 1238 o The error code (i.e., value of the "error" parameter) MUST be 1239 abbreviated as specified in Figure 10, when a CBOR encoding is 1240 used. 1242 /------------------------+-------------\ 1243 | Name | CBOR Values | 1244 |------------------------+-------------| 1245 | invalid_request | 1 | 1246 | invalid_client | 2 | 1247 | invalid_grant | 3 | 1248 | unauthorized_client | 4 | 1249 | unsupported_grant_type | 5 | 1250 | invalid_scope | 6 | 1251 | unsupported_pop_key | 7 | 1252 | incompatible_profiles | 8 | 1253 \------------------------+-------------/ 1255 Figure 10: CBOR abbreviations for common error codes 1257 In addition to the error responses defined in OAuth 2.0, the 1258 following behavior MUST be implemented by the AS: 1260 o If the client submits an asymmetric key in the token request that 1261 the RS cannot process, the AS MUST reject that request with a 1262 response code equivalent to the CoAP code 4.00 (Bad Request) 1263 including the error code "unsupported_pop_key" defined in 1264 Figure 10. 1266 o If the client and the RS it has requested an access token for do 1267 not share a common profile, the AS MUST reject that request with a 1268 response code equivalent to the CoAP code 4.00 (Bad Request) 1269 including the error code "incompatible_profiles" defined in 1270 Figure 10. 1272 5.6.4. Request and Response Parameters 1274 This section provides more detail about the new parameters that can 1275 be used in access token requests and responses, as well as 1276 abbreviations for more compact encoding of existing parameters and 1277 common parameter values. 1279 5.6.4.1. Grant Type 1281 The abbreviations specified in the registry defined in Section 8.4 1282 MUST be used in CBOR encodings instead of the string values defined 1283 in [RFC6749], if CBOR payloads are used. 1285 /--------------------+------------+------------------------\ 1286 | Name | CBOR Value | Original Specification | 1287 |--------------------+------------+------------------------| 1288 | password | 0 | RFC6749 | 1289 | authorization_code | 1 | RFC6749 | 1290 | client_credentials | 2 | RFC6749 | 1291 | refresh_token | 3 | RFC6749 | 1292 \--------------------+------------+------------------------/ 1294 Figure 11: CBOR abbreviations for common grant types 1296 5.6.4.2. Token Type 1298 The "token_type" parameter, defined in section 5.1 of [RFC6749], 1299 allows the AS to indicate to the client which type of access token it 1300 is receiving (e.g., a bearer token). 1302 This document registers the new value "PoP" for the OAuth Access 1303 Token Types registry, specifying a proof-of-possession token. How 1304 the proof-of-possession by the client to the RS is performed MUST be 1305 specified by the profiles. 1307 The values in the "token_type" parameter MUST use the CBOR 1308 abbreviations defined in the registry specified by Section 8.6, if a 1309 CBOR encoding is used. 1311 In this framework the "pop" value for the "token_type" parameter is 1312 the default. The AS may, however, provide a different value. 1314 5.6.4.3. Profile 1316 Profiles of this framework MUST define the communication protocol and 1317 the communication security protocol between the client and the RS. 1318 The security protocol MUST provide encryption, integrity and replay 1319 protection. It MUST also provide a binding between requests and 1320 responses. Furthermore profiles MUST define a list of allowed proof- 1321 of-possession methods, if they support proof-of-possession tokens. 1323 A profile MUST specify an identifier that MUST be used to uniquely 1324 identify itself in the "ace_profile" parameter. The textual 1325 representation of the profile identifier is just intended for human 1326 readability and MUST NOT be used in parameters and claims. Profiles 1327 MUST register their identifier in the registry defined in 1328 Section 8.7. 1330 Profiles MAY define additional parameters for both the token request 1331 and the Access Information in the access token response in order to 1332 support negotiation or signaling of profile specific parameters. 1334 Clients that want the AS to provide them with the "ace_profile" 1335 parameter in the access token response can indicate that by sending a 1336 ace_profile parameter with a null value in the access token request. 1338 5.6.4.4. Client-Nonce 1340 This parameter MUST be sent from the client to the AS, if it 1341 previously received a "cnonce" parameter in the AS Request Creation 1342 Hints Section 5.1.2. The parameter is encoded as a byte string and 1343 copies the value from the cnonce parameter in the AS Request Creation 1344 Hints. 1346 5.6.5. Mapping Parameters to CBOR 1348 If CBOR encoding is used, all OAuth parameters in access token 1349 requests and responses MUST be mapped to CBOR types as specified in 1350 the registry defined by Section 8.9, using the given integer 1351 abbreviation for the map keys. 1353 Note that we have aligned the abbreviations corresponding to claims 1354 with the abbreviations defined in [RFC8392]. 1356 Note also that abbreviations from -24 to 23 have a 1 byte encoding 1357 size in CBOR. We have thus chosen to assign abbreviations in that 1358 range to parameters we expect to be used most frequently in 1359 constrained scenarios. 1361 /-------------------+----------+---------------------\ 1362 | Name | CBOR Key | Value Type | 1363 |-------------------+----------+---------------------| 1364 | access_token | 1 | byte string | 1365 | expires_in | 2 | unsigned integer | 1366 | audience | 5 | text string | 1367 | scope | 9 | text or byte string | 1368 | client_id | 24 | text string | 1369 | client_secret | 25 | byte string | 1370 | response_type | 26 | text string | 1371 | redirect_uri | 27 | text string | 1372 | state | 28 | text string | 1373 | code | 29 | byte string | 1374 | error | 30 | unsigned integer | 1375 | error_description | 31 | text string | 1376 | error_uri | 32 | text string | 1377 | grant_type | 33 | unsigned integer | 1378 | token_type | 34 | unsigned integer | 1379 | username | 35 | text string | 1380 | password | 36 | text string | 1381 | refresh_token | 37 | byte string | 1382 | ace_profile | 38 | unsigned integer | 1383 | cnonce | 39 | byte string | 1384 \-------------------+----------+---------------------/ 1386 Figure 12: CBOR mappings used in token requests and responses 1388 5.7. The Introspection Endpoint 1390 Token introspection [RFC7662] can be OPTIONALLY provided by the AS, 1391 and is then used by the RS and potentially the client to query the AS 1392 for metadata about a given token, e.g., validity or scope. Analogous 1393 to the protocol defined in [RFC7662] for HTTP and JSON, this section 1394 defines adaptations to more constrained environments using CBOR and 1395 leaving the choice of the application protocol to the profile. 1397 Communication between the requesting entity and the introspection 1398 endpoint at the AS MUST be integrity protected and encrypted. The 1399 communication security protocol MUST also provide a binding between 1400 requests and responses. Furthermore the two interacting parties MUST 1401 perform mutual authentication. Finally the AS SHOULD verify that the 1402 requesting entity has the right to access introspection information 1403 about the provided token. Profiles of this framework that support 1404 introspection MUST specify how authentication and communication 1405 security between the requesting entity and the AS is implemented. 1407 The default name of this endpoint in an url-path is '/introspect', 1408 however implementations are not required to use this name and can 1409 define their own instead. 1411 The figures of this section uses CBOR diagnostic notation without the 1412 integer abbreviations for the parameters or their values for better 1413 readability. 1415 Note that supporting introspection is OPTIONAL for implementations of 1416 this framework. 1418 5.7.1. Introspection Request 1420 The requesting entity sends a POST request to the introspection 1421 endpoint at the AS. The profile MUST specify how the communication 1422 is protected. If CBOR is used, the payload MUST be encoded as a CBOR 1423 map with a "token" entry containing the access token. Further 1424 optional parameters representing additional context that is known by 1425 the requesting entity to aid the AS in its response MAY be included. 1427 For CoAP-based interaction, all messages MUST use the content type 1428 "application/ace+cbor", while for HTTP-based interactions the 1429 equivalent media type "application/ace+cbor" MUST be used. 1431 The same parameters are required and optional as in Section 2.1 of 1432 [RFC7662]. 1434 For example, Figure 13 shows a RS calling the token introspection 1435 endpoint at the AS to query about an OAuth 2.0 proof-of-possession 1436 token. Note that object security based on OSCORE [RFC8613] is 1437 assumed in this example, therefore the Content-Format is 1438 "application/oscore". Figure 14 shows the decoded payload. 1440 Header: POST (Code=0.02) 1441 Uri-Host: "as.example.com" 1442 Uri-Path: "introspect" 1443 OSCORE: 0x09, 0x05, 0x25 1444 Content-Format: "application/oscore" 1445 Payload: 1446 ... COSE content ... 1448 Figure 13: Example introspection request. 1450 { 1451 "token" : b64'7gj0dXJQ43U', 1452 "token_type_hint" : "PoP" 1453 } 1455 Figure 14: Decoded payload. 1457 5.7.2. Introspection Response 1459 If the introspection request is authorized and successfully 1460 processed, the AS sends a response with the response code equivalent 1461 to the CoAP code 2.01 (Created). If the introspection request was 1462 invalid, not authorized or couldn't be processed the AS returns an 1463 error response as described in Section 5.7.3. 1465 In a successful response, the AS encodes the response parameters in a 1466 map including with the same required and optional parameters as in 1467 Section 2.2 of [RFC7662] with the following addition: 1469 ace_profile OPTIONAL. This indicates the profile that the RS MUST 1470 use with the client. See Section 5.6.4.3 for more details on the 1471 formatting of this parameter. 1473 cnonce OPTIONAL. A client-nonce provided to the AS by the client. 1474 The RS MUST verify that this corresponds to the client-nonce 1475 previously provided to the client in the AS Request Creation 1476 Hints. See Section 5.1.2 and Section 5.6.4.4. 1478 exi OPTIONAL. The "expires-in" claim associated to this access 1479 token. See Section 5.8.3. 1481 Furthermore [I-D.ietf-ace-oauth-params] defines more parameters that 1482 the AS MUST be able to use when responding to a request to the 1483 introspection endpoint. 1485 For example, Figure 15 shows an AS response to the introspection 1486 request in Figure 13. Note that this example contains the "cnf" 1487 parameter defined in [I-D.ietf-ace-oauth-params]. 1489 Header: Created (Code=2.01) 1490 Content-Format: "application/ace+cbor" 1491 Payload: 1492 { 1493 "active" : true, 1494 "scope" : "read", 1495 "ace_profile" : "coap_dtls", 1496 "cnf" : { 1497 "COSE_Key" : { 1498 "kty" : "Symmetric", 1499 "kid" : b64'39Gqlw', 1500 "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' 1501 } 1502 } 1503 } 1505 Figure 15: Example introspection response. 1507 5.7.3. Error Response 1509 The error responses for CoAP-based interactions with the AS are 1510 equivalent to the ones for HTTP-based interactions as defined in 1511 Section 2.3 of [RFC7662], with the following differences: 1513 o If content is sent and CBOR is used the payload MUST be encoded as 1514 a CBOR map and the Content-Format "application/ace+cbor" MUST be 1515 used. 1517 o If the credentials used by the requesting entity (usually the RS) 1518 are invalid the AS MUST respond with the response code equivalent 1519 to the CoAP code 4.01 (Unauthorized) and use the required and 1520 optional parameters from Section 5.2 in [RFC6749]. 1522 o If the requesting entity does not have the right to perform this 1523 introspection request, the AS MUST respond with a response code 1524 equivalent to the CoAP code 4.03 (Forbidden). In this case no 1525 payload is returned. 1527 o The parameters "error", "error_description" and "error_uri" MUST 1528 be abbreviated using the codes specified in Figure 12. 1530 o The error codes MUST be abbreviated using the codes specified in 1531 the registry defined by Section 8.3. 1533 Note that a properly formed and authorized query for an inactive or 1534 otherwise invalid token does not warrant an error response by this 1535 specification. In these cases, the authorization server MUST instead 1536 respond with an introspection response with the "active" field set to 1537 "false". 1539 5.7.4. Mapping Introspection parameters to CBOR 1541 If CBOR is used, the introspection request and response parameters 1542 MUST be mapped to CBOR types as specified in the registry defined by 1543 Section 8.11, using the given integer abbreviation for the map key. 1545 Note that we have aligned abbreviations that correspond to a claim 1546 with the abbreviations defined in [RFC8392] and the abbreviations of 1547 parameters with the same name from Section 5.6.5. 1549 /-------------------+----------+-------------------------\ 1550 | Parameter name | CBOR Key | Value Type | 1551 |-------------------+----------+-------------------------| 1552 | iss | 1 | text string | 1553 | sub | 2 | text string | 1554 | aud | 3 | text string | 1555 | exp | 4 | integer or | 1556 | | | floating-point number | 1557 | nbf | 5 | integer or | 1558 | | | floating-point number | 1559 | iat | 6 | integer or | 1560 | | | floating-point number | 1561 | cti | 7 | byte string | 1562 | scope | 9 | text or byte string | 1563 | active | 10 | True or False | 1564 | token | 11 | byte string | 1565 | client_id | 24 | text string | 1566 | error | 30 | unsigned integer | 1567 | error_description | 31 | text string | 1568 | error_uri | 32 | text string | 1569 | token_type_hint | 33 | text string | 1570 | token_type | 34 | text string | 1571 | username | 35 | text string | 1572 | ace_profile | 38 | unsigned integer | 1573 | cnonce | 39 | byte string | 1574 | exi | 40 | unsigned integer | 1575 \-------------------+----------+-------------------------/ 1577 Figure 16: CBOR Mappings to Token Introspection Parameters. 1579 5.8. The Access Token 1581 This framework RECOMMENDS the use of CBOR web token (CWT) as 1582 specified in [RFC8392]. 1584 In order to facilitate offline processing of access tokens, this 1585 document uses the "cnf" claim from 1586 [I-D.ietf-ace-cwt-proof-of-possession] and the "scope" claim from 1587 [I-D.ietf-oauth-token-exchange] for JWT- and CWT-encoded tokens. In 1588 addition to string encoding specified for the "scope" claim, a binary 1589 encoding MAY be used. The syntax of such an encoding is explicitly 1590 not specified here and left to profiles or applications, specifically 1591 note that a binary encoded scope does not necessarily use the space 1592 character '0x20' to delimit scope-tokens. 1594 If the AS needs to convey a hint to the RS about which profile it 1595 should use to communicate with the client, the AS MAY include an 1596 "ace_profile" claim in the access token, with the same syntax and 1597 semantics as defined in Section 5.6.4.3. 1599 If the client submitted a client-nonce parameter in the access token 1600 request Section 5.6.4.4, the AS MUST include the value of this 1601 parameter in the "cnonce" claim specified here. The "cnonce" claim 1602 uses binary encoding. 1604 5.8.1. The Authorization Information Endpoint 1606 The access token, containing authorization information and 1607 information about the proof-of-possession method used by the client, 1608 needs to be transported to the RS so that the RS can authenticate and 1609 authorize the client request. 1611 This section defines a method for transporting the access token to 1612 the RS using a RESTful protocol such as CoAP. Profiles of this 1613 framework MAY define other methods for token transport. 1615 The method consists of an authz-info endpoint, implemented by the RS. 1616 A client using this method MUST make a POST request to the authz-info 1617 endpoint at the RS with the access token in the payload. The RS 1618 receiving the token MUST verify the validity of the token. If the 1619 token is valid, the RS MUST respond to the POST request with 2.01 1620 (Created). Section Section 5.8.1.1 outlines how an RS MUST proceed 1621 to verify the validity of an access token. 1623 The RS MUST be prepared to store at least one access token for future 1624 use. This is a difference to how access tokens are handled in OAuth 1625 2.0, where the access token is typically sent along with each 1626 request, and therefore not stored at the RS. 1628 This specification RECOMMENDS that an RS stores only one token per 1629 proof-of-possession key, meaning that an additional token linked to 1630 the same key will overwrite any existing token at the RS. The reason 1631 is that this greatly simplifies (constrained) implementations, with 1632 respect to required storage and resolving a request to the applicable 1633 token. 1635 If the payload sent to the authz-info endpoint does not parse to a 1636 token, the RS MUST respond with a response code equivalent to the 1637 CoAP code 4.00 (Bad Request). 1639 The RS MAY make an introspection request to validate the token before 1640 responding to the POST request to the authz-info endpoint, e.g. if 1641 the token is an opaque reference. Some transport protocols may 1642 provide a way to indicate that the RS is busy and the client should 1643 retry after an interval; this type of status update would be 1644 appropriate while the RS is waiting for an introspection response. 1646 Profiles MUST specify whether the authz-info endpoint is protected, 1647 including whether error responses from this endpoint are protected. 1648 Note that since the token contains information that allow the client 1649 and the RS to establish a security context in the first place, mutual 1650 authentication may not be possible at this point. 1652 The default name of this endpoint in an url-path is '/authz-info', 1653 however implementations are not required to use this name and can 1654 define their own instead. 1656 5.8.1.1. Verifying an Access Token 1658 When an RS receives an access token, it MUST verify it before storing 1659 it. The details of token verification depends on various aspects, 1660 including the token encoding, the type of token, the security 1661 protection applied to the token, and the claims. The token encoding 1662 matters since the security wrapper differs between the token 1663 encodings. For example, a CWT token uses COSE while a JWT token uses 1664 JOSE. The type of token also has an influence on the verification 1665 procedure since tokens may be self-contained whereby token 1666 verification may happen locally at the RS while a token-by-reference 1667 requires further interaction with the authorization server, for 1668 example using token introspection, to obtain the claims associated 1669 with the token reference. Self-contained tokens MUST, at a minimum, 1670 be integrity protected but they MAY also be encrypted. 1672 For self-contained tokens the RS MUST process the security protection 1673 of the token first, as specified by the respective token format. For 1674 CWT the description can be found in [RFC8392] and for JWT the 1675 relevant specification is [RFC7519]. This MUST include a 1676 verification that security protection (and thus the token) was 1677 generated by an AS that has the right to issue access tokens for this 1678 RS. 1680 In case the token is communicated by reference the RS needs to obtain 1681 the claims first. When the RS uses token introspection the relevant 1682 specification is [RFC7662] with CoAP transport specified in 1683 Section 5.7. 1685 Errors may happen during this initial processing stage: 1687 o If token or claim verification fails, the RS MUST discard the 1688 token and, if this was an interaction with authz-info, return an 1689 error message with a response code equivalent to the CoAP code 1690 4.01 (Unauthorized). 1692 o If the claims cannot be obtained the RS MUST discard the token 1693 and, in case of an interaction via the authz-info endpoint, return 1694 an error message with a response code equivalent to the CoAP code 1695 4.00 (Bad Request). 1697 Next, the RS MUST verify claims, if present, contained in the access 1698 token. Errors are returned when claim checks fail, in the order of 1699 priority of this list: 1701 iss The issuer claim must identify an AS that has the authority to 1702 issue access tokens for the receiving RS. If that is not the case 1703 the RS MUST discard the token. If this was an interaction with 1704 authz-info, the RS MUST also respond with a response code 1705 equivalent to the CoAP code 4.01 (Unauthorized). 1707 exp The expiration date must be in the future. If that is not the 1708 case the RS MUST discard the token. If this was an interaction 1709 with authz-info the RS MUST also respond with a response code 1710 equivalent to the CoAP code 4.01 (Unauthorized). Note that the RS 1711 has to terminate access rights to the protected resources at the 1712 time when the tokens expire. 1714 aud The audience claim must refer to an audience that the RS 1715 identifies with. If that is not the case the RS MUST discard the 1716 token. If this was an interaction with authz-info, the RS MUST 1717 also respond with a response code equivalent to the CoAP code 4.03 1718 (Forbidden). 1720 scope The RS must recognize value of the scope claim. If that is 1721 not the case the RS MUST discard the token. If this was an 1722 interaction with authz-info, the RS MUST also respond with a 1723 response code equivalent to the CoAP code 4.00 (Bad Request). The 1724 RS MAY provide additional information in the error response, to 1725 clarify what went wrong. 1727 Additional processing may be needed for other claims in a way 1728 specific to a profile or the underlying application. 1730 Note that the Subject (sub) claim cannot always be verified when the 1731 token is submitted to the RS since the client may not have 1732 authenticated yet. Also note that a counter for the expires_in (exi) 1733 claim MUST be initialized when the RS first verifies this token. 1735 Also note that profiles of this framework may define access token 1736 transport mechanisms that do not allow for error responses. 1737 Therefore the error messages specified here only apply if the token 1738 was sent to the authz-info endpoint. 1740 When sending error responses, the RS MAY use the error codes from 1741 Section 3.1 of [RFC6750], to provide additional details to the 1742 client. 1744 5.8.1.2. Protecting the Authorization Information Endpoint 1746 As this framework can be used in RESTful environments, it is 1747 important to make sure that attackers cannot perform unauthorized 1748 requests on the authz-info endpoints, other than submitting access 1749 tokens. 1751 Specifically it SHOULD NOT be possible to perform GET, DELETE or PUT 1752 on the authz-info endpoint and on it's children (if any). 1754 The POST method SHOULD NOT be allowed on children of the authz-info 1755 endpoint. 1757 The RS SHOULD implement rate limiting measures to mitigate attacks 1758 aiming to overload the processing capacity of the RS by repeatedly 1759 submitting tokens. For CoAP-based communication the RS could use the 1760 mechanisms from [RFC8516] to indicate that it is overloaded. 1762 5.8.2. Client Requests to the RS 1764 Before sending a request to a RS, the client MUST verify that the 1765 keys used to protect this communication are still valid. See 1766 Section 5.8.4 for details on how the client determines the validity 1767 of the keys used. 1769 If an RS receives a request from a client, and the target resource 1770 requires authorization, the RS MUST first verify that it has an 1771 access token that authorizes this request, and that the client has 1772 performed the proof-of-possession binding that token to the request. 1774 The response code MUST be 4.01 (Unauthorized) in case the client has 1775 not performed the proof-of-possession, or if RS has no valid access 1776 token for the client. If RS has an access token for the client but 1777 the token does not authorize access for the resource that was 1778 requested, RS MUST reject the request with a 4.03 (Forbidden). If RS 1779 has an access token for the client but it does not cover the action 1780 that was requested on the resource, RS MUST reject the request with a 1781 4.05 (Method Not Allowed). 1783 Note: The use of the response codes 4.03 and 4.05 is intended to 1784 prevent infinite loops where a dumb Client optimistically tries to 1785 access a requested resource with any access token received from AS. 1786 As malicious clients could pretend to be C to determine C's 1787 privileges, these detailed response codes must be used only when a 1788 certain level of security is already available which can be achieved 1789 only when the Client is authenticated. 1791 Note: The RS MAY use introspection for timely validation of an access 1792 token, at the time when a request is presented. 1794 Note: Matching the claims of the access token (e.g., scope) to a 1795 specific request is application specific. 1797 If the request matches a valid token and the client has performed the 1798 proof-of-possession for that token, the RS continues to process the 1799 request as specified by the underlying application. 1801 5.8.3. Token Expiration 1803 Depending on the capabilities of the RS, there are various ways in 1804 which it can verify the expiration of a received access token. Here 1805 follows a list of the possibilities including what functionality they 1806 require of the RS. 1808 o The token is a CWT and includes an "exp" claim and possibly the 1809 "nbf" claim. The RS verifies these by comparing them to values 1810 from its internal clock as defined in [RFC7519]. In this case the 1811 RS's internal clock must reflect the current date and time, or at 1812 least be synchronized with the AS's clock. How this clock 1813 synchronization would be performed is out of scope for this 1814 specification. 1816 o The RS verifies the validity of the token by performing an 1817 introspection request as specified in Section 5.7. This requires 1818 the RS to have a reliable network connection to the AS and to be 1819 able to handle two secure sessions in parallel (C to RS and RS to 1820 AS). 1822 o In order to support token expiration for devices that have no 1823 reliable way of synchronizing their internal clocks, this 1824 specification defines the following approach: The claim "exi" 1825 ("expires in") can be used, to provide the RS with the lifetime of 1826 the token in seconds from the time the RS first receives the 1827 token. This approach is of course vulnerable to malicious clients 1828 holding back tokens they do not want to expire. Such an attack 1829 can only be prevented if the RS is able to communicate with the AS 1830 in some regular intervals, so that the can AS provide the RS with 1831 a list of expired tokens. The drawback of this mitigation is that 1832 the RS might as well use the communication with the AS to 1833 synchronize its internal clock. 1835 If a token that authorizes a long running request such as a CoAP 1836 Observe [RFC7641] expires, the RS MUST send an error response with 1837 the response code equivalent to the CoAP code 4.01 (Unauthorized) to 1838 the client and then terminate processing the long running request. 1840 5.8.4. Key Expiration 1842 The AS provides the client with key material that the RS uses. This 1843 can either be a common symmetric PoP-key, or an asymmetric key used 1844 by the RS to authenticate towards the client. Since there is no 1845 metadata associated to those keys, the client has no way of knowing 1846 if these keys are still valid. This may lead to situations where the 1847 client sends requests containing sensitive information to the RS 1848 using a key that is expired and possibly in the hands of an attacker, 1849 or accepts responses from the RS that are not properly protected and 1850 could possibly have been forged by an attacker. 1852 In order to prevent this, the client must assume that those keys are 1853 only valid as long as the related access token is. Since the access 1854 token is opaque to the client, one of the following methods MUST be 1855 used to inform the client about the validity of an access token: 1857 o The client knows a default validity time for all tokens it is 1858 using (i.e. how long a token is valid after being issued). This 1859 information could be provisioned to the client when it is 1860 registered at the AS, or published by the AS in a way that the 1861 client can query. 1863 o The AS informs the client about the token validity using the 1864 "expires_in" parameter in the Access Information. 1866 o The client performs an introspection of the token. Although this 1867 is not explicitly forbidden, how exactly a client does 1868 introspection is not currently specified for OAuth. 1870 A client that is not able to obtain information about the expiration 1871 of a token MUST NOT use this token. 1873 6. Security Considerations 1875 Security considerations applicable to authentication and 1876 authorization in RESTful environments provided in OAuth 2.0 [RFC6749] 1877 apply to this work. Furthermore [RFC6819] provides additional 1878 security considerations for OAuth which apply to IoT deployments as 1879 well. If the introspection endpoint is used, the security 1880 considerations from [RFC7662] also apply. 1882 The following subsections address issues specific to this document 1883 and it's use in constrained environments. 1885 6.1. Protecting Tokens 1887 A large range of threats can be mitigated by protecting the contents 1888 of the access token by using a digital signature or a keyed message 1889 digest (MAC) or an Authenticated Encryption with Associated Data 1890 (AEAD) algorithm. Consequently, the token integrity protection MUST 1891 be applied to prevent the token from being modified, particularly 1892 since it contains a reference to the symmetric key or the asymmetric 1893 key used for proof-of-possession. If the access token contains the 1894 symmetric key, this symmetric key MUST be encrypted by the 1895 authorization server so that only the resource server can decrypt it. 1896 Note that using an AEAD algorithm is preferable over using a MAC 1897 unless the token needs to be publicly readable. 1899 If the token is intended for multiple recipients (i.e. an audience 1900 that is a group), integrity protection of the token with a symmetric 1901 key, shared between the AS and the recipients, is not sufficient, 1902 since any of the recipients could modify the token undetected by the 1903 other recipients. Therefore a token with a multi-recipient audience 1904 MUST be protected with an asymmetric signature. 1906 It is important for the authorization server to include the identity 1907 of the intended recipient (the audience), typically a single resource 1908 server (or a list of resource servers), in the token. Using a single 1909 shared secret as proof-of-possession key with multiple resource 1910 servers is NOT RECOMMENDED since the benefit from using the proof-of- 1911 possession concept is then significantly reduced. 1913 If clients are capable of doing so, they should frequently request 1914 fresh access tokens, as this allows the AS to keep the lifetime of 1915 the tokens short. This allows the AS to use shorter proof-of- 1916 possession key sizes, which translate to a performance benefit for 1917 the client and for the resource server. Shorter keys also lead to 1918 shorter messages (particularly with asymmetric keying material). 1920 When authorization servers bind symmetric keys to access tokens, they 1921 SHOULD scope these access tokens to a specific permission. 1923 In certain situations it may be necessary to revoke an access token 1924 that is still valid. Client-initiated revocation is specified in 1925 [RFC7009] for OAuth 2.0. Other revocation mechanisms are currently 1926 not specified, as the underlying assumption in OAuth is that access 1927 tokens are issued with a relatively short lifetime. This may not 1928 hold true for disconnected constrained devices, needing access tokens 1929 with relatively long lifetimes, and would therefore necessitate 1930 further standardization work that is out of scope for this document. 1932 6.2. Communication Security 1934 The authorization server MUST offer confidentiality protection for 1935 any interactions with the client. This step is extremely important 1936 since the client may obtain the proof-of-possession key from the 1937 authorization server for use with a specific access token. Not using 1938 confidentiality protection exposes this secret (and the access token) 1939 to an eavesdropper thereby completely negating proof-of-possession 1940 security. Profiles MUST specify how communication security according 1941 to the requirements in Section 5 is provided. 1943 Additional protection for the access token can be applied by 1944 encrypting it, for example encryption of CWTs is specified in 1945 Section 5.1 of [RFC8392]. Such additional protection can be 1946 necessary if the token is later transferred over an insecure 1947 connection (e.g. when it is sent to the authz-info endpoint). 1949 Developers MUST ensure that the ephemeral credentials (i.e., the 1950 private key or the session key) are not leaked to third parties. An 1951 adversary in possession of the ephemeral credentials bound to the 1952 access token will be able to impersonate the client. Be aware that 1953 this is a real risk with many constrained environments, since 1954 adversaries can often easily get physical access to the devices. 1955 This risk can also be mitigated to some extent by making sure that 1956 keys are refreshed more frequently. 1958 6.3. Long-Term Credentials 1960 Both clients and RSs have long-term credentials that are used to 1961 secure communications, and authenticate to the AS. These credentials 1962 need to be protected against unauthorized access. In constrained 1963 devices, deployed in publicly accessible places, such protection can 1964 be difficult to achieve without specialized hardware (e.g. secure key 1965 storage memory). 1967 If credentials are lost or compromised, the operator of the affected 1968 devices needs to have procedures to invalidate any access these 1969 credentials give and to revoke tokens linked to such credentials. 1970 The loss of a credential linked to a specific device MUST NOT lead to 1971 a compromise of other credentials not linked to that device, 1972 therefore sharing secret keys between more than two parties is NOT 1973 RECOMMENDED. 1975 Operators of clients or RS should have procedures in place to replace 1976 credentials that are suspected to have been compromised or that have 1977 been lost. 1979 Operators also need to have procedures for decommissioning devices, 1980 that include securely erasing credentials and other security critical 1981 material in the devices being decommissioned. 1983 6.4. Unprotected AS Request Creation Hints 1985 Initially, no secure channel exists to protect the communication 1986 between C and RS. Thus, C cannot determine if the AS Request 1987 Creation Hints contained in an unprotected response from RS to an 1988 unauthorized request (see Section 5.1.2) are authentic. It is 1989 therefore advisable to provide C with a (possibly hard-coded) list of 1990 trustworthy authorization servers. AS Request Creation Hints 1991 referring to a URI not listed there would be ignored. 1993 A compromised RS may use the hints to trick a client into contacting 1994 an AS that is not supposed to be in charge of that RS. Since this AS 1995 must be in the hard-coded list of trusted AS no violation of 1996 privileges and or exposure of redentials should happen. However a 1997 compromised RS may use this to perform a denial of service against a 1998 specific AS, by redirecting a large number of client requests to that 1999 AS. 2001 A compromised client can be made to contact any AS, including 2002 compromised ones. This should not affect the RS, since it is 2003 supposed to keep track of which AS are trusted and have corresponding 2004 credentials to verify the source of access tokens it receives. 2006 6.5. Minimal security requirements for communication 2008 This section summarizes the minimal requirements for the 2009 communication security of the different protocol interactions. 2011 C-AS All communication between the client and the Authorization 2012 Server MUST be encrypted, integrity and replay protected. 2013 Furthermore responses from the AS to the client MUST be bound to 2014 the client's request to avoid attacks where the attacker swaps the 2015 intended response for an older one valid for a previous request. 2016 This requires that the client and the Authorization Server have 2017 previously exchanged either a shared secret or their public keys 2018 in order to negotiate a secure communication. Furthermore the 2019 client MUST be able to determine whether an AS has the authority 2020 to issue access tokens for a certain RS. This can for example be 2021 done through pre-configured lists, or through an online lookup 2022 mechanism that in turn also must be secured. 2024 RS-AS The communication between the Resource Server and the 2025 Authorization Server via the introspection endpoint MUST be 2026 encrypted, integrity and replay protected. Furthermore responses 2027 from the AS to the RS MUST be bound to the RS's request. This 2028 requires that the RS and the Authorization Server have previously 2029 exchanged either a shared secret, or their public keys in order to 2030 negotiate a secure communication. Furthermore the RS MUST be able 2031 to determine whether an AS has the authority to issue access 2032 tokens itself. This is usually configured out of band, but could 2033 also be performed through an online lookup mechanism provided that 2034 it is also secured in the same way. 2036 C-RS The initial communication between the client and the Resource 2037 Server can not be secured in general, since the RS is not in 2038 possession of on access token for that client, which would carry 2039 the necessary parameters. Certain security mechanisms (e.g. DTLS 2040 with server-side authentication via a certificate or a raw public 2041 key) can be possible and are RECOMMEND if supported by both 2042 parties. After the client has successfully transmitted the access 2043 token to the RS, a secure communication protocol MUST be 2044 established between client and RS for the actual resource request. 2045 This protocol MUST provide confidentiality, integrity and replay 2046 protection as well as a binding between requests and responses. 2047 This requires that the client learned either the RS's public key 2048 or received a symmetric proof-of-possession key bound to the 2049 access token from the AS. The RS must have learned either the 2050 client's public key or a shared symmetric key from the claims in 2051 the token or an introspection request. Since ACE does not provide 2052 profile negotiation between C and RS, the client MUST have learned 2053 what profile the RS supports (e.g. from the AS or pre-configured) 2054 and initiate the communication accordingly. 2056 6.6. Token Freshness and Expiration 2058 An RS that is offline faces the problem of clock drift. Since it 2059 cannot synchronize its clock with the AS, it may be tricked into 2060 accepting old access tokens that are no longer valid or have been 2061 compromised. In order to prevent this, an RS may use the nonce-based 2062 mechanism defined in Section 5.1.2 to ensure freshness of an Access 2063 Token subsequently presented to this RS. 2065 Another problem with clock drift is that evaluating the standard 2066 token expiration claim "exp" can give unpredictable results. 2068 The expiration mechanism implemented by the "exi" claim, based on the 2069 first time the RS sees the token was defined to provide a more 2070 predictable alternative. The "exi" approach has some drawbacks that 2071 need to be considered: First a malicious client may hold back tokens 2072 with the "exi" claim in order to prolong their lifespan, and second 2073 if an RS loses state (e.g. due to an unscheduled reboot), it looses 2074 the current values of counters tracking the "exi" claims of tokens it 2075 is storing. The first drawback is inherent to the deployment 2076 scenario and the "exi" solution. It can therefore not be mitigated 2077 without requiring the the RS be online at times. The second drawback 2078 can be mitigated by regularly storing the value of "exi" Counters to 2079 persistent memory. 2081 6.7. Combining profiles 2083 There may be use cases were different profiles of this framework are 2084 combined. For example, an MQTT-TLS profile is used between the 2085 client and the RS in combination with a CoAP-DTLS profile for 2086 interactions between the client and the AS. The security of a 2087 profile MUST NOT depend on the assumption that the profile is used 2088 for all the different types of interactions in this framework. 2090 6.8. Unprotected Information 2092 Communication with the authz-info endpoint, as well as the various 2093 error responses defined in this framework, all potentially include 2094 sending information over an unprotected channel. These messages may 2095 leak information to an adversary. For example error responses for 2096 requests to the Authorization Information endpoint can reveal 2097 information about an otherwise opaque access token to an adversary 2098 who has intercepted this token. 2100 As far as error messages are concerned, this framework is written 2101 under the assumption that, in general, the benefits of detailed error 2102 messages outweigh the risk due to information leakage. For 2103 particular use cases, where this assessment does not apply, detailed 2104 error messages can be replaced by more generic ones. 2106 In some scenarios it may be possible to protect the communication 2107 with the authz-info endpoint (e.g. through DTLS with only server-side 2108 authentication). In cases where this is not possible this framework 2109 RECOMMENDS to use encrypted CWTs or tokens that are opaque references 2110 and need to be subjected to introspection by the RS. 2112 If the initial unauthorized resource request message (see 2113 Section 5.1.1) is used, the client MUST make sure that it is not 2114 sending sensitive content in this request. While GET and DELETE 2115 requests only reveal the target URI of the resource, POST and PUT 2116 requests would reveal the whole payload of the intended operation. 2118 6.9. Identifying audiences 2120 The audience claim as defined in [RFC7519] and the equivalent 2121 "audience" parameter from [I-D.ietf-oauth-token-exchange] are 2122 intentionally vague on how to match the audience value to a specific 2123 RS. This is intended to allow application specific semantics to be 2124 used. This section attempts to give some general guidance for the 2125 use of audiences in constrained environments. 2127 URLs are not a good way of identifying mobile devices that can switch 2128 networks and thus be associated with new URLs. If the audience 2129 represents a single RS, and asymmetric keys are used, the RS can be 2130 uniquely identified by a hash of its public key. If this approach is 2131 used this framework RECOMMENDS to apply the procedure from section 3 2132 of [RFC6920]. 2134 If the audience addresses a group of resource servers, the mapping of 2135 group identifier to individual RS has to be provisioned to each RS 2136 before the group-audience is usable. Managing dynamic groups could 2137 be an issue, if any RS is not always reachable when the groups' 2138 memberships change. Furthermore, issuing access tokens bound to 2139 symmetric proof-of-possession keys that apply to a group-audience is 2140 problematic, as an RS that is in possession of the access token can 2141 impersonate the client towards the other RSs that are part of the 2142 group. It is therefore NOT RECOMMENDED to issue access tokens bound 2143 to a group audience and symmetric proof-of possession keys. 2145 Even the client must be able to determine the correct values to put 2146 into the "audience" parameter, in order to obtain a token for the 2147 intended RS. Errors in this process can lead to the client 2148 inadvertently obtaining a token for the wrong RS. The correct values 2149 for "audience" can either be provisioned to the client as part of its 2150 configuration, or dynamically looked up by the client in some 2151 directory. In the latter case the integrity and correctness of the 2152 directory data must be assured. Note that the "audience" hint 2153 provided by the RS as part of the "AS Request Creation Hints" 2154 Section 5.1.2 is not typically source authenticated and integrity 2155 protected, and should therefore not be treated a trusted value. 2157 6.10. Denial of service against or with Introspection 2159 The optional introspection mechanism provided by OAuth and supported 2160 in the ACE framework allows for two types of attacks that need to be 2161 considered by implementers. 2163 First, an attacker could perform a denial of service attack against 2164 the introspection endpoint at the AS in order to prevent validation 2165 of access tokens. To maintain the security of the system, an RS that 2166 is configured to use introspection MUST NOT allow access based on a 2167 token for which it couldn't reach the introspection endpoint. 2169 Second, an attacker could use the fact that an RS performs 2170 introspection to perform a denial of service attack against that RS 2171 by repeatedly sending tokens to its authz-info endpoint that require 2172 an introspection call. RS can mitigate such attacks by implementing 2173 rate limits on how many introspection requests they perform in a 2174 given time interval for a certain client IP address submitting tokens 2175 to /authz-info. When that limit has been reached, incoming requests 2176 from that address are rejected for a certain amount of time. A 2177 general rate limit on the introspection requests should also be 2178 considered, to mitigate distributed attacks. 2180 7. Privacy Considerations 2182 Implementers and users should be aware of the privacy implications of 2183 the different possible deployments of this framework. 2185 The AS is in a very central position and can potentially learn 2186 sensitive information about the clients requesting access tokens. If 2187 the client credentials grant is used, the AS can track what kind of 2188 access the client intends to perform. With other grants this can be 2189 prevented by the Resource Owner. To do so, the resource owner needs 2190 to bind the grants it issues to anonymous, ephemeral credentials that 2191 do not allow the AS to link different grants and thus different 2192 access token requests by the same client. 2194 The claims contained in a token can reveal privacy sensitive 2195 information about the client and the RS to any party having access to 2196 them (whether by processing the content of a self-contained token or 2197 by introspection). The AS SHOULD be configured to minimize the 2198 information about clients and RSs disclosed in the tokens it issues. 2200 If tokens are only integrity protected and not encrypted, they may 2201 reveal information to attackers listening on the wire, or able to 2202 acquire the access tokens in some other way. In the case of CWTs the 2203 token may, e.g., reveal the audience, the scope and the confirmation 2204 method used by the client. The latter may reveal the identity of the 2205 device or application running the client. This may be linkable to 2206 the identity of the person using the client (if there is a person and 2207 not a machine-to-machine interaction). 2209 Clients using asymmetric keys for proof-of-possession should be aware 2210 of the consequences of using the same key pair for proof-of- 2211 possession towards different RSs. A set of colluding RSs or an 2212 attacker able to obtain the access tokens will be able to link the 2213 requests, or even to determine the client's identity. 2215 An unprotected response to an unauthorized request (see 2216 Section 5.1.2) may disclose information about RS and/or its existing 2217 relationship with C. It is advisable to include as little 2218 information as possible in an unencrypted response. If means of 2219 encrypting communication between C and RS already exist, more 2220 detailed information may be included with an error response to 2221 provide C with sufficient information to react on that particular 2222 error. 2224 8. IANA Considerations 2226 This document creates several registries with a registration policy 2227 of "Expert Review"; guidelines to the experts are given in 2228 Section 8.16. 2230 8.1. ACE Authorization Server Request Creation Hints 2232 This specification establishes the IANA "ACE Authorization Server 2233 Request Creation Hints" registry. The registry has been created to 2234 use the "Expert Review" registration procedure [RFC8126]. It should 2235 be noted that, in addition to the expert review, some portions of the 2236 registry require a specification, potentially a Standards Track RFC, 2237 be supplied as well. 2239 The columns of the registry are: 2241 Name The name of the parameter 2243 CBOR Key CBOR map key for the parameter. Different ranges of values 2244 use different registration policies [RFC8126]. Integer values 2245 from -256 to 255 are designated as Standards Action. Integer 2246 values from -65536 to -257 and from 256 to 65535 are designated as 2247 Specification Required. Integer values greater than 65535 are 2248 designated as Expert Review. Integer values less than -65536 are 2249 marked as Private Use. 2251 Value Type The CBOR data types allowable for the values of this 2252 parameter. 2254 Reference This contains a pointer to the public specification of the 2255 request creation hint abbreviation, if one exists. 2257 This registry will be initially populated by the values in Figure 2. 2258 The Reference column for all of these entries will be this document. 2260 8.2. OAuth Extensions Error Registration 2262 This specification registers the following error values in the OAuth 2263 Extensions Error registry [IANA.OAuthExtensionsErrorRegistry]. 2265 o Error name: "unsupported_pop_key" 2266 o Error usage location: token error response 2267 o Related protocol extension: The ACE framework [this document] 2268 o Change Controller: IESG 2269 o Specification document(s): Section 5.6.3 of [this document] 2271 o Error name: "incompatible_profiles" 2272 o Error usage location: token error response 2273 o Related protocol extension: The ACE framework [this document] 2274 o Change Controller: IESG 2275 o Specification document(s): Section 5.6.3 of [this document] 2277 8.3. OAuth Error Code CBOR Mappings Registry 2279 This specification establishes the IANA "OAuth Error Code CBOR 2280 Mappings" registry. The registry has been created to use the "Expert 2281 Review" registration procedure [RFC8126], except for the value range 2282 designated for private use. 2284 The columns of the registry are: 2286 Name The OAuth Error Code name, refers to the name in Section 5.2. 2287 of [RFC6749], e.g., "invalid_request". 2288 CBOR Value CBOR abbreviation for this error code. Integer values 2289 less than -65536 are marked as "Private Use", all other values use 2290 the registration policy "Expert Review" [RFC8126]. 2291 Reference This contains a pointer to the public specification of the 2292 error code abbreviation, if one exists. 2294 This registry will be initially populated by the values in Figure 10. 2295 The Reference column for all of these entries will be this document. 2297 8.4. OAuth Grant Type CBOR Mappings 2299 This specification establishes the IANA "OAuth Grant Type CBOR 2300 Mappings" registry. The registry has been created to use the "Expert 2301 Review" registration procedure [RFC8126], except for the value range 2302 designated for private use. 2304 The columns of this registry are: 2306 Name The name of the grant type as specified in Section 1.3 of 2307 [RFC6749]. 2308 CBOR Value CBOR abbreviation for this grant type. Integer values 2309 less than -65536 are marked as "Private Use", all other values use 2310 the registration policy "Expert Review" [RFC8126]. 2311 Reference This contains a pointer to the public specification of the 2312 grant type abbreviation, if one exists. 2313 Original Specification This contains a pointer to the public 2314 specification of the grant type, if one exists. 2316 This registry will be initially populated by the values in Figure 11. 2317 The Reference column for all of these entries will be this document. 2319 8.5. OAuth Access Token Types 2321 This section registers the following new token type in the "OAuth 2322 Access Token Types" registry [IANA.OAuthAccessTokenTypes]. 2324 o Type name: "PoP" 2325 o Additional Token Endpoint Response Parameters: "cnf", "rs_cnf" see 2326 section 3.3 of [I-D.ietf-ace-oauth-params]. 2327 o HTTP Authentication Scheme(s): N/A 2328 o Change Controller: IETF 2329 o Specification document(s): [this document] 2331 8.6. OAuth Access Token Type CBOR Mappings 2333 This specification established the IANA "OAuth Access Token Type CBOR 2334 Mappings" registry. The registry has been created to use the "Expert 2335 Review" registration procedure [RFC8126], except for the value range 2336 designated for private use. 2338 The columns of this registry are: 2340 Name The name of token type as registered in the OAuth Access Token 2341 Types registry, e.g., "Bearer". 2342 CBOR Value CBOR abbreviation for this token type. Integer values 2343 less than -65536 are marked as "Private Use", all other values use 2344 the registration policy "Expert Review" [RFC8126]. 2346 Reference This contains a pointer to the public specification of the 2347 OAuth token type abbreviation, if one exists. 2348 Original Specification This contains a pointer to the public 2349 specification of the OAuth token type, if one exists. 2351 8.6.1. Initial Registry Contents 2353 o Name: "Bearer" 2354 o Value: 1 2355 o Reference: [this document] 2356 o Original Specification: [RFC6749] 2358 o Name: "PoP" 2359 o Value: 2 2360 o Reference: [this document] 2361 o Original Specification: [this document] 2363 8.7. ACE Profile Registry 2365 This specification establishes the IANA "ACE Profile" registry. The 2366 registry has been created to use the "Expert Review" registration 2367 procedure [RFC8126]. It should be noted that, in addition to the 2368 expert review, some portions of the registry require a specification, 2369 potentially a Standards Track RFC, be supplied as well. 2371 The columns of this registry are: 2373 Name The name of the profile, to be used as value of the profile 2374 attribute. 2375 Description Text giving an overview of the profile and the context 2376 it is developed for. 2377 CBOR Value CBOR abbreviation for this profile name. Different 2378 ranges of values use different registration policies [RFC8126]. 2379 Integer values from -256 to 255 are designated as Standards 2380 Action. Integer values from -65536 to -257 and from 256 to 65535 2381 are designated as Specification Required. Integer values greater 2382 than 65535 are designated as "Expert Review". Integer values less 2383 than -65536 are marked as Private Use. 2384 Reference This contains a pointer to the public specification of the 2385 profile abbreviation, if one exists. 2387 This registry will be initially empty and will be populated by the 2388 registrations from the ACE framework profiles. 2390 8.8. OAuth Parameter Registration 2392 This specification registers the following parameter in the "OAuth 2393 Parameters" registry [IANA.OAuthParameters]: 2395 o Name: "ace_profile" 2396 o Parameter Usage Location: token response 2397 o Change Controller: IESG 2398 o Reference: Section 5.6.4.3 of [this document] 2400 8.9. OAuth Parameters CBOR Mappings Registry 2402 This specification establishes the IANA "OAuth Parameters CBOR 2403 Mappings" registry. The registry has been created to use the "Expert 2404 Review" registration procedure [RFC8126], except for the value range 2405 designated for private use. 2407 The columns of this registry are: 2409 Name The OAuth Parameter name, refers to the name in the OAuth 2410 parameter registry, e.g., "client_id". 2411 CBOR Key CBOR map key for this parameter. Integer values less than 2412 -65536 are marked as "Private Use", all other values use the 2413 registration policy "Expert Review" [RFC8126]. 2414 Value Type The allowable CBOR data types for values of this 2415 parameter. 2416 Reference This contains a pointer to the public specification of the 2417 OAuth parameter abbreviation, if one exists. 2419 This registry will be initially populated by the values in Figure 12. 2420 The Reference column for all of these entries will be this document. 2422 8.10. OAuth Introspection Response Parameter Registration 2424 This specification registers the following parameter in the OAuth 2425 Token Introspection Response registry 2426 [IANA.TokenIntrospectionResponse]. 2428 o Name: "ace_profile" 2429 o Description: The communication and communication security profile 2430 used between client and RS, as defined in ACE profiles. 2431 o Change Controller: IESG 2432 o Reference: Section 5.7.2 of [this document] 2434 8.11. OAuth Token Introspection Response CBOR Mappings Registry 2436 This specification establishes the IANA "OAuth Token Introspection 2437 Response CBOR Mappings" registry. The registry has been created to 2438 use the "Expert Review" registration procedure [RFC8126], except for 2439 the value range designated for private use. 2441 The columns of this registry are: 2443 Name The OAuth Parameter name, refers to the name in the OAuth 2444 parameter registry, e.g., "client_id". 2445 CBOR Key CBOR map key for this parameter. Integer values less than 2446 -65536 are marked as "Private Use", all other values use the 2447 registration policy "Expert Review" [RFC8126]. 2448 Value Type The allowable CBOR data types for values of this 2449 parameter. 2450 Reference This contains a pointer to the public specification of the 2451 introspection response parameter abbreviation, if one exists. 2453 This registry will be initially populated by the values in Figure 16. 2454 The Reference column for all of these entries will be this document. 2456 Note that the mappings of parameters corresponding to claim names 2457 intentionally coincide with the CWT claim name mappings from 2458 [RFC8392]. 2460 8.12. JSON Web Token Claims 2462 This specification registers the following new claims in the JSON Web 2463 Token (JWT) registry of JSON Web Token Claims 2464 [IANA.JsonWebTokenClaims]: 2466 o Claim Name: "ace_profile" 2467 o Claim Description: The profile a token is supposed to be used 2468 with. 2469 o Change Controller: IESG 2470 o Reference: Section 5.8 of [this document] 2472 o Claim Name: "exi" 2473 o Claim Description: "Expires in". Lifetime of the token in seconds 2474 from the time the RS first sees it. Used to implement a weaker 2475 from of token expiration for devices that cannot synchronize their 2476 internal clocks. 2477 o Change Controller: IESG 2478 o Reference: Section 5.8.3 of [this document] 2480 o Claim Name: "cnonce" 2481 o Claim Description: "client-nonce". A nonce previously provided to 2482 the AS by the RS via the client. Used to verify token freshness 2483 when the RS cannot synchronize its clock with the AS. 2484 o Change Controller: IESG 2485 o Reference: Section 5.8 of [this document] 2487 8.13. CBOR Web Token Claims 2489 This specification registers the following new claims in the "CBOR 2490 Web Token (CWT) Claims" registry [IANA.CborWebTokenClaims]. 2492 o Claim Name: "scope" 2493 o Claim Description: The scope of an access token as defined in 2494 [RFC6749]. 2495 o JWT Claim Name: scope 2496 o Claim Key: TBD (suggested: 9) 2497 o Claim Value Type(s): byte string or text string 2498 o Change Controller: IESG 2499 o Specification Document(s): Section 4.2 of 2500 [I-D.ietf-oauth-token-exchange] 2502 o Claim Name: "ace_profile" 2503 o Claim Description: The profile a token is supposed to be used 2504 with. 2505 o JWT Claim Name: ace_profile 2506 o Claim Key: TBD (suggested: 38) 2507 o Claim Value Type(s): integer 2508 o Change Controller: IESG 2509 o Specification Document(s): Section 5.8 of [this document] 2511 o Claim Name: "exi" 2512 o Claim Description: The expiration time of a token measured from 2513 when it was received at the RS in seconds. 2514 o JWT Claim Name: exi 2515 o Claim Key: TBD (suggested: 40) 2516 o Claim Value Type(s): integer 2517 o Change Controller: IESG 2518 o Specification Document(s): Section 5.8.3 of [this document] 2520 o Claim Name: "cnonce" 2521 o Claim Description: The client-nonce sent to the AS by the RS via 2522 the client. 2523 o JWT Claim Name: cnonce 2524 o Claim Key: TBD (suggested: 39) 2525 o Claim Value Type(s): byte string 2526 o Change Controller: IESG 2527 o Specification Document(s): Section 5.8 of [this document] 2529 8.14. Media Type Registrations 2531 This specification registers the 'application/ace+cbor' media type 2532 for messages of the protocols defined in this document carrying 2533 parameters encoded in CBOR. This registration follows the procedures 2534 specified in [RFC6838]. 2536 Type name: application 2538 Subtype name: ace+cbor 2540 Required parameters: none 2542 Optional parameters: none 2544 Encoding considerations: Must be encoded as CBOR map containing the 2545 protocol parameters defined in [this document]. 2547 Security considerations: See Section 6 of this document. 2549 Interoperability considerations: n/a 2551 Published specification: [this document] 2553 Applications that use this media type: The type is used by 2554 authorization servers, clients and resource servers that support the 2555 ACE framework as specified in [this document]. 2557 Additional information: 2559 Magic number(s): n/a 2561 File extension(s): .ace 2563 Macintosh file type code(s): n/a 2565 Person & email address to contact for further information: 2566 2568 Intended usage: COMMON 2570 Restrictions on usage: None 2572 Author: Ludwig Seitz 2574 Change controller: IESG 2576 8.15. CoAP Content-Format Registry 2578 This specification registers the following entry to the "CoAP 2579 Content-Formats" registry: 2581 Media Type: application/ace+cbor 2583 Encoding 2585 ID: 19 2587 Reference: [this document] 2589 8.16. Expert Review Instructions 2591 All of the IANA registries established in this document are defined 2592 to use a registration policy of Expert Review. This section gives 2593 some general guidelines for what the experts should be looking for, 2594 but they are being designated as experts for a reason, so they should 2595 be given substantial latitude. 2597 Expert reviewers should take into consideration the following points: 2599 o Point squatting should be discouraged. Reviewers are encouraged 2600 to get sufficient information for registration requests to ensure 2601 that the usage is not going to duplicate one that is already 2602 registered, and that the point is likely to be used in 2603 deployments. The zones tagged as private use are intended for 2604 testing purposes and closed environments; code points in other 2605 ranges should not be assigned for testing. 2606 o Experts should take into account the expected usage of fields when 2607 approving point assignment. The fact that there is a range for 2608 standards track documents does not mean that a standards track 2609 document cannot have points assigned outside of that range. The 2610 length of the encoded value should be weighed against how many 2611 code points of that length are left, the size of device it will be 2612 used on. 2613 o Since a high degree of overlap is expected between these 2614 registries and the contents of the OAuth parameters 2615 [IANA.OAuthParameters] registries, experts should require new 2616 registrations to maintain alignment with parameters from OAuth 2617 that have comparable functionality. Deviation from this alignment 2618 should only be allowed if there are functional differences, that 2619 are motivated by the use case and that cannot be easily or 2620 efficiently addressed by comparable OAuth parameters. 2622 9. Acknowledgments 2624 This document is a product of the ACE working group of the IETF. 2626 Thanks to Eve Maler for her contributions to the use of OAuth 2.0 and 2627 UMA in IoT scenarios, Robert Taylor for his discussion input, and 2628 Malisa Vucinic for his input on the predecessors of this proposal. 2630 Thanks to the authors of draft-ietf-oauth-pop-key-distribution, from 2631 where large parts of the security considerations where copied. 2633 Thanks to Stefanie Gerdes, Olaf Bergmann, and Carsten Bormann for 2634 contributing their work on AS discovery from draft-gerdes-ace-dcaf- 2635 authorize (see Section 5.1). 2637 Thanks to Jim Schaad and Mike Jones for their comprehensive reviews. 2639 Thanks to Benjamin Kaduk for his input on various questions related 2640 to this work. 2642 Thanks to Cigdem Sengul for some very useful review comments. 2644 Ludwig Seitz and Goeran Selander worked on this document as part of 2645 the CelticPlus project CyberWI, with funding from Vinnova. Ludwig 2646 Seitz was also received further funding for this work by Vinnova in 2647 the context of the CelticNext project Critisec. 2649 10. References 2651 10.1. Normative References 2653 [I-D.ietf-ace-cwt-proof-of-possession] 2654 Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. 2655 Tschofenig, "Proof-of-Possession Key Semantics for CBOR 2656 Web Tokens (CWTs)", draft-ietf-ace-cwt-proof-of- 2657 possession-09 (work in progress), October 2019. 2659 [I-D.ietf-ace-oauth-params] 2660 Seitz, L., "Additional OAuth Parameters for Authorization 2661 in Constrained Environments (ACE)", draft-ietf-ace-oauth- 2662 params-05 (work in progress), March 2019. 2664 [I-D.ietf-oauth-token-exchange] 2665 Jones, M., Nadalin, A., Campbell, B., Bradley, J., and C. 2666 Mortimore, "OAuth 2.0 Token Exchange", draft-ietf-oauth- 2667 token-exchange-19 (work in progress), July 2019. 2669 [IANA.CborWebTokenClaims] 2670 IANA, "CBOR Web Token (CWT) Claims", 2671 . 2674 [IANA.JsonWebTokenClaims] 2675 IANA, "JSON Web Token Claims", 2676 . 2678 [IANA.OAuthAccessTokenTypes] 2679 IANA, "OAuth Access Token Types", 2680 . 2683 [IANA.OAuthExtensionsErrorRegistry] 2684 IANA, "OAuth Extensions Error Registry", 2685 . 2688 [IANA.OAuthParameters] 2689 IANA, "OAuth Parameters", 2690 . 2693 [IANA.TokenIntrospectionResponse] 2694 IANA, "OAuth Token Introspection Response", 2695 . 2698 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2699 Requirement Levels", BCP 14, RFC 2119, 2700 DOI 10.17487/RFC2119, March 1997, 2701 . 2703 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2704 Resource Identifier (URI): Generic Syntax", STD 66, 2705 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2706 . 2708 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 2709 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 2710 January 2012, . 2712 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 2713 RFC 6749, DOI 10.17487/RFC6749, October 2012, 2714 . 2716 [RFC6750] Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 2717 Framework: Bearer Token Usage", RFC 6750, 2718 DOI 10.17487/RFC6750, October 2012, 2719 . 2721 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 2722 Specifications and Registration Procedures", BCP 13, 2723 RFC 6838, DOI 10.17487/RFC6838, January 2013, 2724 . 2726 [RFC6920] Farrell, S., Kutscher, D., Dannewitz, C., Ohlman, B., 2727 Keranen, A., and P. Hallam-Baker, "Naming Things with 2728 Hashes", RFC 6920, DOI 10.17487/RFC6920, April 2013, 2729 . 2731 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 2732 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 2733 October 2013, . 2735 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2736 Application Protocol (CoAP)", RFC 7252, 2737 DOI 10.17487/RFC7252, June 2014, 2738 . 2740 [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 2741 (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, 2742 . 2744 [RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection", 2745 RFC 7662, DOI 10.17487/RFC7662, October 2015, 2746 . 2748 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2749 Writing an IANA Considerations Section in RFCs", BCP 26, 2750 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2751 . 2753 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 2754 RFC 8152, DOI 10.17487/RFC8152, July 2017, 2755 . 2757 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2758 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2759 May 2017, . 2761 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 2762 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 2763 May 2018, . 2765 10.2. Informative References 2767 [BLE] Bluetooth SIG, "Bluetooth Core Specification v5.1", 2768 Section 4.4, January 2019, 2769 . 2772 [I-D.erdtman-ace-rpcc] 2773 Seitz, L. and S. Erdtman, "Raw-Public-Key and Pre-Shared- 2774 Key as OAuth client credentials", draft-erdtman-ace- 2775 rpcc-02 (work in progress), October 2017. 2777 [I-D.ietf-quic-transport] 2778 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 2779 and Secure Transport", draft-ietf-quic-transport-23 (work 2780 in progress), September 2019. 2782 [I-D.ietf-tls-dtls13] 2783 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 2784 Datagram Transport Layer Security (DTLS) Protocol Version 2785 1.3", draft-ietf-tls-dtls13-33 (work in progress), October 2786 2019. 2788 [Margi10impact] 2789 Margi, C., de Oliveira, B., de Sousa, G., Simplicio Jr, 2790 M., Barreto, P., Carvalho, T., Naeslund, M., and R. Gold, 2791 "Impact of Operating Systems on Wireless Sensor Networks 2792 (Security) Applications and Testbeds", Proceedings of 2793 the 19th International Conference on Computer 2794 Communications and Networks (ICCCN), August 2010. 2796 [MQTT5.0] Banks, A., Briggs, E., Borgendale, K., and R. Gupta, "MQTT 2797 Version 5.0", OASIS Standard, March 2019, 2798 . 2801 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2802 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 2803 . 2805 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 2806 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 2807 . 2809 [RFC6819] Lodderstedt, T., Ed., McGloin, M., and P. Hunt, "OAuth 2.0 2810 Threat Model and Security Considerations", RFC 6819, 2811 DOI 10.17487/RFC6819, January 2013, 2812 . 2814 [RFC7009] Lodderstedt, T., Ed., Dronia, S., and M. Scurtescu, "OAuth 2815 2.0 Token Revocation", RFC 7009, DOI 10.17487/RFC7009, 2816 August 2013, . 2818 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2819 Constrained-Node Networks", RFC 7228, 2820 DOI 10.17487/RFC7228, May 2014, 2821 . 2823 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2824 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 2825 DOI 10.17487/RFC7231, June 2014, 2826 . 2828 [RFC7521] Campbell, B., Mortimore, C., Jones, M., and Y. Goland, 2829 "Assertion Framework for OAuth 2.0 Client Authentication 2830 and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521, 2831 May 2015, . 2833 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 2834 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 2835 DOI 10.17487/RFC7540, May 2015, 2836 . 2838 [RFC7591] Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and 2839 P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol", 2840 RFC 7591, DOI 10.17487/RFC7591, July 2015, 2841 . 2843 [RFC7641] Hartke, K., "Observing Resources in the Constrained 2844 Application Protocol (CoAP)", RFC 7641, 2845 DOI 10.17487/RFC7641, September 2015, 2846 . 2848 [RFC7744] Seitz, L., Ed., Gerdes, S., Ed., Selander, G., Mani, M., 2849 and S. Kumar, "Use Cases for Authentication and 2850 Authorization in Constrained Environments", RFC 7744, 2851 DOI 10.17487/RFC7744, January 2016, 2852 . 2854 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 2855 the Constrained Application Protocol (CoAP)", RFC 7959, 2856 DOI 10.17487/RFC7959, August 2016, 2857 . 2859 [RFC8252] Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps", 2860 BCP 212, RFC 8252, DOI 10.17487/RFC8252, October 2017, 2861 . 2863 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2864 Interchange Format", STD 90, RFC 8259, 2865 DOI 10.17487/RFC8259, December 2017, 2866 . 2868 [RFC8414] Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0 2869 Authorization Server Metadata", RFC 8414, 2870 DOI 10.17487/RFC8414, June 2018, 2871 . 2873 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 2874 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 2875 . 2877 [RFC8516] Keranen, A., ""Too Many Requests" Response Code for the 2878 Constrained Application Protocol", RFC 8516, 2879 DOI 10.17487/RFC8516, January 2019, 2880 . 2882 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 2883 "Object Security for Constrained RESTful Environments 2884 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 2885 . 2887 [RFC8628] Denniss, W., Bradley, J., Jones, M., and H. Tschofenig, 2888 "OAuth 2.0 Device Authorization Grant", RFC 8628, 2889 DOI 10.17487/RFC8628, August 2019, 2890 . 2892 Appendix A. Design Justification 2894 This section provides further insight into the design decisions of 2895 the solution documented in this document. Section 3 lists several 2896 building blocks and briefly summarizes their importance. The 2897 justification for offering some of those building blocks, as opposed 2898 to using OAuth 2.0 as is, is given below. 2900 Common IoT constraints are: 2902 Low Power Radio: 2904 Many IoT devices are equipped with a small battery which needs to 2905 last for a long time. For many constrained wireless devices, the 2906 highest energy cost is associated to transmitting or receiving 2907 messages (roughly by a factor of 10 compared to AES) 2908 [Margi10impact]. It is therefore important to keep the total 2909 communication overhead low, including minimizing the number and 2910 size of messages sent and received, which has an impact of choice 2911 on the message format and protocol. By using CoAP over UDP and 2912 CBOR encoded messages, some of these aspects are addressed. 2913 Security protocols contribute to the communication overhead and 2914 can, in some cases, be optimized. For example, authentication and 2915 key establishment may, in certain cases where security 2916 requirements allow, be replaced by provisioning of security 2917 context by a trusted third party, using transport or application 2918 layer security. 2920 Low CPU Speed: 2922 Some IoT devices are equipped with processors that are 2923 significantly slower than those found in most current devices on 2924 the Internet. This typically has implications on what timely 2925 cryptographic operations a device is capable of performing, which 2926 in turn impacts, e.g., protocol latency. Symmetric key 2927 cryptography may be used instead of the computationally more 2928 expensive public key cryptography where the security requirements 2929 so allow, but this may also require support for trusted-third- 2930 party-assisted secret key establishment using transport- or 2931 application-layer security. 2932 Small Amount of Memory: 2934 Microcontrollers embedded in IoT devices are often equipped with 2935 only a small amount of RAM and flash memory, which places 2936 limitations on what kind of processing can be performed and how 2937 much code can be put on those devices. To reduce code size, fewer 2938 and smaller protocol implementations can be put on the firmware of 2939 such a device. In this case, CoAP may be used instead of HTTP, 2940 symmetric-key cryptography instead of public-key cryptography, and 2941 CBOR instead of JSON. An authentication and key establishment 2942 protocol, e.g., the DTLS handshake, in comparison with assisted 2943 key establishment, also has an impact on memory and code 2944 footprints. 2946 User Interface Limitations: 2948 Protecting access to resources is both an important security as 2949 well as privacy feature. End users and enterprise customers may 2950 not want to give access to the data collected by their IoT device 2951 or to functions it may offer to third parties. Since the 2952 classical approach of requesting permissions from end users via a 2953 rich user interface does not work in many IoT deployment 2954 scenarios, these functions need to be delegated to user-controlled 2955 devices that are better suitable for such tasks, such as smart 2956 phones and tablets. 2958 Communication Constraints: 2960 In certain constrained settings an IoT device may not be able to 2961 communicate with a given device at all times. Devices may be 2962 sleeping, or just disconnected from the Internet because of 2963 general lack of connectivity in the area, for cost reasons, or for 2964 security reasons, e.g., to avoid an entry point for Denial-of- 2965 Service attacks. 2967 The communication interactions this framework builds upon (as 2968 shown graphically in Figure 1) may be accomplished using a variety 2969 of different protocols, and not all parts of the message flow are 2970 used in all applications due to the communication constraints. 2971 Deployments making use of CoAP are expected, but this framework is 2972 not limited to them. Other protocols such as HTTP, or even 2973 protocols such as Bluetooth Smart communication that do not 2974 necessarily use IP, could also be used. The latter raises the 2975 need for application layer security over the various interfaces. 2977 In the light of these constraints we have made the following design 2978 decisions: 2980 CBOR, COSE, CWT: 2982 This framework RECOMMENDS the use of CBOR [RFC7049] as data 2983 format. Where CBOR data needs to be protected, the use of COSE 2984 [RFC8152] is RECOMMENDED. Furthermore, where self-contained 2985 tokens are needed, this framework RECOMMENDS the use of CWT 2986 [RFC8392]. These measures aim at reducing the size of messages 2987 sent over the wire, the RAM size of data objects that need to be 2988 kept in memory and the size of libraries that devices need to 2989 support. 2991 CoAP: 2993 This framework RECOMMENDS the use of CoAP [RFC7252] instead of 2994 HTTP. This does not preclude the use of other protocols 2995 specifically aimed at constrained devices, like, e.g., Bluetooth 2996 Low Energy (see Section 3.2). This aims again at reducing the 2997 size of messages sent over the wire, the RAM size of data objects 2998 that need to be kept in memory and the size of libraries that 2999 devices need to support. 3001 Access Information: 3003 This framework defines the name "Access Information" for data 3004 concerning the RS that the AS returns to the client in an access 3005 token response (see Section 5.6.2). This aims at enabling 3006 scenarios where a powerful client, supporting multiple profiles, 3007 needs to interact with a RS for which it does not know the 3008 supported profiles and the raw public key. 3010 Proof-of-Possession: 3012 This framework makes use of proof-of-possession tokens, using the 3013 "cnf" claim [I-D.ietf-ace-cwt-proof-of-possession]. A request 3014 parameter "cnf" and a Response parameter "cnf", both having a 3015 value space semantically and syntactically identical to the "cnf" 3016 claim, are defined for the token endpoint, to allow requesting and 3017 stating confirmation keys. This aims at making token theft 3018 harder. Token theft is specifically relevant in constrained use 3019 cases, as communication often passes through middle-boxes, which 3020 could be able to steal bearer tokens and use them to gain 3021 unauthorized access. 3023 Authz-Info endpoint: 3025 This framework introduces a new way of providing access tokens to 3026 a RS by exposing a authz-info endpoint, to which access tokens can 3027 be POSTed. This aims at reducing the size of the request message 3028 and the code complexity at the RS. The size of the request 3029 message is problematic, since many constrained protocols have 3030 severe message size limitations at the physical layer (e.g., in 3031 the order of 100 bytes). This means that larger packets get 3032 fragmented, which in turn combines badly with the high rate of 3033 packet loss, and the need to retransmit the whole message if one 3034 packet gets lost. Thus separating sending of the request and 3035 sending of the access tokens helps to reduce fragmentation. 3037 Client Credentials Grant: 3039 This framework RECOMMENDS the use of the client credentials grant 3040 for machine-to-machine communication use cases, where manual 3041 intervention of the resource owner to produce a grant token is not 3042 feasible. The intention is that the resource owner would instead 3043 pre-arrange authorization with the AS, based on the client's own 3044 credentials. The client can then (without manual intervention) 3045 obtain access tokens from the AS. 3047 Introspection: 3049 This framework RECOMMENDS the use of access token introspection in 3050 cases where the client is constrained in a way that it can not 3051 easily obtain new access tokens (i.e. it has connectivity issues 3052 that prevent it from communicating with the AS). In that case 3053 this framework RECOMMENDS the use of a long-term token, that could 3054 be a simple reference. The RS is assumed to be able to 3055 communicate with the AS, and can therefore perform introspection, 3056 in order to learn the claims associated with the token reference. 3057 The advantage of such an approach is that the resource owner can 3058 change the claims associated to the token reference without having 3059 to be in contact with the client, thus granting or revoking access 3060 rights. 3062 Appendix B. Roles and Responsibilities 3064 Resource Owner 3066 * Make sure that the RS is registered at the AS. This includes 3067 making known to the AS which profiles, token_type, scopes, and 3068 key types (symmetric/asymmetric) the RS supports. Also making 3069 it known to the AS which audience(s) the RS identifies itself 3070 with. 3071 * Make sure that clients can discover the AS that is in charge of 3072 the RS. 3073 * If the client-credentials grant is used, make sure that the AS 3074 has the necessary, up-to-date, access control policies for the 3075 RS. 3077 Requesting Party 3079 * Make sure that the client is provisioned the necessary 3080 credentials to authenticate to the AS. 3081 * Make sure that the client is configured to follow the security 3082 requirements of the Requesting Party when issuing requests 3083 (e.g., minimum communication security requirements, trust 3084 anchors). 3085 * Register the client at the AS. This includes making known to 3086 the AS which profiles, token_types, and key types (symmetric/ 3087 asymmetric) the client. 3089 Authorization Server 3091 * Register the RS and manage corresponding security contexts. 3092 * Register clients and authentication credentials. 3093 * Allow Resource Owners to configure and update access control 3094 policies related to their registered RSs. 3095 * Expose the token endpoint to allow clients to request tokens. 3096 * Authenticate clients that wish to request a token. 3097 * Process a token request using the authorization policies 3098 configured for the RS. 3099 * Optionally: Expose the introspection endpoint that allows RS's 3100 to submit token introspection requests. 3102 * If providing an introspection endpoint: Authenticate RSs that 3103 wish to get an introspection response. 3104 * If providing an introspection endpoint: Process token 3105 introspection requests. 3106 * Optionally: Handle token revocation. 3107 * Optionally: Provide discovery metadata. See [RFC8414] 3108 * Optionally: Handle refresh tokens. 3110 Client 3112 * Discover the AS in charge of the RS that is to be targeted with 3113 a request. 3114 * Submit the token request (see step (A) of Figure 1). 3116 + Authenticate to the AS. 3117 + Optionally (if not pre-configured): Specify which RS, which 3118 resource(s), and which action(s) the request(s) will target. 3119 + If raw public keys (rpk) or certificates are used, make sure 3120 the AS has the right rpk or certificate for this client. 3121 * Process the access token and Access Information (see step (B) 3122 of Figure 1). 3124 + Check that the Access Information provides the necessary 3125 security parameters (e.g., PoP key, information on 3126 communication security protocols supported by the RS). 3127 + Safely store the proof-of-possession key. 3128 + If provided by the AS: Safely store the refresh token. 3129 * Send the token and request to the RS (see step (C) of 3130 Figure 1). 3132 + Authenticate towards the RS (this could coincide with the 3133 proof of possession process). 3134 + Transmit the token as specified by the AS (default is to the 3135 authz-info endpoint, alternative options are specified by 3136 profiles). 3137 + Perform the proof-of-possession procedure as specified by 3138 the profile in use (this may already have been taken care of 3139 through the authentication procedure). 3140 * Process the RS response (see step (F) of Figure 1) of the RS. 3142 Resource Server 3144 * Expose a way to submit access tokens. By default this is the 3145 authz-info endpoint. 3146 * Process an access token. 3148 + Verify the token is from a recognized AS. 3149 + Check the token's integrity. 3151 + Verify that the token applies to this RS. 3152 + Check that the token has not expired (if the token provides 3153 expiration information). 3154 + Store the token so that it can be retrieved in the context 3155 of a matching request. 3157 Note: The order proposed here is not normative, any process 3158 that arrives at an equivalent result can be used. A noteworthy 3159 consideration is whether one can use cheap operations early on 3160 to quickly discard non-applicable or invalid tokens, before 3161 performing expensive cryptographic operations (e.g. doing an 3162 expiration check before verifying a signature). 3164 * Process a request. 3166 + Set up communication security with the client. 3167 + Authenticate the client. 3168 + Match the client against existing tokens. 3169 + Check that tokens belonging to the client actually authorize 3170 the requested action. 3171 + Optionally: Check that the matching tokens are still valid, 3172 using introspection (if this is possible.) 3173 * Send a response following the agreed upon communication 3174 security mechanism(s). 3175 * Safely store credentials such as raw public keys for 3176 authentication or proof-of-possession keys linked to access 3177 tokens. 3179 Appendix C. Requirements on Profiles 3181 This section lists the requirements on profiles of this framework, 3182 for the convenience of profile designers. 3184 o Optionally define new methods for the client to discover the 3185 necessary permissions and AS for accessing a resource, different 3186 from the one proposed in Section 5.1. Section 4 3187 o Optionally specify new grant types. Section 5.2 3188 o Optionally define the use of client certificates as client 3189 credential type. Section 5.3 3190 o Specify the communication protocol the client and RS the must use 3191 (e.g., CoAP). Section 5 and Section 5.6.4.3 3192 o Specify the security protocol the client and RS must use to 3193 protect their communication (e.g., OSCORE or DTLS). This must 3194 provide encryption, integrity and replay protection. 3195 Section 5.6.4.3 3196 o Specify how the client and the RS mutually authenticate. 3197 Section 4 3199 o Specify the proof-of-possession protocol(s) and how to select one, 3200 if several are available. Also specify which key types (e.g., 3201 symmetric/asymmetric) are supported by a specific proof-of- 3202 possession protocol. Section 5.6.4.2 3203 o Specify a unique ace_profile identifier. Section 5.6.4.3 3204 o If introspection is supported: Specify the communication and 3205 security protocol for introspection. Section 5.7 3206 o Specify the communication and security protocol for interactions 3207 between client and AS. This must provide encryption, integrity 3208 protection, replay protection and a binding between requests and 3209 responses. Section 5 and Section 5.6 3210 o Specify how/if the authz-info endpoint is protected, including how 3211 error responses are protected. Section 5.8.1 3212 o Optionally define other methods of token transport than the authz- 3213 info endpoint. Section 5.8.1 3215 Appendix D. Assumptions on AS knowledge about C and RS 3217 This section lists the assumptions on what an AS should know about a 3218 client and a RS in order to be able to respond to requests to the 3219 token and introspection endpoints. How this information is 3220 established is out of scope for this document. 3222 o The identifier of the client or RS. 3223 o The profiles that the client or RS supports. 3224 o The scopes that the RS supports. 3225 o The audiences that the RS identifies with. 3226 o The key types (e.g., pre-shared symmetric key, raw public key, key 3227 length, other key parameters) that the client or RS supports. 3228 o The types of access tokens the RS supports (e.g., CWT). 3229 o If the RS supports CWTs, the COSE parameters for the crypto 3230 wrapper (e.g., algorithm, key-wrap algorithm, key-length) that the 3231 RS supports. 3232 o The expiration time for access tokens issued to this RS (unless 3233 the RS accepts a default time chosen by the AS). 3234 o The symmetric key shared between client and AS (if any). 3235 o The symmetric key shared between RS and AS (if any). 3236 o The raw public key of the client or RS (if any). 3237 o Whether the RS has synchronized time (and thus is able to use the 3238 'exp' claim) or not. 3240 Appendix E. Deployment Examples 3242 There is a large variety of IoT deployments, as is indicated in 3243 Appendix A, and this section highlights a few common variants. This 3244 section is not normative but illustrates how the framework can be 3245 applied. 3247 For each of the deployment variants, there are a number of possible 3248 security setups between clients, resource servers and authorization 3249 servers. The main focus in the following subsections is on how 3250 authorization of a client request for a resource hosted by a RS is 3251 performed. This requires the security of the requests and responses 3252 between the clients and the RS to be considered. 3254 Note: CBOR diagnostic notation is used for examples of requests and 3255 responses. 3257 E.1. Local Token Validation 3259 In this scenario, the case where the resource server is offline is 3260 considered, i.e., it is not connected to the AS at the time of the 3261 access request. This access procedure involves steps A, B, C, and F 3262 of Figure 1. 3264 Since the resource server must be able to verify the access token 3265 locally, self-contained access tokens must be used. 3267 This example shows the interactions between a client, the 3268 authorization server and a temperature sensor acting as a resource 3269 server. Message exchanges A and B are shown in Figure 17. 3271 A: The client first generates a public-private key pair used for 3272 communication security with the RS. 3273 The client sends a CoAP POST request to the token endpoint at the 3274 AS. The security of this request can be transport or application 3275 layer. It is up the the communication security profile to define. 3276 In the example it is assumed that both client and AS have 3277 performed mutual authentication e.g. via DTLS. The request 3278 contains the public key of the client and the Audience parameter 3279 set to "tempSensorInLivingRoom", a value that the temperature 3280 sensor identifies itself with. The AS evaluates the request and 3281 authorizes the client to access the resource. 3282 B: The AS responds with a 2.05 Content response containing the 3283 Access Information, including the access token. The PoP access 3284 token contains the public key of the client, and the Access 3285 Information contains the public key of the RS. For communication 3286 security this example uses DTLS RawPublicKey between the client 3287 and the RS. The issued token will have a short validity time, 3288 i.e., "exp" close to "iat", in order to mitigate attacks using 3289 stolen client credentials. The token includes the claim such as 3290 "scope" with the authorized access that an owner of the 3291 temperature device can enjoy. In this example, the "scope" claim, 3292 issued by the AS, informs the RS that the owner of the token, that 3293 can prove the possession of a key is authorized to make a GET 3294 request against the /temperature resource and a POST request on 3295 the /firmware resource. Note that the syntax and semantics of the 3296 scope claim are application specific. 3297 Note: In this example it is assumed that the client knows what 3298 resource it wants to access, and is therefore able to request 3299 specific audience and scope claims for the access token. 3301 Authorization 3302 Client Server 3303 | | 3304 |<=======>| DTLS Connection Establishment 3305 | | and mutual authentication 3306 | | 3307 A: +-------->| Header: POST (Code=0.02) 3308 | POST | Uri-Path:"token" 3309 | | Content-Format: application/ace+cbor 3310 | | Payload: 3311 | | 3312 B: |<--------+ Header: 2.05 Content 3313 | 2.05 | Content-Format: application/ace+cbor 3314 | | Payload: 3315 | | 3317 Figure 17: Token Request and Response Using Client Credentials. 3319 The information contained in the Request-Payload and the Response- 3320 Payload is shown in Figure 18 Note that the parameter "rs_cnf" from 3321 [I-D.ietf-ace-oauth-params] is used to inform the client about the 3322 resource server's public key. 3324 Request-Payload : 3325 { 3326 "audience" : "tempSensorInLivingRoom", 3327 "client_id" : "myclient", 3328 "req_cnf" : { 3329 "COSE_Key" : { 3330 "kid" : b64'1Bg8vub9tLe1gHMzV76e8', 3331 "kty" : "EC", 3332 "crv" : "P-256", 3333 "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', 3334 "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' 3335 } 3336 } 3337 } 3339 Response-Payload : 3340 { 3341 "access_token" : b64'0INDoQEKoQVNKkXfb7xaWqMTf6 ...', 3342 "rs_cnf" : { 3343 "COSE_Key" : { 3344 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', 3345 "kty" : "EC", 3346 "crv" : "P-256", 3347 "x" : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4', 3348 "y" : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM' 3349 } 3350 } 3351 } 3353 Figure 18: Request and Response Payload Details. 3355 The content of the access token is shown in Figure 19. 3357 { 3358 "aud" : "tempSensorInLivingRoom", 3359 "iat" : "1563451500", 3360 "exp" : "1563453000", 3361 "scope" : "temperature_g firmware_p", 3362 "cnf" : { 3363 "COSE_Key" : { 3364 "kid" : b64'1Bg8vub9tLe1gHMzV76e8', 3365 "kty" : "EC", 3366 "crv" : "P-256", 3367 "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', 3368 "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' 3369 } 3370 } 3371 } 3373 Figure 19: Access Token including Public Key of the Client. 3375 Messages C and F are shown in Figure 20 - Figure 21. 3377 C: The client then sends the PoP access token to the authz-info 3378 endpoint at the RS. This is a plain CoAP POST request, i.e., no 3379 transport or application layer security is used between client and 3380 RS since the token is integrity protected between the AS and RS. 3381 The RS verifies that the PoP access token was created by a known 3382 and trusted AS, that it applies to this RS, and that it is valid. 3383 The RS caches the security context together with authorization 3384 information about this client contained in the PoP access token. 3386 Resource 3387 Client Server 3388 | | 3389 C: +-------->| Header: POST (Code=0.02) 3390 | POST | Uri-Path:"authz-info" 3391 | | Payload: 0INDoQEKoQVN ... 3392 | | 3393 |<--------+ Header: 2.04 Changed 3394 | 2.04 | 3395 | | 3397 Figure 20: Access Token provisioning to RS 3398 The client and the RS runs the DTLS handshake using the raw public 3399 keys established in step B and C. 3400 The client sends a CoAP GET request to /temperature on RS over 3401 DTLS. The RS verifies that the request is authorized, based on 3402 previously established security context. 3404 F: The RS responds over the same DTLS channel with a CoAP 2.05 3405 Content response, containing a resource representation as payload. 3407 Resource 3408 Client Server 3409 | | 3410 |<=======>| DTLS Connection Establishment 3411 | | using Raw Public Keys 3412 | | 3413 +-------->| Header: GET (Code=0.01) 3414 | GET | Uri-Path: "temperature" 3415 | | 3416 | | 3417 | | 3418 F: |<--------+ Header: 2.05 Content 3419 | 2.05 | Payload: 3420 | | 3422 Figure 21: Resource Request and Response protected by DTLS. 3424 E.2. Introspection Aided Token Validation 3426 In this deployment scenario it is assumed that a client is not able 3427 to access the AS at the time of the access request, whereas the RS is 3428 assumed to be connected to the back-end infrastructure. Thus the RS 3429 can make use of token introspection. This access procedure involves 3430 steps A-F of Figure 1, but assumes steps A and B have been carried 3431 out during a phase when the client had connectivity to AS. 3433 Since the client is assumed to be offline, at least for a certain 3434 period of time, a pre-provisioned access token has to be long-lived. 3435 Since the client is constrained, the token will not be self contained 3436 (i.e. not a CWT) but instead just a reference. The resource server 3437 uses its connectivity to learn about the claims associated to the 3438 access token by using introspection, which is shown in the example 3439 below. 3441 In the example interactions between an offline client (key fob), a RS 3442 (online lock), and an AS is shown. It is assumed that there is a 3443 provisioning step where the client has access to the AS. This 3444 corresponds to message exchanges A and B which are shown in 3445 Figure 22. 3447 Authorization consent from the resource owner can be pre-configured, 3448 but it can also be provided via an interactive flow with the resource 3449 owner. An example of this for the key fob case could be that the 3450 resource owner has a connected car, he buys a generic key that he 3451 wants to use with the car. To authorize the key fob he connects it 3452 to his computer that then provides the UI for the device. After that 3453 OAuth 2.0 implicit flow can used to authorize the key for his car at 3454 the the car manufacturers AS. 3456 Note: In this example the client does not know the exact door it will 3457 be used to access since the token request is not send at the time of 3458 access. So the scope and audience parameters are set quite wide to 3459 start with, while tailored values narrowing down the claims to the 3460 specific RS being accessed can be provided to that RS during an 3461 introspection step. 3463 A: The client sends a CoAP POST request to the token endpoint at 3464 AS. The request contains the Audience parameter set to "PACS1337" 3465 (PACS, Physical Access System), a value the that identifies the 3466 physical access control system to which the individual doors are 3467 connected. The AS generates an access token as an opaque string, 3468 which it can match to the specific client and the targeted 3469 audience. It furthermore generates a symmetric proof-of- 3470 possession key. The communication security and authentication 3471 between client and AS is assumed to have been provided at 3472 transport layer (e.g. via DTLS) using a pre-shared security 3473 context (psk, rpk or certificate). 3474 B: The AS responds with a CoAP 2.05 Content response, containing 3475 as playload the Access Information, including the access token and 3476 the symmetric proof-of-possession key. Communication security 3477 between C and RS will be DTLS and PreSharedKey. The PoP key is 3478 used as the PreSharedKey. 3480 Note: In this example we are using a symmetric key for a multi-RS 3481 audience, which is not recommended normally (see Section 6.9). 3482 However in this case the risk is deemed to be acceptable, since all 3483 the doors are part of the same physical access control system, and 3484 therefore the risk of a malicious RS impersonating the client towards 3485 another RS is low. 3487 Authorization 3488 Client Server 3489 | | 3490 |<=======>| DTLS Connection Establishment 3491 | | and mutual authentication 3492 | | 3493 A: +-------->| Header: POST (Code=0.02) 3494 | POST | Uri-Path:"token" 3495 | | Content-Format: application/ace+cbor 3496 | | Payload: 3497 | | 3498 B: |<--------+ Header: 2.05 Content 3499 | | Content-Format: application/ace+cbor 3500 | 2.05 | Payload: 3501 | | 3503 Figure 22: Token Request and Response using Client Credentials. 3505 The information contained in the Request-Payload and the Response- 3506 Payload is shown in Figure 23. 3508 Request-Payload: 3509 { 3510 "client_id" : "keyfob", 3511 "audience" : "PACS1337" 3512 } 3514 Response-Payload: 3515 { 3516 "access_token" : b64'VGVzdCB0b2tlbg==', 3517 "cnf" : { 3518 "COSE_Key" : { 3519 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', 3520 "kty" : "oct", 3521 "alg" : "HS256", 3522 "k": b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE' 3523 } 3524 } 3525 } 3527 Figure 23: Request and Response Payload for C offline 3529 The access token in this case is just an opaque byte string 3530 referencing the authorization information at the AS. 3532 C: Next, the client POSTs the access token to the authz-info 3533 endpoint in the RS. This is a plain CoAP request, i.e., no DTLS 3534 between client and RS. Since the token is an opaque string, the 3535 RS cannot verify it on its own, and thus defers to respond the 3536 client with a status code until after step E. 3537 D: The RS sends the token to the introspection endpoint on the AS 3538 using a CoAP POST request. In this example RS and AS are assumed 3539 to have performed mutual authentication using a pre shared 3540 security context (psk, rpk or certificate) with the RS acting as 3541 DTLS client. 3542 E: The AS provides the introspection response (2.05 Content) 3543 containing parameters about the token. This includes the 3544 confirmation key (cnf) parameter that allows the RS to verify the 3545 client's proof of possession in step F. Note that our example in 3546 Figure 25 assumes a pre-established key (e.g. one used by the 3547 client and the RS for a previous token) that is now only 3548 referenced by its key-identifier 'kid'. 3549 After receiving message E, the RS responds to the client's POST in 3550 step C with the CoAP response code 2.01 (Created). 3552 Resource 3553 Client Server 3554 | | 3555 C: +-------->| Header: POST (T=CON, Code=0.02) 3556 | POST | Uri-Path:"authz-info" 3557 | | Payload: b64'VGVzdCB0b2tlbg==' 3558 | | 3559 | | Authorization 3560 | | Server 3561 | | | 3562 | D: +--------->| Header: POST (Code=0.02) 3563 | | POST | Uri-Path: "introspect" 3564 | | | Content-Format: "application/ace+cbor" 3565 | | | Payload: 3566 | | | 3567 | E: |<---------+ Header: 2.05 Content 3568 | | 2.05 | Content-Format: "application/ace+cbor" 3569 | | | Payload: 3570 | | | 3571 | | 3572 |<--------+ Header: 2.01 Created 3573 | 2.01 | 3574 | | 3576 Figure 24: Token Introspection for C offline 3577 The information contained in the Request-Payload and the Response- 3578 Payload is shown in Figure 25. 3580 Request-Payload: 3581 { 3582 "token" : b64'VGVzdCB0b2tlbg==', 3583 "client_id" : "FrontDoor", 3584 } 3586 Response-Payload: 3587 { 3588 "active" : true, 3589 "aud" : "lockOfDoor4711", 3590 "scope" : "open, close", 3591 "iat" : 1563454000, 3592 "cnf" : { 3593 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk' 3594 } 3595 } 3597 Figure 25: Request and Response Payload for Introspection 3599 The client uses the symmetric PoP key to establish a DTLS 3600 PreSharedKey secure connection to the RS. The CoAP request PUT is 3601 sent to the uri-path /state on the RS, changing the state of the 3602 door to locked. 3603 F: The RS responds with a appropriate over the secure DTLS 3604 channel. 3606 Resource 3607 Client Server 3608 | | 3609 |<=======>| DTLS Connection Establishment 3610 | | using Pre Shared Key 3611 | | 3612 +-------->| Header: PUT (Code=0.03) 3613 | PUT | Uri-Path: "state" 3614 | | Payload: 3615 | | 3616 F: |<--------+ Header: 2.04 Changed 3617 | 2.04 | Payload: 3618 | | 3620 Figure 26: Resource request and response protected by OSCORE 3622 Appendix F. Document Updates 3624 RFC EDITOR: PLEASE REMOVE THIS SECTION. 3626 F.1. Version -21 to 22 3628 o Provided section numbers in references to OAuth RFC. 3629 o Updated IANA mapping registries to only use "Private Use" and 3630 "Expert Review". 3631 o Made error messages optional for RS at token submission since it 3632 may not be able to send them depending on the profile. 3633 o Corrected errors in examples. 3635 F.2. Version -20 to 21 3637 o Added text about expiration of RS keys. 3639 F.3. Version -19 to 20 3641 o Replaced "req_aud" with "audience" from the OAuth token exchange 3642 draft. 3643 o Updated examples to remove unnecessary elements. 3645 F.4. Version -18 to -19 3647 o Added definition of "Authorization Information". 3648 o Explicitly state that ACE allows encoding refresh tokens in binary 3649 format in addition to strings. 3650 o Renamed "AS Information" to "AS Request Creation Hints" and added 3651 the possibility to specify req_aud and scope as hints. 3652 o Added the "kid" parameter to AS Request Creation Hints. 3653 o Added security considerations about the integrity protection of 3654 tokens with multi-RS audiences. 3655 o Renamed IANA registries mapping OAuth parameters to reflect the 3656 mapped registry. 3657 o Added JWT claim names to CWT claim registrations. 3658 o Added expert review instructions. 3659 o Updated references to TLS from 1.2 to 1.3. 3661 F.5. Version -17 to -18 3663 o Added OSCORE options in examples involving OSCORE. 3664 o Removed requirement for the client to send application/cwt, since 3665 the client has no way to know. 3666 o Clarified verification of tokens by the RS. 3667 o Added exi claim CWT registration. 3669 F.6. Version -16 to -17 3671 o Added references to (D)TLS 1.3. 3672 o Added requirement that responses are bound to requests. 3674 o Specify that grant_type is OPTIONAL in C2AS requests (as opposed 3675 to REQUIRED in OAuth). 3676 o Replaced examples with hypothetical COSE profile with OSCORE. 3677 o Added requirement for content type application/ace+cbor in error 3678 responses for token and introspection requests and responses. 3679 o Reworked abbreviation space for claims, request and response 3680 parameters. 3681 o Added text that the RS may indicate that it is busy at the authz- 3682 info resource. 3683 o Added section that specifies how the RS verifies an access token. 3684 o Added section on the protection of the authz-info endpoint. 3685 o Removed the expiration mechanism based on sequence numbers. 3686 o Added reference to RFC7662 security considerations. 3687 o Added considerations on minimal security requirements for 3688 communication. 3689 o Added security considerations on unprotected information sent to 3690 authz-info and in the error responses. 3692 F.7. Version -15 to -16 3694 o Added text the RS using RFC6750 error codes. 3695 o Defined an error code for incompatible token request parameters. 3696 o Removed references to the actors draft. 3697 o Fixed errors in examples. 3699 F.8. Version -14 to -15 3701 o Added text about refresh tokens. 3702 o Added text about protection of credentials. 3703 o Rephrased introspection so that other entities than RS can do it. 3704 o Editorial improvements. 3706 F.9. Version -13 to -14 3708 o Split out the 'aud', 'cnf' and 'rs_cnf' parameters to 3709 [I-D.ietf-ace-oauth-params] 3710 o Introduced the "application/ace+cbor" Content-Type. 3711 o Added claim registrations from 'profile' and 'rs_cnf'. 3712 o Added note on schema part of AS Information Section 5.1.2 3713 o Realigned the parameter abbreviations to push rarely used ones to 3714 the 2-byte encoding size of CBOR integers. 3716 F.10. Version -12 to -13 3718 o Changed "Resource Information" to "Access Information" to avoid 3719 confusion. 3720 o Clarified section about AS discovery. 3721 o Editorial changes 3723 F.11. Version -11 to -12 3725 o Moved the Request error handling to a section of its own. 3726 o Require the use of the abbreviation for profile identifiers. 3727 o Added rs_cnf parameter in the introspection response, to inform 3728 RS' with several RPKs on which key to use. 3729 o Allowed use of rs_cnf as claim in the access token in order to 3730 inform an RS with several RPKs on which key to use. 3731 o Clarified that profiles must specify if/how error responses are 3732 protected. 3733 o Fixed label number range to align with COSE/CWT. 3734 o Clarified the requirements language in order to allow profiles to 3735 specify other payload formats than CBOR if they do not use CoAP. 3737 F.12. Version -10 to -11 3739 o Fixed some CBOR data type errors. 3740 o Updated boilerplate text 3742 F.13. Version -09 to -10 3744 o Removed CBOR major type numbers. 3745 o Removed the client token design. 3746 o Rephrased to clarify that other protocols than CoAP can be used. 3747 o Clarifications regarding the use of HTTP 3749 F.14. Version -08 to -09 3751 o Allowed scope to be byte strings. 3752 o Defined default names for endpoints. 3753 o Refactored the IANA section for briefness and consistency. 3754 o Refactored tables that define IANA registry contents for 3755 consistency. 3756 o Created IANA registry for CBOR mappings of error codes, grant 3757 types and Authorization Server Information. 3758 o Added references to other document sections defining IANA entries 3759 in the IANA section. 3761 F.15. Version -07 to -08 3763 o Moved AS discovery from the DTLS profile to the framework, see 3764 Section 5.1. 3765 o Made the use of CBOR mandatory. If you use JSON you can use 3766 vanilla OAuth. 3767 o Made it mandatory for profiles to specify C-AS security and RS-AS 3768 security (the latter only if introspection is supported). 3769 o Made the use of CBOR abbreviations mandatory. 3771 o Added text to clarify the use of token references as an 3772 alternative to CWTs. 3773 o Added text to clarify that introspection must not be delayed, in 3774 case the RS has to return a client token. 3775 o Added security considerations about leakage through unprotected AS 3776 discovery information, combining profiles and leakage through 3777 error responses. 3778 o Added privacy considerations about leakage through unprotected AS 3779 discovery. 3780 o Added text that clarifies that introspection is optional. 3781 o Made profile parameter optional since it can be implicit. 3782 o Clarified that CoAP is not mandatory and other protocols can be 3783 used. 3784 o Clarified the design justification for specific features of the 3785 framework in appendix A. 3786 o Clarified appendix E.2. 3787 o Removed specification of the "cnf" claim for CBOR/COSE, and 3788 replaced with references to [I-D.ietf-ace-cwt-proof-of-possession] 3790 F.16. Version -06 to -07 3792 o Various clarifications added. 3793 o Fixed erroneous author email. 3795 F.17. Version -05 to -06 3797 o Moved sections that define the ACE framework into a subsection of 3798 the framework Section 5. 3799 o Split section on client credentials and grant into two separate 3800 sections, Section 5.2, and Section 5.3. 3801 o Added Section 5.4 on AS authentication. 3802 o Added Section 5.5 on the Authorization endpoint. 3804 F.18. Version -04 to -05 3806 o Added RFC 2119 language to the specification of the required 3807 behavior of profile specifications. 3808 o Added Section 5.3 on the relation to the OAuth2 grant types. 3809 o Added CBOR abbreviations for error and the error codes defined in 3810 OAuth2. 3811 o Added clarification about token expiration and long-running 3812 requests in Section 5.8.3 3813 o Added security considerations about tokens with symmetric PoP keys 3814 valid for more than one RS. 3815 o Added privacy considerations section. 3816 o Added IANA registry mapping the confirmation types from RFC 7800 3817 to equivalent COSE types. 3819 o Added appendix D, describing assumptions about what the AS knows 3820 about the client and the RS. 3822 F.19. Version -03 to -04 3824 o Added a description of the terms "framework" and "profiles" as 3825 used in this document. 3826 o Clarified protection of access tokens in section 3.1. 3827 o Clarified uses of the "cnf" parameter in section 6.4.5. 3828 o Clarified intended use of Client Token in section 7.4. 3830 F.20. Version -02 to -03 3832 o Removed references to draft-ietf-oauth-pop-key-distribution since 3833 the status of this draft is unclear. 3834 o Copied and adapted security considerations from draft-ietf-oauth- 3835 pop-key-distribution. 3836 o Renamed "client information" to "RS information" since it is 3837 information about the RS. 3838 o Clarified the requirements on profiles of this framework. 3839 o Clarified the token endpoint protocol and removed negotiation of 3840 "profile" and "alg" (section 6). 3841 o Renumbered the abbreviations for claims and parameters to get a 3842 consistent numbering across different endpoints. 3843 o Clarified the introspection endpoint. 3844 o Renamed token, introspection and authz-info to "endpoint" instead 3845 of "resource" to mirror the OAuth 2.0 terminology. 3846 o Updated the examples in the appendices. 3848 F.21. Version -01 to -02 3850 o Restructured to remove communication security parts. These shall 3851 now be defined in profiles. 3852 o Restructured section 5 to create new sections on the OAuth 3853 endpoints token, introspection and authz-info. 3854 o Pulled in material from draft-ietf-oauth-pop-key-distribution in 3855 order to define proof-of-possession key distribution. 3856 o Introduced the "cnf" parameter as defined in RFC7800 to reference 3857 or transport keys used for proof of possession. 3858 o Introduced the "client-token" to transport client information from 3859 the AS to the client via the RS in conjunction with introspection. 3860 o Expanded the IANA section to define parameters for token request, 3861 introspection and CWT claims. 3862 o Moved deployment scenarios to the appendix as examples. 3864 F.22. Version -00 to -01 3866 o Changed 5.1. from "Communication Security Protocol" to "Client 3867 Information". 3868 o Major rewrite of 5.1 to clarify the information exchanged between 3869 C and AS in the PoP access token request profile for IoT. 3871 * Allow the client to indicate preferences for the communication 3872 security protocol. 3873 * Defined the term "Client Information" for the additional 3874 information returned to the client in addition to the access 3875 token. 3876 * Require that the messages between AS and client are secured, 3877 either with (D)TLS or with COSE_Encrypted wrappers. 3878 * Removed dependency on OSCOAP and added generic text about 3879 object security instead. 3880 * Defined the "rpk" parameter in the client information to 3881 transmit the raw public key of the RS from AS to client. 3882 * (D)TLS MUST use the PoP key in the handshake (either as PSK or 3883 as client RPK with client authentication). 3884 * Defined the use of x5c, x5t and x5tS256 parameters when a 3885 client certificate is used for proof of possession. 3886 * Defined "tktn" parameter for signaling for how to transfer the 3887 access token. 3888 o Added 5.2. the CoAP Access-Token option for transferring access 3889 tokens in messages that do not have payload. 3890 o 5.3.2. Defined success and error responses from the RS when 3891 receiving an access token. 3892 o 5.6.:Added section giving guidance on how to handle token 3893 expiration in the absence of reliable time. 3894 o Appendix B Added list of roles and responsibilities for C, AS and 3895 RS. 3897 Authors' Addresses 3899 Ludwig Seitz 3900 RISE 3901 Scheelevaegen 17 3902 Lund 223 70 3903 Sweden 3905 Email: ludwig.seitz@ri.se 3906 Goeran Selander 3907 Ericsson 3908 Faroegatan 6 3909 Kista 164 80 3910 Sweden 3912 Email: goran.selander@ericsson.com 3914 Erik Wahlstroem 3915 Sweden 3917 Email: erik@wahlstromstekniska.se 3919 Samuel Erdtman 3920 Spotify AB 3921 Birger Jarlsgatan 61, 4tr 3922 Stockholm 113 56 3923 Sweden 3925 Email: erdtman@spotify.com 3927 Hannes Tschofenig 3928 Arm Ltd. 3929 Absam 6067 3930 Austria 3932 Email: Hannes.Tschofenig@arm.com