idnits 2.17.1 draft-ietf-ace-oscore-profile-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 5, 2018) is 2243 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 (-15) exists of draft-ietf-ace-cbor-web-token-12 == Outdated reference: A later version (-46) exists of draft-ietf-ace-oauth-authz-10 == Outdated reference: A later version (-16) exists of draft-ietf-core-object-security-08 ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) == Outdated reference: A later version (-07) exists of draft-ietf-ace-actors-06 == Outdated reference: A later version (-14) exists of draft-selander-ace-cose-ecdhe-07 -- 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: 1 error (**), 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 SICS AB 4 Intended status: Standards Track F. Palombini 5 Expires: September 6, 2018 Ericsson AB 6 M. Gunnarsson 7 RISE SICS AB 8 G. Selander 9 Ericsson AB 10 March 5, 2018 12 OSCORE profile of the Authentication and Authorization for Constrained 13 Environments Framework 14 draft-ietf-ace-oscore-profile-01 16 Abstract 18 This memo specifies a profile for the Authentication and 19 Authorization for Constrained Environments (ACE) framework. It 20 utilizes Object Security for Constrained RESTful Environments 21 (OSCORE) to provide communication security, server authentication, 22 and proof-of-possession for a key owned by the client and bound to an 23 OAuth 2.0 access token. 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on September 6, 2018. 42 Copyright Notice 44 Copyright (c) 2018 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 60 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 61 2. Client to Resource Server . . . . . . . . . . . . . . . . . . 3 62 2.1. Signaling the use of OSCORE . . . . . . . . . . . . . . . 3 63 2.2. Key establishment for OSCORE . . . . . . . . . . . . . . 4 64 3. Client to Authorization Server . . . . . . . . . . . . . . . 7 65 4. Resource Server to Authorization Server . . . . . . . . . . . 7 66 5. Security Considerations . . . . . . . . . . . . . . . . . . . 7 67 6. Privacy Considerations . . . . . . . . . . . . . . . . . . . 8 68 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 69 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 70 8.1. Normative References . . . . . . . . . . . . . . . . . . 9 71 8.2. Informative References . . . . . . . . . . . . . . . . . 10 72 Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 10 73 Appendix B. Using the pop-key with EDHOC (EDHOC+OSCORE) . . . . 11 74 B.1. Using Asymmetric Keys . . . . . . . . . . . . . . . . . . 12 75 B.2. Using Symmetric Keys . . . . . . . . . . . . . . . . . . 13 76 B.3. Processing . . . . . . . . . . . . . . . . . . . . . . . 15 77 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 16 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17 80 1. Introduction 82 This memo specifies a profile of the ACE framework 83 [I-D.ietf-ace-oauth-authz]. In this profile, a client and a resource 84 server use CoAP [RFC7252] to communicate. The client uses an access 85 token, bound to a key (the proof-of-possession key) to authorize its 86 access to the resource server. In order to provide communication 87 security, proof of possession, and server authentication they use 88 Object Security for Constrained RESTful Environments (OSCORE) 89 [I-D.ietf-core-object-security]. Optionally the client and the 90 resource server may also use CoAP and OSCORE to communicate with the 91 authorization server. 93 OSCORE specifies how to use CBOR Object Signing and Encryption (COSE) 94 [RFC8152] to secure CoAP messages. In order to provide replay and 95 reordering protection OSCORE also introduces sequence numbers that 96 are used together with COSE. 98 Note that OSCORE can be used to secure CoAP messages, as well as HTTP 99 and combinations of HTTP and CoAP; a profile of ACE similar to the 100 one described in this document, with the difference of using HTTP 101 instead of CoAP as communication protocol, could be specified 102 analogously to this one. 104 1.1. Terminology 106 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 107 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 108 document are to be interpreted as described in [RFC2119]. These 109 words may also appear in this document in lowercase, absent their 110 normative meanings. 112 Certain security-related terms such as "authentication", 113 "authorization", "confidentiality", "(data) integrity", "message 114 authentication code", and "verify" are taken from [RFC4949]. 116 Since we describe exchanges as RESTful protocol interactions HTTP 117 [RFC7231] offers useful terminology. 119 Terminology for entities in the architecture is defined in OAuth 2.0 120 [RFC6749] and [I-D.ietf-ace-actors], such as client (C), resource 121 server (RS), and authorization server (AS). It is assumed in this 122 document that a given resource on a specific RS is associated to a 123 unique AS. 125 2. Client to Resource Server 127 The use of OSCORE for arbitrary CoAP messages is specified in 128 [I-D.ietf-core-object-security]. This section defines the specific 129 uses and their purpose for securing the communication between a 130 client and a resource server, and the parameters needed to negotiate 131 the use of this profile with the token resource at the authorization 132 server as specified in section 5.6 of the ACE framework 133 [I-D.ietf-ace-oauth-authz]. 135 2.1. Signaling the use of OSCORE 137 A client requests a token at an AS via the /token resource. This 138 follows the message formats specified in section 5.6.1 of the ACE 139 framework [I-D.ietf-ace-oauth-authz]. 141 The AS responding to a successful access token request as defined in 142 section 5.6.2 of the ACE framework can signal that the use of OSCORE 143 is REQUIRED for a specific access token by including the "profile" 144 parameter with the value "coap_oscore" in the access token response. 145 This means that the client MUST use OSCORE towards all resource 146 servers for which this access token is valid, and follow Section 2.2 147 to derive the security context to run OSCORE. 149 The error response procedures defined in section 5.6.3 of the ACE 150 framework are unchanged by this profile. 152 Note the the client and the authorization server MAY OPTIONALLY use 153 OSCORE to protect the interaction via the /token resource. See 154 Section 3 for details. 156 2.2. Key establishment for OSCORE 158 Section 3.2 of OSCORE [I-D.ietf-core-object-security] defines how to 159 derive a security context based on a shared master secret and a set 160 of other parameters, established between client and server. The 161 proof-of-possession key (pop-key) provisioned from the AS MAY, in 162 case of pre-shared keys, be used directly as master secret in OSCORE. 164 If OSCORE is used directly with the symmetric pop-key as master 165 secret, then the AS MUST provision the following data, in response to 166 the access token request: 168 o a master secret 169 o the sender identifier 170 o the recipient identifier 172 Additionally, the AS MAY provision the following data, in the same 173 response. In case these parameters are omitted, the default values 174 are used as described in section 3.2 of 175 [I-D.ietf-core-object-security]. 177 o an AEAD algorithm 178 o a KDF algorithm 179 o a salt 180 o a replay window type and size 182 The master secret MUST be communicated as COSE_Key in the 'cnf' 183 parameter of the access token response as defined in section 5.6.4.5 184 of [I-D.ietf-ace-oauth-authz]. The AEAD algorithm MAY be included as 185 the 'alg' parameter in the COSE_Key; the KDF algorithm MAY be 186 included as the 'kdf' parameter of the COSE_Key and the salt MAY be 187 included as the 'slt' parameter of the COSE_Key as defined in table 188 1. 190 The same parameters MUST be included as metadata of the access token; 191 if the token is a CWT [I-D.ietf-ace-cbor-web-token], the same 192 COSE_Key structure MUST be placed in the 'cnf' claim of this token. 194 If a CWT is used it MUST be encrypted, since the token is transferred 195 from the client to the RS over an unprotected channel. 197 The AS MUST also assign identifiers to both client and RS, which are 198 then used as Sender ID and Recipient ID in the OSCORE context as 199 described in section 3.1 of [I-D.ietf-core-object-security]. These 200 identifiers MUST be unique in the set of all clients and RS 201 identifiers for a certain AS. Moreover, these MUST be included in 202 the COSE_Key as header parameters, as defined in table 1. 204 We assume in this document that a resource is associated to one 205 single AS, which makes it possible to assume unique identifiers for 206 each client requesting a particular resource to a RS. If this is not 207 the case, collisions of identifiers may appear in the RS, in which 208 case the RS needs to have a mechanism in place to disambiguate 209 identifiers or mitigate their effect. 211 Note that C should set the Sender ID of its security context to the 212 clientId value received and the Recipient ID to the serverId value, 213 and RS should do the opposite. 215 +----------+-------+--------------+------------+-------------------+ 216 | name | label | CBOR type | registry | description | 217 +----------+-------+--------------+------------+-------------------+ 218 | clientId | 6 | bstr | | Identifies the | 219 | | | | | client in an | 220 | | | | | OSCORE context | 221 | | | | | using this key | 222 | | | | | | 223 | serverId | 7 | bstr | | Identifies the | 224 | | | | | server in an | 225 | | | | | OSCORE context | 226 | | | | | using this key | 227 | | | | | | 228 | kdf | 8 | bstr | | Identifies the | 229 | | | | | KDF algorithm in | 230 | | | | | an OSCORE context | 231 | | | | | using this key | 232 | | | | | | 233 | slt | 9 | bstr | | Identifies the | 234 | | | | | master salt in | 235 | | | | | an OSCORE context | 236 | | | | | using this key | 237 +----------+-------+--------------+------------+-------------------+ 238 Table 1: Additional common header parameters for COSE_Key 240 Figure 1 shows an example of such an AS response, in CBOR diagnostic 241 notation without the tag and value abbreviations. 243 Header: Created (Code=2.01) 244 Content-Type: "application/cose+cbor" 245 Payload: 246 { 247 "access_token" : b64'SlAV32hkKG ... 248 (remainder of access token omitted for brevity)', 249 "profile" : "coap_oscore", 250 "expires_in" : "3600", 251 "cnf" : { 252 "COSE_Key" : { 253 "kty" : "Symmetric", 254 "alg" : "AES-CCM-16-64-128", 255 "clientId" : b64'qA', 256 "serverId" : b64'Qg', 257 "k" : b64'+a+Dg2jjU+eIiOFCa9lObw' 258 } 259 } 260 } 262 Figure 1: Example AS response with OSCORE parameters. 264 Figure 2 shows an example CWT, containing the necessary OSCORE 265 parameters in the 'cnf' claim, in CBOR diagnostic notation without 266 tag and value abbreviations. 268 { 269 "aud" : "tempSensorInLivingRoom", 270 "iat" : "1360189224", 271 "exp" : "1360289224", 272 "scope" : "temperature_g firmware_p", 273 "cnf" : { 274 "COSE_Key" : { 275 "kty" : "Symmetric", 276 "alg" : "AES-CCM-16-64-128", 277 "clientId" : b64'Qg', 278 "serverId" : b64'qA', 279 "k" : b64'+a+Dg2jjU+eIiOFCa9lObw' 280 } 281 } 283 Figure 2: Example CWT with OSCORE parameters. 285 Note that the proof-of-possession required to bind the access token 286 to the client is implicitly performed by generating the shared OSCORE 287 context using the pop-key as master secret, both on the client and RS 288 side. An attacker using a stolen token will not be able to generate 289 a valid OSCORE context and thus not be able to prove possession of 290 the pop-key. 292 3. Client to Authorization Server 294 As specified in the ACE framework section 5.6 295 [I-D.ietf-ace-oauth-authz], the Client and AS can also use CoAP 296 instead of HTTP to communicate via the token resource. This section 297 specifies how to use OSCORE between Client and AS together with CoAP. 298 The use of OSCORE for this communication is OPTIONAL in this profile, 299 other security protocols (such as DTLS) MAY be used instead. 301 The client and the AS are expected to have pre-established security 302 contexts in place. How these security contexts are established is 303 out of scope for this profile. Furthermore the client and the AS 304 communicate using OSCORE ([I-D.ietf-core-object-security]) through 305 the introspection resource as specified in section 5.7 of 306 [I-D.ietf-ace-oauth-authz]. 308 4. Resource Server to Authorization Server 310 As specified in the ACE framework section 5.7 311 [I-D.ietf-ace-oauth-authz], the RS and AS can also use CoAP instead 312 of HTTP to communicate via the introspection resource. This section 313 specifies how to use OSCORE between RS and AS. The use of OSCORE for 314 this communication is OPTIONAL in this profile, other security 315 protocols (such as DTLS) MAY be used instead. 317 The RS and the AS are expected to have pre-established security 318 contexts in place. How these security contexts are established is 319 out of scope for this profile. Furthermore the RS and the AS 320 communicate using OSCORE ([I-D.ietf-core-object-security]) through 321 the introspection resource as specified in section 5.7 of 322 [I-D.ietf-ace-oauth-authz]. 324 5. Security Considerations 326 This document specifies a profile for the Authentication and 327 Authorization for Constrained Environments (ACE) framework 328 [I-D.ietf-ace-oauth-authz]. Thus the general security considerations 329 from the framework also apply to this profile. 331 Furthermore the general security considerations of OSCORE 332 [I-D.ietf-core-object-security] also apply to this specific use of 333 the OSCORE protocol. 335 OSCORE is designed to secure point-to-point communication, providing 336 a secure binding between the request and the response(s). Thus the 337 basic OSCORE protocol is not intended for use in point-to-multipoint 338 communication (e.g. multicast, publish-subscribe). Implementers of 339 this profile should make sure that their usecase corresponds to the 340 expected use of OSCORE, to prevent weakening the security assurances 341 provided by OSCORE. 343 6. Privacy Considerations 345 TBD. 347 7. IANA Considerations 349 Note to RFC Editor: Please replace all occurrences of "[[this 350 specification]]" with the RFC number of this specification and delete 351 this paragraph. 353 The following registration is done for the ACE OAuth Profile Registry 354 following the procedure specified in section 8.6 of 355 [I-D.ietf-ace-oauth-authz]: 357 o Profile name: coap_oscore 358 o Profile Description: Profile for using OSCORE to secure 359 communication between constrained nodes using the Authentication 360 and Authorization for Constrained Environments framework. 361 o Profile ID: 2 362 o Change Controller: IESG 363 o Specification Document(s): [[this specification]] 365 The following registrations are done for the COSE Key Common 366 Parameter Registry specified in section 16.5 of [RFC8152]: 368 o Name: clientId 369 o Label: 6 370 o CBOR Type: bstr 371 o Value Registry: N/A 372 o Description: Identifies the client in an OSCORE context 373 o Reference: [[this specification]] 375 o Name: serverId 376 o Label: 7 377 o Value Type: bstr 378 o Value Registry: N/A 379 o Description: Identifies the server in an OSCORE context 380 o Reference: [[this specification]] 382 o Name: kdf 383 o Label: 8 384 o Value Type: bstr 385 o Value Registry: COSE Algorithms registry 386 o Description: Identifies the KDF algorithm to be used in an OSCORE 387 context 388 o Reference: [[this specification]] 390 o Name: slt 391 o Label: 9 392 o Value Type: bstr 393 o Value Registry: N/A 394 o Description: Identifies the master salt of to be used in an OSCORE 395 context 396 o Reference: [[this specification]] 398 8. References 400 8.1. Normative References 402 [I-D.ietf-ace-cbor-web-token] 403 Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 404 "CBOR Web Token (CWT)", draft-ietf-ace-cbor-web-token-12 405 (work in progress), February 2018. 407 [I-D.ietf-ace-oauth-authz] 408 Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and 409 H. Tschofenig, "Authentication and Authorization for 410 Constrained Environments (ACE)", draft-ietf-ace-oauth- 411 authz-10 (work in progress), February 2018. 413 [I-D.ietf-core-object-security] 414 Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 415 "Object Security for Constrained RESTful Environments 416 (OSCORE)", draft-ietf-core-object-security-08 (work in 417 progress), January 2018. 419 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 420 Requirement Levels", BCP 14, RFC 2119, 421 DOI 10.17487/RFC2119, March 1997, . 424 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 425 Application Protocol (CoAP)", RFC 7252, 426 DOI 10.17487/RFC7252, June 2014, . 429 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 430 RFC 8152, DOI 10.17487/RFC8152, July 2017, 431 . 433 8.2. Informative References 435 [I-D.gerdes-ace-dcaf-authorize] 436 Gerdes, S., Bergmann, O., and C. Bormann, "Delegated CoAP 437 Authentication and Authorization Framework (DCAF)", draft- 438 gerdes-ace-dcaf-authorize-04 (work in progress), October 439 2015. 441 [I-D.ietf-ace-actors] 442 Gerdes, S., Seitz, L., Selander, G., and C. Bormann, "An 443 architecture for authorization in constrained 444 environments", draft-ietf-ace-actors-06 (work in 445 progress), November 2017. 447 [I-D.selander-ace-cose-ecdhe] 448 Selander, G., Mattsson, J., and F. Palombini, "Ephemeral 449 Diffie-Hellman Over COSE (EDHOC)", draft-selander-ace- 450 cose-ecdhe-07 (work in progress), July 2017. 452 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 453 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 454 . 456 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 457 RFC 6749, DOI 10.17487/RFC6749, October 2012, 458 . 460 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 461 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 462 October 2013, . 464 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 465 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 466 DOI 10.17487/RFC7231, June 2014, . 469 Appendix A. Profile Requirements 471 This section lists the specifications on this profile based on the 472 requirements on the framework, as requested in Appendix C. of 473 [I-D.ietf-ace-oauth-authz]. 475 o (Optional) discovery process of how the client finds the right AS 476 for an RS it wants to send a request to: Not specified 478 o communication protocol the client and the RS must use: CoAP 479 o security protocol the client and RS must use: OSCORE 480 o how the client and the RS mutually authenticate: Implicitly by 481 possession of a common OSCORE security context 482 o Content-format of the protocol messages: "application/cose+cbor" 483 o proof-of-possession protocol(s) and how to select one; which key 484 types (e.g. symmetric/asymmetric) supported: OSCORE algorithms; 485 pre-established symmetric keys 486 o profile identifier: coap_oscore 487 o (Optional) how the RS talks to the AS for introspection: HTTP/CoAP 488 (+ TLS/DTLS/OSCORE) 489 o how the client talks to the AS for requesting a token: HTTP/CoAP 490 (+ TLS/DTLS/OSCORE) 491 o how/if the /authz-info endpoint is protected: Security protocol 492 above 493 o (Optional)other methods of token transport than the /authz-info 494 endpoint: no 496 Appendix B. Using the pop-key with EDHOC (EDHOC+OSCORE) 498 EDHOC specifies an authenticated Diffie-Hellman protocol that allows 499 two parties to use CBOR [RFC7049] and COSE in order to establish a 500 shared secret key with perfect forward secrecy. The use of Ephemeral 501 Diffie-Hellman Over COSE (EDHOC) [I-D.selander-ace-cose-ecdhe] in 502 this profile in addition to OSCORE, provides perfect forward secrecy 503 (PFS) and the initial proof-of-possession, which ties the proof-of- 504 possession key to an OSCORE security context. 506 If EDHOC is used together with OSCORE, and the pop-key (symmetric or 507 asymmetric) is used to authenticate the messages in EDHOC, then the 508 AS MUST provision the following data, in response to the access token 509 request: 511 o a symmetric or public key (associated to the RS) 512 o a key identifier; 514 How these parameters are communicated depends on the type of key 515 (asymmetric or symmetric). Moreover, the AS MUST signal the use of 516 OSCORE + EDHOC with the 'profile' parameter set to 517 "coap_oscore_edhoc" and follow Appendix B to derive the security 518 context to run OSCORE. 520 Note that in the case described in this section, the 'expires_in' 521 parameter, defined in section 4.2.2. of [RFC6749] defines the 522 lifetime in seconds of both the access token and the shared secret. 523 After expiration, C MUST acquire a new access token from the AS, and 524 run EDHOC again, as specified in this section 526 B.1. Using Asymmetric Keys 528 In case of an asymmetric key, C MUST communicate its own asymmetric 529 key to the AS in the 'cnf' parameter of the access token request, as 530 specified in section 5.6.1 of [I-D.ietf-ace-oauth-authz]; the AS MUST 531 communicate the RS's public key to C in the response, in the 'rs_cnf' 532 parameter, as specified in section 5.6.1 of 533 [I-D.ietf-ace-oauth-authz]. Note that the RS's public key MUST 534 include a 'kid' parameter, and that the value of the 'kid' MUST be 535 included in the access token, to let the RS know which of its public 536 keys C used. If the access token is a CWT 537 [I-D.ietf-ace-cbor-web-token], the key identifier MUST be placed 538 directly in the 'cnf' structure (if the key is only referenced). 540 Figure 3 shows an example of such a request in CBOR diagnostic 541 notation without tag and value abbreviations. 543 Header: POST (Code=0.02) 544 Uri-Host: "server.example.com" 545 Uri-Path: "token" 546 Content-Type: "application/cose+cbor" 547 Payload: 548 { 549 "grant_type" : "client_credentials", 550 "cnf" : { 551 "COSE_Key" : { 552 "kid" : "client_key" 553 "kty" : "EC", 554 "crv" : "P-256", 555 "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', 556 "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' 557 } 558 } 559 } 561 Figure 3: Example access token request (OSCORE+EDHOC, asymmetric). 563 Figure 4 shows an example of a corresponding response in CBOR 564 diagnostic notation without tag and value abbreviations. 566 Header: Created (Code=2.01) 567 Content-Type: "application/cose+cbor" 568 Payload: 569 { 570 "access_token" : b64'SlAV32hkKG ... 571 (contains "kid" : "client_key")', 572 "profile" : "coap_oscore_edhoc", 573 "expires_in" : "3600", 574 "cnf" : { 575 "COSE_Key" : { 576 "kid" : "server_key" 577 "kty" : "EC", 578 "crv" : "P-256", 579 "x" : b64'cGJ90UiglWiGahtagnv8usWxHK2PmfnHKwXPS54m0kT', 580 "y" : b64'reASjpkttcsz+1rb7btKLv8EX4IBOL+C3BttVivg+lS' 581 } 582 } 583 } 585 Figure 4: Example AS response (EDHOC+OSCORE, asymmetric). 587 B.2. Using Symmetric Keys 589 In the case of a symmetric key, the AS MUST communicate the key to 590 the client in the 'cnf' parameter of the access token response, as 591 specified in section 5.6.2. of [I-D.ietf-ace-oauth-authz]. AS MUST 592 also select a key identifier, that MUST be included as the 'kid' 593 parameter either directly in the 'cnf' structure, as in figure 4 of 594 [I-D.ietf-ace-oauth-authz], or as the 'kid' parameter of the 595 COSE_key, as in figure 6 of [I-D.ietf-ace-oauth-authz]. 597 Figure 5 shows an example of the necessary parameters in the AS 598 response to the access token request when EDHOC is used. The example 599 uses CBOR diagnostic notation without tag and value abbreviations. 601 Header: Created (Code=2.01) 602 Content-Type: "application/cose+cbor" 603 Payload: 604 { 605 "access_token" : b64'SlAV32hkKG ... 606 (remainder of access token omitted for brevity)', 607 "profile" : "coap_oscore_edhoc", 608 "expires_in" : "3600", 609 "cnf" : { 610 "COSE_Key" : { 611 "kty" : "Symmetric", 612 "kid" : b64'5tOS+h42dkw', 613 "k" : b64'+a+Dg2jjU+eIiOFCa9lObw' 614 } 615 } 616 } 618 Figure 5: Example AS response (EDHOC+OSCORE, symmetric). 620 In both cases, the AS MUST also include the same key identifier as 621 'kid' parameter in the access token metadata. If the access token is 622 a CWT [I-D.ietf-ace-cbor-web-token], the key identifier MUST be 623 placed inside the 'cnf' claim as 'kid' parameter of the COSE_Key or 624 directly in the 'cnf' structure (if the key is only referenced). 626 Figure 6 shows an example CWT containing the necessary EDHOC+OSCORE 627 parameters in the 'cnf' claim, in CBOR diagnostic notation without 628 tag and value abbreviations. 630 { 631 "aud" : "tempSensorInLivingRoom", 632 "iat" : "1360189224", 633 "exp" : "1360289224", 634 "scope" : "temperature_g firmware_p", 635 "cnf" : { 636 "COSE_Key" : { 637 "kty" : "Symmetric", 638 "kid" : b64'5tOS+h42dkw', 639 "k" : b64'+a+Dg2jjU+eIiOFCa9lObw' 640 } 641 } 643 Figure 6: Example CWT with EDHOC+OSCORE, symmetric case. 645 All other parameters defining OSCORE security context are derived 646 from EDHOC message exchange, including the master secret (see 647 Appendix C.2 of [I-D.selander-ace-cose-ecdhe]). 649 B.3. Processing 651 To provide forward secrecy and mutual authentication in the case of 652 pre-shared keys, pre-established raw public keys or with X.509 653 certificates it is RECOMMENDED to use EDHOC 654 [I-D.selander-ace-cose-ecdhe] to generate the keying material. EDHOC 655 MUST be used as defined in Appendix C of 656 [I-D.selander-ace-cose-ecdhe], with the following additions and 657 modifications. 659 The first EDHOC message is sent after the access token is posted to 660 the /authz-info resource of the RS as specified in section 5.8.1 of 661 [I-D.ietf-ace-oauth-authz]. Then the EDHOC message_1 is sent and the 662 EDHOC protocol is initiated [I-D.selander-ace-cose-ecdhe]). 664 Before the RS continues with the EDHOC protocol and responds to this 665 token submission request, additional verifications on the access 666 token are done: the RS SHALL process the access token according to 667 [I-D.ietf-ace-oauth-authz]. If the token is valid then the RS 668 continues processing EDHOC following Appendix C of 669 [I-D.selander-ace-cose-ecdhe], otherwise it discontinues EDHOC and 670 responds with the error code as specified in 671 [I-D.ietf-ace-oauth-authz]. 673 o In case the EDHOC verification fails, the RS MUST return an error 674 response to the client with code 4.01 (Unauthorized). 675 o If RS has an access token for C but not for the resource that C 676 has requested, RS MUST reject the request with a 4.03 (Forbidden). 677 o If RS has an access token for C but it does not cover the action C 678 requested on the resource, RS MUST reject the request with a 4.05 679 (Method Not Allowed). 680 o If all verifications above succeeds, further communication between 681 client and RS is protected with OSCORE, including the RS response 682 to the OSCORE request. 684 In the case of EDHOC being used with symmetric keys, the protocol in 685 section 5 of [I-D.selander-ace-cose-ecdhe] MUST be used. If the key 686 is asymmetric, the RS MUST also use an asymmetric key for 687 authentication. This key is known to the client through the access 688 token response (see section 5.6.2 of [I-D.ietf-ace-oauth-authz]). In 689 this case the protocol in section 4 of [I-D.selander-ace-cose-ecdhe] 690 MUST be used. 692 Figure 7 illustrates the message exchanges for using OSCORE+EDHOC 693 (step C in figure 1 of [I-D.ietf-ace-oauth-authz]). 695 Resource 696 Client Server 697 | | 698 | | 699 +--------->| Header: POST (Code=0.02) 700 | POST | Uri-Path:"authz-info" 701 | | Content-Type: application/cbor 702 | | Payload: access token 703 | | 704 | | 705 +--------->| Header: POST (Code=0.02) 706 | POST | Uri-Path: "/.well-known/edhoc" 707 | | Content-Type: application/edhoc 708 | | Payload: EDHOC message_1 709 | | 710 |<---------+ Header: 2.04 Changed 711 | 2.04 | Content-Type: application/edhoc 712 | | Payload: EDHOC message_2 713 | | 714 +--------->| Header: POST (Code=0.02) 715 | POST | Uri-Path: "/.well-known/edhoc" 716 | | Content-Type: application/edhoc 717 | | Payload: EDHOC message_3 718 | | 719 |<---------+ Header: 2.04 Changed 720 | 2.04 | 721 | | 722 start of protected communication 723 | | 724 +--------->| CoAP request + 725 | OSCORE | Object-Security option 726 | request | 727 | | 728 |<---------+ CoAP response + 729 | OSCORE | Object-Security option 730 | response | 731 | | 733 Figure 7: Access token and key establishment with EDHOC 735 Acknowledgments 737 The authors wish to thank Jim Schaad, Goeran Selander and Marco 738 Tiloca for the input on this memo. The error responses specified in 739 Appendix B.3 were originally specified by Gerdes et al. in 740 [I-D.gerdes-ace-dcaf-authorize]. 742 Authors' Addresses 744 Ludwig Seitz 745 RISE SICS AB 746 Scheelevagen 17 747 Lund 22370 748 Sweden 750 Email: ludwig.seitz@ri.se 752 Francesca Palombini 753 Ericsson AB 754 Farogatan 6 755 Kista SE-16480 Stockholm 756 Sweden 758 Email: francesca.palombini@ericsson.com 760 Martin Gunnarsson 761 RISE SICS AB 762 Scheelevagen 17 763 Lund 22370 764 Sweden 766 Email: martin.gunnarsson@ri.se 768 Goeran Selander 769 Ericsson AB 770 Farogatan 6 771 Kista SE-16480 Stockholm 772 Sweden 774 Email: goran.selander@ericsson.com