idnits 2.17.1 draft-ietf-ace-oauth-authz-19.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 (January 31, 2019) is 1905 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-11) exists of draft-ietf-ace-cwt-proof-of-possession-05 == Outdated reference: A later version (-16) exists of draft-ietf-ace-oauth-params-03 ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) == Outdated reference: A later version (-16) exists of draft-ietf-core-object-security-15 == Outdated reference: A later version (-15) exists of draft-ietf-oauth-device-flow-14 == Outdated reference: A later version (-43) exists of draft-ietf-tls-dtls13-30 -- Obsolete informational reference (is this intentional?): RFC 7049 (Obsoleted by RFC 8949) -- Obsolete informational reference (is this intentional?): RFC 7231 (Obsoleted by RFC 9110) Summary: 2 errors (**), 0 flaws (~~), 6 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 ACE Working Group L. Seitz 3 Internet-Draft RISE 4 Intended status: Standards Track G. Selander 5 Expires: August 4, 2019 Ericsson 6 E. Wahlstroem 8 S. Erdtman 9 Spotify AB 10 H. Tschofenig 11 Arm Ltd. 12 January 31, 2019 14 Authentication and Authorization for Constrained Environments (ACE) 15 using the OAuth 2.0 Framework (ACE-OAuth) 16 draft-ietf-ace-oauth-authz-19 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 making a well-known and widely used 24 authorization solution suitable for IoT devices. Existing 25 specifications are used where possible, but where the constraints of 26 IoT devices require it, extensions are added and profiles are 27 defined. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on August 4, 2019. 46 Copyright Notice 48 Copyright (c) 2019 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 64 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 66 3.1. OAuth 2.0 . . . . . . . . . . . . . . . . . . . . . . . . 7 67 3.2. CoAP . . . . . . . . . . . . . . . . . . . . . . . . . . 10 68 4. Protocol Interactions . . . . . . . . . . . . . . . . . . . . 11 69 5. Framework . . . . . . . . . . . . . . . . . . . . . . . . . . 14 70 5.1. Discovering Authorization Servers . . . . . . . . . . . . 16 71 5.1.1. Unauthorized Resource Request Message . . . . . . . . 16 72 5.1.2. AS Request Creation Hints . . . . . . . . . . . . . . 16 73 5.2. Authorization Grants . . . . . . . . . . . . . . . . . . 18 74 5.3. Client Credentials . . . . . . . . . . . . . . . . . . . 19 75 5.4. AS Authentication . . . . . . . . . . . . . . . . . . . . 19 76 5.5. The Authorization Endpoint . . . . . . . . . . . . . . . 19 77 5.6. The Token Endpoint . . . . . . . . . . . . . . . . . . . 20 78 5.6.1. Client-to-AS Request . . . . . . . . . . . . . . . . 20 79 5.6.2. AS-to-Client Response . . . . . . . . . . . . . . . . 23 80 5.6.3. Error Response . . . . . . . . . . . . . . . . . . . 25 81 5.6.4. Request and Response Parameters . . . . . . . . . . . 26 82 5.6.4.1. Grant Type . . . . . . . . . . . . . . . . . . . 26 83 5.6.4.2. Token Type . . . . . . . . . . . . . . . . . . . 27 84 5.6.4.3. Profile . . . . . . . . . . . . . . . . . . . . . 27 85 5.6.5. Mapping Parameters to CBOR . . . . . . . . . . . . . 28 86 5.7. The Introspection Endpoint . . . . . . . . . . . . . . . 28 87 5.7.1. Introspection Request . . . . . . . . . . . . . . . . 29 88 5.7.2. Introspection Response . . . . . . . . . . . . . . . 30 89 5.7.3. Error Response . . . . . . . . . . . . . . . . . . . 31 90 5.7.4. Mapping Introspection parameters to CBOR . . . . . . 32 91 5.8. The Access Token . . . . . . . . . . . . . . . . . . . . 32 92 5.8.1. The Authorization Information Endpoint . . . . . . . 33 93 5.8.1.1. Verifying an Access Token . . . . . . . . . . . . 34 94 5.8.1.2. Protecting the Authorization Information 95 Endpoint . . . . . . . . . . . . . . . . . . . . 36 96 5.8.2. Client Requests to the RS . . . . . . . . . . . . . . 36 97 5.8.3. Token Expiration . . . . . . . . . . . . . . . . . . 37 98 6. Security Considerations . . . . . . . . . . . . . . . . . . . 37 99 6.1. Unprotected AS Request Creation Hints . . . . . . . . . . 39 100 6.2. Minimal security requirements for communication . 39 101 6.3. Use of Nonces for Replay Protection . . . . . . . . . . . 40 102 6.4. Combining profiles . . . . . . . . . . . . . . . . . . . 40 103 6.5. Unprotected Information . . . . . . . . . . . . . . . . . 40 104 6.6. Denial of service against or with Introspection . . 41 105 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 41 106 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 42 107 8.1. ACE Authorization Server Request Creation Hints . . . . . 42 108 8.2. OAuth Extensions Error Registration . . . . . . . . . . . 43 109 8.3. OAuth Error Code CBOR Mappings Registry . . . . . . . . . 43 110 8.4. OAuth Grant Type CBOR Mappings . . . . . . . . . . . . . 44 111 8.5. OAuth Access Token Types . . . . . . . . . . . . . . . . 44 112 8.6. OAuth Access Token Type CBOR Mappings . . . . . . . . . . 44 113 8.6.1. Initial Registry Contents . . . . . . . . . . . . . . 45 114 8.7. ACE Profile Registry . . . . . . . . . . . . . . . . . . 45 115 8.8. OAuth Parameter Registration . . . . . . . . . . . . . . 46 116 8.9. OAuth Parameters CBOR Mappings Registry . . . . . . . . . 46 117 8.10. OAuth Introspection Response Parameter Registration . . . 47 118 8.11. OAuth Token Introspection Response CBOR Mappings Registry 47 119 8.12. JSON Web Token Claims . . . . . . . . . . . . . . . . . . 48 120 8.13. CBOR Web Token Claims . . . . . . . . . . . . . . . . . . 48 121 8.14. Media Type Registrations . . . . . . . . . . . . . . . . 49 122 8.15. CoAP Content-Format Registry . . . . . . . . . . . . . . 50 123 8.16. Expert Review Instructions . . . . . . . . . . . . . . . 50 124 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 51 125 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 51 126 10.1. Normative References . . . . . . . . . . . . . . . . . . 51 127 10.2. Informative References . . . . . . . . . . . . . . . . . 53 128 Appendix A. Design Justification . . . . . . . . . . . . . . . . 56 129 Appendix B. Roles and Responsibilities . . . . . . . . . . . . . 59 130 Appendix C. Requirements on Profiles . . . . . . . . . . . . . . 62 131 Appendix D. Assumptions on AS knowledge about C and RS . . . . . 62 132 Appendix E. Deployment Examples . . . . . . . . . . . . . . . . 63 133 E.1. Local Token Validation . . . . . . . . . . . . . . . . . 63 134 E.2. Introspection Aided Token Validation . . . . . . . . . . 67 135 Appendix F. Document Updates . . . . . . . . . . . . . . . . . . 71 136 F.1. Version -18 to -19 . . . . . . . . . . . . . . . . . . . 71 137 F.2. Version -17 to -18 . . . . . . . . . . . . . . . . . . . 71 138 F.3. Version -16 to -17 . . . . . . . . . . . . . . . . . . . 72 139 F.4. Version -15 to -16 . . . . . . . . . . . . . . . . . . . 72 140 F.5. Version -14 to -15 . . . . . . . . . . . . . . . . . . . 72 141 F.6. Version -13 to -14 . . . . . . . . . . . . . . . . . . . 72 142 F.7. Version -12 to -13 . . . . . . . . . . . . . . . . . . . 73 143 F.8. Version -11 to -12 . . . . . . . . . . . . . . . . . . . 73 144 F.9. Version -10 to -11 . . . . . . . . . . . . . . . . . . . 73 145 F.10. Version -09 to -10 . . . . . . . . . . . . . . . . . . . 73 146 F.11. Version -08 to -09 . . . . . . . . . . . . . . . . . . . 73 147 F.12. Version -07 to -08 . . . . . . . . . . . . . . . . . . . 74 148 F.13. Version -06 to -07 . . . . . . . . . . . . . . . . . . . 74 149 F.14. Version -05 to -06 . . . . . . . . . . . . . . . . . . . 74 150 F.15. Version -04 to -05 . . . . . . . . . . . . . . . . . . . 74 151 F.16. Version -03 to -04 . . . . . . . . . . . . . . . . . . . 75 152 F.17. Version -02 to -03 . . . . . . . . . . . . . . . . . . . 75 153 F.18. Version -01 to -02 . . . . . . . . . . . . . . . . . . . 75 154 F.19. Version -00 to -01 . . . . . . . . . . . . . . . . . . . 76 155 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 76 157 1. Introduction 159 Authorization is the process for granting approval to an entity to 160 access a resource [RFC4949]. The authorization task itself can best 161 be described as granting access to a requesting client, for a 162 resource hosted on a device, the resource server (RS). This exchange 163 is mediated by one or multiple authorization servers (AS). Managing 164 authorization for a large number of devices and users can be a 165 complex task. 167 While prior work on authorization solutions for the Web and for the 168 mobile environment also applies to the Internet of Things (IoT) 169 environment, many IoT devices are constrained, for example, in terms 170 of processing capabilities, available memory, etc. For web 171 applications on constrained nodes, this specification RECOMMENDS the 172 use of CoAP [RFC7252] as replacement for HTTP. 174 A detailed treatment of constraints can be found in [RFC7228], and 175 the different IoT deployments present a continuous range of device 176 and network capabilities. Taking energy consumption as an example: 177 At one end there are energy-harvesting or battery powered devices 178 which have a tight power budget, on the other end there are mains- 179 powered devices, and all levels in between. 181 Hence, IoT devices may be very different in terms of available 182 processing and message exchange capabilities and there is a need to 183 support many different authorization use cases [RFC7744]. 185 This specification describes a framework for authentication and 186 authorization in constrained environments (ACE) built on re-use of 187 OAuth 2.0 [RFC6749], thereby extending authorization to Internet of 188 Things devices. This specification contains the necessary building 189 blocks for adjusting OAuth 2.0 to IoT environments. 191 More detailed, interoperable specifications can be found in profiles. 192 Implementations may claim conformance with a specific profile, 193 whereby implementations utilizing the same profile interoperate while 194 implementations of different profiles are not expected to be 195 interoperable. Some devices, such as mobile phones and tablets, may 196 implement multiple profiles and will therefore be able to interact 197 with a wider range of low end devices. Requirements on profiles are 198 described at contextually appropriate places throughout this 199 specification, and also summarized in Appendix C. 201 2. Terminology 203 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 204 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 205 "OPTIONAL" in this document are to be interpreted as described in BCP 206 14 [RFC2119] [RFC8174] when, and only when, they appear in all 207 capitals, as shown here. 209 Certain security-related terms such as "authentication", 210 "authorization", "confidentiality", "(data) integrity", "message 211 authentication code", and "verify" are taken from [RFC4949]. 213 Since exchanges in this specification are described as RESTful 214 protocol interactions, HTTP [RFC7231] offers useful terminology. 216 Terminology for entities in the architecture is defined in OAuth 2.0 217 [RFC6749] such as client (C), resource server (RS), and authorization 218 server (AS). 220 Note that the term "endpoint" is used here following its OAuth 221 definition, which is to denote resources such as token and 222 introspection at the AS and authz-info at the RS (see Section 5.8.1 223 for a definition of the authz-info endpoint). The CoAP [RFC7252] 224 definition, which is "An entity participating in the CoAP protocol" 225 is not used in this specification. 227 The specifications in this document is called the "framework" or "ACE 228 framework". When referring to "profiles of this framework" it refers 229 to additional specifications that define the use of this 230 specification with concrete transport, and communication security 231 protocols (e.g., CoAP over DTLS). 233 We use the term "Access Information" for parameters other than the 234 access token provided to the client by the AS to enable it to access 235 the RS (e.g. public key of the RS, profile supported by RS). 237 We use the term "Authorization Information" to denote all 238 information, including the claims of relevant access tokens, that an 239 RS uses to determine whether an access request should be granted. 241 3. Overview 243 This specification defines the ACE framework for authorization in the 244 Internet of Things environment. It consists of a set of building 245 blocks. 247 The basic block is the OAuth 2.0 [RFC6749] framework, which enjoys 248 widespread deployment. Many IoT devices can support OAuth 2.0 249 without any additional extensions, but for certain constrained 250 settings additional profiling is needed. 252 Another building block is the lightweight web transfer protocol CoAP 253 [RFC7252], for those communication environments where HTTP is not 254 appropriate. CoAP typically runs on top of UDP, which further 255 reduces overhead and message exchanges. While this specification 256 defines extensions for the use of OAuth over CoAP, other underlying 257 protocols are not prohibited from being supported in the future, such 258 as HTTP/2, MQTT, BLE and QUIC. 260 A third building block is CBOR [RFC7049], for encodings where JSON 261 [RFC8259] is not sufficiently compact. CBOR is a binary encoding 262 designed for small code and message size, which may be used for 263 encoding of self contained tokens, and also for encoding payload 264 transferred in protocol messages. 266 A fourth building block is the compact CBOR-based secure message 267 format COSE [RFC8152], which enables application layer security as an 268 alternative or complement to transport layer security (DTLS [RFC6347] 269 or TLS [RFC8446]). COSE is used to secure self-contained tokens such 270 as proof-of-possession (PoP) tokens, which is an extension to the 271 OAuth tokens. The default token format is defined in CBOR web token 272 (CWT) [RFC8392]. Application layer security for CoAP using COSE can 273 be provided with OSCORE [I-D.ietf-core-object-security]. 275 With the building blocks listed above, solutions satisfying various 276 IoT device and network constraints are possible. A list of 277 constraints is described in detail in RFC 7228 [RFC7228] and a 278 description of how the building blocks mentioned above relate to the 279 various constraints can be found in Appendix A. 281 Luckily, not every IoT device suffers from all constraints. The ACE 282 framework nevertheless takes all these aspects into account and 283 allows several different deployment variants to co-exist, rather than 284 mandating a one-size-fits-all solution. It is important to cover the 285 wide range of possible interworking use cases and the different 286 requirements from a security point of view. Once IoT deployments 287 mature, popular deployment variants will be documented in the form of 288 ACE profiles. 290 3.1. OAuth 2.0 292 The OAuth 2.0 authorization framework enables a client to obtain 293 scoped access to a resource with the permission of a resource owner. 294 Authorization information, or references to it, is passed between the 295 nodes using access tokens. These access tokens are issued to clients 296 by an authorization server with the approval of the resource owner. 297 The client uses the access token to access the protected resources 298 hosted by the resource server. 300 A number of OAuth 2.0 terms are used within this specification: 302 The token and introspection Endpoints: 303 The AS hosts the token endpoint that allows a client to request 304 access tokens. The client makes a POST request to the token 305 endpoint on the AS and receives the access token in the response 306 (if the request was successful). 307 In some deployments, a token introspection endpoint is provided by 308 the AS, which can be used by the RS if it needs to request 309 additional information regarding a received access token. The RS 310 makes a POST request to the introspection endpoint on the AS and 311 receives information about the access token in the response. (See 312 "Introspection" below.) 314 Access Tokens: 315 Access tokens are credentials needed to access protected 316 resources. An access token is a data structure representing 317 authorization permissions issued by the AS to the client. Access 318 tokens are generated by the AS and consumed by the RS. The access 319 token content is opaque to the client. 321 Access tokens can have different formats, and various methods of 322 utilization (e.g., cryptographic properties) based on the security 323 requirements of the given deployment. 325 Refresh Tokens: 326 Refresh tokens are credentials used to obtain access tokens. 327 Refresh tokens are issued to the client by the authorization 328 server and are used to obtain a new access token when the current 329 access token becomes invalid or expires, or to obtain additional 330 access tokens with identical or narrower scope (access tokens may 331 have a shorter lifetime and fewer permissions than authorized by 332 the resource owner). Issuing a refresh token is optional at the 333 discretion of the authorization server. If the authorization 334 server issues a refresh token, it is included when issuing an 335 access token (i.e., step (B) in Figure 1). 337 A refresh token in OAuth 2.0 is a string representing the 338 authorization granted to the client by the resource owner. The 339 string is usually opaque to the client. The token denotes an 340 identifier used to retrieve the authorization information. Unlike 341 access tokens, refresh tokens are intended for use only with 342 authorization servers and are never sent to resource servers. In 343 this framework, refresh tokens are encoded in binary instead of 344 strings, if used. 346 Proof of Possession Tokens: 347 An access token may be bound to a cryptographic key, which is then 348 used by an RS to authenticate requests from a client. Such tokens 349 are called proof-of-possession access tokens (or PoP access 350 tokens). 352 The proof-of-possession (PoP) security concept assumes that the AS 353 acts as a trusted third party that binds keys to access tokens. 354 These so called PoP keys are then used by the client to 355 demonstrate the possession of the secret to the RS when accessing 356 the resource. The RS, when receiving an access token, needs to 357 verify that the key used by the client matches the one bound to 358 the access token. When this specification uses the term "access 359 token" it is assumed to be a PoP access token token unless 360 specifically stated otherwise. 362 The key bound to the access token (the PoP key) may use either 363 symmetric or asymmetric cryptography. The appropriate choice of 364 the kind of cryptography depends on the constraints of the IoT 365 devices as well as on the security requirements of the use case. 367 Symmetric PoP key: 368 The AS generates a random symmetric PoP key. The key is either 369 stored to be returned on introspection calls or encrypted and 370 included in the access token. The PoP key is also encrypted 371 for the client and sent together with the access token to the 372 client. 374 Asymmetric PoP key: 376 An asymmetric key pair is generated on the client and the 377 public key is sent to the AS (if it does not already have 378 knowledge of the client's public key). Information about the 379 public key, which is the PoP key in this case, is either stored 380 to be returned on introspection calls or included inside the 381 access token and sent back to the requesting client. The RS 382 can identify the client's public key from the information in 383 the token, which allows the client to use the corresponding 384 private key for the proof of possession. 386 The access token is either a simple reference, or a structured 387 information object (e.g., CWT [RFC8392]) protected by a 388 cryptographic wrapper (e.g., COSE [RFC8152]). The choice of PoP 389 key does not necessarily imply a specific credential type for the 390 integrity protection of the token. 392 Scopes and Permissions: 393 In OAuth 2.0, the client specifies the type of permissions it is 394 seeking to obtain (via the scope parameter) in the access token 395 request. In turn, the AS may use the scope response parameter to 396 inform the client of the scope of the access token issued. As the 397 client could be a constrained device as well, this specification 398 defines the use of CBOR encoding as data format, see Section 5, to 399 request scopes and to be informed what scopes the access token 400 actually authorizes. 402 The values of the scope parameter in OAuth 2.0 are expressed as a 403 list of space-delimited, case-sensitive strings, with a semantic 404 that is well-known to the AS and the RS. More details about the 405 concept of scopes is found under Section 3.3 in [RFC6749]. 407 Claims: 408 Information carried in the access token or returned from 409 introspection, called claims, is in the form of name-value pairs. 410 An access token may, for example, include a claim identifying the 411 AS that issued the token (via the "iss" claim) and what audience 412 the access token is intended for (via the "aud" claim). The 413 audience of an access token can be a specific resource or one or 414 many resource servers. The resource owner policies influence what 415 claims are put into the access token by the authorization server. 417 While the structure and encoding of the access token varies 418 throughout deployments, a standardized format has been defined 419 with the JSON Web Token (JWT) [RFC7519] where claims are encoded 420 as a JSON object. In [RFC8392], an equivalent format using CBOR 421 encoding (CWT) has been defined. 423 Introspection: 424 Introspection is a method for a resource server to query the 425 authorization server for the active state and content of a 426 received access token. This is particularly useful in those cases 427 where the authorization decisions are very dynamic and/or where 428 the received access token itself is an opaque reference rather 429 than a self-contained token. More information about introspection 430 in OAuth 2.0 can be found in [RFC7662]. 432 3.2. CoAP 434 CoAP is an application layer protocol similar to HTTP, but 435 specifically designed for constrained environments. CoAP typically 436 uses datagram-oriented transport, such as UDP, where reordering and 437 loss of packets can occur. A security solution needs to take the 438 latter aspects into account. 440 While HTTP uses headers and query strings to convey additional 441 information about a request, CoAP encodes such information into 442 header parameters called 'options'. 444 CoAP supports application-layer fragmentation of the CoAP payloads 445 through blockwise transfers [RFC7959]. However, blockwise transfer 446 does not increase the size limits of CoAP options, therefore data 447 encoded in options has to be kept small. 449 Transport layer security for CoAP can be provided by DTLS or TLS 450 [RFC6347][RFC8446] [I-D.ietf-tls-dtls13]. CoAP defines a number of 451 proxy operations that require transport layer security to be 452 terminated at the proxy. One approach for protecting CoAP 453 communication end-to-end through proxies, and also to support 454 security for CoAP over a different transport in a uniform way, is to 455 provide security at the application layer using an object-based 456 security mechanism such as COSE [RFC8152]. 458 One application of COSE is OSCORE [I-D.ietf-core-object-security], 459 which provides end-to-end confidentiality, integrity and replay 460 protection, and a secure binding between CoAP request and response 461 messages. In OSCORE, the CoAP messages are wrapped in COSE objects 462 and sent using CoAP. 464 This framework RECOMMENDS the use of CoAP as replacement for HTTP for 465 use in constrained environments. 467 4. Protocol Interactions 469 The ACE framework is based on the OAuth 2.0 protocol interactions 470 using the token endpoint and optionally the introspection endpoint. 471 A client obtains an access token, and optionally a refresh token, 472 from an AS using the token endpoint and subsequently presents the 473 access token to a RS to gain access to a protected resource. In most 474 deployments the RS can process the access token locally, however in 475 some cases the RS may present it to the AS via the introspection 476 endpoint to get fresh information. These interactions are shown in 477 Figure 1. An overview of various OAuth concepts is provided in 478 Section 3.1. 480 The OAuth 2.0 framework defines a number of "protocol flows" via 481 grant types, which have been extended further with extensions to 482 OAuth 2.0 (such as RFC 7521 [RFC7521] and 483 [I-D.ietf-oauth-device-flow]). What grant types works best depends 484 on the usage scenario and RFC 7744 [RFC7744] describes many different 485 IoT use cases but there are two preferred grant types, namely the 486 Authorization Code Grant (described in Section 4.1 of [RFC7521]) and 487 the Client Credentials Grant (described in Section 4.4 of [RFC7521]). 488 The Authorization Code Grant is a good fit for use with apps running 489 on smart phones and tablets that request access to IoT devices, a 490 common scenario in the smart home environment, where users need to go 491 through an authentication and authorization phase (at least during 492 the initial setup phase). The native apps guidelines described in 493 [RFC8252] are applicable to this use case. The Client Credential 494 Grant is a good fit for use with IoT devices where the OAuth client 495 itself is constrained. In such a case, the resource owner has pre- 496 arranged access rights for the client with the authorization server, 497 which is often accomplished using a commissioning tool. 499 The consent of the resource owner, for giving a client access to a 500 protected resource, can be provided dynamically as in the traditional 501 OAuth flows, or it could be pre-configured by the resource owner as 502 authorization policies at the AS, which the AS evaluates when a token 503 request arrives. The resource owner and the requesting party (i.e., 504 client owner) are not shown in Figure 1. 506 This framework supports a wide variety of communication security 507 mechanisms between the ACE entities, such as client, AS, and RS. It 508 is assumed that the client has been registered (also called enrolled 509 or onboarded) to an AS using a mechanism defined outside the scope of 510 this document. In practice, various techniques for onboarding have 511 been used, such as factory-based provisioning or the use of 512 commissioning tools. Regardless of the onboarding technique, this 513 provisioning procedure implies that the client and the AS exchange 514 credentials and configuration parameters. These credentials are used 515 to mutually authenticate each other and to protect messages exchanged 516 between the client and the AS. 518 It is also assumed that the RS has been registered with the AS, 519 potentially in a similar way as the client has been registered with 520 the AS. Established keying material between the AS and the RS allows 521 the AS to apply cryptographic protection to the access token to 522 ensure that its content cannot be modified, and if needed, that the 523 content is confidentiality protected. 525 The keying material necessary for establishing communication security 526 between C and RS is dynamically established as part of the protocol 527 described in this document. 529 At the start of the protocol, there is an optional discovery step 530 where the client discovers the resource server and the resources this 531 server hosts. In this step, the client might also determine what 532 permissions are needed to access the protected resource. A generic 533 procedure is described in Section 5.1, profiles MAY define other 534 procedures for discovery. 536 In Bluetooth Low Energy, for example, advertisements are broadcasted 537 by a peripheral, including information about the primary services. 538 In CoAP, as a second example, a client can make a request to "/.well- 539 known/core" to obtain information about available resources, which 540 are returned in a standardized format as described in [RFC6690]. 542 +--------+ +---------------+ 543 | |---(A)-- Token Request ------->| | 544 | | | Authorization | 545 | |<--(B)-- Access Token ---------| Server | 546 | | + Access Information | | 547 | | + Refresh Token (optional) +---------------+ 548 | | ^ | 549 | | Introspection Request (D)| | 550 | Client | (optional) | | 551 | | Response | |(E) 552 | | (optional) | v 553 | | +--------------+ 554 | |---(C)-- Token + Request ----->| | 555 | | | Resource | 556 | |<--(F)-- Protected Resource ---| Server | 557 | | | | 558 +--------+ +--------------+ 560 Figure 1: Basic Protocol Flow. 562 Requesting an Access Token (A): 564 The client makes an access token request to the token endpoint at 565 the AS. This framework assumes the use of PoP access tokens (see 566 Section 3.1 for a short description) wherein the AS binds a key to 567 an access token. The client may include permissions it seeks to 568 obtain, and information about the credentials it wants to use 569 (e.g., symmetric/asymmetric cryptography or a reference to a 570 specific credential). 572 Access Token Response (B): 573 If the AS successfully processes the request from the client, it 574 returns an access token and optionally a refresh token (note that 575 only certain grant types support refresh tokens). It can also 576 return additional parameters, referred to as "Access Information". 577 In addition to the response parameters defined by OAuth 2.0 and 578 the PoP access token extension, this framework defines parameters 579 that can be used to inform the client about capabilities of the 580 RS. More information about these parameters can be found in 581 Section 5.6.4. 583 Resource Request (C): 584 The client interacts with the RS to request access to the 585 protected resource and provides the access token. The protocol to 586 use between the client and the RS is not restricted to CoAP. 587 HTTP, HTTP/2, QUIC, MQTT, Bluetooth Low Energy, etc., are also 588 viable candidates. 590 Depending on the device limitations and the selected protocol, 591 this exchange may be split up into two parts: 593 (1) the client sends the access token containing, or 594 referencing, the authorization information to the RS, that may 595 be used for subsequent resource requests by the client, and 596 (2) the client makes the resource access request, using the 597 communication security protocol and other Access Information 598 obtained from the AS. 600 The Client and the RS mutually authenticate using the security 601 protocol specified in the profile (see step B) and the keys 602 obtained in the access token or the Access Information. The RS 603 verifies that the token is integrity protected by the AS and 604 compares the claims contained in the access token with the 605 resource request. If the RS is online, validation can be handed 606 over to the AS using token introspection (see messages D and E) 607 over HTTP or CoAP. 609 Token Introspection Request (D): 610 A resource server may be configured to introspect the access token 611 by including it in a request to the introspection endpoint at that 612 AS. Token introspection over CoAP is defined in Section 5.7 and 613 for HTTP in [RFC7662]. 615 Note that token introspection is an optional step and can be 616 omitted if the token is self-contained and the resource server is 617 prepared to perform the token validation on its own. 619 Token Introspection Response (E): 620 The AS validates the token and returns the most recent parameters, 621 such as scope, audience, validity etc. associated with it back to 622 the RS. The RS then uses the received parameters to process the 623 request to either accept or to deny it. 625 Protected Resource (F): 626 If the request from the client is authorized, the RS fulfills the 627 request and returns a response with the appropriate response code. 628 The RS uses the dynamically established keys to protect the 629 response, according to used communication security protocol. 631 5. Framework 633 The following sections detail the profiling and extensions of OAuth 634 2.0 for constrained environments, which constitutes the ACE 635 framework. 637 Credential Provisioning 638 For IoT, it cannot be assumed that the client and RS are part of a 639 common key infrastructure, so the AS provisions credentials or 640 associated information to allow mutual authentication. These 641 credentials need to be provided to the parties before or during 642 the authentication protocol is executed, and may be re-used for 643 subsequent token requests. 645 Proof-of-Possession 646 The ACE framework, by default, implements proof-of-possession for 647 access tokens, i.e., that the token holder can prove being a 648 holder of the key bound to the token. The binding is provided by 649 the "cnf" claim [I-D.ietf-ace-cwt-proof-of-possession] indicating 650 what key is used for proof-of-possession. If a client needs to 651 submit a new access token, e.g., to obtain additional access 652 rights, they can request that the AS binds this token to the same 653 key as the previous one. 655 ACE Profiles 656 The client or RS may be limited in the encodings or protocols it 657 supports. To support a variety of different deployment settings, 658 specific interactions between client and RS are defined in an ACE 659 profile. In ACE framework the AS is expected to manage the 660 matching of compatible profile choices between a client and an RS. 661 The AS informs the client of the selected profile using the 662 "profile" parameter in the token response. 664 OAuth 2.0 requires the use of TLS both to protect the communication 665 between AS and client when requesting an access token; between client 666 and RS when accessing a resource and between AS and RS if 667 introspection is used. In constrained settings TLS is not always 668 feasible, or desirable. Nevertheless it is REQUIRED that the data 669 exchanged with the AS is encrypted, integrity protected and protected 670 against message replay. It is also REQUIRED that the AS and the 671 endpoint communicating with it (client or RS) perform mutual 672 authentication. Furthermore it MUST be assured that responses are 673 bound to the requests in the sense that the receiver of a response 674 can be certain that the response actually belongs to a certain 675 request. 677 Profiles MUST specify a communication security protocol that provides 678 the features required above. 680 In OAuth 2.0 the communication with the Token and the Introspection 681 endpoints at the AS is assumed to be via HTTP and may use Uri-query 682 parameters. When profiles of this framework use CoAP instead, this 683 framework REQUIRES the use of the following alternative instead of 684 Uri-query parameters: The sender (client or RS) encodes the 685 parameters of its request as a CBOR map and submits that map as the 686 payload of the POST request. Profiles that use CBOR encoding of 687 protocol message parameters MUST use the media format 'application/ 688 ace+cbor', unless the protocol message is wrapped in another Content- 689 Format (e.g. object security). If CoAP is used for communication, 690 the Content-Format MUST be abbreviated with the ID: 19 (see 691 Section 8.15. 693 The OAuth 2.0 AS uses a JSON structure in the payload of its 694 responses both to client and RS. If CoAP is used, this framework 695 REQUIRES the use of CBOR [RFC7049] instead of JSON. Depending on the 696 profile, the CBOR payload MAY be enclosed in a non-CBOR cryptographic 697 wrapper. 699 5.1. Discovering Authorization Servers 701 In order to determine the AS in charge of a resource hosted at the 702 RS, C MAY send an initial Unauthorized Resource Request message to 703 RS. RS then denies the request and sends the address of its AS back 704 to C. 706 Instead of the initial Unauthorized Resource Request message, other 707 discovery methods may be used, or the client may be pre-provisioned 708 with the address of the AS. 710 5.1.1. Unauthorized Resource Request Message 712 The optional Unauthorized Resource Request message is a request for a 713 resource hosted by RS for which no proper authorization is granted. 714 RS MUST treat any request for a protected resource as Unauthorized 715 Resource Request message when any of the following holds: 717 o The request has been received on an unprotected channel. 718 o RS has no valid access token for the sender of the request 719 regarding the requested action on that resource. 720 o RS has a valid access token for the sender of the request, but 721 this does not allow the requested action on the requested 722 resource. 724 Note: These conditions ensure that RS can handle requests 725 autonomously once access was granted and a secure channel has been 726 established between C and RS. The authz-info endpoint MUST NOT be 727 protected as specified above, in order to allow clients to upload 728 access tokens to RS (cf. Section 5.8.1). 730 Unauthorized Resource Request messages MUST be denied with a client 731 error response. In this response, the Resource Server SHOULD provide 732 proper AS Request Creation Hints to enable the Client to request an 733 access token from RS's AS as described in Section 5.1.2. 735 The handling of all client requests (including unauthorized ones) by 736 the RS is described in Section 5.8.2. 738 5.1.2. AS Request Creation Hints 740 The AS Request Creation Hints message is sent by RS as a response to 741 an Unauthorized Resource Request message (see Section 5.1.1) to help 742 the sender of the Unauthorized Resource Request message in acquiring 743 a valid access token. The AS Request Creation Hints message is CBOR 744 map, with a MANDATORY element "AS" specifying an absolute URI (see 745 Section 4.3 of [RFC3986]) that identifies the AS in charge of RS. 747 The message can also contain the following OPTIONAL parameters: 749 o A "req_aud" element containing a suggested audience that the 750 client should request towards the AS. 751 o A "kid" element containing the key identifier of a key used in an 752 existing security association between the client and the RS. The 753 RS expects the client to request an access token bound to this 754 key, in order to avoid having to re-establish the security 755 association. 756 o A "nonce" element containing a nonce generated by RS to ensure 757 freshness in case that the RS and AS do not have synchronized 758 clocks. 759 o A "scope" element containing the suggested scope that the client 760 should request towards the AS. 762 Figure 2 summarizes the parameters that may be part of the AS Request 763 Creation Hints. 765 /-----------+----------+---------------------\ 766 | Name | CBOR Key | Value Type | 767 |-----------+----------+---------------------| 768 | AS | 0 | text string | 769 | req_aud | 3 | text string | 770 | kid | 4 | byte string | 771 | nonce | 5 | byte string | 772 | scope | 9 | text or byte string | 773 \-----------+----------+---------------------/ 775 Figure 2: AS Request Creation Hints 777 Note that the schema part of the AS parameter may need to be adapted 778 to the security protocol that is used between the client and the AS. 779 Thus the example AS value "coap://as.example.com/token" might need to 780 be transformed to "coaps://as.example.com/token". It is assumed that 781 the client can determine the correct schema part on its own depending 782 on the way it communicates with the AS. 784 Figure 3 shows an example for an AS Request Creation Hints message 785 payload using CBOR [RFC7049] diagnostic notation, using the parameter 786 names instead of the CBOR keys for better human readability. 788 4.01 Unauthorized 789 Content-Format: application/ace+cbor 790 {AS: "coaps://as.example.com/token", 791 req_aud: "coaps://rs.example.com", 792 nonce: h'e0a156bb3f', 793 scope: "rTempC" 794 } 796 Figure 3: AS Request Creation Hints payload example 798 In this example, the attribute AS points the receiver of this message 799 to the URI "coaps://as.example.com/token" to request access 800 permissions. The originator of the AS Request Creation Hints payload 801 (i.e., RS) uses a local clock that is loosely synchronized with a 802 time scale common between RS and AS (e.g., wall clock time). 803 Therefore, it has included a parameter "nonce" for replay attack 804 prevention. 806 Figure 4 illustrates the mandatory to use binary encoding of the 807 message payload shown in Figure 3. 809 a2 # map(2) 810 00 # unsigned(0) (=AS) 811 78 1c # text(28) 812 636f6170733a2f2f61732e657861 813 6d706c652e636f6d2f746f6b656e # "coaps://as.example.com/token" 814 05 # unsigned(5) (=nonce) 815 45 # bytes(5) 816 e0a156bb3f 818 Figure 4: AS Request Creation Hints example encoded in CBOR 820 5.2. Authorization Grants 822 To request an access token, the client obtains authorization from the 823 resource owner or uses its client credentials as grant. The 824 authorization is expressed in the form of an authorization grant. 826 The OAuth framework [RFC6749] defines four grant types. The grant 827 types can be split up into two groups, those granted on behalf of the 828 resource owner (password, authorization code, implicit) and those for 829 the client (client credentials). Further grant types have been added 830 later, such as [RFC7521] defining an assertion-based authorization 831 grant. 833 The grant type is selected depending on the use case. In cases where 834 the client acts on behalf of the resource owner, authorization code 835 grant is recommended. If the client acts on behalf of the resource 836 owner, but does not have any display or very limited interaction 837 possibilities it is recommended to use the device code grant defined 838 in [I-D.ietf-oauth-device-flow]. In cases where the client does not 839 act on behalf of the resource owner, client credentials grant is 840 recommended. 842 For details on the different grant types, see the OAuth 2.0 framework 843 [RFC6749]. The OAuth 2.0 framework provides an extension mechanism 844 for defining additional grant types so profiles of this framework MAY 845 define additional grant types, if needed. 847 5.3. Client Credentials 849 Authentication of the client is mandatory independent of the grant 850 type when requesting the access token from the token endpoint. In 851 the case of client credentials grant type, the authentication and 852 grant coincide. 854 Client registration and provisioning of client credentials to the 855 client is out of scope for this specification. 857 The OAuth framework [RFC6749] defines one client credential type, 858 client id and client secret. [I-D.erdtman-ace-rpcc] adds raw-public- 859 key and pre-shared-key to the client credentials types. Profiles of 860 this framework MAY extend with additional client credentials client 861 certificates. 863 5.4. AS Authentication 865 Client credential does not, by default, authenticate the AS that the 866 client connects to. In classic OAuth, the AS is authenticated with a 867 TLS server certificate. 869 Profiles of this framework MUST specify how clients authenticate the 870 AS and how communication security is implemented, otherwise server 871 side TLS certificates, as defined by OAuth 2.0, are required. 873 5.5. The Authorization Endpoint 875 The authorization endpoint is used to interact with the resource 876 owner and obtain an authorization grant in certain grant flows. 877 Since it requires the use of a user agent (i.e., browser), it is not 878 expected that these types of grant flow will be used by constrained 879 clients. This endpoint is therefore out of scope for this 880 specification. Implementations should use the definition and 881 recommendations of [RFC6749] and [RFC6819]. 883 If clients involved cannot support HTTP and TLS, profiles MAY define 884 mappings for the authorization endpoint. 886 5.6. The Token Endpoint 888 In standard OAuth 2.0, the AS provides the token endpoint for 889 submitting access token requests. This framework extends the 890 functionality of the token endpoint, giving the AS the possibility to 891 help the client and RS to establish shared keys or to exchange their 892 public keys. Furthermore, this framework defines encodings using 893 CBOR, as a substitute for JSON. 895 The endpoint may, however, be exposed over HTTPS as in classical 896 OAuth or even other transports. A profile MUST define the details of 897 the mapping between the fields described below, and these transports. 898 If HTTPS is used, JSON or CBOR payloads may be supported. If JSON 899 payloads are used, the semantics of Section 4 of the OAuth 2.0 900 specification MUST be followed (with additions as described below). 901 If CBOR payload is supported, the semantics described below MUST be 902 followed. 904 For the AS to be able to issue a token, the client MUST be 905 authenticated and present a valid grant for the scopes requested. 906 Profiles of this framework MUST specify how the AS authenticates the 907 client and how the communication between client and AS is protected. 909 The default name of this endpoint in an url-path is '/token', however 910 implementations are not required to use this name and can define 911 their own instead. 913 The figures of this section use CBOR diagnostic notation without the 914 integer abbreviations for the parameters or their values for 915 illustrative purposes. Note that implementations MUST use the 916 integer abbreviations and the binary CBOR encoding, if the CBOR 917 encoding is used. 919 5.6.1. Client-to-AS Request 921 The client sends a POST request to the token endpoint at the AS. The 922 profile MUST specify how the communication is protected. The content 923 of the request consists of the parameters specified in Section 4 of 924 the OAuth 2.0 specification [RFC6749] with the exception of the 925 "grant_type" parameter, which is OPTIONAL in the context of this 926 framework (as opposed to REQUIRED in RFC6749). If that parameter is 927 missing, the default value "client_credentials" is implied. 929 In addition to these parameters, a client MUST be able to use the 930 parameters from [I-D.ietf-ace-oauth-params] in an access token 931 request to the token endpoint and the AS MUST be able to process 932 these additional parameters. 934 If CBOR is used then this parameter MUST be encoded as a CBOR map. 935 The "scope" parameter can be formatted as specified in [RFC6749] and 936 additionally as a byte string, in order to allow compact encoding of 937 complex scopes. 939 When HTTP is used as a transport then the client makes a request to 940 the token endpoint by sending the parameters using the "application/ 941 x-www-form-urlencoded" format with a character encoding of UTF-8 in 942 the HTTP request entity-body, as defined in RFC 6749. 944 The following examples illustrate different types of requests for 945 proof-of-possession tokens. 947 Figure 5 shows a request for a token with a symmetric proof-of- 948 possession key. The content is displayed in CBOR diagnostic 949 notation, without abbreviations for better readability. Note that 950 this example uses the "req_aud" parameter from 951 [I-D.ietf-ace-oauth-params]. 953 Header: POST (Code=0.02) 954 Uri-Host: "as.example.com" 955 Uri-Path: "token" 956 Content-Format: "application/ace+cbor" 957 Payload: 958 { 959 "grant_type" : "client_credentials", 960 "client_id" : "myclient", 961 "req_aud" : "tempSensor4711" 962 } 964 Figure 5: Example request for an access token bound to a symmetric 965 key. 967 Figure 6 shows a request for a token with an asymmetric proof-of- 968 possession key. Note that in this example OSCORE 969 [I-D.ietf-core-object-security] is used to provide object-security, 970 therefore the Content-Format is "application/oscore" wrapping the 971 "application/ace+cbor" type content. Also note that in this example 972 the audience is implicitly known by both client and AS. Furthermore 973 note that this example uses the "req_cnf" parameter from 974 [I-D.ietf-ace-oauth-params]. 976 Header: POST (Code=0.02) 977 Uri-Host: "as.example.com" 978 Uri-Path: "token" 979 OSCORE: 0x19, 0x05, 0x05, 0x44, 0x61, 0x6c, 0x65, 0x6b 980 Content-Format: "application/oscore" 981 Payload: 982 0x44025d1 ... (full payload omitted for brevity) ... 68b3825e 983 ) 985 Decrypted payload: 986 { 987 "grant_type" : "client_credentials", 988 "client_id" : "myclient", 989 "req_cnf" : { 990 "COSE_Key" : { 991 "kty" : "EC", 992 "kid" : h'11', 993 "crv" : "P-256", 994 "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', 995 "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' 996 } 997 } 998 } 1000 Figure 6: Example token request bound to an asymmetric key. 1002 Figure 7 shows a request for a token where a previously communicated 1003 proof-of-possession key is only referenced. Note that the client 1004 performs a password based authentication in this example by 1005 submitting its client_secret (see Section 2.3.1 of [RFC6749]). Note 1006 that this example uses the "req_aud" and "req_cnf" parameters from 1007 [I-D.ietf-ace-oauth-params]. 1009 Header: POST (Code=0.02) 1010 Uri-Host: "as.example.com" 1011 Uri-Path: "token" 1012 Content-Format: "application/ace+cbor" 1013 Payload: 1014 { 1015 "grant_type" : "client_credentials", 1016 "client_id" : "myclient", 1017 "client_secret" : "mysecret234", 1018 "req_aud" : "valve424", 1019 "scope" : "read", 1020 "req_cnf" : { 1021 "kid" : b64'6kg0dXJM13U' 1022 } 1023 } 1025 Figure 7: Example request for an access token bound to a key 1026 reference. 1028 Refresh tokens are typically not stored as securely as proof-of- 1029 possession keys in requesting clients. Proof-of-possession based 1030 refresh token requests MUST NOT request different proof-of-possession 1031 keys or different audiences in token requests. Refresh token 1032 requests can only use to request access tokens bound to the same 1033 proof-of-possession key and the same audience as access tokens issued 1034 in the initial token request. 1036 5.6.2. AS-to-Client Response 1038 If the access token request has been successfully verified by the AS 1039 and the client is authorized to obtain an access token corresponding 1040 to its access token request, the AS sends a response with the 1041 response code equivalent to the CoAP response code 2.01 (Created). 1042 If client request was invalid, or not authorized, the AS returns an 1043 error response as described in Section 5.6.3. 1045 Note that the AS decides which token type and profile to use when 1046 issuing a successful response. It is assumed that the AS has prior 1047 knowledge of the capabilities of the client and the RS (see 1048 Appendix D. This prior knowledge may, for example, be set by the use 1049 of a dynamic client registration protocol exchange [RFC7591]. 1051 The content of the successful reply is the Access Information. When 1052 using CBOR payloads, the content MUST be encoded as CBOR map, 1053 containing parameters as specified in Section 5.1 of [RFC6749], with 1054 the following additions and changes: 1056 profile: 1058 OPTIONAL. This indicates the profile that the client MUST use 1059 towards the RS. See Section 5.6.4.3 for the formatting of this 1060 parameter. If this parameter is absent, the AS assumes that the 1061 client implicitly knows which profile to use towards the RS. 1062 token_type: 1063 This parameter is OPTIONAL, as opposed to 'required' in [RFC6749]. 1064 By default implementations of this framework SHOULD assume that 1065 the token_type is "pop". If a specific use case requires another 1066 token_type (e.g., "Bearer") to be used then this parameter is 1067 REQUIRED. 1069 Furthermore [I-D.ietf-ace-oauth-params] defines additional parameters 1070 that the AS MUST be able to use when responding to a request to the 1071 token endpoint. 1073 Figure 8 summarizes the parameters that may be part of the Access 1074 Information. This does not include the additional parameters 1075 specified in [I-D.ietf-ace-oauth-params]. 1077 /-------------------+-------------------------------\ 1078 | Parameter name | Specified in | 1079 |-------------------+-------------------------------| 1080 | access_token | RFC 6749 | 1081 | token_type | RFC 6749 | 1082 | expires_in | RFC 6749 | 1083 | refresh_token | RFC 6749 | 1084 | scope | RFC 6749 | 1085 | state | RFC 6749 | 1086 | error | RFC 6749 | 1087 | error_description | RFC 6749 | 1088 | error_uri | RFC 6749 | 1089 | profile | [this document] | 1090 \-------------------+-------------------------------/ 1092 Figure 8: Access Information parameters 1094 Figure 9 shows a response containing a token and a "cnf" parameter 1095 with a symmetric proof-of-possession key, which is defined in 1096 [I-D.ietf-ace-oauth-params]. 1098 Header: Created (Code=2.01) 1099 Content-Format: "application/ace+cbor" 1100 Payload: 1101 { 1102 "access_token" : b64'SlAV32hkKG ... 1103 (remainder of CWT omitted for brevity; 1104 CWT contains COSE_Key in the "cnf" claim)', 1105 "profile" : "coap_dtls", 1106 "expires_in" : "3600", 1107 "cnf" : { 1108 "COSE_Key" : { 1109 "kty" : "Symmetric", 1110 "kid" : b64'39Gqlw', 1111 "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' 1112 } 1113 } 1114 } 1116 Figure 9: Example AS response with an access token bound to a 1117 symmetric key. 1119 5.6.3. Error Response 1121 The error responses for CoAP-based interactions with the AS are 1122 equivalent to the ones for HTTP-based interactions as defined in 1123 Section 5.2 of [RFC6749], with the following differences: 1125 o When using CBOR the raw payload before being processed by the 1126 communication security protocol MUST be encoded as a CBOR map. 1127 o A response code equivalent to the CoAP code 4.00 (Bad Request) 1128 MUST be used for all error responses, except for invalid_client 1129 where a response code equivalent to the CoAP code 4.01 1130 (Unauthorized) MAY be used under the same conditions as specified 1131 in Section 5.2 of [RFC6749]. 1132 o The content type (for CoAP-based interactions) or media type (for 1133 HTTP-based interactions) "application/ace+cbor" MUST be used for 1134 the error response. 1135 o The parameters "error", "error_description" and "error_uri" MUST 1136 be abbreviated using the codes specified in Figure 12, when a CBOR 1137 encoding is used. 1138 o The error code (i.e., value of the "error" parameter) MUST be 1139 abbreviated as specified in Figure 10, when a CBOR encoding is 1140 used. 1142 /------------------------+-------------\ 1143 | Name | CBOR Values | 1144 |------------------------+-------------| 1145 | invalid_request | 1 | 1146 | invalid_client | 2 | 1147 | invalid_grant | 3 | 1148 | unauthorized_client | 4 | 1149 | unsupported_grant_type | 5 | 1150 | invalid_scope | 6 | 1151 | unsupported_pop_key | 7 | 1152 | incompatible_profiles | 8 | 1153 \------------------------+-------------/ 1155 Figure 10: CBOR abbreviations for common error codes 1157 In addition to the error responses defined in OAuth 2.0, the 1158 following behavior MUST be implemented by the AS: 1160 o If the client submits an asymmetric key in the token request that 1161 the RS cannot process, the AS MUST reject that request with a 1162 response code equivalent to the CoAP code 4.00 (Bad Request) 1163 including the error code "unsupported_pop_key" defined in 1164 Figure 10. 1165 o If the client and the RS it has requested an access token for do 1166 not share a common profile, the AS MUST reject that request with a 1167 response code equivalent to the CoAP code 4.00 (Bad Request) 1168 including the error code "incompatible_profiles" defined in 1169 Figure 10. 1171 5.6.4. Request and Response Parameters 1173 This section provides more detail about the new parameters that can 1174 be used in access token requests and responses, as well as 1175 abbreviations for more compact encoding of existing parameters and 1176 common parameter values. 1178 5.6.4.1. Grant Type 1180 The abbreviations in Figure 11 MUST be used in CBOR encodings instead 1181 of the string values defined in [RFC6749], if CBOR payloads are used. 1183 /--------------------+------------+------------------------\ 1184 | Name | CBOR Value | Original Specification | 1185 |--------------------+------------+------------------------| 1186 | password | 0 | RFC6749 | 1187 | authorization_code | 1 | RFC6749 | 1188 | client_credentials | 2 | RFC6749 | 1189 | refresh_token | 3 | RFC6749 | 1190 \--------------------+------------+------------------------/ 1192 Figure 11: CBOR abbreviations for common grant types 1194 5.6.4.2. Token Type 1196 The "token_type" parameter, defined in [RFC6749], allows the AS to 1197 indicate to the client which type of access token it is receiving 1198 (e.g., a bearer token). 1200 This document registers the new value "pop" for the OAuth Access 1201 Token Types registry, specifying a proof-of-possession token. How 1202 the proof-of-possession by the client to the RS is performed MUST be 1203 specified by the profiles. 1205 The values in the "token_type" parameter MUST be CBOR text strings, 1206 if a CBOR encoding is used. 1208 In this framework the "pop" value for the "token_type" parameter is 1209 the default. The AS may, however, provide a different value. 1211 5.6.4.3. Profile 1213 Profiles of this framework MUST define the communication protocol and 1214 the communication security protocol between the client and the RS. 1215 The security protocol MUST provide encryption, integrity and replay 1216 protection. It MUST also provide a binding between requests and 1217 responses. Furthermore profiles MUST define proof-of-possession 1218 methods, if they support proof-of-possession tokens. 1220 A profile MUST specify an identifier that MUST be used to uniquely 1221 identify itself in the "profile" parameter. The textual 1222 representation of the profile identifier is just intended for human 1223 readability and MUST NOT be used in parameters and claims. 1225 Profiles MAY define additional parameters for both the token request 1226 and the Access Information in the access token response in order to 1227 support negotiation or signaling of profile specific parameters. 1229 5.6.5. Mapping Parameters to CBOR 1231 If CBOR encoding is used, all OAuth parameters in access token 1232 requests and responses MUST be mapped to CBOR types as specified in 1233 Figure 12, using the given integer abbreviation for the map keys. 1235 Note that we have aligned the abbreviations corresponding to claims 1236 with the abbreviations defined in [RFC8392]. 1238 Note also that abbreviations from -24 to 23 have a 1 byte encoding 1239 size in CBOR. We have thus chosen to assign abbreviations in that 1240 range to parameters we expect to be used most frequently in 1241 constrained scenarios. 1243 /-------------------+----------+---------------------\ 1244 | Name | CBOR Key | Value Type | 1245 |-------------------+----------+---------------------| 1246 | access_token | 1 | byte string | 1247 | scope | 9 | text or byte string | 1248 | client_id | 24 | text string | 1249 | client_secret | 25 | byte string | 1250 | response_type | 26 | text string | 1251 | redirect_uri | 27 | text string | 1252 | state | 28 | text string | 1253 | code | 29 | byte string | 1254 | error | 30 | unsigned integer | 1255 | error_description | 31 | text string | 1256 | error_uri | 32 | text string | 1257 | grant_type | 33 | unsigned integer | 1258 | token_type | 34 | unsigned integer | 1259 | expires_in | 35 | unsigned integer | 1260 | username | 36 | text string | 1261 | password | 37 | text string | 1262 | refresh_token | 38 | byte string | 1263 | profile | 39 | unsigned integer | 1264 \-------------------+----------+---------------------/ 1266 Figure 12: CBOR mappings used in token requests 1268 5.7. The Introspection Endpoint 1270 Token introspection [RFC7662] can be OPTIONALLY provided by the AS, 1271 and is then used by the RS and potentially the client to query the AS 1272 for metadata about a given token, e.g., validity or scope. Analogous 1273 to the protocol defined in RFC 7662 [RFC7662] for HTTP and JSON, this 1274 section defines adaptations to more constrained environments using 1275 CBOR and leaving the choice of the application protocol to the 1276 profile. 1278 Communication between the requesting entity and the introspection 1279 endpoint at the AS MUST be integrity protected and encrypted. The 1280 communication security protocol MUST also provide a binding between 1281 requests and responses. Furthermore the two interacting parties MUST 1282 perform mutual authentication. Finally the AS SHOULD verify that the 1283 requesting entity has the right to access introspection information 1284 about the provided token. Profiles of this framework that support 1285 introspection MUST specify how authentication and communication 1286 security between the requesting entity and the AS is implemented. 1288 The default name of this endpoint in an url-path is '/introspect', 1289 however implementations are not required to use this name and can 1290 define their own instead. 1292 The figures of this section uses CBOR diagnostic notation without the 1293 integer abbreviations for the parameters or their values for better 1294 readability. 1296 Note that supporting introspection is OPTIONAL for implementations of 1297 this framework. 1299 5.7.1. Introspection Request 1301 The requesting entity sends a POST request to the introspection 1302 endpoint at the AS, the profile MUST specify how the communication is 1303 protected. If CBOR is used, the payload MUST be encoded as a CBOR 1304 map with a "token" entry containing either the access token or a 1305 reference to the token (e.g., the cti). Further optional parameters 1306 representing additional context that is known by the requesting 1307 entity to aid the AS in its response MAY be included. 1309 For CoAP-based interaction, all messages MUST use the content type 1310 "application/ace+cbor", while for HTTP-based interactions the 1311 equivalent media type "application/ace+cbor" MUST be used. 1313 The same parameters are required and optional as in Section 2.1 of 1314 RFC 7662 [RFC7662]. 1316 For example, Figure 13 shows a RS calling the token introspection 1317 endpoint at the AS to query about an OAuth 2.0 proof-of-possession 1318 token. Note that object security based on OSCORE 1319 [I-D.ietf-core-object-security] is assumed in this example, therefore 1320 the Content-Format is "application/oscore". Figure 14 shows the 1321 decoded payload. 1323 Header: POST (Code=0.02) 1324 Uri-Host: "as.example.com" 1325 Uri-Path: "introspect" 1326 OSCORE: 0x09, 0x05, 0x25 1327 Content-Format: "application/oscore" 1328 Payload: 1329 ... COSE content ... 1331 Figure 13: Example introspection request. 1333 { 1334 "token" : b64'7gj0dXJQ43U', 1335 "token_type_hint" : "pop" 1336 } 1338 Figure 14: Decoded token. 1340 5.7.2. Introspection Response 1342 If the introspection request is authorized and successfully 1343 processed, the AS sends a response with the response code equivalent 1344 to the CoAP code 2.01 (Created). If the introspection request was 1345 invalid, not authorized or couldn't be processed the AS returns an 1346 error response as described in Section 5.7.3. 1348 In a successful response, the AS encodes the response parameters in a 1349 map including with the same required and optional parameters as in 1350 Section 2.2 of RFC 7662 [RFC7662] with the following addition: 1352 profile OPTIONAL. This indicates the profile that the RS MUST use 1353 with the client. See Section 5.6.4.3 for more details on the 1354 formatting of this parameter. 1356 Furthermore [I-D.ietf-ace-oauth-params] defines more parameters that 1357 the AS MUST be able to use when responding to a request to the 1358 introspection endpoint. 1360 For example, Figure 15 shows an AS response to the introspection 1361 request in Figure 13. Note that this example contains the "cnf" 1362 parameter defined in [I-D.ietf-ace-oauth-params]. 1364 Header: Created Code=2.01) 1365 Content-Format: "application/ace+cbor" 1366 Payload: 1367 { 1368 "active" : true, 1369 "scope" : "read", 1370 "profile" : "coap_dtls", 1371 "cnf" : { 1372 "COSE_Key" : { 1373 "kty" : "Symmetric", 1374 "kid" : b64'39Gqlw', 1375 "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' 1376 } 1377 } 1378 } 1380 Figure 15: Example introspection response. 1382 5.7.3. Error Response 1384 The error responses for CoAP-based interactions with the AS are 1385 equivalent to the ones for HTTP-based interactions as defined in 1386 Section 2.3 of [RFC7662], with the following differences: 1388 o If content is sent and CBOR is used the payload MUST be encoded as 1389 a CBOR map and the Content-Format "application/ace+cbor" MUST be 1390 used. 1391 o If the credentials used by the requesting entity (usually the RS) 1392 are invalid the AS MUST respond with the response code equivalent 1393 to the CoAP code 4.01 (Unauthorized) and use the required and 1394 optional parameters from Section 5.2 in RFC 6749 [RFC6749]. 1395 o If the requesting entity does not have the right to perform this 1396 introspection request, the AS MUST respond with a response code 1397 equivalent to the CoAP code 4.03 (Forbidden). In this case no 1398 payload is returned. 1399 o The parameters "error", "error_description" and "error_uri" MUST 1400 be abbreviated using the codes specified in Figure 12. 1401 o The error codes MUST be abbreviated using the codes specified in 1402 Figure 10. 1404 Note that a properly formed and authorized query for an inactive or 1405 otherwise invalid token does not warrant an error response by this 1406 specification. In these cases, the authorization server MUST instead 1407 respond with an introspection response with the "active" field set to 1408 "false". 1410 5.7.4. Mapping Introspection parameters to CBOR 1412 If CBOR is used, the introspection request and response parameters 1413 MUST be mapped to CBOR types as specified in Figure 16, using the 1414 given integer abbreviation for the map key. 1416 Note that we have aligned abbreviations that correspond to a claim 1417 with the abbreviations defined in [RFC8392] and the abbreviations of 1418 parameters with the same name from Section 5.6.5. 1420 /-------------------+----------+-------------------------\ 1421 | Parameter name | CBOR Key | Value Type | 1422 |-------------------+----------+-------------------------| 1423 | iss | 1 | text string | 1424 | sub | 2 | text string | 1425 | aud | 3 | text string | 1426 | exp | 4 | integer or | 1427 | | | floating-point number | 1428 | nbf | 5 | integer or | 1429 | | | floating-point number | 1430 | iat | 6 | integer or | 1431 | | | floating-point number | 1432 | cti | 7 | byte string | 1433 | scope | 9 | text or byte string | 1434 | active | 10 | True or False | 1435 | token | 12 | byte string | 1436 | client_id | 24 | text string | 1437 | error | 30 | unsigned integer | 1438 | error_description | 31 | text string | 1439 | error_uri | 32 | text string | 1440 | token_type_hint | 33 | text string | 1441 | token_type | 34 | text string | 1442 | username | 36 | text string | 1443 | profile | 39 | unsigned integer | 1444 \-------------------+----------+-------------------------/ 1446 Figure 16: CBOR Mappings to Token Introspection Parameters. 1448 5.8. The Access Token 1450 This framework RECOMMENDS the use of CBOR web token (CWT) as 1451 specified in [RFC8392]. 1453 In order to facilitate offline processing of access tokens, this 1454 document uses the "cnf" claim from 1455 [I-D.ietf-ace-cwt-proof-of-possession] and specifies the "scope" 1456 claim for JWT- and CWT-encoded tokens. 1458 The "scope" claim explicitly encodes the scope of a given access 1459 token. This claim follows the same encoding rules as defined in 1460 Section 3.3 of [RFC6749], but in addition implementers MAY use byte 1461 strings as scope values, to achieve compact encoding of large scope 1462 elements. The meaning of a specific scope value is application 1463 specific and expected to be known to the RS running that application. 1465 If the AS needs to convey a hint to the RS about which profile it 1466 should use to communicate with the client, the AS MAY include a 1467 "profile" claim in the access token, with the same syntax and 1468 semantics as defined in Section 5.6.4.3. 1470 5.8.1. The Authorization Information Endpoint 1472 The access token, containing authorization information and 1473 information about the key used by the client, needs to be transported 1474 to the RS so that the RS can authenticate and authorize the client 1475 request. 1477 This section defines a method for transporting the access token to 1478 the RS using a RESTful protocol such as CoAP. Profiles of this 1479 framework MAY define other methods for token transport. 1481 The method consists of an authz-info endpoint, implemented by the RS. 1482 A client using this method MUST make a POST request to the authz-info 1483 endpoint at the RS with the access token in the payload. The RS 1484 receiving the token MUST verify the validity of the token. If the 1485 token is valid, the RS MUST respond to the POST request with 2.01 1486 (Created). Section Section 5.8.1.1 outlines how an RS MUST proceed 1487 to verify the validity of an access token. 1489 The RS MUST be prepared to store at least one access token for future 1490 use. This is a difference to how access tokens are handled in OAuth 1491 2.0, where the access token is typically sent along with each 1492 request, and therefore not stored at the RS. 1494 This specification RECOMMENDS that an RS stores only one token per 1495 proof-of-possession key, meaning that an additional token linked to 1496 the same key will overwrite any existing token at the RS. 1498 If the payload sent to the authz-info endpoint does not parse to a 1499 token, the RS MUST respond with a response code equivalent to the 1500 CoAP code 4.00 (Bad Request). 1502 The RS MAY make an introspection request to validate the token before 1503 responding to the POST request to the authz-info endpoint. 1505 Profiles MUST specify whether the authz-info endpoint is protected, 1506 including whether error responses from this endpoint are protected. 1507 Note that since the token contains information that allow the client 1508 and the RS to establish a security context in the first place, mutual 1509 authentication may not be possible at this point. 1511 The default name of this endpoint in an url-path is '/authz-info', 1512 however implementations are not required to use this name and can 1513 define their own instead. 1515 A RS MAY use introspection on a token received through the authz-info 1516 endpoint, e.g. if the token is an opaque reference. Some transport 1517 protocols may provide a way to indicate that the RS is busy and the 1518 client should retry after an interval; this type of status update 1519 would be appropriate while the RS is waiting for an introspection 1520 response. 1522 5.8.1.1. Verifying an Access Token 1524 When an RS receives an access token, it MUST verify it before storing 1525 it. The details of token verification depends on various aspects, 1526 including the token encoding, the type of token, the security 1527 protection applied to the token, and the claims. The token encoding 1528 matters since the security wrapper differs between the token 1529 encodings. For example, a CWT token uses COSE while a JWT token uses 1530 JOSE. The type of token also has an influence on the verification 1531 procedure since tokens may be self-contained whereby token 1532 verification may happen locally at the RS while a token-by-reference 1533 requires further interaction with the authorization server, for 1534 example using token introspection, to obtain the claims associated 1535 with the token reference. Self-contained token MUST, at a minimum, 1536 be integrity protected but they MAY also be encrypted. 1538 For self-contained tokens the RS MUST process the security protection 1539 of the token first, as specified by the respective token format. For 1540 CWT the description can be found in [RFC8392] and for JWT the 1541 relevant specification is [RFC7519]. This MUST include a 1542 verification that security protection (and thus the token) was 1543 generated by an AS that has the right to issue access tokens for this 1544 RS. 1546 In case the token is communicated by reference the RS needs to obtain 1547 the claims first. When the RS uses token introspection the relevant 1548 specification is [RFC7662] with CoAP transport specified in 1549 Section 5.7. 1551 Errors may happen during this initial processing stage: 1553 o If token or claim verification fails, the RS MUST discard the 1554 token and, if this was an interaction with authz-info, return an 1555 error message with a response code equivalent to the CoAP code 1556 4.01 (Unauthorized). 1557 o If the claims cannot be obtained the RS MUST discard the token 1558 and, in case of an interaction via the authz-info endpoint, return 1559 an error message with a response code equivalent to the CoAP code 1560 4.00 (Bad Request). 1562 Next, the RS MUST verify claims, if present, contained in the access 1563 token. Errors are returned when claim checks fail, in the order of 1564 priority of this list: 1566 iss The issuer claim must identify an AS that has the authority to 1567 issue access tokens for the receiving RS. If that is not the case 1568 the RS MUST respond with a response code equivalent to the CoAP 1569 code 4.01 (Unauthorized). 1570 exp The expiration date must be in the future. If that is not the 1571 case the RS MUST respond with a response code equivalent to the 1572 CoAP code 4.01 (Unauthorized). Note that the RS has to terminate 1573 access rights to the protected resources at the time when the 1574 tokens expire. 1575 aud The audience claim must refer to an audience that the RS 1576 identifies with. If that is not the case the RS MUST respond with 1577 a response code equivalent to the CoAP code 4.03 (Forbidden). 1578 scope The RS must recognize value of the scope claim. If that is 1579 not the case the RS MUST respond with a response code equivalent 1580 to the CoAP code 4.00 (Bad Request). The RS MAY provide 1581 additional information in the error response, to clarify what went 1582 wrong. 1584 If the access token contains any other claims that the RS cannot 1585 process the RS MUST respond with a response code equivalent to the 1586 CoAP code 4.00 (Bad Request). The RS MAY provide additional detail 1587 in the error response to clarify which claim couldn't be processed. 1589 Note that the Subject (sub) claim cannot always be verified when the 1590 token is submitted to the RS since the client may not have 1591 authenticated yet. Also note that a counter for the expires_in (exi) 1592 claim MUST be initialized when the RS first verifies this token. 1594 When sending error responses, the RS MAY use the error codes from 1595 Section 3.1 of [RFC6750], to provide additional details to the 1596 client. 1598 5.8.1.2. Protecting the Authorization Information Endpoint 1600 As this framework can be used in RESTful environments, it is 1601 important to make sure that attackers cannot perform unauthorized 1602 requests on the auth-info endpoints, other than submitting access 1603 tokens. 1605 Specifically it SHOULD NOT be possible to perform GET, DELETE or PUT 1606 on the authz-info endpoint and on it's children (if any). 1608 The POST method SHOULD NOT be allowed on children of the authz-info 1609 endpoint. 1611 The RS SHOULD implement rate limiting measures to mitigate attacks 1612 aiming to overload the processing capacity of the RS by repeatedly 1613 submitting tokens. For CoAP-based communication the RS could use the 1614 mechanisms from [RFC8516] to indicate that it is overloaded. 1616 5.8.2. Client Requests to the RS 1618 If an RS receives a request from a client, and the target resource 1619 requires authorization, the RS MUST first verify that it has an 1620 access token that authorizes this request, and that the client has 1621 performed the proof-of-possession for that token. 1623 The response code MUST be 4.01 (Unauthorized) in case the client has 1624 not performed the proof-of-possession, or if RS has no valid access 1625 token for the client. If RS has an access token for the client but 1626 not for the resource that was requested, RS MUST reject the request 1627 with a 4.03 (Forbidden). If RS has an access token for the client 1628 but it does not cover the action that was requested on the resource, 1629 RS MUST reject the request with a 4.05 (Method Not Allowed). 1631 Note: The use of the response codes 4.03 and 4.05 is intended to 1632 prevent infinite loops where a dumb Client optimistically tries to 1633 access a requested resource with any access token received from AS. 1634 As malicious clients could pretend to be C to determine C's 1635 privileges, these detailed response codes must be used only when a 1636 certain level of security is already available which can be achieved 1637 only when the Client is authenticated. 1639 Note: The RS MAY use introspection for timely validation of an access 1640 token, at the time when a request is presented. 1642 Note: Matching the claims of the access token (e.g., scope) to a 1643 specific request is application specific. 1645 If the request matches a valid token and the client has performed the 1646 proof-of-possession for that token, the RS continues to process the 1647 request as specified by the underlying application. 1649 5.8.3. Token Expiration 1651 Depending on the capabilities of the RS, there are various ways in 1652 which it can verify the expiration of a received access token. Here 1653 follows a list of the possibilities including what functionality they 1654 require of the RS. 1656 o The token is a CWT and includes an "exp" claim and possibly the 1657 "nbf" claim. The RS verifies these by comparing them to values 1658 from its internal clock as defined in [RFC7519]. In this case the 1659 RS's internal clock must reflect the current date and time, or at 1660 least be synchronized with the AS's clock. How this clock 1661 synchronization would be performed is out of scope for this 1662 specification. 1663 o The RS verifies the validity of the token by performing an 1664 introspection request as specified in Section 5.7. This requires 1665 the RS to have a reliable network connection to the AS and to be 1666 able to handle two secure sessions in parallel (C to RS and AS to 1667 RS). 1668 o In order to support token expiration for devices that have no 1669 reliable way of synchronizing their internal clocks, this 1670 specification defines the following approach: The claim "exi" 1671 ("expires in") can be used, to provide the RS with the lifetime of 1672 the token in seconds from the time the RS first receives the 1673 token. This approach is of course vulnerable to malicious clients 1674 holding back tokens they do not want to expire. Such an attack 1675 can only be prevented if the RS is able to communicate with the AS 1676 in some regular intervals, so that the can AS provide the RS with 1677 a list of expired tokens. The drawback of this mitigation is that 1678 the RS might as well use the communication with the AS to 1679 synchronize its internal clock. 1681 If a token that authorizes a long running request such as a CoAP 1682 Observe [RFC7641] expires, the RS MUST send an error response with 1683 the response code equivalent to the CoAP code 4.01 (Unauthorized) to 1684 the client and then terminate processing the long running request. 1686 6. Security Considerations 1688 Security considerations applicable to authentication and 1689 authorization in RESTful environments provided in OAuth 2.0 [RFC6749] 1690 apply to this work. Furthermore [RFC6819] provides additional 1691 security considerations for OAuth which apply to IoT deployments as 1692 well. If the introspection endpoint is used, the security 1693 considerations from [RFC7662] also apply. 1695 A large range of threats can be mitigated by protecting the contents 1696 of the access token by using a digital signature or a keyed message 1697 digest (MAC) or an Authenticated Encryption with Associated Data 1698 (AEAD) algorithm. Consequently, the token integrity protection MUST 1699 be applied to prevent the token from being modified, particularly 1700 since it contains a reference to the symmetric key or the asymmetric 1701 key. If the access token contains the symmetric key, this symmetric 1702 key MUST be encrypted by the authorization server so that only the 1703 resource server can decrypt it. Note that using an AEAD algorithm is 1704 preferable over using a MAC unless the message needs to be publicly 1705 readable. 1707 If the token is intended for multiple recipients (i.e. an audience 1708 that is a group), integrity protection of the token with a symmetric 1709 key is not sufficient, since any of the recipients could modify the 1710 token undetected by the other recipients. Therefore a token with a 1711 multi-recipient audience MUST be protected with an asymmetric 1712 signature. 1714 It is important for the authorization server to include the identity 1715 of the intended recipient (the audience), typically a single resource 1716 server (or a list of resource servers), in the token. Using a single 1717 shared secret with multiple resource servers to simplify key 1718 management is NOT RECOMMENDED since the benefit from using the proof- 1719 of-possession concept is significantly reduced. 1721 The authorization server MUST offer confidentiality protection for 1722 any interactions with the client. This step is extremely important 1723 since the client may obtain the proof-of-possession key from the 1724 authorization server for use with a specific access token. Not using 1725 confidentiality protection exposes this secret (and the access token) 1726 to an eavesdropper thereby completely negating proof-of-possession 1727 security. Profiles MUST specify how confidentiality protection is 1728 provided, and additional protection can be applied by encrypting the 1729 token, for example encryption of CWTs is specified in Section 5.1 of 1730 [RFC8392]. 1732 Developers MUST ensure that the ephemeral credentials (i.e., the 1733 private key or the session key) are not leaked to third parties. An 1734 adversary in possession of the ephemeral credentials bound to the 1735 access token will be able to impersonate the client. Be aware that 1736 this is a real risk with many constrained environments, since 1737 adversaries can often easily get physical access to the devices. 1738 This risk can also be mitigated to some extent by making sure that 1739 keys are refreshed more frequently. 1741 If clients are capable of doing so, they should frequently request 1742 fresh access tokens, as this allows the AS to keep the lifetime of 1743 the tokens short. This allows the AS to use shorter proof-of- 1744 possession key sizes, which translate to a performance benefit for 1745 the client and for the resource server. Shorter keys also lead to 1746 shorter messages (particularly with asymmetric keying material). 1748 When authorization servers bind symmetric keys to access tokens, they 1749 SHOULD scope these access tokens to a specific permission. 1751 6.1. Unprotected AS Request Creation Hints 1753 Initially, no secure channel exists to protect the communication 1754 between C and RS. Thus, C cannot determine if the AS Request 1755 Creation Hints contained in an unprotected response from RS to an 1756 unauthorized request (see Section 5.1.2) are authentic. It is 1757 therefore advisable to provide C with a (possibly hard-coded) list of 1758 trustworthy authorization servers. AS Request Creation Hints 1759 referring to a URI not listed there would be ignored. 1761 6.2. Minimal security requirements for communication 1763 This section summarizes the minimal requirements for the 1764 communication security of the different protocol interactions. 1766 C-AS All communication between the client and the Authorization 1767 Server MUST be encrypted, integrity and replay protected. 1768 Furthermore responses from the AS to the client MUST be bound to 1769 the client's request to avoid attacks where the attacker swaps the 1770 intended response for an older one valid for a previous request. 1771 This requires that the client and the Authorization Server have 1772 previously exchanged either a shared secret, or their public keys 1773 in order to negotiate a secure communication. Furthermore the 1774 client MUST be able to determine whether an AS has the authority 1775 to issue access tokens for a certain RS. This can be done through 1776 pre-configured lists, or through an online lookup mechanism that 1777 in turn also must be secured. 1778 RS-AS The communication between the Resource Server and the 1779 Authorization Server via the introspection endpoint MUST be 1780 encrypted, integrity and replay protected. Furthermore responses 1781 from the AS to the RS MUST be bound to the RS's request. This 1782 requires that the client and the Authorization Server have 1783 previously exchanged either a shared secret, or their public keys 1784 in order to negotiate a secure communication. Furthermore the RS 1785 MUST be able to determine whether an AS has the authority to issue 1786 access tokens itself. This is usually configured out of band, but 1787 could also be performed through an online lookup mechanism 1788 provided that it is also secured in the same way. 1790 C-RS The initial communication between the client and the Resource 1791 Server can not be secured in general, since the RS is not in 1792 possession of on access token for that client, which would carry 1793 the necessary parameters. Certain security mechanisms (e.g. DTLS 1794 with server-side authentication via a certificate or a raw public 1795 key) can be possible and are RECOMMEND if supported by both 1796 parties. After the client has successfully transmitted the access 1797 token to the RS, a secure communication protocol MUST be 1798 established between client and RS for the actual resource request. 1799 This protocol MUST provide encryption, integrity and replay 1800 protection as well as a binding between requests and responses. 1801 This requires that the client learned either the RS's public key 1802 or received a symmetric proof-of-possession key bound to the 1803 access token from the AS. The RS must have learned either the 1804 client's public key or a shared symmetric key from the claims in 1805 the token or an introspection request. Since ACE does not provide 1806 profile negotiation between C and RS, the client MUST have learned 1807 what profile the RS supports (e.g. from the AS or pre-configured) 1808 and initiate the communication accordingly. 1810 6.3. Use of Nonces for Replay Protection 1812 The RS may add a nonce to the AS Request Creation Hints message sent 1813 as a response to an unauthorized request to ensure freshness of an 1814 Access Token subsequently presented to RS. While a time-stamp of 1815 some granularity would be sufficient to protect against replay 1816 attacks, using randomized nonce is preferred to prevent disclosure of 1817 information about RS's internal clock characteristics. 1819 6.4. Combining profiles 1821 There may be use cases were different profiles of this framework are 1822 combined. For example, an MQTT-TLS profile is used between the 1823 client and the RS in combination with a CoAP-DTLS profile for 1824 interactions between the client and the AS. Ideally, profiles should 1825 be designed in a way that the security of system should not depend on 1826 the specific security mechanisms used in individual protocol 1827 interactions. 1829 6.5. Unprotected Information 1831 Communication with the authz-info endpoint, as well as the various 1832 error responses defined in this framework all potentially include 1833 sending information over an unprotected channel. These messages may 1834 leak information to an adversary. For example errors responses for 1835 requests to the Authorization Information endpoint can reveal 1836 information about an otherwise opaque access token to an adversary 1837 who has intercepted this token. 1839 As far as error messages are concerned, this framework is written 1840 under the assumption that, in general, the benefits of detailed error 1841 messages outweigh the risk due to information leakage. For 1842 particular use cases, where this assessment does not apply, detailed 1843 error messages can be replaced by more generic ones. 1845 In some scenarios it may be possible to protect the communication 1846 with the authz-info endpoint (e.g. through DTLS with only server-side 1847 authentication). In cases where this is not possible this framework 1848 RECOMMENDS to use encrypted CWTs or opaque references and need to be 1849 subjected to introspection by the RS. 1851 If the initial unauthorized resource request message (see 1852 Section 5.1.1) is used, the client MUST make sure that it is not 1853 sending sensitive content in this request. While GET and DELETE 1854 requests only reveal the target URI of the resource, while POST and 1855 PUT requests would reveal the whole payload of the intended 1856 operation. 1858 6.6. Denial of service against or with Introspection 1860 The optional introspection mechanism provided by OAuth and supported 1861 in the ACE framework allows for two types of attacks that need to be 1862 considered by implementers. 1864 First an attacker could perform a denial of service attack against 1865 the introspection endpoint at the AS in order to prevent validation 1866 of access tokens. To mitigate this attack, an RS that is configured 1867 to use introspection MUST NOT allow access based on a token for which 1868 it couldn't reach the introspection endpoint. 1870 Second an attacker could use the fact that an RS performs 1871 introspection to perform a denial of service attack against that RS 1872 by repeatedly sending tokens to its authz-info endpoint that require 1873 an introspection call. RS can mitigate such attacks by implementing 1874 a rate limit on how many introspection requests they perform in a 1875 given time interval and rejecting incoming requests to authz-info for 1876 a certain amount of time, when that rate limit has been reached. 1878 7. Privacy Considerations 1880 Implementers and users should be aware of the privacy implications of 1881 the different possible deployments of this framework. 1883 The AS is in a very central position and can potentially learn 1884 sensitive information about the clients requesting access tokens. If 1885 the client credentials grant is used, the AS can track what kind of 1886 access the client intends to perform. With other grants this can be 1887 prevented by the Resource Owner. To do so, the resource owner needs 1888 to bind the grants it issues to anonymous, ephemeral credentials that 1889 do not allow the AS to link different grants and thus different 1890 access token requests by the same client. 1892 If access tokens are only integrity protected and not encrypted, they 1893 may reveal information to attackers listening on the wire, or able to 1894 acquire the access tokens in some other way. In the case of CWTs the 1895 token may, e.g., reveal the audience, the scope and the confirmation 1896 method used by the client. The latter may reveal the identity of the 1897 device or application running the client. This may be linkable to 1898 the identity of the person using the client (if there is a person and 1899 not a machine-to-machine interaction). 1901 Clients using asymmetric keys for proof-of-possession should be aware 1902 of the consequences of using the same key pair for proof-of- 1903 possession towards different RSs. A set of colluding RSs or an 1904 attacker able to obtain the access tokens will be able to link the 1905 requests, or even to determine the client's identity. 1907 An unprotected response to an unauthorized request (see 1908 Section 5.1.2) may disclose information about RS and/or its existing 1909 relationship with C. It is advisable to include as little 1910 information as possible in an unencrypted response. Means of 1911 encrypting communication between C and RS already exist, more 1912 detailed information may be included with an error response to 1913 provide C with sufficient information to react on that particular 1914 error. 1916 8. IANA Considerations 1918 8.1. ACE Authorization Server Request Creation Hints 1920 This specification establishes the IANA "ACE Authorization Server 1921 Request Creation Hints" registry. The registry has been created to 1922 use the "Expert Review Required" registration procedure [RFC8126]. 1923 It should be noted that, in addition to the expert review, some 1924 portions of the registry require a specification, potentially a 1925 Standards Track RFC, be supplied as well. 1927 The columns of the registry are: 1929 Name The name of the parameter 1930 CBOR Key CBOR map key for the parameter. Different ranges of values 1931 use different registration policies [RFC8126]. Integer values 1932 from -256 to 255 are designated as Standards Action. Integer 1933 values from -65536 to -257 and from 256 to 65535 are designated as 1934 Specification Required. Integer values greater than 65535 are 1935 designated as Expert Review. Integer values less than -65536 are 1936 marked as Private Use. 1937 Value Type The CBOR data types allowable for the values of this 1938 parameter. 1939 Reference This contains a pointer to the public specification of the 1940 grant type abbreviation, if one exists. 1942 This registry will be initially populated by the values in Figure 2. 1943 The Reference column for all of these entries will be this document. 1945 8.2. OAuth Extensions Error Registration 1947 This specification registers the following error values in the OAuth 1948 Extensions Error registry defined in [RFC6749]. 1950 o Error name: "unsupported_pop_key" 1951 o Error usage location: AS token endpoint error response 1952 o Related protocol extension: The ACE framework [this document] 1953 o Change Controller: IESG 1954 o Specification document(s): Section 5.6.3 of [this document] 1956 o Error name: "incompatible_profiles" 1957 o Error usage location: AS token endpoint error response 1958 o Related protocol extension: The ACE framework [this document] 1959 o Change Controller: IESG 1960 o Specification document(s): Section 5.6.3 of [this document] 1962 8.3. OAuth Error Code CBOR Mappings Registry 1964 This specification establishes the IANA "OAuth Error Code CBOR 1965 Mappings" registry. The registry has been created to use the "Expert 1966 Review Required" registration procedure [RFC8126]. It should be 1967 noted that, in addition to the expert review, some portions of the 1968 registry require a specification, potentially a Standards Track RFC, 1969 be supplied as well. 1971 The columns of the registry are: 1973 Name The OAuth Error Code name, refers to the name in Section 5.2. 1974 of [RFC6749], e.g., "invalid_request". 1975 CBOR Value CBOR abbreviation for this error code. Different ranges 1976 of values use different registration policies [RFC8126]. Integer 1977 values from -256 to 255 are designated as Standards Action. 1978 Integer values from -65536 to -257 and from 256 to 65535 are 1979 designated as Specification Required. Integer values greater than 1980 65535 are designated as Expert Review. Integer values less than 1981 -65536 are marked as Private Use. 1983 Reference This contains a pointer to the public specification of the 1984 grant type abbreviation, if one exists. 1986 This registry will be initially populated by the values in Figure 10. 1987 The Reference column for all of these entries will be this document. 1989 8.4. OAuth Grant Type CBOR Mappings 1991 This specification establishes the IANA "OAuth Grant Type CBOR 1992 Mappings" registry. The registry has been created to use the "Expert 1993 Review Required" registration procedure [RFC8126]. It should be 1994 noted that, in addition to the expert review, some portions of the 1995 registry require a specification, potentially a Standards Track RFC, 1996 be supplied as well. 1998 The columns of this registry are: 2000 Name The name of the grant type as specified in Section 1.3 of 2001 [RFC6749]. 2002 CBOR Value CBOR abbreviation for this grant type. Different ranges 2003 of values use different registration policies [RFC8126]. Integer 2004 values from -256 to 255 are designated as Standards Action. 2005 Integer values from -65536 to -257 and from 256 to 65535 are 2006 designated as Specification Required. Integer values greater than 2007 65535 are designated as Expert Review. Integer values less than 2008 -65536 are marked as Private Use. 2009 Reference This contains a pointer to the public specification of the 2010 grant type abbreviation, if one exists. 2011 Original Specification This contains a pointer to the public 2012 specification of the grant type, if one exists. 2014 This registry will be initially populated by the values in Figure 11. 2015 The Reference column for all of these entries will be this document. 2017 8.5. OAuth Access Token Types 2019 This section registers the following new token type in the "OAuth 2020 Access Token Types" registry [IANA.OAuthAccessTokenTypes]. 2022 o Name: "PoP" 2023 o Change Controller: IETF 2024 o Reference: [this document] 2026 8.6. OAuth Access Token Type CBOR Mappings 2028 This specification established the IANA "OAuth Access Token Type CBOR 2029 Mappings" registry. The registry has been created to use the "Expert 2030 Review Required" registration procedure [RFC8126]. It should be 2031 noted that, in addition to the expert review, some portions of the 2032 registry require a specification, potentially a Standards Track RFC, 2033 be supplied as well. 2035 The columns of this registry are: 2037 Name The name of token type as registered in the OAuth Access Token 2038 Types registry, e.g., "Bearer". 2039 CBOR Value CBOR abbreviation for this token type. Different ranges 2040 of values use different registration policies [RFC8126]. Integer 2041 values from -256 to 255 are designated as Standards Action. 2042 Integer values from -65536 to -257 and from 256 to 65535 are 2043 designated as Specification Required. Integer values greater than 2044 65535 are designated as Expert Review. Integer values less than 2045 -65536 are marked as Private Use. 2046 Reference This contains a pointer to the public specification of the 2047 OAuth token type abbreviation, if one exists. 2048 Original Specification This contains a pointer to the public 2049 specification of the grant type, if one exists. 2051 8.6.1. Initial Registry Contents 2053 o Name: "Bearer" 2054 o Value: 1 2055 o Reference: [this document] 2056 o Original Specification: [RFC6749] 2058 o Name: "pop" 2059 o Value: 2 2060 o Reference: [this document] 2061 o Original Specification: [this document] 2063 8.7. ACE Profile Registry 2065 This specification establishes the IANA "ACE Profile" registry. The 2066 registry has been created to use the "Expert Review Required" 2067 registration procedure [RFC8126]. It should be noted that, in 2068 addition to the expert review, some portions of the registry require 2069 a specification, potentially a Standards Track RFC, be supplied as 2070 well. 2072 The columns of this registry are: 2074 Name The name of the profile, to be used as value of the profile 2075 attribute. 2076 Description Text giving an overview of the profile and the context 2077 it is developed for. 2079 CBOR Value CBOR abbreviation for this profile name. Different 2080 ranges of values use different registration policies [RFC8126]. 2081 Integer values from -256 to 255 are designated as Standards 2082 Action. Integer values from -65536 to -257 and from 256 to 65535 2083 are designated as Specification Required. Integer values greater 2084 than 65535 are designated as Expert Review. Integer values less 2085 than -65536 are marked as Private Use. 2086 Reference This contains a pointer to the public specification of the 2087 profile abbreviation, if one exists. 2089 This registry will be initially empty and will be populated by the 2090 registrations from the ACE framework profiles. 2092 8.8. OAuth Parameter Registration 2094 This specification registers the following parameter in the "OAuth 2095 Parameters" registry [IANA.OAuthParameters]: 2097 o Name: "profile" 2098 o Parameter Usage Location: token response 2099 o Change Controller: IESG 2100 o Reference: Section 5.6.4.3 of [this document] 2102 8.9. OAuth Parameters CBOR Mappings Registry 2104 This specification establishes the IANA "OAuth Parameters CBOR 2105 Mappings" registry. The registry has been created to use the "Expert 2106 Review Required" registration procedure [RFC8126]. It should be 2107 noted that, in addition to the expert review, some portions of the 2108 registry require a specification, potentially a Standards Track RFC, 2109 be supplied as well. 2111 The columns of this registry are: 2113 Name The OAuth Parameter name, refers to the name in the OAuth 2114 parameter registry, e.g., "client_id". 2115 CBOR Key CBOR map key for this parameter. Different ranges of 2116 values use different registration policies [RFC8126]. Integer 2117 values from -256 to 255 are designated as Standards Action. 2118 Integer values from -65536 to -257 and from 256 to 65535 are 2119 designated as Specification Required. Integer values greater than 2120 65535 are designated as Expert Review. Integer values less than 2121 -65536 are marked as Private Use. 2122 Value Type The allowable CBOR data types for values of this 2123 parameter. 2124 Reference This contains a pointer to the public specification of the 2125 parameter abbreviation, if one exists. 2127 This registry will be initially populated by the values in Figure 12. 2128 The Reference column for all of these entries will be this document. 2130 Note that the mappings of parameters corresponding to claim names 2131 intentionally coincide with the CWT claim name mappings from 2132 [RFC8392]. 2134 8.10. OAuth Introspection Response Parameter Registration 2136 This specification registers the following parameter in the OAuth 2137 Token Introspection Response registry 2138 [IANA.TokenIntrospectionResponse]. 2140 o Name: "profile" 2141 o Description: The communication and communication security profile 2142 used between client and RS, as defined in ACE profiles. 2143 o Change Controller: IESG 2144 o Reference: Section 5.7.2 of [this document] 2146 8.11. OAuth Token Introspection Response CBOR Mappings Registry 2148 This specification establishes the IANA "OAuth Token Introspection 2149 Response CBOR Mappings" registry. The registry has been created to 2150 use the "Expert Review Required" registration procedure [RFC8126]. 2151 It should be noted that, in addition to the expert review, some 2152 portions of the registry require a specification, potentially a 2153 Standards Track RFC, be supplied as well. 2155 The columns of this registry are: 2157 Name The OAuth Parameter name, refers to the name in the OAuth 2158 parameter registry, e.g., "client_id". 2159 CBOR Key CBOR map key for this parameter. Different ranges of 2160 values use different registration policies [RFC8126]. Integer 2161 values from -256 to 255 are designated as Standards Action. 2162 Integer values from -65536 to -257 and from 256 to 65535 are 2163 designated as Specification Required. Integer values greater than 2164 65535 are designated as Expert Review. Integer values less than 2165 -65536 are marked as Private Use. 2166 Value Type The allowable CBOR data types for values of this 2167 parameter. 2168 Reference This contains a pointer to the public specification of the 2169 grant type abbreviation, if one exists. 2171 This registry will be initially populated by the values in Figure 16. 2172 The Reference column for all of these entries will be this document. 2174 Note that the mappings of parameters corresponding to claim names 2175 intentionally coincide with the CWT claim name mappings from 2176 [RFC8392]. 2178 8.12. JSON Web Token Claims 2180 This specification registers the following new claims in the JSON Web 2181 Token (JWT) registry of JSON Web Token Claims 2182 [IANA.JsonWebTokenClaims]: 2184 o Claim Name: "scope" 2185 o Claim Description: The scope of an access token as defined in 2186 [RFC6749]. 2187 o Change Controller: IESG 2188 o Reference: Section 5.8 of [this document] 2190 o Claim Name: "profile" 2191 o Claim Description: The profile a token is supposed to be used 2192 with. 2193 o Change Controller: IESG 2194 o Reference: Section 5.8 of [this document] 2196 o Claim Name: "exi" 2197 o Claim Description: "Expires in". Lifetime of the token in seconds 2198 from the time the RS first sees it. Used to implement a weaker 2199 from of token expiration for devices that cannot synchronize their 2200 internal clocks. 2201 o Change Controller: IESG 2202 o Reference: Section 5.8.3 of [this document] 2204 8.13. CBOR Web Token Claims 2206 This specification registers the following new claims in the "CBOR 2207 Web Token (CWT) Claims" registry [IANA.CborWebTokenClaims]. 2209 o Claim Name: "scope" 2210 o Claim Description: The scope of an access token as defined in 2211 [RFC6749]. 2212 o JWT Claim Name: scope 2213 o Claim Key: TBD (suggested: 9) 2214 o Claim Value Type(s): byte string or text string 2215 o Change Controller: IESG 2216 o Specification Document(s): Section 5.8 of [this document] 2218 o Claim Name: "profile" 2219 o Claim Description: The profile a token is supposed to be used 2220 with. 2221 o JWT Claim Name: profile 2222 o Claim Key: TBD (suggested: 39) 2223 o Claim Value Type(s): integer 2224 o Change Controller: IESG 2225 o Specification Document(s): Section 5.8 of [this document] 2227 o Claim Name: "exi" 2228 o Claim Description: The expiration time of a token measured from 2229 when it was received at the RS in seconds. 2230 o JWT Claim Name: exi 2231 o Claim Key: TBD (suggested: 41) 2232 o Claim Value Type(s): integer 2233 o Change Controller: IESG 2234 o Specification Document(s): Section 5.8 of [this document] 2236 8.14. Media Type Registrations 2238 This specification registers the 'application/ace+cbor' media type 2239 for messages of the protocols defined in this document carrying 2240 parameters encoded in CBOR. This registration follows the procedures 2241 specified in [RFC6838]. 2243 Type name: application 2245 Subtype name: ace+cbor 2247 Required parameters: none 2249 Optional parameters: none 2251 Encoding considerations: Must be encoded as CBOR map containing the 2252 protocol parameters defined in [this document]. 2254 Security considerations: See Section 6 of this document. 2256 Interoperability considerations: n/a 2258 Published specification: [this document] 2260 Applications that use this media type: The type is used by 2261 authorization servers, clients and resource servers that support the 2262 ACE framework as specified in [this document]. 2264 Additional information: 2266 Magic number(s): n/a 2268 File extension(s): .ace 2269 Macintosh file type code(s): n/a 2271 Person & email address to contact for further information: Ludwig 2272 Seitz 2274 Intended usage: COMMON 2276 Restrictions on usage: None 2278 Author: Ludwig Seitz 2280 Change controller: IESG 2282 8.15. CoAP Content-Format Registry 2284 This specification registers the following entry to the "CoAP 2285 Content-Formats" registry: 2287 Media Type: application/ace+cbor 2289 Encoding 2291 ID: 19 2293 Reference: [this document] 2295 8.16. Expert Review Instructions 2297 All of the IANA registries established in this document are defined 2298 as expert review. This section gives some general guidelines for 2299 what the experts should be looking for, but they are being designated 2300 as experts for a reason, so they should be given substantial 2301 latitude. 2303 Expert reviewers should take into consideration the following points: 2305 o Point squatting should be discouraged. Reviewers are encouraged 2306 to get sufficient information for registration requests to ensure 2307 that the usage is not going to duplicate one that is already 2308 registered, and that the point is likely to be used in 2309 deployments. The zones tagged as private use are intended for 2310 testing purposes and closed environments; code points in other 2311 ranges should not be assigned for testing. 2312 o Specifications are required for the standards track range of point 2313 assignment. Specifications should exist for specification 2314 required ranges, but early assignment before a specification is 2315 available is considered to be permissible. Specifications are 2316 needed for the first-come, first-serve range if they are expected 2317 to be used outside of closed environments in an interoperable way. 2318 When specifications are not provided, the description provided 2319 needs to have sufficient information to identify what the point is 2320 being used for. 2321 o Experts should take into account the expected usage of fields when 2322 approving point assignment. The fact that there is a range for 2323 standards track documents does not mean that a standards track 2324 document cannot have points assigned outside of that range. The 2325 length of the encoded value should be weighed against how many 2326 code points of that length are left, the size of device it will be 2327 used on, and the number of code points left that encode to that 2328 size. 2329 o Since a high degree of overlap is expected between these 2330 registries and the contents of the OAuth parameters 2331 [IANA.OAuthParameters] registries, experts should require new 2332 registrations to maintain a reasonable level of alignment with 2333 parameters from OAuth that have comparable functionality. 2335 9. Acknowledgments 2337 This document is a product of the ACE working group of the IETF. 2339 Thanks to Eve Maler for her contributions to the use of OAuth 2.0 and 2340 UMA in IoT scenarios, Robert Taylor for his discussion input, and 2341 Malisa Vucinic for his input on the predecessors of this proposal. 2343 Thanks to the authors of draft-ietf-oauth-pop-key-distribution, from 2344 where large parts of the security considerations where copied. 2346 Thanks to Stefanie Gerdes, Olaf Bergmann, and Carsten Bormann for 2347 contributing their work on AS discovery from draft-gerdes-ace-dcaf- 2348 authorize (see Section 5.1). 2350 Thanks to Jim Schaad and Mike Jones for their comprehensive reviews. 2352 Thanks to Benjamin Kaduk for his input on various questions related 2353 to this work. 2355 Ludwig Seitz and Goeran Selander worked on this document as part of 2356 the CelticPlus project CyberWI, with funding from Vinnova. 2358 10. References 2360 10.1. Normative References 2362 [I-D.ietf-ace-cwt-proof-of-possession] 2363 Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. 2364 Tschofenig, "Proof-of-Possession Key Semantics for CBOR 2365 Web Tokens (CWTs)", draft-ietf-ace-cwt-proof-of- 2366 possession-05 (work in progress), November 2018. 2368 [I-D.ietf-ace-oauth-params] 2369 Seitz, L., "Additional OAuth Parameters for Authorization 2370 in Constrained Environments (ACE)", draft-ietf-ace-oauth- 2371 params-03 (work in progress), January 2019. 2373 [IANA.CborWebTokenClaims] 2374 IANA, "CBOR Web Token (CWT) Claims", 2375 . 2378 [IANA.JsonWebTokenClaims] 2379 IANA, "JSON Web Token Claims", 2380 . 2382 [IANA.OAuthAccessTokenTypes] 2383 IANA, "OAuth Access Token Types", 2384 . 2387 [IANA.OAuthParameters] 2388 IANA, "OAuth Parameters", 2389 . 2392 [IANA.TokenIntrospectionResponse] 2393 IANA, "OAuth Token Introspection Response", 2394 . 2397 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2398 Requirement Levels", BCP 14, RFC 2119, 2399 DOI 10.17487/RFC2119, March 1997, . 2402 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2403 Resource Identifier (URI): Generic Syntax", STD 66, 2404 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2405 . 2407 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 2408 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 2409 January 2012, . 2411 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 2412 RFC 6749, DOI 10.17487/RFC6749, October 2012, 2413 . 2415 [RFC6750] Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 2416 Framework: Bearer Token Usage", RFC 6750, 2417 DOI 10.17487/RFC6750, October 2012, . 2420 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 2421 Specifications and Registration Procedures", BCP 13, 2422 RFC 6838, DOI 10.17487/RFC6838, January 2013, 2423 . 2425 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2426 Application Protocol (CoAP)", RFC 7252, 2427 DOI 10.17487/RFC7252, June 2014, . 2430 [RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection", 2431 RFC 7662, DOI 10.17487/RFC7662, October 2015, 2432 . 2434 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2435 Writing an IANA Considerations Section in RFCs", BCP 26, 2436 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2437 . 2439 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 2440 RFC 8152, DOI 10.17487/RFC8152, July 2017, 2441 . 2443 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2444 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2445 May 2017, . 2447 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 2448 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 2449 May 2018, . 2451 10.2. Informative References 2453 [I-D.erdtman-ace-rpcc] 2454 Seitz, L. and S. Erdtman, "Raw-Public-Key and Pre-Shared- 2455 Key as OAuth client credentials", draft-erdtman-ace- 2456 rpcc-02 (work in progress), October 2017. 2458 [I-D.ietf-core-object-security] 2459 Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 2460 "Object Security for Constrained RESTful Environments 2461 (OSCORE)", draft-ietf-core-object-security-15 (work in 2462 progress), August 2018. 2464 [I-D.ietf-oauth-device-flow] 2465 Denniss, W., Bradley, J., Jones, M., and H. Tschofenig, 2466 "OAuth 2.0 Device Flow for Browserless and Input 2467 Constrained Devices", draft-ietf-oauth-device-flow-14 2468 (work in progress), January 2019. 2470 [I-D.ietf-tls-dtls13] 2471 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 2472 Datagram Transport Layer Security (DTLS) Protocol Version 2473 1.3", draft-ietf-tls-dtls13-30 (work in progress), 2474 November 2018. 2476 [Margi10impact] 2477 Margi, C., de Oliveira, B., de Sousa, G., Simplicio Jr, 2478 M., Barreto, P., Carvalho, T., Naeslund, M., and R. Gold, 2479 "Impact of Operating Systems on Wireless Sensor Networks 2480 (Security) Applications and Testbeds", Proceedings of 2481 the 19th International Conference on Computer 2482 Communications and Networks (ICCCN), 2010 August. 2484 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2485 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 2486 . 2488 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 2489 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 2490 . 2492 [RFC6819] Lodderstedt, T., Ed., McGloin, M., and P. Hunt, "OAuth 2.0 2493 Threat Model and Security Considerations", RFC 6819, 2494 DOI 10.17487/RFC6819, January 2013, . 2497 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 2498 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 2499 October 2013, . 2501 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2502 Constrained-Node Networks", RFC 7228, 2503 DOI 10.17487/RFC7228, May 2014, . 2506 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2507 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 2508 DOI 10.17487/RFC7231, June 2014, . 2511 [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 2512 (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, 2513 . 2515 [RFC7521] Campbell, B., Mortimore, C., Jones, M., and Y. Goland, 2516 "Assertion Framework for OAuth 2.0 Client Authentication 2517 and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521, 2518 May 2015, . 2520 [RFC7591] Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and 2521 P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol", 2522 RFC 7591, DOI 10.17487/RFC7591, July 2015, 2523 . 2525 [RFC7641] Hartke, K., "Observing Resources in the Constrained 2526 Application Protocol (CoAP)", RFC 7641, 2527 DOI 10.17487/RFC7641, September 2015, . 2530 [RFC7744] Seitz, L., Ed., Gerdes, S., Ed., Selander, G., Mani, M., 2531 and S. Kumar, "Use Cases for Authentication and 2532 Authorization in Constrained Environments", RFC 7744, 2533 DOI 10.17487/RFC7744, January 2016, . 2536 [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in 2537 the Constrained Application Protocol (CoAP)", RFC 7959, 2538 DOI 10.17487/RFC7959, August 2016, . 2541 [RFC8252] Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps", 2542 BCP 212, RFC 8252, DOI 10.17487/RFC8252, October 2017, 2543 . 2545 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2546 Interchange Format", STD 90, RFC 8259, 2547 DOI 10.17487/RFC8259, December 2017, . 2550 [RFC8414] Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0 2551 Authorization Server Metadata", RFC 8414, 2552 DOI 10.17487/RFC8414, June 2018, . 2555 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 2556 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 2557 . 2559 [RFC8516] Keranen, A., ""Too Many Requests" 2560 Response Code for the Constrained Application Protocol", 2561 RFC 8516, DOI 10.17487/RFC8516, January 2019, 2562 . 2564 Appendix A. Design Justification 2566 This section provides further insight into the design decisions of 2567 the solution documented in this document. Section 3 lists several 2568 building blocks and briefly summarizes their importance. The 2569 justification for offering some of those building blocks, as opposed 2570 to using OAuth 2.0 as is, is given below. 2572 Common IoT constraints are: 2574 Low Power Radio: 2576 Many IoT devices are equipped with a small battery which needs to 2577 last for a long time. For many constrained wireless devices, the 2578 highest energy cost is associated to transmitting or receiving 2579 messages (roughly by a factor of 10 compared to AES) 2580 [Margi10impact]. It is therefore important to keep the total 2581 communication overhead low, including minimizing the number and 2582 size of messages sent and received, which has an impact of choice 2583 on the message format and protocol. By using CoAP over UDP and 2584 CBOR encoded messages, some of these aspects are addressed. 2585 Security protocols contribute to the communication overhead and 2586 can, in some cases, be optimized. For example, authentication and 2587 key establishment may, in certain cases where security 2588 requirements allow, be replaced by provisioning of security 2589 context by a trusted third party, using transport or application 2590 layer security. 2592 Low CPU Speed: 2594 Some IoT devices are equipped with processors that are 2595 significantly slower than those found in most current devices on 2596 the Internet. This typically has implications on what timely 2597 cryptographic operations a device is capable of performing, which 2598 in turn impacts, e.g., protocol latency. Symmetric key 2599 cryptography may be used instead of the computationally more 2600 expensive public key cryptography where the security requirements 2601 so allows, but this may also require support for trusted third 2602 party assisted secret key establishment using transport or 2603 application layer security. 2604 Small Amount of Memory: 2606 Microcontrollers embedded in IoT devices are often equipped with 2607 small amount of RAM and flash memory, which places limitations 2608 what kind of processing can be performed and how much code can be 2609 put on those devices. To reduce code size fewer and smaller 2610 protocol implementations can be put on the firmware of such a 2611 device. In this case, CoAP may be used instead of HTTP, symmetric 2612 key cryptography instead of public key cryptography, and CBOR 2613 instead of JSON. Authentication and key establishment protocol, 2614 e.g., the DTLS handshake, in comparison with assisted key 2615 establishment also has an impact on memory and code. 2617 User Interface Limitations: 2619 Protecting access to resources is both an important security as 2620 well as privacy feature. End users and enterprise customers may 2621 not want to give access to the data collected by their IoT device 2622 or to functions it may offer to third parties. Since the 2623 classical approach of requesting permissions from end users via a 2624 rich user interface does not work in many IoT deployment 2625 scenarios, these functions need to be delegated to user-controlled 2626 devices that are better suitable for such tasks, such as smart 2627 phones and tablets. 2629 Communication Constraints: 2631 In certain constrained settings an IoT device may not be able to 2632 communicate with a given device at all times. Devices may be 2633 sleeping, or just disconnected from the Internet because of 2634 general lack of connectivity in the area, for cost reasons, or for 2635 security reasons, e.g., to avoid an entry point for Denial-of- 2636 Service attacks. 2638 The communication interactions this framework builds upon (as 2639 shown graphically in Figure 1) may be accomplished using a variety 2640 of different protocols, and not all parts of the message flow are 2641 used in all applications due to the communication constraints. 2642 Deployments making use of CoAP are expected, but not limited to, 2643 other protocols such as HTTP, HTTP/2 or other specific protocols, 2644 such as Bluetooth Smart communication, that do not necessarily use 2645 IP could also be used. The latter raises the need for application 2646 layer security over the various interfaces. 2648 In the light of these constraints we have made the following design 2649 decisions: 2651 CBOR, COSE, CWT: 2653 This framework RECOMMENDS the use of CBOR [RFC7049] as data 2654 format. Where CBOR data needs to be protected, the use of COSE 2655 [RFC8152] is RECOMMENDED. Furthermore where self-contained tokens 2656 are needed, this framework RECOMMENDS the use of CWT [RFC8392]. 2657 These measures aim at reducing the size of messages sent over the 2658 wire, the RAM size of data objects that need to be kept in memory 2659 and the size of libraries that devices need to support. 2661 CoAP: 2663 This framework RECOMMENDS the use of CoAP [RFC7252] instead of 2664 HTTP. This does not preclude the use of other protocols 2665 specifically aimed at constrained devices, like, e.g., Bluetooth 2666 Low Energy (see Section 3.2). This aims again at reducing the 2667 size of messages sent over the wire, the RAM size of data objects 2668 that need to be kept in memory and the size of libraries that 2669 devices need to support. 2671 Access Information: 2673 This framework defines the name "Access Information" for data 2674 concerning the RS that the AS returns to the client in an access 2675 token response (see Section 5.6.2). This aims at enabling 2676 scenarios, where a powerful client, supporting multiple profiles, 2677 needs to interact with a RS for which it does not know the 2678 supported profiles and the raw public key. 2680 Proof-of-Possession: 2682 This framework makes use of proof-of-possession tokens, using the 2683 "cnf" claim [I-D.ietf-ace-cwt-proof-of-possession]. A 2684 semantically and syntactically identical request and response 2685 parameter is defined for the token endpoint, to allow requesting 2686 and stating confirmation keys. This aims at making token theft 2687 harder. Token theft is specifically relevant in constrained use 2688 cases, as communication often passes through middle-boxes, which 2689 could be able to steal bearer tokens and use them to gain 2690 unauthorized access. 2692 Auth-Info endpoint: 2694 This framework introduces a new way of providing access tokens to 2695 a RS by exposing a authz-info endpoint, to which access tokens can 2696 be POSTed. This aims at reducing the size of the request message 2697 and the code complexity at the RS. The size of the request 2698 message is problematic, since many constrained protocols have 2699 severe message size limitations at the physical layer (e.g., in 2700 the order of 100 bytes). This means that larger packets get 2701 fragmented, which in turn combines badly with the high rate of 2702 packet loss, and the need to retransmit the whole message if one 2703 packet gets lost. Thus separating sending of the request and 2704 sending of the access tokens helps to reduce fragmentation. 2706 Client Credentials Grant: 2708 This framework RECOMMENDS the use of the client credentials grant 2709 for machine-to-machine communication use cases, where manual 2710 intervention of the resource owner to produce a grant token is not 2711 feasible. The intention is that the resource owner would instead 2712 pre-arrange authorization with the AS, based on the client's own 2713 credentials. The client can then (without manual intervention) 2714 obtain access tokens from the AS. 2716 Introspection: 2718 This framework RECOMMENDS the use of access token introspection in 2719 cases where the client is constrained in a way that it can not 2720 easily obtain new access tokens (i.e. it has connectivity issues 2721 that prevent it from communicating with the AS). In that case 2722 this framework RECOMMENDS the use of a long-term token, that could 2723 be a simple reference. The RS is assumed to be able to 2724 communicate with the AS, and can therefore perform introspection, 2725 in order to learn the claims associated with the token reference. 2726 The advantage of such an approach is that the resource owner can 2727 change the claims associated to the token reference without having 2728 to be in contact with the client, thus granting or revoking access 2729 rights. 2731 Appendix B. Roles and Responsibilities 2733 Resource Owner 2735 * Make sure that the RS is registered at the AS. This includes 2736 making known to the AS which profiles, token_types, scopes, and 2737 key types (symmetric/asymmetric) the RS supports. Also making 2738 it known to the AS which audience(s) the RS identifies itself 2739 with. 2740 * Make sure that clients can discover the AS that is in charge of 2741 the RS. 2742 * If the client-credentials grant is used, make sure that the AS 2743 has the necessary, up-to-date, access control policies for the 2744 RS. 2746 Requesting Party 2748 * Make sure that the client is provisioned the necessary 2749 credentials to authenticate to the AS. 2750 * Make sure that the client is configured to follow the security 2751 requirements of the Requesting Party when issuing requests 2752 (e.g., minimum communication security requirements, trust 2753 anchors). 2754 * Register the client at the AS. This includes making known to 2755 the AS which profiles, token_types, and key types (symmetric/ 2756 asymmetric) the client. 2758 Authorization Server 2760 * Register the RS and manage corresponding security contexts. 2761 * Register clients and authentication credentials. 2762 * Allow Resource Owners to configure and update access control 2763 policies related to their registered RSs. 2764 * Expose the token endpoint to allow clients to request tokens. 2765 * Authenticate clients that wish to request a token. 2766 * Process a token request using the authorization policies 2767 configured for the RS. 2768 * Optionally: Expose the introspection endpoint that allows RS's 2769 to submit token introspection requests. 2770 * If providing an introspection endpoint: Authenticate RSs that 2771 wish to get an introspection response. 2772 * If providing an introspection endpoint: Process token 2773 introspection requests. 2774 * Optionally: Handle token revocation. 2775 * Optionally: Provide discovery metadata. See [RFC8414] 2776 * Optionally: Handle refresh tokens. 2778 Client 2780 * Discover the AS in charge of the RS that is to be targeted with 2781 a request. 2782 * Submit the token request (see step (A) of Figure 1). 2784 + Authenticate to the AS. 2785 + Optionally (if not pre-configured): Specify which RS, which 2786 resource(s), and which action(s) the request(s) will target. 2787 + If raw public keys (rpk) or certificates are used, make sure 2788 the AS has the right rpk or certificate for this client. 2789 * Process the access token and Access Information (see step (B) 2790 of Figure 1). 2792 + Check that the Access Information provides the necessary 2793 security parameters (e.g., PoP key, information on 2794 communication security protocols supported by the RS). 2795 + Safely store the proof-of-possession key. 2796 + If provided by the AS: Safely store the refresh token. 2797 * Send the token and request to the RS (see step (C) of 2798 Figure 1). 2800 + Authenticate towards the RS (this could coincide with the 2801 proof of possession process). 2802 + Transmit the token as specified by the AS (default is to the 2803 authz-info endpoint, alternative options are specified by 2804 profiles). 2805 + Perform the proof-of-possession procedure as specified by 2806 the profile in use (this may already have been taken care of 2807 through the authentication procedure). 2808 * Process the RS response (see step (F) of Figure 1) of the RS. 2810 Resource Server 2812 * Expose a way to submit access tokens. By default this is the 2813 authz-info endpoint. 2814 * Process an access token. 2816 + Verify the token is from a recognized AS. 2817 + Verify that the token applies to this RS. 2818 + Check that the token has not expired (if the token provides 2819 expiration information). 2820 + Check the token's integrity. 2821 + Store the token so that it can be retrieved in the context 2822 of a matching request. 2823 * Process a request. 2825 + Set up communication security with the client. 2826 + Authenticate the client. 2827 + Match the client against existing tokens. 2828 + Check that tokens belonging to the client actually authorize 2829 the requested action. 2830 + Optionally: Check that the matching tokens are still valid, 2831 using introspection (if this is possible.) 2832 * Send a response following the agreed upon communication 2833 security. 2834 * Safely store credentials such as raw public keys for 2835 authentication or proof-of-possession keys linked to access 2836 tokens. 2838 Appendix C. Requirements on Profiles 2840 This section lists the requirements on profiles of this framework, 2841 for the convenience of profile designers. 2843 o Specify the communication protocol the client and RS the must use 2844 (e.g., CoAP). Section 5 and Section 5.6.4.3 2845 o Specify the security protocol the client and RS must use to 2846 protect their communication (e.g., OSCORE or DTLS over CoAP). 2847 This must provide encryption, integrity and replay protection. 2848 Section 5.6.4.3 2849 o Specify how the client and the RS mutually authenticate. 2850 Section 4 2851 o Specify the proof-of-possession protocol(s) and how to select one, 2852 if several are available. Also specify which key types (e.g., 2853 symmetric/asymmetric) are supported by a specific proof-of- 2854 possession protocol. Section 5.6.4.2 2855 o Specify a unique profile identifier. Section 5.6.4.3 2856 o If introspection is supported: Specify the communication and 2857 security protocol for introspection. Section 5.7 2858 o Specify the communication and security protocol for interactions 2859 between client and AS. This must provide encryption, integrity 2860 protection, replay protection and a binding between requests and 2861 responses. Section 5 and Section 5.6 2862 o Specify how/if the authz-info endpoint is protected, including how 2863 error responses are protected. Section 5.8.1 2864 o Optionally define other methods of token transport than the authz- 2865 info endpoint. Section 5.8.1 2867 Appendix D. Assumptions on AS knowledge about C and RS 2869 This section lists the assumptions on what an AS should know about a 2870 client and a RS in order to be able to respond to requests to the 2871 token and introspection endpoints. How this information is 2872 established is out of scope for this document. 2874 o The identifier of the client or RS. 2875 o The profiles that the client or RS supports. 2876 o The scopes that the RS supports. 2877 o The audiences that the RS identifies with. 2878 o The key types (e.g., pre-shared symmetric key, raw public key, key 2879 length, other key parameters) that the client or RS supports. 2880 o The types of access tokens the RS supports (e.g., CWT). 2881 o If the RS supports CWTs, the COSE parameters for the crypto 2882 wrapper (e.g., algorithm, key-wrap algorithm, key-length). 2883 o The expiration time for access tokens issued to this RS (unless 2884 the RS accepts a default time chosen by the AS). 2885 o The symmetric key shared between client or RS and AS (if any). 2887 o The raw public key of the client or RS (if any). 2888 o Whether the RS has synchronized time (and thus is able to use the 2889 'exp' claim) or not. 2891 Appendix E. Deployment Examples 2893 There is a large variety of IoT deployments, as is indicated in 2894 Appendix A, and this section highlights a few common variants. This 2895 section is not normative but illustrates how the framework can be 2896 applied. 2898 For each of the deployment variants, there are a number of possible 2899 security setups between clients, resource servers and authorization 2900 servers. The main focus in the following subsections is on how 2901 authorization of a client request for a resource hosted by a RS is 2902 performed. This requires the security of the requests and responses 2903 between the clients and the RS to consider. 2905 Note: CBOR diagnostic notation is used for examples of requests and 2906 responses. 2908 E.1. Local Token Validation 2910 In this scenario, the case where the resource server is offline is 2911 considered, i.e., it is not connected to the AS at the time of the 2912 access request. This access procedure involves steps A, B, C, and F 2913 of Figure 1. 2915 Since the resource server must be able to verify the access token 2916 locally, self-contained access tokens must be used. 2918 This example shows the interactions between a client, the 2919 authorization server and a temperature sensor acting as a resource 2920 server. Message exchanges A and B are shown in Figure 17. 2922 A: The client first generates a public-private key pair used for 2923 communication security with the RS. 2924 The client sends the POST request to the token endpoint at the AS. 2925 The security of this request can be transport or application 2926 layer. It is up the the communication security profile to define. 2927 In the example transport layer identification of the AS is done 2928 and the client identifies with client_id and client_secret as in 2929 classic OAuth. The request contains the public key of the client 2930 and the Audience parameter set to "tempSensorInLivingRoom", a 2931 value that the temperature sensor identifies itself with. The AS 2932 evaluates the request and authorizes the client to access the 2933 resource. 2935 B: The AS responds with a PoP access token and Access Information. 2936 The PoP access token contains the public key of the client, and 2937 the Access Information contains the public key of the RS. For 2938 communication security this example uses DTLS RawPublicKey between 2939 the client and the RS. The issued token will have a short 2940 validity time, i.e., "exp" close to "iat", to protect the RS from 2941 replay attacks. The token includes the claim such as "scope" with 2942 the authorized access that an owner of the temperature device can 2943 enjoy. In this example, the "scope" claim, issued by the AS, 2944 informs the RS that the owner of the token, that can prove the 2945 possession of a key is authorized to make a GET request against 2946 the /temperature resource and a POST request on the /firmware 2947 resource. Note that the syntax and semantics of the scope claim 2948 are application specific. 2949 Note: In this example it is assumed that the client knows what 2950 resource it wants to access, and is therefore able to request 2951 specific audience and scope claims for the access token. 2953 Authorization 2954 Client Server 2955 | | 2956 |<=======>| DTLS Connection Establishment 2957 | | to identify the AS 2958 | | 2959 A: +-------->| Header: POST (Code=0.02) 2960 | POST | Uri-Path:"token" 2961 | | Content-Format: application/ace+cbor 2962 | | Payload: 2963 | | 2964 B: |<--------+ Header: 2.05 Content 2965 | 2.05 | Content-Format: application/ace+cbor 2966 | | Payload: 2967 | | 2969 Figure 17: Token Request and Response Using Client Credentials. 2971 The information contained in the Request-Payload and the Response- 2972 Payload is shown in Figure 18 Note that the parameter "rs_cnf" from 2973 [I-D.ietf-ace-oauth-params] is used to inform the client about the 2974 resource server's public key. 2976 Request-Payload : 2977 { 2978 "grant_type" : "client_credentials", 2979 "req_aud" : "tempSensorInLivingRoom", 2980 "client_id" : "myclient", 2981 "client_secret" : "qwerty" 2982 "req_cnf" : { 2983 "COSE_Key" : { 2984 "kid" : b64'1Bg8vub9tLe1gHMzV76e8', 2985 "kty" : "EC", 2986 "crv" : "P-256", 2987 "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', 2988 "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' 2989 } 2990 } 2991 } 2993 Response-Payload : 2994 { 2995 "access_token" : b64'SlAV32hkKG ...', 2996 "token_type" : "pop", 2997 "rs_cnf" : { 2998 "COSE_Key" : { 2999 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', 3000 "kty" : "EC", 3001 "crv" : "P-256", 3002 "x" : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4', 3003 "y" : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM' 3004 } 3005 } 3006 } 3008 Figure 18: Request and Response Payload Details. 3010 The content of the access token is shown in Figure 19. 3012 { 3013 "aud" : "tempSensorInLivingRoom", 3014 "iat" : "1360189224", 3015 "exp" : "1360289224", 3016 "scope" : "temperature_g firmware_p", 3017 "cnf" : { 3018 "COSE_Key" : { 3019 "kid" : b64'1Bg8vub9tLe1gHMzV76e8', 3020 "kty" : "EC", 3021 "crv" : "P-256", 3022 "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', 3023 "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' 3024 } 3025 } 3026 } 3028 Figure 19: Access Token including Public Key of the Client. 3030 Messages C and F are shown in Figure 20 - Figure 21. 3032 C: The client then sends the PoP access token to the authz-info 3033 endpoint at the RS. This is a plain CoAP request, i.e., no 3034 transport or application layer security is used between client and 3035 RS since the token is integrity protected between the AS and RS. 3036 The RS verifies that the PoP access token was created by a known 3037 and trusted AS, is valid, and has been issued to the client. The 3038 RS caches the security context together with authorization 3039 information about this client contained in the PoP access token. 3041 Resource 3042 Client Server 3043 | | 3044 C: +-------->| Header: POST (Code=0.02) 3045 | POST | Uri-Path:"authz-info" 3046 | | Payload: SlAV32hkKG ... 3047 | | 3048 |<--------+ Header: 2.04 Changed 3049 | 2.04 | 3050 | | 3052 Figure 20: Access Token provisioning to RS 3053 The client and the RS runs the DTLS handshake using the raw public 3054 keys established in step B and C. 3055 The client sends the CoAP request GET to /temperature on RS over 3056 DTLS. The RS verifies that the request is authorized, based on 3057 previously established security context. 3058 F: The RS responds with a resource representation over DTLS. 3060 Resource 3061 Client Server 3062 | | 3063 |<=======>| DTLS Connection Establishment 3064 | | using Raw Public Keys 3065 | | 3066 +-------->| Header: GET (Code=0.01) 3067 | GET | Uri-Path: "temperature" 3068 | | 3069 | | 3070 | | 3071 F: |<--------+ Header: 2.05 Content 3072 | 2.05 | Payload: 3073 | | 3075 Figure 21: Resource Request and Response protected by DTLS. 3077 E.2. Introspection Aided Token Validation 3079 In this deployment scenario it is assumed that a client is not able 3080 to access the AS at the time of the access request, whereas the RS is 3081 assumed to be connected to the back-end infrastructure. Thus the RS 3082 can make use of token introspection. This access procedure involves 3083 steps A-F of Figure 1, but assumes steps A and B have been carried 3084 out during a phase when the client had connectivity to AS. 3086 Since the client is assumed to be offline, at least for a certain 3087 period of time, a pre-provisioned access token has to be long-lived. 3088 Since the client is constrained, the token will not be self contained 3089 (i.e. not a CWT) but instead just a reference. The resource server 3090 uses its connectivity to learn about the claims associated to the 3091 access token by using introspection, which is shown in the example 3092 below. 3094 In the example interactions between an offline client (key fob), a RS 3095 (online lock), and an AS is shown. It is assumed that there is a 3096 provisioning step where the client has access to the AS. This 3097 corresponds to message exchanges A and B which are shown in 3098 Figure 22. 3100 Authorization consent from the resource owner can be pre-configured, 3101 but it can also be provided via an interactive flow with the resource 3102 owner. An example of this for the key fob case could be that the 3103 resource owner has a connected car, he buys a generic key that he 3104 wants to use with the car. To authorize the key fob he connects it 3105 to his computer that then provides the UI for the device. After that 3106 OAuth 2.0 implicit flow can used to authorize the key for his car at 3107 the the car manufacturers AS. 3109 Note: In this example the client does not know the exact door it will 3110 be used to access since the token request is not send at the time of 3111 access. So the scope and audience parameters are set quite wide to 3112 start with and new values different form the original once can be 3113 returned from introspection later on. 3115 A: The client sends the request using POST to the token endpoint 3116 at AS. The request contains the Audience parameter set to 3117 "PACS1337" (PACS, Physical Access System), a value the that the 3118 online door in question identifies itself with. The AS generates 3119 an access token as an opaque string, which it can match to the 3120 specific client, a targeted audience and a symmetric key. The 3121 security is provided by identifying the AS on transport layer 3122 using a pre shared security context (psk, rpk or certificate) and 3123 then the client is identified using client_id and client_secret as 3124 in classic OAuth. 3125 B: The AS responds with the an access token and Access 3126 Information, the latter containing a symmetric key. Communication 3127 security between C and RS will be DTLS and PreSharedKey. The PoP 3128 key is used as the PreSharedKey. 3130 Authorization 3131 Client Server 3132 | | 3133 | | 3134 A: +-------->| Header: POST (Code=0.02) 3135 | POST | Uri-Path:"token" 3136 | | Content-Format: application/ace+cbor 3137 | | Payload: 3138 | | 3139 B: |<--------+ Header: 2.05 Content 3140 | | Content-Format: application/ace+cbor 3141 | 2.05 | Payload: 3142 | | 3144 Figure 22: Token Request and Response using Client Credentials. 3146 The information contained in the Request-Payload and the Response- 3147 Payload is shown in Figure 23. 3149 Request-Payload: 3150 { 3151 "grant_type" : "client_credentials", 3152 "client_id" : "keyfob", 3153 "client_secret" : "qwerty" 3154 } 3156 Response-Payload: 3157 { 3158 "access_token" : b64'VGVzdCB0b2tlbg==', 3159 "token_type" : "pop", 3160 "cnf" : { 3161 "COSE_Key" : { 3162 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', 3163 "kty" : "oct", 3164 "alg" : "HS256", 3165 "k": b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE' 3166 } 3167 } 3168 } 3170 Figure 23: Request and Response Payload for C offline 3172 The access token in this case is just an opaque byte string 3173 referencing the authorization information at the AS. 3175 C: Next, the client POSTs the access token to the authz-info 3176 endpoint in the RS. This is a plain CoAP request, i.e., no DTLS 3177 between client and RS. Since the token is an opaque string, the 3178 RS cannot verify it on its own, and thus defers to respond the 3179 client with a status code until after step E. 3180 D: The RS forwards the token to the introspection endpoint on the 3181 AS. Introspection assumes a secure connection between the AS and 3182 the RS, e.g., using transport of application layer security. In 3183 the example AS is identified using pre shared security context 3184 (psk, rpk or certificate) while RS is acting as client and is 3185 identified with client_id and client_secret. 3186 E: The AS provides the introspection response containing 3187 parameters about the token. This includes the confirmation key 3188 (cnf) parameter that allows the RS to verify the client's proof of 3189 possession in step F. 3190 After receiving message E, the RS responds to the client's POST in 3191 step C with the CoAP response code 2.01 (Created). 3193 Resource 3194 Client Server 3195 | | 3196 C: +-------->| Header: POST (T=CON, Code=0.02) 3197 | POST | Uri-Path:"authz-info" 3198 | | Payload: b64'VGVzdCB0b2tlbg==' 3199 | | 3200 | | Authorization 3201 | | Server 3202 | | | 3203 | D: +--------->| Header: POST (Code=0.02) 3204 | | POST | Uri-Path: "introspect" 3205 | | | Content-Format: "application/ace+cbor" 3206 | | | Payload: 3207 | | | 3208 | E: |<---------+ Header: 2.05 Content 3209 | | 2.05 | Content-Format: "application/ace+cbor" 3210 | | | Payload: 3211 | | | 3212 | | 3213 |<--------+ Header: 2.01 Created 3214 | 2.01 | 3215 | | 3217 Figure 24: Token Introspection for C offline 3218 The information contained in the Request-Payload and the Response- 3219 Payload is shown in Figure 25. 3221 Request-Payload: 3222 { 3223 "token" : b64'VGVzdCB0b2tlbg==', 3224 "client_id" : "FrontDoor", 3225 "client_secret" : "ytrewq" 3226 } 3228 Response-Payload: 3229 { 3230 "active" : true, 3231 "aud" : "lockOfDoor4711", 3232 "scope" : "open, close", 3233 "iat" : 1311280970, 3234 "cnf" : { 3235 "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk' 3236 } 3237 } 3239 Figure 25: Request and Response Payload for Introspection 3241 The client uses the symmetric PoP key to establish a DTLS 3242 PreSharedKey secure connection to the RS. The CoAP request PUT is 3243 sent to the uri-path /state on the RS, changing the state of the 3244 door to locked. 3245 F: The RS responds with a appropriate over the secure DTLS 3246 channel. 3248 Resource 3249 Client Server 3250 | | 3251 |<=======>| DTLS Connection Establishment 3252 | | using Pre Shared Key 3253 | | 3254 +-------->| Header: PUT (Code=0.03) 3255 | PUT | Uri-Path: "state" 3256 | | Payload: 3257 | | 3258 F: |<--------+ Header: 2.04 Changed 3259 | 2.04 | Payload: 3260 | | 3262 Figure 26: Resource request and response protected by OSCORE 3264 Appendix F. Document Updates 3266 RFC EDITOR: PLEASE REMOVE THIS SECTION. 3268 F.1. Version -18 to -19 3270 o Added definition of "Authorization Information". 3271 o Explicitly state that ACE allows encoding refresh tokens in binary 3272 format in addition to strings. 3273 o Renamed "AS Information" to "AS Request Creation Hints" and added 3274 the possibility to specify req_aud and scope as hints. 3275 o Added the "kid" parameter to AS Request Creation Hints. 3276 o Added security considerations about the integrity protection of 3277 tokens with multi-RS audiences. 3278 o Renamed IANA registries mapping OAuth parameters to reflect the 3279 mapped registry. 3280 o Added JWT claim names to CWT claim registrations. 3281 o Added expert review instructions. 3282 o Updated references to TLS from 1.2 to 1.3. 3284 F.2. Version -17 to -18 3286 o Added OSCORE options in examples involving OSCORE. 3287 o Removed requirement for the client to send application/cwt, since 3288 the client has no way to know. 3290 o Clarified verification of tokens by the RS. 3291 o Added exi claim CWT registration. 3293 F.3. Version -16 to -17 3295 o Added references to (D)TLS 1.3. 3296 o Added requirement that responses are bound to requests. 3297 o Specify that grant_type is OPTIONAL in C2AS requests (as opposed 3298 to REQUIRED in OAuth). 3299 o Replaced examples with hypothetical COSE profile with OSCORE. 3300 o Added requirement for content type application/ace+cbor in error 3301 responses for token and introspection requests and responses. 3302 o Reworked abbreviation space for claims, request and response 3303 parameters. 3304 o Added text that the RS may indicate that it is busy at the authz- 3305 info resource. 3306 o Added section that specifies how the RS verifies an access token. 3307 o Added section on the protection of the authz-info endpoint. 3308 o Removed the expiration mechanism based on sequence numbers. 3309 o Added reference to RFC7662 security considerations. 3310 o Added considerations on minimal security requirements for 3311 communication. 3312 o Added security considerations on unprotected information sent to 3313 authz-info and in the error responses. 3315 F.4. Version -15 to -16 3317 o Added text the RS using RFC6750 error codes. 3318 o Defined an error code for incompatible token request parameters. 3319 o Removed references to the actors draft. 3320 o Fixed errors in examples. 3322 F.5. Version -14 to -15 3324 o Added text about refresh tokens. 3325 o Added text about protection of credentials. 3326 o Rephrased introspection so that other entities than RS can do it. 3327 o Editorial improvements. 3329 F.6. Version -13 to -14 3331 o Split out the 'aud', 'cnf' and 'rs_cnf' parameters to 3332 [I-D.ietf-ace-oauth-params] 3333 o Introduced the "application/ace+cbor" Content-Type. 3334 o Added claim registrations from 'profile' and 'rs_cnf'. 3335 o Added note on schema part of AS Information Section 5.1.2 3336 o Realigned the parameter abbreviations to push rarely used ones to 3337 the 2-byte encoding size of CBOR integers. 3339 F.7. Version -12 to -13 3341 o Changed "Resource Information" to "Access Information" to avoid 3342 confusion. 3343 o Clarified section about AS discovery. 3344 o Editorial changes 3346 F.8. Version -11 to -12 3348 o Moved the Request error handling to a section of its own. 3349 o Require the use of the abbreviation for profile identifiers. 3350 o Added rs_cnf parameter in the introspection response, to inform 3351 RS' with several RPKs on which key to use. 3352 o Allowed use of rs_cnf as claim in the access token in order to 3353 inform an RS with several RPKs on which key to use. 3354 o Clarified that profiles must specify if/how error responses are 3355 protected. 3356 o Fixed label number range to align with COSE/CWT. 3357 o Clarified the requirements language in order to allow profiles to 3358 specify other payload formats than CBOR if they do not use CoAP. 3360 F.9. Version -10 to -11 3362 o Fixed some CBOR data type errors. 3363 o Updated boilerplate text 3365 F.10. Version -09 to -10 3367 o Removed CBOR major type numbers. 3368 o Removed the client token design. 3369 o Rephrased to clarify that other protocols than CoAP can be used. 3370 o Clarifications regarding the use of HTTP 3372 F.11. Version -08 to -09 3374 o Allowed scope to be byte strings. 3375 o Defined default names for endpoints. 3376 o Refactored the IANA section for briefness and consistency. 3377 o Refactored tables that define IANA registry contents for 3378 consistency. 3379 o Created IANA registry for CBOR mappings of error codes, grant 3380 types and Authorization Server Information. 3381 o Added references to other document sections defining IANA entries 3382 in the IANA section. 3384 F.12. Version -07 to -08 3386 o Moved AS discovery from the DTLS profile to the framework, see 3387 Section 5.1. 3388 o Made the use of CBOR mandatory. If you use JSON you can use 3389 vanilla OAuth. 3390 o Made it mandatory for profiles to specify C-AS security and RS-AS 3391 security (the latter only if introspection is supported). 3392 o Made the use of CBOR abbreviations mandatory. 3393 o Added text to clarify the use of token references as an 3394 alternative to CWTs. 3395 o Added text to clarify that introspection must not be delayed, in 3396 case the RS has to return a client token. 3397 o Added security considerations about leakage through unprotected AS 3398 discovery information, combining profiles and leakage through 3399 error responses. 3400 o Added privacy considerations about leakage through unprotected AS 3401 discovery. 3402 o Added text that clarifies that introspection is optional. 3403 o Made profile parameter optional since it can be implicit. 3404 o Clarified that CoAP is not mandatory and other protocols can be 3405 used. 3406 o Clarified the design justification for specific features of the 3407 framework in appendix A. 3408 o Clarified appendix E.2. 3409 o Removed specification of the "cnf" claim for CBOR/COSE, and 3410 replaced with references to [I-D.ietf-ace-cwt-proof-of-possession] 3412 F.13. Version -06 to -07 3414 o Various clarifications added. 3415 o Fixed erroneous author email. 3417 F.14. Version -05 to -06 3419 o Moved sections that define the ACE framework into a subsection of 3420 the framework Section 5. 3421 o Split section on client credentials and grant into two separate 3422 sections, Section 5.2, and Section 5.3. 3423 o Added Section 5.4 on AS authentication. 3424 o Added Section 5.5 on the Authorization endpoint. 3426 F.15. Version -04 to -05 3428 o Added RFC 2119 language to the specification of the required 3429 behavior of profile specifications. 3430 o Added Section 5.3 on the relation to the OAuth2 grant types. 3432 o Added CBOR abbreviations for error and the error codes defined in 3433 OAuth2. 3434 o Added clarification about token expiration and long-running 3435 requests in Section 5.8.3 3436 o Added security considerations about tokens with symmetric pop keys 3437 valid for more than one RS. 3438 o Added privacy considerations section. 3439 o Added IANA registry mapping the confirmation types from RFC 7800 3440 to equivalent COSE types. 3441 o Added appendix D, describing assumptions about what the AS knows 3442 about the client and the RS. 3444 F.16. Version -03 to -04 3446 o Added a description of the terms "framework" and "profiles" as 3447 used in this document. 3448 o Clarified protection of access tokens in section 3.1. 3449 o Clarified uses of the "cnf" parameter in section 6.4.5. 3450 o Clarified intended use of Client Token in section 7.4. 3452 F.17. Version -02 to -03 3454 o Removed references to draft-ietf-oauth-pop-key-distribution since 3455 the status of this draft is unclear. 3456 o Copied and adapted security considerations from draft-ietf-oauth- 3457 pop-key-distribution. 3458 o Renamed "client information" to "RS information" since it is 3459 information about the RS. 3460 o Clarified the requirements on profiles of this framework. 3461 o Clarified the token endpoint protocol and removed negotiation of 3462 "profile" and "alg" (section 6). 3463 o Renumbered the abbreviations for claims and parameters to get a 3464 consistent numbering across different endpoints. 3465 o Clarified the introspection endpoint. 3466 o Renamed token, introspection and authz-info to "endpoint" instead 3467 of "resource" to mirror the OAuth 2.0 terminology. 3468 o Updated the examples in the appendices. 3470 F.18. Version -01 to -02 3472 o Restructured to remove communication security parts. These shall 3473 now be defined in profiles. 3474 o Restructured section 5 to create new sections on the OAuth 3475 endpoints token, introspection and authz-info. 3476 o Pulled in material from draft-ietf-oauth-pop-key-distribution in 3477 order to define proof-of-possession key distribution. 3478 o Introduced the "cnf" parameter as defined in RFC7800 to reference 3479 or transport keys used for proof of possession. 3481 o Introduced the "client-token" to transport client information from 3482 the AS to the client via the RS in conjunction with introspection. 3483 o Expanded the IANA section to define parameters for token request, 3484 introspection and CWT claims. 3485 o Moved deployment scenarios to the appendix as examples. 3487 F.19. Version -00 to -01 3489 o Changed 5.1. from "Communication Security Protocol" to "Client 3490 Information". 3491 o Major rewrite of 5.1 to clarify the information exchanged between 3492 C and AS in the PoP access token request profile for IoT. 3494 * Allow the client to indicate preferences for the communication 3495 security protocol. 3496 * Defined the term "Client Information" for the additional 3497 information returned to the client in addition to the access 3498 token. 3499 * Require that the messages between AS and client are secured, 3500 either with (D)TLS or with COSE_Encrypted wrappers. 3501 * Removed dependency on OSCOAP and added generic text about 3502 object security instead. 3503 * Defined the "rpk" parameter in the client information to 3504 transmit the raw public key of the RS from AS to client. 3505 * (D)TLS MUST use the PoP key in the handshake (either as PSK or 3506 as client RPK with client authentication). 3507 * Defined the use of x5c, x5t and x5tS256 parameters when a 3508 client certificate is used for proof of possession. 3509 * Defined "tktn" parameter for signaling for how to transfer the 3510 access token. 3511 o Added 5.2. the CoAP Access-Token option for transferring access 3512 tokens in messages that do not have payload. 3513 o 5.3.2. Defined success and error responses from the RS when 3514 receiving an access token. 3515 o 5.6.:Added section giving guidance on how to handle token 3516 expiration in the absence of reliable time. 3517 o Appendix B Added list of roles and responsibilities for C, AS and 3518 RS. 3520 Authors' Addresses 3522 Ludwig Seitz 3523 RISE 3524 Scheelevaegen 17 3525 Lund 223 70 3526 Sweden 3528 Email: ludwig.seitz@ri.se 3529 Goeran Selander 3530 Ericsson 3531 Faroegatan 6 3532 Kista 164 80 3533 Sweden 3535 Email: goran.selander@ericsson.com 3537 Erik Wahlstroem 3538 Sweden 3540 Email: erik@wahlstromstekniska.se 3542 Samuel Erdtman 3543 Spotify AB 3544 Birger Jarlsgatan 61, 4tr 3545 Stockholm 113 56 3546 Sweden 3548 Email: erdtman@spotify.com 3550 Hannes Tschofenig 3551 Arm Ltd. 3552 Absam 6067 3553 Austria 3555 Email: Hannes.Tschofenig@arm.com