idnits 2.17.1 draft-ietf-ace-oscore-profile-02.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 (June 28, 2018) is 2128 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 (-46) exists of draft-ietf-ace-oauth-authz-12 == Outdated reference: A later version (-16) exists of draft-ietf-core-object-security-13 ** 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-08 -- 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 (~~), 5 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: December 30, 2018 Ericsson AB 6 M. Gunnarsson 7 RISE SICS AB 8 G. Selander 9 Ericsson AB 10 June 28, 2018 12 OSCORE profile of the Authentication and Authorization for Constrained 13 Environments Framework 14 draft-ietf-ace-oscore-profile-02 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 https://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 December 30, 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 (https://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 . . . . . . . . . . . . . . . 8 65 4. Resource Server to Authorization Server . . . . . . . . . . . 8 66 5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 67 6. Privacy Considerations . . . . . . . . . . . . . . . . . . . 9 68 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 69 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 70 8.1. Normative References . . . . . . . . . . . . . . . . . . 10 71 8.2. Informative References . . . . . . . . . . . . . . . . . 11 72 Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 11 73 Appendix B. Using the pop-key with EDHOC (EDHOC+OSCORE) . . . . 12 74 B.1. Using Asymmetric Keys . . . . . . . . . . . . . . . . . . 13 75 B.2. Using Symmetric Keys . . . . . . . . . . . . . . . . . . 14 76 B.3. Processing . . . . . . . . . . . . . . . . . . . . . . . 16 77 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 17 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 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 [I-D.ietf-ace-oauth-authz]. 134 2.1. Signaling the use of OSCORE 136 A client requests a token at an AS via the /token resource. This 137 follows the message formats specified in section 5.6.1 of 138 [I-D.ietf-ace-oauth-authz]. 140 The AS responding to a successful access token request as defined in 141 section 5.6.2 of [I-D.ietf-ace-oauth-authz] can signal that the use 142 of OSCORE is REQUIRED for a specific access token by including the 143 "profile" parameter with the value "coap_oscore" in the access token 144 response. This means that the client MUST use OSCORE towards all 145 resource servers for which this access token is valid, and follow 146 Section 2.2 to derive the security context to run OSCORE. 148 The error response procedures defined in section 5.6.3 of the ACE 149 framework are unchanged by this profile. 151 Note the the client and the authorization server MAY OPTIONALLY use 152 OSCORE to protect the interaction via the /token resource. See 153 Section 3 for details. 155 2.2. Key establishment for OSCORE 157 Section 3.2 of [I-D.ietf-core-object-security] defines how to derive 158 a security context based on a shared master secret and a set of other 159 parameters, established between client and server. The proof-of- 160 possession key (pop-key) provisioned from the AS MAY, in case of pre- 161 shared keys, be used directly as master secret in OSCORE. 163 If OSCORE is used directly with the symmetric pop-key as master 164 secret, then the AS MUST provision the following data, in response to 165 the access token request: 167 o a master secret 169 o the sender identifier 171 o the recipient identifier 173 Additionally, the AS MAY provision the following data, in the same 174 response. In case these parameters are omitted, the default values 175 are used as described in section 3.2 of 176 [I-D.ietf-core-object-security]. 178 o an AEAD algorithm 180 o a KDF algorithm 182 o a salt 184 o a replay window type and size 186 The master secret MUST be communicated as COSE_Key in the 'cnf' 187 parameter of the access token response as defined in Section 5.6.4.5 188 of [I-D.ietf-ace-oauth-authz]. The AEAD algorithm MAY be included as 189 the 'alg' parameter in the COSE_Key; the KDF algorithm MAY be 190 included as the 'kdf' parameter of the COSE_Key and the salt MAY be 191 included as the 'slt' parameter of the COSE_Key as defined in table 192 1. 194 The same parameters MUST be included as metadata of the access token; 195 if the token is a CWT [RFC8392], the same COSE_Key structure MUST be 196 placed in the 'cnf' claim of this token. If a CWT is used it MUST be 197 encrypted, since the token is transferred from the client to the RS 198 over an unprotected channel. 200 The AS MUST also assign identifiers to both client and RS, which are 201 then used as Sender ID and Recipient ID in the OSCORE context as 202 described in section 3.1 of [I-D.ietf-core-object-security]. These 203 identifiers MUST be unique in the set of all clients and RS 204 identifiers for a certain AS. Moreover, these MUST be included in 205 the COSE_Key as header parameters, as defined in table 1. 207 We assume in this document that a resource is associated to one 208 single AS, which makes it possible to assume unique identifiers for 209 each client requesting a particular resource to a RS. If this is not 210 the case, collisions of identifiers may appear in the RS, in which 211 case the RS needs to have a mechanism in place to disambiguate 212 identifiers or mitigate their effect. 214 Note that C should set the Sender ID of its security context to the 215 clientId value received and the Recipient ID to the serverId value, 216 and RS should do the opposite. 218 +----------+-------+--------------+------------+-------------------+ 219 | name | label | CBOR type | registry | description | 220 +----------+-------+--------------+------------+-------------------+ 221 | clientId | TBD1 | bstr | | Identifies the | 222 | | | | | client in an | 223 | | | | | OSCORE context | 224 | | | | | using this key | 225 | | | | | | 226 | serverId | TBD2 | bstr | | Identifies the | 227 | | | | | server in an | 228 | | | | | OSCORE context | 229 | | | | | using this key | 230 | | | | | | 231 | kdf | TBD3 | bstr | | Identifies the | 232 | | | | | KDF algorithm in | 233 | | | | | an OSCORE context | 234 | | | | | using this key | 235 | | | | | | 236 | slt | TBD4 | bstr | | Identifies the | 237 | | | | | master salt in | 238 | | | | | an OSCORE context | 239 | | | | | using this key | 240 +----------+-------+--------------+------------+-------------------+ 241 Table 1: Additional COSE_Key Common Parameters 243 Figure 1 shows an example of such an AS response, in CBOR diagnostic 244 notation without the tag and value abbreviations. 246 Header: Created (Code=2.01) 247 Content-Type: "application/cose+cbor" 248 Payload: 249 { 250 "access_token" : b64'SlAV32hkKG ... 251 (remainder of access token omitted for brevity)', 252 "profile" : "coap_oscore", 253 "expires_in" : "3600", 254 "cnf" : { 255 "COSE_Key" : { 256 "kty" : "Symmetric", 257 "alg" : "AES-CCM-16-64-128", 258 "clientId" : b64'qA', 259 "serverId" : b64'Qg', 260 "k" : b64'+a+Dg2jjU+eIiOFCa9lObw' 261 } 262 } 263 } 265 Figure 1: Example AS response with OSCORE parameters. 267 Figure 2 shows an example CWT, containing the necessary OSCORE 268 parameters in the 'cnf' claim, in CBOR diagnostic notation without 269 tag and value abbreviations. 271 { 272 "aud" : "tempSensorInLivingRoom", 273 "iat" : "1360189224", 274 "exp" : "1360289224", 275 "scope" : "temperature_g firmware_p", 276 "cnf" : { 277 "COSE_Key" : { 278 "kty" : "Symmetric", 279 "alg" : "AES-CCM-16-64-128", 280 "clientId" : b64'Qg', 281 "serverId" : b64'qA', 282 "k" : b64'+a+Dg2jjU+eIiOFCa9lObw' 283 } 284 } 286 Figure 2: Example CWT with OSCORE parameters. 288 Note that the proof-of-possession required to bind the access token 289 to the client is implicitly performed by generating the shared OSCORE 290 context using the pop-key as master secret, both on the client and RS 291 side. An attacker using a stolen token will not be able to generate 292 a valid OSCORE context and thus not be able to prove possession of 293 the pop-key. 295 3. Client to Authorization Server 297 As specified in the ACE framework (section 5.6 of 298 [I-D.ietf-ace-oauth-authz]), the Client and AS can also use CoAP 299 instead of HTTP to communicate via the token resource. This section 300 specifies how to use OSCORE between Client and AS together with CoAP. 301 The use of OSCORE for this communication is OPTIONAL in this profile, 302 other security protocols (such as DTLS) MAY be used instead. 304 The client and the AS are expected to have pre-established security 305 contexts in place. How these security contexts are established is 306 out of scope for this profile. Furthermore the client and the AS 307 communicate using OSCORE ([I-D.ietf-core-object-security]) through 308 the introspection resource as specified in section 5.7 of 309 [I-D.ietf-ace-oauth-authz]. 311 4. Resource Server to Authorization Server 313 As specified in the ACE framework (section 5.7 of 314 [I-D.ietf-ace-oauth-authz]), the RS and AS can also use CoAP instead 315 of HTTP to communicate via the introspection resource. This section 316 specifies how to use OSCORE between RS and AS. The use of OSCORE for 317 this communication is OPTIONAL in this profile, other security 318 protocols (such as DTLS) MAY be used instead. 320 The RS and the AS are expected to have pre-established security 321 contexts in place. How these security contexts are established is 322 out of scope for this profile. Furthermore the RS and the AS 323 communicate using OSCORE ([I-D.ietf-core-object-security]) through 324 the introspection resource as specified in section 5.7 of 325 [I-D.ietf-ace-oauth-authz]. 327 5. Security Considerations 329 This document specifies a profile for the Authentication and 330 Authorization for Constrained Environments (ACE) framework 331 [I-D.ietf-ace-oauth-authz]. Thus the general security considerations 332 from the framework also apply to this profile. 334 Furthermore the general security considerations of OSCORE 335 [I-D.ietf-core-object-security] also apply to this specific use of 336 the OSCORE protocol. 338 OSCORE is designed to secure point-to-point communication, providing 339 a secure binding between the request and the response(s). Thus the 340 basic OSCORE protocol is not intended for use in point-to-multipoint 341 communication (e.g. multicast, publish-subscribe). Implementers of 342 this profile should make sure that their usecase corresponds to the 343 expected use of OSCORE, to prevent weakening the security assurances 344 provided by OSCORE. 346 6. Privacy Considerations 348 TBD. 350 7. IANA Considerations 352 Note to RFC Editor: Please replace all occurrences of "[[this 353 specification]]" with the RFC number of this specification and delete 354 this paragraph. 356 The following registration is done for the ACE OAuth Profile Registry 357 following the procedure specified in section 8.6 of 358 [I-D.ietf-ace-oauth-authz]: 360 o Profile name: coap_oscore 361 o Profile Description: Profile for using OSCORE to secure 362 communication between constrained nodes using the Authentication 363 and Authorization for Constrained Environments framework. 364 o Profile ID: TBD (value between 1 and 255) 365 o Change Controller: IESG 366 o Specification Document(s): [[this specification]] 368 The following registrations are done for the COSE Key Common 369 Parameter Registry specified in section 16.5 of [RFC8152]: 371 o Name: clientId 372 o Label: TBD1 (value between 1 and 255) 373 o CBOR Type: bstr 374 o Value Registry: N/A 375 o Description: Identifies the client in an OSCORE context 376 o Reference: [[this specification]] 378 o Name: serverId 379 o Label: TBD2 (value between 1 and 255) 380 o Value Type: bstr 381 o Value Registry: N/A 382 o Description: Identifies the server in an OSCORE context 383 o Reference: [[this specification]] 385 o Name: kdf 386 o Label: TBD3 (value between 1 and 255) 387 o Value Type: bstr 388 o Value Registry: COSE Algorithms registry 389 o Description: Identifies the KDF algorithm to be used in an OSCORE 390 context 392 o Reference: [[this specification]] 394 o Name: slt 395 o Label: TBD4 (value between 1 and 255) 396 o Value Type: bstr 397 o Value Registry: N/A 398 o Description: Identifies the master salt of to be used in an OSCORE 399 context 400 o Reference: [[this specification]] 402 8. References 404 8.1. Normative References 406 [I-D.ietf-ace-oauth-authz] 407 Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and 408 H. Tschofenig, "Authentication and Authorization for 409 Constrained Environments (ACE) using the OAuth 2.0 410 Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-12 411 (work in progress), May 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-13 (work in 417 progress), June 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, 422 . 424 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 425 Application Protocol (CoAP)", RFC 7252, 426 DOI 10.17487/RFC7252, June 2014, 427 . 429 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 430 RFC 8152, DOI 10.17487/RFC8152, July 2017, 431 . 433 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 434 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 435 May 2018, . 437 8.2. Informative References 439 [I-D.gerdes-ace-dcaf-authorize] 440 Gerdes, S., Bergmann, O., and C. Bormann, "Delegated CoAP 441 Authentication and Authorization Framework (DCAF)", draft- 442 gerdes-ace-dcaf-authorize-04 (work in progress), October 443 2015. 445 [I-D.ietf-ace-actors] 446 Gerdes, S., Seitz, L., Selander, G., and C. Bormann, "An 447 architecture for authorization in constrained 448 environments", draft-ietf-ace-actors-06 (work in 449 progress), November 2017. 451 [I-D.selander-ace-cose-ecdhe] 452 Selander, G., Mattsson, J., and F. Palombini, "Ephemeral 453 Diffie-Hellman Over COSE (EDHOC)", draft-selander-ace- 454 cose-ecdhe-08 (work in progress), March 2018. 456 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 457 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 458 . 460 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 461 RFC 6749, DOI 10.17487/RFC6749, October 2012, 462 . 464 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 465 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 466 October 2013, . 468 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 469 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 470 DOI 10.17487/RFC7231, June 2014, 471 . 473 Appendix A. Profile Requirements 475 This section lists the specifications on this profile based on the 476 requirements on the framework, as requested in Appendix C of 477 [I-D.ietf-ace-oauth-authz]. 479 o (Optional) discovery process of how the client finds the right AS 480 for an RS it wants to send a request to: Not specified 481 o communication protocol the client and the RS must use: CoAP 482 o security protocol the client and RS must use: OSCORE 483 o how the client and the RS mutually authenticate: Implicitly by 484 possession of a common OSCORE security context 486 o Content-format of the protocol messages: "application/cose+cbor" 487 o proof-of-possession protocol(s) and how to select one; which key 488 types (e.g. symmetric/asymmetric) supported: OSCORE algorithms; 489 pre-established symmetric keys 490 o profile identifier: coap_oscore 491 o (Optional) how the RS talks to the AS for introspection: HTTP/CoAP 492 (+ TLS/DTLS/OSCORE) 493 o how the client talks to the AS for requesting a token: HTTP/CoAP 494 (+ TLS/DTLS/OSCORE) 495 o how/if the /authz-info endpoint is protected: Security protocol 496 above 497 o (Optional)other methods of token transport than the /authz-info 498 endpoint: no 500 Appendix B. Using the pop-key with EDHOC (EDHOC+OSCORE) 502 EDHOC specifies an authenticated Diffie-Hellman protocol that allows 503 two parties to use CBOR [RFC7049] and COSE in order to establish a 504 shared secret key with perfect forward secrecy. The use of Ephemeral 505 Diffie-Hellman Over COSE (EDHOC) [I-D.selander-ace-cose-ecdhe] in 506 this profile in addition to OSCORE, provides perfect forward secrecy 507 (PFS) and the initial proof-of-possession, which ties the proof-of- 508 possession key to an OSCORE security context. 510 If EDHOC is used together with OSCORE, and the pop-key (symmetric or 511 asymmetric) is used to authenticate the messages in EDHOC, then the 512 AS MUST provision the following data, in response to the access token 513 request: 515 o a symmetric or public key (associated to the RS) 516 o a key identifier; 518 How these parameters are communicated depends on the type of key 519 (asymmetric or symmetric). Moreover, the AS MUST signal the use of 520 OSCORE + EDHOC with the 'profile' parameter set to 521 "coap_oscore_edhoc" and follow Appendix B to derive the security 522 context to run OSCORE. 524 Note that in the case described in this section, the 'expires_in' 525 parameter, defined in Section 4.2.2. of [RFC6749] defines the 526 lifetime in seconds of both the access token and the shared secret. 527 After expiration, C MUST acquire a new access token from the AS, and 528 run EDHOC again, as specified in this section 530 B.1. Using Asymmetric Keys 532 In case of an asymmetric key, C MUST communicate its own asymmetric 533 key to the AS in the 'cnf' parameter of the access token request, as 534 specified in Section 5.6.1 of [I-D.ietf-ace-oauth-authz]; the AS MUST 535 communicate the RS's public key to C in the response, in the 'rs_cnf' 536 parameter, as specified in Section 5.6.1 of 537 [I-D.ietf-ace-oauth-authz]. Note that the RS's public key MUST 538 include a 'kid' parameter, and that the value of the 'kid' MUST be 539 included in the access token, to let the RS know which of its public 540 keys C used. If the access token is a CWT [RFC8392], the key 541 identifier MUST be placed directly in the 'cnf' structure (if the key 542 is only referenced). 544 Figure 3 shows an example of such a request in CBOR diagnostic 545 notation without tag and value abbreviations. 547 Header: POST (Code=0.02) 548 Uri-Host: "server.example.com" 549 Uri-Path: "token" 550 Content-Type: "application/cose+cbor" 551 Payload: 552 { 553 "grant_type" : "client_credentials", 554 "cnf" : { 555 "COSE_Key" : { 556 "kid" : "client_key" 557 "kty" : "EC", 558 "crv" : "P-256", 559 "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', 560 "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' 561 } 562 } 563 } 565 Figure 3: Example access token request (OSCORE+EDHOC, asymmetric). 567 Figure 4 shows an example of a corresponding response in CBOR 568 diagnostic notation without tag and value abbreviations. 570 Header: Created (Code=2.01) 571 Content-Type: "application/cose+cbor" 572 Payload: 573 { 574 "access_token" : b64'SlAV32hkKG ... 575 (contains "kid" : "client_key")', 576 "profile" : "coap_oscore_edhoc", 577 "expires_in" : "3600", 578 "cnf" : { 579 "COSE_Key" : { 580 "kid" : "server_key" 581 "kty" : "EC", 582 "crv" : "P-256", 583 "x" : b64'cGJ90UiglWiGahtagnv8usWxHK2PmfnHKwXPS54m0kT', 584 "y" : b64'reASjpkttcsz+1rb7btKLv8EX4IBOL+C3BttVivg+lS' 585 } 586 } 587 } 589 Figure 4: Example AS response (EDHOC+OSCORE, asymmetric). 591 B.2. Using Symmetric Keys 593 In the case of a symmetric key, the AS MUST communicate the key to 594 the client in the 'cnf' parameter of the access token response, as 595 specified in Section 5.6.2. of [I-D.ietf-ace-oauth-authz]. AS MUST 596 also select a key identifier, that MUST be included as the 'kid' 597 parameter either directly in the 'cnf' structure, as in figure 4 of 598 [I-D.ietf-ace-oauth-authz], or as the 'kid' parameter of the 599 COSE_key, as in figure 6 of [I-D.ietf-ace-oauth-authz]. 601 Figure 5 shows an example of the necessary parameters in the AS 602 response to the access token request when EDHOC is used. The example 603 uses CBOR diagnostic notation without tag and value abbreviations. 605 Header: Created (Code=2.01) 606 Content-Type: "application/cose+cbor" 607 Payload: 608 { 609 "access_token" : b64'SlAV32hkKG ... 610 (remainder of access token omitted for brevity)', 611 "profile" : "coap_oscore_edhoc", 612 "expires_in" : "3600", 613 "cnf" : { 614 "COSE_Key" : { 615 "kty" : "Symmetric", 616 "kid" : b64'5tOS+h42dkw', 617 "k" : b64'+a+Dg2jjU+eIiOFCa9lObw' 618 } 619 } 620 } 622 Figure 5: Example AS response (EDHOC+OSCORE, symmetric). 624 In both cases, the AS MUST also include the same key identifier as 625 'kid' parameter in the access token metadata. If the access token is 626 a CWT [RFC8392], the key identifier MUST be placed inside the 'cnf' 627 claim as 'kid' parameter of the COSE_Key or directly in the 'cnf' 628 structure (if the key is only referenced). 630 Figure 6 shows an example CWT containing the necessary EDHOC+OSCORE 631 parameters in the 'cnf' claim, in CBOR diagnostic notation without 632 tag and value abbreviations. 634 { 635 "aud" : "tempSensorInLivingRoom", 636 "iat" : "1360189224", 637 "exp" : "1360289224", 638 "scope" : "temperature_g firmware_p", 639 "cnf" : { 640 "COSE_Key" : { 641 "kty" : "Symmetric", 642 "kid" : b64'5tOS+h42dkw', 643 "k" : b64'+a+Dg2jjU+eIiOFCa9lObw' 644 } 645 } 647 Figure 6: Example CWT with EDHOC+OSCORE, symmetric case. 649 All other parameters defining OSCORE security context are derived 650 from EDHOC message exchange, including the master secret (see 651 Appendix C.2 of [I-D.selander-ace-cose-ecdhe]). 653 B.3. Processing 655 To provide forward secrecy and mutual authentication in the case of 656 pre-shared keys, pre-established raw public keys or with X.509 657 certificates it is RECOMMENDED to use EDHOC 658 [I-D.selander-ace-cose-ecdhe] to generate the keying material. EDHOC 659 MUST be used as defined in Appendix C of 660 [I-D.selander-ace-cose-ecdhe], with the following additions and 661 modifications. 663 The first EDHOC message is sent after the access token is posted to 664 the /authz-info resource of the RS as specified in Section 5.8.1 of 665 [I-D.ietf-ace-oauth-authz]. Then the EDHOC message_1 is sent and the 666 EDHOC protocol is initiated [I-D.selander-ace-cose-ecdhe]). 668 Before the RS continues with the EDHOC protocol and responds to this 669 token submission request, additional verifications on the access 670 token are done: the RS SHALL process the access token according to 671 [I-D.ietf-ace-oauth-authz]. If the token is valid then the RS 672 continues processing EDHOC following Appendix C of 673 [I-D.selander-ace-cose-ecdhe], otherwise it discontinues EDHOC and 674 responds with the error code as specified in 675 [I-D.ietf-ace-oauth-authz]. 677 o In case the EDHOC verification fails, the RS MUST return an error 678 response to the client with code 4.01 (Unauthorized). 679 o If RS has an access token for C but not for the resource that C 680 has requested, RS MUST reject the request with a 4.03 (Forbidden). 681 o If RS has an access token for C but it does not cover the action C 682 requested on the resource, RS MUST reject the request with a 4.05 683 (Method Not Allowed). 684 o If all verifications above succeeds, further communication between 685 client and RS is protected with OSCORE, including the RS response 686 to the OSCORE request. 688 In the case of EDHOC being used with symmetric keys, the protocol in 689 Section 5 of [I-D.selander-ace-cose-ecdhe] MUST be used. If the key 690 is asymmetric, the RS MUST also use an asymmetric key for 691 authentication. This key is known to the client through the access 692 token response (see Section 5.6.2 of [I-D.ietf-ace-oauth-authz]). In 693 this case the protocol in Section 4 of [I-D.selander-ace-cose-ecdhe] 694 MUST be used. 696 Figure 7 illustrates the message exchanges for using OSCORE+EDHOC 697 (step C in figure 1 of [I-D.ietf-ace-oauth-authz]). 699 Resource 700 Client Server 701 | | 702 | | 703 +--------->| Header: POST (Code=0.02) 704 | POST | Uri-Path:"authz-info" 705 | | Content-Type: application/cbor 706 | | Payload: access token 707 | | 708 | | 709 +--------->| Header: POST (Code=0.02) 710 | POST | Uri-Path: "/.well-known/edhoc" 711 | | Content-Type: application/edhoc 712 | | Payload: EDHOC message_1 713 | | 714 |<---------+ Header: 2.04 Changed 715 | 2.04 | Content-Type: application/edhoc 716 | | Payload: EDHOC message_2 717 | | 718 +--------->| Header: POST (Code=0.02) 719 | POST | Uri-Path: "/.well-known/edhoc" 720 | | Content-Type: application/edhoc 721 | | Payload: EDHOC message_3 722 | | 723 |<---------+ Header: 2.04 Changed 724 | 2.04 | 725 | | 726 start of protected communication 727 | | 728 +--------->| CoAP request + 729 | OSCORE | Object-Security option 730 | request | 731 | | 732 |<---------+ CoAP response + 733 | OSCORE | Object-Security option 734 | response | 735 | | 737 Figure 7: Access token and key establishment with EDHOC 739 Acknowledgments 741 The authors wish to thank Jim Schaad, Goeran Selander and Marco 742 Tiloca for the input on this memo. The error responses specified in 743 Appendix B.3 were originally specified by Gerdes et al. in 744 [I-D.gerdes-ace-dcaf-authorize]. 746 Authors' Addresses 748 Ludwig Seitz 749 RISE SICS AB 750 Scheelevagen 17 751 Lund 22370 752 Sweden 754 Email: ludwig.seitz@ri.se 756 Francesca Palombini 757 Ericsson AB 758 Farogatan 6 759 Kista SE-16480 Stockholm 760 Sweden 762 Email: francesca.palombini@ericsson.com 764 Martin Gunnarsson 765 RISE SICS AB 766 Scheelevagen 17 767 Lund 22370 768 Sweden 770 Email: martin.gunnarsson@ri.se 772 Goeran Selander 773 Ericsson AB 774 Farogatan 6 775 Kista SE-16480 Stockholm 776 Sweden 778 Email: goran.selander@ericsson.com