draft-ietf-ace-oauth-authz-07.txt   draft-ietf-ace-oauth-authz-08.txt 
ACE Working Group L. Seitz ACE Working Group L. Seitz
Internet-Draft RISE SICS Internet-Draft RISE SICS
Intended status: Standards Track G. Selander Intended status: Standards Track G. Selander
Expires: February 9, 2018 Ericsson Expires: April 22, 2018 Ericsson
E. Wahlstroem E. Wahlstroem
(no affiliation) (no affiliation)
S. Erdtman S. Erdtman
Spotify AB Spotify AB
H. Tschofenig H. Tschofenig
ARM Ltd. ARM Ltd.
August 8, 2017 October 19, 2017
Authentication and Authorization for Constrained Environments (ACE) Authentication and Authorization for Constrained Environments (ACE)
draft-ietf-ace-oauth-authz-07 draft-ietf-ace-oauth-authz-08
Abstract Abstract
This specification defines a framework for authentication and This specification defines a framework for authentication and
authorization in Internet of Things (IoT) environments. The authorization in Internet of Things (IoT) environments. The
framework is based on a set of building blocks including OAuth 2.0 framework is based on a set of building blocks including OAuth 2.0
and CoAP, thus making a well-known and widely used authorization and CoAP, thus making a well-known and widely used authorization
solution suitable for IoT devices. Existing specifications are used solution suitable for IoT devices. Existing specifications are used
where possible, but where the constraints of IoT devices require it, where possible, but where the constraints of IoT devices require it,
extensions are added and profiles are defined. extensions are added and profiles are defined.
skipping to change at page 1, line 43 skipping to change at page 1, line 43
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on February 9, 2018. This Internet-Draft will expire on April 22, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5
3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.1. OAuth 2.0 . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1. OAuth 2.0 . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2. CoAP . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2. CoAP . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4. Protocol Interactions . . . . . . . . . . . . . . . . . . . . 9 4. Protocol Interactions . . . . . . . . . . . . . . . . . . . . 10
5. Framework . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5. Framework . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.1. Authorization Grants . . . . . . . . . . . . . . . . . . 14 5.1. Discovering Authorization Servers . . . . . . . . . . . . 15
5.2. Client Credentials . . . . . . . . . . . . . . . . . . . 15 5.1.1. Unauthorized Resource Request Message . . . . . . . . 15
5.3. AS Authentication . . . . . . . . . . . . . . . . . . . . 15 5.1.2. AS Information . . . . . . . . . . . . . . . . . . . 16
5.4. The 'Authorize' Endpoint . . . . . . . . . . . . . . . . 16 5.2. Authorization Grants . . . . . . . . . . . . . . . . . . 17
5.5. The 'Token' Endpoint . . . . . . . . . . . . . . . . . . 16 5.3. Client Credentials . . . . . . . . . . . . . . . . . . . 18
5.5.1. Client-to-AS Request . . . . . . . . . . . . . . . . 16 5.4. AS Authentication . . . . . . . . . . . . . . . . . . . . 18
5.5.2. AS-to-Client Response . . . . . . . . . . . . . . . . 19 5.5. The Authorization Endpoint . . . . . . . . . . . . . . . 18
5.5.3. Error Response . . . . . . . . . . . . . . . . . . . 21 5.6. The Token Endpoint . . . . . . . . . . . . . . . . . . . 19
5.5.4. Request and Response Parameters . . . . . . . . . . . 22 5.6.1. Client-to-AS Request . . . . . . . . . . . . . . . . 19
5.5.4.1. Audience . . . . . . . . . . . . . . . . . . . . 22 5.6.2. AS-to-Client Response . . . . . . . . . . . . . . . . 22
5.5.4.2. Grant Type . . . . . . . . . . . . . . . . . . . 22 5.6.3. Error Response . . . . . . . . . . . . . . . . . . . 24
5.5.4.3. Token Type . . . . . . . . . . . . . . . . . . . 23 5.6.4. Request and Response Parameters . . . . . . . . . . . 25
5.5.4.4. Profile . . . . . . . . . . . . . . . . . . . . . 23 5.6.4.1. Audience . . . . . . . . . . . . . . . . . . . . 25
5.5.4.5. Confirmation . . . . . . . . . . . . . . . . . . 23 5.6.4.2. Grant Type . . . . . . . . . . . . . . . . . . . 25
5.5.5. Mapping parameters to CBOR . . . . . . . . . . . . . 26 5.6.4.3. Token Type . . . . . . . . . . . . . . . . . . . 26
5.6. The 'Introspect' Endpoint . . . . . . . . . . . . . . . . 26 5.6.4.4. Profile . . . . . . . . . . . . . . . . . . . . . 26
5.6.1. RS-to-AS Request . . . . . . . . . . . . . . . . . . 27 5.6.4.5. Confirmation . . . . . . . . . . . . . . . . . . 26
5.6.2. AS-to-RS Response . . . . . . . . . . . . . . . . . . 27 5.6.5. Mapping parameters to CBOR . . . . . . . . . . . . . 27
5.6.3. Error Response . . . . . . . . . . . . . . . . . . . 28 5.7. The 'Introspect' Endpoint . . . . . . . . . . . . . . . . 28
5.6.4. Client Token . . . . . . . . . . . . . . . . . . . . 29 5.7.1. RS-to-AS Request . . . . . . . . . . . . . . . . . . 29
5.6.5. Mapping Introspection parameters to CBOR . . . . . . 31 5.7.2. AS-to-RS Response . . . . . . . . . . . . . . . . . . 29
5.7. The Access Token . . . . . . . . . . . . . . . . . . . . 31 5.7.3. Error Response . . . . . . . . . . . . . . . . . . . 30
5.7.1. The 'Authorization Information' Endpoint . . . . . . 32 5.7.4. Client Token . . . . . . . . . . . . . . . . . . . . 31
5.7.2. Token Expiration . . . . . . . . . . . . . . . . . . 32 5.7.5. Mapping Introspection parameters to CBOR . . . . . . 33
6. Security Considerations . . . . . . . . . . . . . . . . . . . 33 5.8. The Access Token . . . . . . . . . . . . . . . . . . . . 33
7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 35 5.8.1. The 'Authorization Information' Endpoint . . . . . . 34
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 35 5.8.2. Token Expiration . . . . . . . . . . . . . . . . . . 35
8.1. OAuth Introspection Response Parameter Registration . . . 35 6. Security Considerations . . . . . . . . . . . . . . . . . . . 36
8.2. OAuth Parameter Registration . . . . . . . . . . . . . . 36 6.1. Unprotected AS Information . . . . . . . . . . . . . . . 37
8.3. OAuth Access Token Types . . . . . . . . . . . . . . . . 36 6.2. Use of Nonces for Replay Protection . . . . . . . . . . . 37
8.4. Token Type Mappings . . . . . . . . . . . . . . . . . . . 36 6.3. Combining profiles . . . . . . . . . . . . . . . . . . . 37
8.4.1. Registration Template . . . . . . . . . . . . . . . . 37 6.4. Error responses . . . . . . . . . . . . . . . . . . . . . 37
8.4.2. Initial Registry Contents . . . . . . . . . . . . . . 37 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 38
8.5. CBOR Web Token Claims . . . . . . . . . . . . . . . . . . 37 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 39
8.6. ACE Profile Registry . . . . . . . . . . . . . . . . . . 38 8.1. OAuth Introspection Response Parameter Registration . . . 39
8.6.1. Registration Template . . . . . . . . . . . . . . . . 38 8.2. OAuth Parameter Registration . . . . . . . . . . . . . . 39
8.7. OAuth Parameter Mappings Registry . . . . . . . . . . . . 38 8.3. OAuth Access Token Types . . . . . . . . . . . . . . . . 40
8.7.1. Registration Template . . . . . . . . . . . . . . . . 38 8.4. OAuth Token Type CBOR Mappings . . . . . . . . 40
8.7.2. Initial Registry Contents . . . . . . . . . . . . . . 39 8.4.1. Registration Template . . . . . . . . . . . . . . . . 40
8.8. Introspection Endpoint CBOR Mappings Registry . . . . . . 41 8.4.2. Initial Registry Contents . . . . . . . . . . . . . . 40
8.8.1. Registration Template . . . . . . . . . . . . . . . . 41 8.5. CBOR Web Token Claims . . . . . . . . . . . . . . . . . . 41
8.8.2. Initial Registry Contents . . . . . . . . . . . . . . 41 8.6. ACE OAuth Profile Registry . . . . . . . . . . . . . . . 41
8.9. CoAP Option Number Registration . . . . . . . . . . . . . 43 8.6.1. Registration Template . . . . . . . . . . . . . . . . 41
8.10. CWT Confirmation Methods Registry . . . . . . . . . . . . 44 8.7. OAuth CBOR Parameter Mappings Registry . . . . . . . . . 41
8.10.1. Registration Template . . . . . . . . . . . . . . . 44 8.7.1. Registration Template . . . . . . . . . . . . . . . . 42
8.10.2. Initial Registry Contents . . . . . . . . . . . . . 45 8.7.2. Initial Registry Contents . . . . . . . . . . . . . . 42
9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 45 8.8. Introspection Endpoint CBOR Mappings Registry . . . . . . 44
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 45 8.8.1. Registration Template . . . . . . . . . . . . . . . . 44
10.1. Normative References . . . . . . . . . . . . . . . . . . 45 8.8.2. Initial Registry Contents . . . . . . . . . . . . . . 45
10.2. Informative References . . . . . . . . . . . . . . . . . 46 8.9. CoAP Option Number Registration . . . . . . . . . . . . . 47
Appendix A. Design Justification . . . . . . . . . . . . . . . . 48 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 47
Appendix B. Roles and Responsibilities . . . . . . . . . . . . . 50 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 48
Appendix C. Requirements on Profiles . . . . . . . . . . . . . . 52 10.1. Normative References . . . . . . . . . . . . . . . . . . 48
Appendix D. Assumptions on AS knowledge about C and RS . . . . . 53 10.2. Informative References . . . . . . . . . . . . . . . . . 49
Appendix E. Deployment Examples . . . . . . . . . . . . . . . . 53 Appendix A. Design Justification . . . . . . . . . . . . . . . . 51
E.1. Local Token Validation . . . . . . . . . . . . . . . . . 53 Appendix B. Roles and Responsibilities . . . . . . . . . . . . . 55
E.2. Introspection Aided Token Validation . . . . . . . . . . 57 Appendix C. Requirements on Profiles . . . . . . . . . . . . . . 57
Appendix F. Document Updates . . . . . . . . . . . . . . . . . . 61 Appendix D. Assumptions on AS knowledge about C and RS . . . . . 58
F.1. Version -06 to -07 . . . . . . . . . . . . . . . . . . . 61 Appendix E. Deployment Examples . . . . . . . . . . . . . . . . 58
F.2. Version -05 to -06 . . . . . . . . . . . . . . . . . . . 61 E.1. Local Token Validation . . . . . . . . . . . . . . . . . 58
F.3. Version -04 to -05 . . . . . . . . . . . . . . . . . . . 61 E.2. Introspection Aided Token Validation . . . . . . . . . . 62
F.4. Version -03 to -04 . . . . . . . . . . . . . . . . . . . 62 Appendix F. Document Updates . . . . . . . . . . . . . . . . . . 66
F.5. Version -02 to -03 . . . . . . . . . . . . . . . . . . . 62 F.1. Version -08 to -09 . . . . . . . . . . . . . . . . . . . 66
F.6. Version -01 to -02 . . . . . . . . . . . . . . . . . . . 62 F.2. Version -07 to -08 . . . . . . . . . . . . . . . . . . . 67
F.7. Version -00 to -01 . . . . . . . . . . . . . . . . . . . 63 F.3. Version -06 to -07 . . . . . . . . . . . . . . . . . . . 67
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 63 F.4. Version -05 to -06 . . . . . . . . . . . . . . . . . . . 67
F.5. Version -04 to -05 . . . . . . . . . . . . . . . . . . . 67
F.6. Version -03 to -04 . . . . . . . . . . . . . . . . . . . 67
F.7. Version -02 to -03 . . . . . . . . . . . . . . . . . . . 68
F.8. Version -01 to -02 . . . . . . . . . . . . . . . . . . . 68
F.9. Version -00 to -01 . . . . . . . . . . . . . . . . . . . 68
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 69
1. Introduction 1. Introduction
Authorization is the process for granting approval to an entity to Authorization is the process for granting approval to an entity to
access a resource [RFC4949]. The authorization task itself can best access a resource [RFC4949]. The authorization task itself can best
be described as granting access to a requesting client, for a be described as granting access to a requesting client, for a
resource hosted on a device, the resource server (RS). This exchange resource hosted on a device, the resource server (RS). This exchange
is mediated by one or multiple authorization servers (AS). Managing is mediated by one or multiple authorization servers (AS). Managing
authorization for a large number of devices and users is a complex authorization for a large number of devices and users can be a
task. complex task.
While prior work on authorization solutions for the Web and for the While prior work on authorization solutions for the Web and for the
mobile environment also applies to the IoT environment many IoT mobile environment also applies to the Internet of Things (IoT)
devices are constrained, for example in terms of processing environment, many IoT devices are constrained, for example, in terms
capabilities, available memory, etc. For web applications on of processing capabilities, available memory, etc. For web
constrained nodes this specification makes use of CoAP [RFC7252]. applications on constrained nodes, this specification RECOMMENDS the
use of CoAP [RFC7252] as replacement for HTTP.
A detailed treatment of constraints can be found in [RFC7228], and A detailed treatment of constraints can be found in [RFC7228], and
the different IoT deployments present a continuous range of device the different IoT deployments present a continuous range of device
and network capabilities. Taking energy consumption as an example: and network capabilities. Taking energy consumption as an example:
At one end there are energy-harvesting or battery powered devices At one end there are energy-harvesting or battery powered devices
which have a tight power budget, on the other end there are mains- which have a tight power budget, on the other end there are mains-
powered devices, and all levels in between. powered devices, and all levels in between.
Hence, IoT devices may be very different in terms of available Hence, IoT devices may be very different in terms of available
processing and message exchange capabilities and there is a need to processing and message exchange capabilities and there is a need to
skipping to change at page 4, line 35 skipping to change at page 4, line 46
Things devices. This specification contains the necessary building Things devices. This specification contains the necessary building
blocks for adjusting OAuth 2.0 to IoT environments. blocks for adjusting OAuth 2.0 to IoT environments.
More detailed, interoperable specifications can be found in profiles. More detailed, interoperable specifications can be found in profiles.
Implementations may claim conformance with a specific profile, Implementations may claim conformance with a specific profile,
whereby implementations utilizing the same profile interoperate while whereby implementations utilizing the same profile interoperate while
implementations of different profiles are not expected to be implementations of different profiles are not expected to be
interoperable. Some devices, such as mobile phones and tablets, may interoperable. Some devices, such as mobile phones and tablets, may
implement multiple profiles and will therefore be able to interact implement multiple profiles and will therefore be able to interact
with a wider range of low end devices. Requirements on profiles are with a wider range of low end devices. Requirements on profiles are
described at contextually appropriate places througout this memo, and described at contextually appropriate places throughout this
also summarized in Appendix C. specification, and also summarized in Appendix C.
2. Terminology 2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
[RFC2119]. [RFC2119].
Certain security-related terms such as "authentication", Certain security-related terms such as "authentication",
"authorization", "confidentiality", "(data) integrity", "message "authorization", "confidentiality", "(data) integrity", "message
authentication code", and "verify" are taken from [RFC4949]. authentication code", and "verify" are taken from [RFC4949].
Since we describe exchanges as RESTful protocol interactions HTTP Since exchanges in this specification are described as RESTful
[RFC7231] offers useful terminology. protocol interactions, HTTP [RFC7231] offers useful terminology.
Terminology for entities in the architecture is defined in OAuth 2.0 Terminology for entities in the architecture is defined in OAuth 2.0
[RFC6749] and [I-D.ietf-ace-actors], such as client (C), resource [RFC6749] and [I-D.ietf-ace-actors], such as client (C), resource
server (RS), and authorization server (AS). server (RS), and authorization server (AS).
Note that the term "endpoint" is used here following its OAuth Note that the term "endpoint" is used here following its OAuth
definition, which is to denote resources such as /token and definition, which is to denote resources such as token and
/introspect at the AS and /authz-info at the RS. The CoAP [RFC7252] introspection at the AS and authz-info at the RS (see Section 5.8.1
for a definition of the authz-info endpoint). The CoAP [RFC7252]
definition, which is "An entity participating in the CoAP protocol" definition, which is "An entity participating in the CoAP protocol"
is not used in this memo. is not used in this specification.
Since this specification focuses on the problem of access control to Since this specification focuses on the problem of access control to
resources, we simplify the actors by assuming that the client resources, the actors has been simplified by assuming that the client
authorization server (CAS) functionality is not stand-alone but authorization server (CAS) functionality is not stand-alone but
subsumed by either the authorization server or the client (see subsumed by either the authorization server or the client (see
section 2.2 in [I-D.ietf-ace-actors]). section 2.2 in [I-D.ietf-ace-actors]).
We call the specifications of this memo the "framework" or "ACE The specifications in this document is called the "framework" or "ACE
framework". When referring to "profiles of this framework" we mean framework". When referring to "profiles of this framework" it refers
additional memo's that define the use of this specification with to additional specifications that define the use of this
concrete transport, and communication security protocols (e.g. CoAP specification with concrete transport, and communication security
over DTLS). protocols (e.g., CoAP over DTLS).
We use the term "RS Information" for parameters describing
characteristics of the RS (e.g. public key) that the AS provides to
the client.
3. Overview 3. Overview
This specification defines the ACE framework for authorization in the This specification defines the ACE framework for authorization in the
Internet of Things environment. It consists of a set of building Internet of Things environment. It consists of a set of building
blocks. blocks.
The basic block is the OAuth 2.0 [RFC6749] framework, which enjoys The basic block is the OAuth 2.0 [RFC6749] framework, which enjoys
widespread deployment. Many IoT devices can support OAuth 2.0 widespread deployment. Many IoT devices can support OAuth 2.0
without any additional extensions, but for certain constrained without any additional extensions, but for certain constrained
settings additional profiling is needed. settings additional profiling is needed.
Another building block is the lightweight web transfer protocol CoAP Another building block is the lightweight web transfer protocol CoAP
[RFC7252] for those communication environments where HTTP is not [RFC7252], for those communication environments where HTTP is not
appropriate. CoAP typically runs on top of UDP which further reduces appropriate. CoAP typically runs on top of UDP, which further
overhead and message exchanges. While this specification defines reduces overhead and message exchanges. While this specification
extensions for the use of OAuth over CoAP, we do envision further defines extensions for the use of OAuth over CoAP, other underlying
underlying protocols to be supported in the future, such as HTTP/2, protocols are not prohibited from beeing supported in the future,
MQTT and QUIC. such as HTTP/2, MQTT, BLE and QUIC.
A third building block is CBOR [RFC7049] for encodings where JSON A third building block is CBOR [RFC7049], for encodings where JSON
[RFC7159] is not sufficiently compact. CBOR is a binary encoding [RFC7159] is not sufficiently compact. CBOR is a binary encoding
designed for small code and message size, which may be used for designed for small code and message size, which may be used for
encoding of self contained tokens, and also for encoding CoAP POST encoding of self contained tokens, and also for encoding payload
parameters and CoAP responses. transferred in protocol messages.
A fourth building block is the compact CBOR-based secure message A fourth building block is the compact CBOR-based secure message
format COSE [RFC8152], which enables application layer security as an format COSE [RFC8152], which enables application layer security as an
alternative or complement to transport layer security (DTLS [RFC6347] alternative or complement to transport layer security (DTLS [RFC6347]
or TLS [RFC5246]). COSE is used to secure self contained tokens such or TLS [RFC5246]). COSE is used to secure self-contained tokens such
as proof-of-possession (PoP) tokens, which is an extension to the as proof-of-possession (PoP) tokens, which is an extension to the
OAuth access tokens, and "client tokens" which are defined in this OAuth tokens, and "client tokens" which are defined in this framework
framework (see Section 5.6.4). The default access token format is (see Section 5.7.4). The default token format is defined in CBOR web
defined in CBOR web token (CWT) [I-D.ietf-ace-cbor-web-token]. token (CWT) [I-D.ietf-ace-cbor-web-token]. Application layer
Application layer security for CoAP using COSE can be provided with security for CoAP using COSE can be provided with OSCOAP
OSCOAP [I-D.ietf-core-object-security]. [I-D.ietf-core-object-security].
With the building blocks listed above, solutions satisfying various With the building blocks listed above, solutions satisfying various
IoT device and network constraints are possible. A list of IoT device and network constraints are possible. A list of
constraints is described in detail in RFC 7228 [RFC7228] and a constraints is described in detail in RFC 7228 [RFC7228] and a
description of how the building blocks mentioned above relate to the description of how the building blocks mentioned above relate to the
various constraints can be found in Appendix A. various constraints can be found in Appendix A.
Luckily, not every IoT device suffers from all constraints. The ACE Luckily, not every IoT device suffers from all constraints. The ACE
framework nevertheless takes all these aspects into account and framework nevertheless takes all these aspects into account and
allows several different deployment variants to co-exist rather than allows several different deployment variants to co-exist, rather than
mandating a one-size-fits-all solution. We believe this is important mandating a one-size-fits-all solution. It is important to cover the
to cover the wide range of possible interworking use cases and the wide range of possible interworking use cases and the different
different requirements from a security point of view. Once IoT requirements from a security point of view. Once IoT deployments
deployments mature, popular deployment variants will be documented in mature, popular deployment variants will be documented in the form of
form of ACE profiles. ACE profiles.
In the subsections below we provide further details about the
different building blocks.
3.1. OAuth 2.0 3.1. OAuth 2.0
The OAuth 2.0 authorization framework enables a client to obtain The OAuth 2.0 authorization framework enables a client to obtain
limited access to a resource with the permission of a resource owner. scoped access to a resource with the permission of a resource owner.
Authorization information, or references to it, is passed between the Authorization information, or references to it, is passed between the
nodes using access tokens. These access tokens are issued to clients nodes using access tokens. These access tokens are issued to clients
by an authorization server with the approval of the resource owner. by an authorization server with the approval of the resource owner.
The client uses the access token to access the protected resources The client uses the access token to access the protected resources
hosted by the resource server. hosted by the resource server.
A number of OAuth 2.0 terms are used within this specification: A number of OAuth 2.0 terms are used within this specification:
The token and introspect Endpoints: The token and introspection Endpoints:
The AS hosts the /token endpoint that allows a client to request The AS hosts the token endpoint that allows a client to request
access tokens. The client makes a POST request to the /token access tokens. The client makes a POST request to the token
endpoint on the AS and receives the access token in the response endpoint on the AS and receives the access token in the response
(if the request was successful). (if the request was successful).
The token introspection endpoint, /introspect, is used by the RS In some deployments, a token introspection endpoint is provied by
when requesting additional information regarding a received access the AS, which can be used by the RS if it needs to request
token. The RS makes a POST request to /introspect on the AS and additional information regarding a received access token. The RS
makes a POST request to the introspecton endpoint on the AS and
receives information about the access token in the response. (See receives information about the access token in the response. (See
"Introspection" below.) "Introspection" below.)
Access Tokens: Access Tokens:
Access tokens are credentials needed to access protected Access tokens are credentials needed to access protected
resources. An access token is a data structure representing resources. An access token is a data structure representing
authorization permissions issued by the AS to the client. Access authorization permissions issued by the AS to the client. Access
tokens are generated by the authorization server and consumed by tokens are generated by the AS and consumed by the RS. The access
the resource server. The access token content is opaque to the token content is opaque to the client.
client.
Access tokens can have different formats, and various methods of Access tokens can have different formats, and various methods of
utilization (e.g., cryptographic properties) based on the security utilization (e.g., cryptographic properties) based on the security
requirements of the given deployment. requirements of the given deployment.
Proof of Possession Tokens: Proof of Possession Tokens:
An access token may be bound to a cryptographic key, which is then An access token may be bound to a cryptographic key, which is then
used by an RS to authenticate requests from a client. Such tokens used by an RS to authenticate requests from a client. Such tokens
are called proof-of-possession tokens (or PoP tokens). are called proof-of-possession access tokens (or PoP access
tokens).
The proof-of-possession (PoP) security concept assumes that the AS The proof-of-possession (PoP) security concept assumes that the AS
acts as a trusted third party that binds keys to access tokens. acts as a trusted third party that binds keys to access tokens.
These so called PoP keys are then used by the client to These so called PoP keys are then used by the client to
demonstrate the possession of the secret to the RS when accessing demonstrate the possession of the secret to the RS when accessing
the resource. The RS, when receiving an access token, needs to the resource. The RS, when receiving an access token, needs to
verify that the key used by the client matches the one bound to verify that the key used by the client matches the one bound to
the access token. When this specification uses the term "access the access token. When this specification uses the term "access
token" it is assumed to be a PoP token unless specifically stated token" it is assumed to be a PoP access token token unless
otherwise. specifically stated otherwise.
The key bound to the access token (aka PoP key) may be based on The key bound to the access token (the PoP key) may use either
symmetric as well as on asymmetric cryptography. The appropriate symmetric or asymmetric cryptography. The appropriate choice of
choice of security depends on the constraints of the IoT devices the kind of cryptography depends on the constraints of the IoT
as well as on the security requirements of the use case. devices as well as on the security requirements of the use case.
Symmetric PoP key: The AS generates a random symmetric PoP key. Symmetric PoP key: The AS generates a random symmetric PoP key.
The key is either stored to be returned on introspection calls The key is either stored to be returned on introspection calls
or encrypted and included in the access token. The PoP key is or encrypted and included in the access token. The PoP key is
also encrypted for the client and sent together with the access also encrypted for the client and sent together with the access
token to the client. token to the client.
Asymmetric PoP key: An asymmetric key pair is generated on the Asymmetric PoP key: An asymmetric key pair is generated on the
client and the public key is sent to the AS (if it does not client and the public key is sent to the AS (if it does not
already have knowledge of the client's public key). already have knowledge of the client's public key).
Information about the public key, which is the PoP key in this Information about the public key, which is the PoP key in this
case, is either stored to be returned on introspection calls or case, is either stored to be returned on introspection calls or
included inside the access token and sent back to the included inside the access token and sent back to the
requesting client. The RS can identify the client's public key requesting client. The RS can identify the client's public key
from the information in the token, which allows the client to from the information in the token, which allows the client to
use the corresponding private key for the proof of possession. use the corresponding private key for the proof of possession.
The access token is either a simple reference, or a structured The access token is either a simple reference, or a structured
information object (e.g. CWT [I-D.ietf-ace-cbor-web-token]), information object (e.g., CWT [I-D.ietf-ace-cbor-web-token]),
protected by a cryptographic wrapper (e.g. COSE [RFC8152]). The protected by a cryptographic wrapper (e.g., COSE [RFC8152]). The
choice of PoP key does not necessarily imply a specific credential choice of PoP key does not necessarily imply a specific credential
type for the integrity protection of the token. type for the integrity protection of the token.
Scopes and Permissions: Scopes and Permissions:
In OAuth 2.0, the client specifies the type of permissions it is In OAuth 2.0, the client specifies the type of permissions it is
seeking to obtain (via the scope parameter) in the access token seeking to obtain (via the scope parameter) in the access token
request. In turn, the AS may use the scope response parameter to request. In turn, the AS may use the scope response parameter to
inform the client of the scope of the access token issued. As the inform the client of the scope of the access token issued. As the
client could be a constrained device as well, this specification client could be a constrained device as well, this specification
uses CBOR encoded messages for CoAP, defined in Section 5, to uses CBOR encoding as data formt, defined in Section 5, to request
request scopes and to be informed what scopes the access token scopes and to be informed what scopes the access token actually
actually authorizes. authorizes.
The values of the scope parameter are expressed as a list of The values of the scope parameter are expressed as a list of
space- delimited, case-sensitive strings, with a semantic that is space-delimited, case-sensitive strings, with a semantic that is
well-known to the AS and the RS. More details about the concept well-known to the AS and the RS. More details about the concept
of scopes is found under Section 3.3 in [RFC6749]. of scopes is found under Section 3.3 in [RFC6749].
Claims: Claims:
Information carried in the access token or returned from Information carried in the access token or returned from
introspection, called claims, is in the form of type-value pairs. introspection, called claims, is in the form of name-value pairs.
An access token may, for example, include a claim identifying the An access token may, for example, include a claim identifying the
AS that issued the token (via the "iss" claim) and what audience AS that issued the token (via the "iss" claim) and what audience
the access token is intended for (via the "aud" claim). The the access token is intended for (via the "aud" claim). The
audience of an access token can be a specific resource or one or audience of an access token can be a specific resource or one or
many resource servers. The resource owner policies influence what many resource servers. The resource owner policies influence what
claims are put into the access token by the authorization server. claims are put into the access token by the authorization server.
While the structure and encoding of the access token varies While the structure and encoding of the access token varies
throughout deployments, a standardized format has been defined throughout deployments, a standardized format has been defined
with the JSON Web Token (JWT) [RFC7519] where claims are encoded with the JSON Web Token (JWT) [RFC7519] where claims are encoded
as a JSON object. In [I-D.ietf-ace-cbor-web-token] an equivalent as a JSON object. In [I-D.ietf-ace-cbor-web-token], an equivalent
format using CBOR encoding (CWT) has been defined. format using CBOR encoding (CWT) has been defined.
Introspection: Introspection:
Introspection is a method for a resource server to query the Introspection is a method for a resource server to query the
authorization server for the active state and content of a authorization server for the active state and content of a
received access token. This is particularly useful in those cases received access token. This is particularly useful in those cases
where the authorization decisions are very dynamic and/or where where the authorization decisions are very dynamic and/or where
the received access token itself is a reference rather than a the received access token itself is an opaque reference rather
self-contained token. More information about introspection in than a self-contained token. More information about introspection
OAuth 2.0 can be found in [RFC7662]. in OAuth 2.0 can be found in [RFC7662].
3.2. CoAP 3.2. CoAP
CoAP is an application layer protocol similar to HTTP, but CoAP is an application layer protocol similar to HTTP, but
specifically designed for constrained environments. CoAP typically specifically designed for constrained environments. CoAP typically
uses datagram-oriented transport, such as UDP, where reordering and uses datagram-oriented transport, such as UDP, where reordering and
loss of packets can occur. A security solution need to take the loss of packets can occur. A security solution needs to take the
latter aspects into account. latter aspects into account.
While HTTP uses headers and query-strings to convey additional While HTTP uses headers and query strings to convey additional
information about a request, CoAP encodes such information in so- information about a request, CoAP encodes such information into
called 'options'. header parameters called 'options'.
CoAP supports application-layer fragmentation of the CoAP payloads CoAP supports application-layer fragmentation of the CoAP payloads
through blockwise transfers [RFC7959]. However, block-wise transfer through blockwise transfers [RFC7959]. However, blockwise transfer
does not increase the size limits of CoAP options, therefore data does not increase the size limits of CoAP options, therefore data
encoded in options has to be kept small. encoded in options has to be kept small.
Transport layer security for CoAP can be provided by DTLS 1.2 Transport layer security for CoAP can be provided by DTLS 1.2
[RFC6347] or TLS 1.2 [RFC5246]. CoAP defines a number of proxy [RFC6347] or TLS 1.2 [RFC5246]. CoAP defines a number of proxy
operations which requires transport layer security to be terminated operations that require transport layer security to be terminated at
at the proxy. One approach for protecting CoAP communication end-to- the proxy. One approach for protecting CoAP communication end-to-end
end through proxies, and also to support security for CoAP over a through proxies, and also to support security for CoAP over a
different transport in a uniform way, is to provide security on different transport in a uniform way, is to provide security at the
application layer using an object-based security mechanism such as application layer using an object-based security mechanism such as
COSE [RFC8152]. COSE [RFC8152].
One application of COSE is OSCOAP [I-D.ietf-core-object-security], One application of COSE is OSCOAP [I-D.ietf-core-object-security],
which provides end-to-end confidentiality, integrity and replay which provides end-to-end confidentiality, integrity and replay
protection, and a secure binding between CoAP request and response protection, and a secure binding between CoAP request and response
messages. In OSCOAP, the CoAP messages are wrapped in COSE objects messages. In OSCOAP, the CoAP messages are wrapped in COSE objects
and sent using CoAP. and sent using CoAP.
This framework RECOMMENDS the use of CoAP as replacement for HTTP.
4. Protocol Interactions 4. Protocol Interactions
The ACE framework is based on the OAuth 2.0 protocol interactions The ACE framework is based on the OAuth 2.0 protocol interactions
using the /token and /introspect endpoints. A client obtains an using the token endpoint and optionally the introspection endpoint.
access token from an AS using the /token endpoint and subsequently A client obtains an access token from an AS using the token endpoint
presents the access token to a RS to gain access to a protected and subsequently presents the access token to a RS to gain access to
resource. The RS, after receiving an access token, may present it to a protected resource. In most deployments the RS can process the
the AS via the /introspect endpoint to get information about the access token locally, however in some cases the RS may present it to
access token. In other deployments the RS may process the access the AS via the introspection endpoint to get fresh information.
token locally without the need to contact an AS. These interactions These interactions are shown in Figure 1. An overview of various
are shown in Figure 1. An overview of various OAuth concepts is OAuth concepts is provided in Section 3.1.
provided in Section 3.1.
The OAuth 2.0 framework defines a number of "protocol flows" via The OAuth 2.0 framework defines a number of "protocol flows" via
grant types, which have been extended further with extensions to grant types, which have been extended further with extensions to
OAuth 2.0 (such as RFC 7521 [RFC7521] and OAuth 2.0 (such as RFC 7521 [RFC7521] and
[I-D.ietf-oauth-device-flow]). What grant types works best depends [I-D.ietf-oauth-device-flow]). What grant types works best depends
on the usage scenario and RFC 7744 [RFC7744] describes many different on the usage scenario and RFC 7744 [RFC7744] describes many different
IoT use cases but there are two preferred grant types, namely the IoT use cases but there are two preferred grant types, namely the
Authorization Code Grant (described in Section 4.1 of [RFC7521]) and Authorization Code Grant (described in Section 4.1 of [RFC7521]) and
the Client Credentials Grant (described in Section 4.4 of [RFC7521]). the Client Credentials Grant (described in Section 4.4 of [RFC7521]).
The Authorization Code Grant is a good fit for use with apps running The Authorization Code Grant is a good fit for use with apps running
on smart phones and tablets that request access to IoT devices, a on smart phones and tablets that request access to IoT devices, a
common scenario in the smart home environment, where users need to go common scenario in the smart home environment, where users need to go
through an authentication and authorization phase (at least during through an authentication and authorization phase (at least during
the initial setup phase). The native apps guidelines described in the initial setup phase). The native apps guidelines described in
[I-D.ietf-oauth-native-apps] are applicable to this use case. The [I-D.ietf-oauth-native-apps] are applicable to this use case. The
Client Credential Grant is a good fit for use with IoT devices where Client Credential Grant is a good fit for use with IoT devices where
the OAuth client itself is constrained. In such a case the resource the OAuth client itself is constrained. In such a case, the resource
owner or another person on his or her behalf have arranged with the owner has pre-arranged access rights for the client with the
authorization server out-of-band, which is often accomplished using a authorization server, which is often accomplished using a
commissioning tool. commissioning tool.
The consent of the resource owner, for giving a client access to a The consent of the resource owner, for giving a client access to a
protected resource, can be provided dynamically as in the traditional protected resource, can be provided dynamically as in the traditional
OAuth flows, or it could be pre-configured by the resource owner as OAuth flows, or it could be pre-configured by the resource owner as
authorization policies at the AS, which the AS evaluates when a token authorization policies at the AS, which the AS evaluates when a token
request arrives. The resource owner and the requesting party (i.e. request arrives. The resource owner and the requesting party (i.e.,
client owner) are not shown in Figure 1. client owner) are not shown in Figure 1.
This framework supports a wide variety of communication security This framework supports a wide variety of communication security
mechanisms between the ACE entities, such as client, AS, and RS. We mechanisms between the ACE entities, such as client, AS, and RS. It
assume that the client has been registered (also called enrolled or is assumed that the client has been registered (also called enrolled
onboarded) to an AS using a mechanism defined outside the scope of or onboarded) to an AS using a mechanism defined outside the scope of
this document. In practice, various techniques for onboarding have this document. In practice, various techniques for onboarding have
been used, such as factory-based provisioning or the use of been used, such as factory-based provisioning or the use of
commissioning tools. Regardless of the onboarding technique, this commissioning tools. Regardless of the onboarding technique, this
registration procedure implies that the client and the AS share provisioning procedure implies that the client and the AS exchange
credentials, and configuration parameters. These credentials are credentials and configuration parameters. These credentials are used
used to mutually authenticate each other and to protect messages to mutually authenticate each other and to protect messages exchanged
exchanged between the client and the AS. between the client and the AS.
It is also assumed that the RS has been registered with the AS, It is also assumed that the RS has been registered with the AS,
potentially in a similar way as the client has been registered with potentially in a similar way as the client has been registered with
the AS. Established keying material between the AS and the RS allows the AS. Established keying material between the AS and the RS allows
the AS to apply cryptographic protection to the access token to the AS to apply cryptographic protection to the access token to
ensure that its content cannot be modified, and if needed, that the ensure that its content cannot be modified, and if needed, that the
content is confidentiality protected. content is confidentiality protected.
The keying material necessary for establishing communication security The keying material necessary for establishing communication security
between C and RS is dynamically established as part of the protocol between C and RS is dynamically established as part of the protocol
described in this document. described in this document.
At the start of the protocol there is an optional discovery step At the start of the protocol, there is an optional discovery step
where the client discovers the resource server and the resources this where the client discovers the resource server and the resources this
server hosts. In this step the client might also determine what server hosts. In this step, the client might also determine what
permissions are needed to access the protected resource. The permissions are needed to access the protected resource. A generic
detailed procedures for this discovery process may be defined in an procedure is described in Section 5.1, profiles MAY define other
ACE profile and depend on the protocols being used and the specific procedures for discovery.
deployment environment.
In Bluetooth Low Energy, for example, advertisements are broadcasted In Bluetooth Low Energy, for example, advertisements are broadcasted
by a peripheral, including information about the primary services. by a peripheral, including information about the primary services.
In CoAP, as a second example, a client can make a request to "/.well- In CoAP, as a second example, a client can make a request to "/.well-
known/core" to obtain information about available resources, which known/core" to obtain information about available resources, which
are returned in a standardized format as described in [RFC6690]. are returned in a standardized format as described in [RFC6690].
+--------+ +---------------+ +--------+ +---------------+
| |---(A)-- Token Request ------->| | | |---(A)-- Token Request ------->| |
| | | Authorization | | | | Authorization |
| |<--(B)-- Access Token ---------| Server | | |<--(B)-- Access Token ---------| Server |
| | + RS Information | | | | + RS Information | |
| | +---------------+ | | +---------------+
| | ^ | | | ^ |
| | Introspection Request (D)| | | | Introspection Request (D)| |
| Client | | | | Client | (optional) | |
| | Response + Client Token | |(E) | | Response + Client Token | |(E)
| | | v | | (optional) | v
| | +--------------+ | | +--------------+
| |---(C)-- Token + Request ----->| | | |---(C)-- Token + Request ----->| |
| | | Resource | | | | Resource |
| |<--(F)-- Protected Resource ---| Server | | |<--(F)-- Protected Resource ---| Server |
| | | | | | | |
+--------+ +--------------+ +--------+ +--------------+
Figure 1: Basic Protocol Flow. Figure 1: Basic Protocol Flow.
Requesting an Access Token (A): Requesting an Access Token (A):
The client makes an access token request to the /token endpoint at The client makes an access token request to the token endpoint at
the AS. This framework assumes the use of PoP tokens (see the AS. This framework assumes the use of PoP access tokens (see
Section 3.1 for a short description) wherein the AS binds a key to Section 3.1 for a short description) wherein the AS binds a key to
an access token. The client may include permissions it seeks to an access token. The client may include permissions it seeks to
obtain, and information about the credentials it wants to use obtain, and information about the credentials it wants to use
(e.g., symmetric/asymmetric cryptography or a reference to a (e.g., symmetric/asymmetric cryptography or a reference to a
specific credential). specific credential).
Access Token Response (B): Access Token Response (B):
If the AS successfully processes the request from the client, it If the AS successfully processes the request from the client, it
returns an access token. It also returns various parameters, returns an access token. It can also return additional
referred as "RS Information". In addition to the response parameters, referred to as "RS Information". In addition to the
parameters defined by OAuth 2.0 and the PoP token extension, response parameters defined by OAuth 2.0 and the PoP access token
further response parameters, such as information on which profile extension, this framework defines parameters that can be used to
the client should use with the resource server(s). More inform the client about capabilities of the RS. More information
information about these parameters can be found in Section 5.5.4. about these parameters can be found in Section 5.6.4.
Resource Request (C): Resource Request (C):
The client interacts with the RS to request access to the The client interacts with the RS to request access to the
protected resource and provides the access token. The protocol to protected resource and provides the access token. The protocol to
use between the client and the RS is not restricted to CoAP. use between the client and the RS is not restricted to CoAP.
HTTP, HTTP/2, QUIC, MQTT, Bluetooth Low Energy, etc., are also HTTP, HTTP/2, QUIC, MQTT, Bluetooth Low Energy, etc., are also
viable candidates. viable candidates.
Depending on the device limitations and the selected protocol this Depending on the device limitations and the selected protocol,
exchange may be split up into two parts: this exchange may be split up into two parts:
(1) the client sends the access token containing, or (1) the client sends the access token containing, or
referencing, the authorization information to the RS, that may referencing, the authorization information to the RS, that may
be used for subsequent resource requests by the client, and be used for subsequent resource requests by the client, and
(2) the client makes the resource access request, using the (2) the client makes the resource access request, using the
communication security protocol and other RS Information communication security protocol and other RS Information
obtained from the AS. obtained from the AS.
The Client and the RS mutually authenticate using the security The Client and the RS mutually authenticate using the security
protocol specified in the profile (see step B) and the keys protocol specified in the profile (see step B) and the keys
skipping to change at page 12, line 50 skipping to change at page 13, line 28
token. The RS verifies that the token is integrity protected by token. The RS verifies that the token is integrity protected by
the AS and compares the claims contained in the access token with the AS and compares the claims contained in the access token with
the resource request. If the RS is online, validation can be the resource request. If the RS is online, validation can be
handed over to the AS using token introspection (see messages D handed over to the AS using token introspection (see messages D
and E) over HTTP or CoAP, in which case the different parts of and E) over HTTP or CoAP, in which case the different parts of
step C may be interleaved with introspection. step C may be interleaved with introspection.
Token Introspection Request (D): Token Introspection Request (D):
A resource server may be configured to introspect the access token A resource server may be configured to introspect the access token
by including it in a request to the /introspect endpoint at that by including it in a request to the introspection endpoint at that
AS. Token introspection over CoAP is defined in Section 5.6 and AS. Token introspection over CoAP is defined in Section 5.7 and
for HTTP in [RFC7662]. for HTTP in [RFC7662].
Note that token introspection is an optional step and can be Note that token introspection is an optional step and can be
omitted if the token is self-contained and the resource server is omitted if the token is self-contained and the resource server is
prepared to perform the token validation on its own. prepared to perform the token validation on its own.
Token Introspection Response (E): Token Introspection Response (E):
The AS validates the token and returns the most recent parameters, The AS validates the token and returns the most recent parameters,
such as scope, audience, validity etc. associated with it back to such as scope, audience, validity etc. associated with it back to
the RS. The RS then uses the received parameters to process the the RS. The RS then uses the received parameters to process the
request to either accept or to deny it. The AS can additionally request to either accept or to deny it. The AS can additionally
return information that the RS needs to pass on to the client in return information that the RS needs to pass on to the client in
the form of a client token. The latter is used to establish keys the form of a client token. The latter is used to establish keys
for mutual authentication between client and RS, when the client for mutual authentication between client and RS, when the client
has no direct connectivity to the AS, see Section 5.6.4 for has no direct connectivity to the AS, see Section 5.7.4 for
details. details.
Protected Resource (F): Protected Resource (F):
If the request from the client is authorized, the RS fulfills the If the request from the client is authorized, the RS fulfills the
request and returns a response with the appropriate response code. request and returns a response with the appropriate response code.
The RS uses the dynamically established keys to protect the The RS uses the dynamically established keys to protect the
response, according to used communication security protocol. response, according to used communication security protocol.
5. Framework 5. Framework
The following sections detail the profiling and extensions of OAuth The following sections detail the profiling and extensions of OAuth
2.0 for constrained environments which constitutes the ACE framework. 2.0 for constrained environments, which constitutes the ACE
framework.
Credential Provisioning Credential Provisioning
For IoT we cannot generally assume that the client and RS are part For IoT, it cannot be assumed that the client and RS are part of a
of a common key infrastructure, so the AS provisions credentials common key infrastructure, so the AS provisions credentials or
or associated information to allow mutual authentication. These associated information to allow mutual authentication. These
credentials need to be provided to the parties before or during credentials need to be provided to the parties before or during
the authentication protocol is executed, and may be re-used for the authentication protocol is executed, and may be re-used for
subsequent token requests. subsequent token requests.
Proof-of-Possession Proof-of-Possession
The ACE framework by default implements proof-of-possession for The ACE framework, by default, implements proof-of-possession for
access tokens, i.e. that the token holder can prove being a holder access tokens, i.e., that the token holder can prove being a
of the key bound to the token. The binding is provided by the holder of the key bound to the token. The binding is provided by
"cnf" claim indicating what key is used for proof-of-possession. the "cnf" claim [I-D.jones-ace-cwt-proof-of-possession] indicating
If clients need to update a token, e.g. to get additional rights, what key is used for proof-of-possession. If a client needs to
they can request that the AS binds the new access token to the submit a new access token e.g., to obtain additional access
same key as the previous token. rights, they can request that the AS binds this token to the same
key as the previous one.
ACE Profiles ACE Profiles
The client or RS may be limited in the encodings or protocols it The client or RS may be limited in the encodings or protocols it
supports. To support a variety of different deployment settings, supports. To support a variety of different deployment settings,
specific interactions between client and RS are defined in an ACE specific interactions between client and RS are defined in an ACE
profile. In ACE framework the AS is expected to manage the profile. In ACE framework the AS is expected to manage the
matching of compatible profile choices between a client and an RS. matching of compatible profile choices between a client and an RS.
The AS informs the client of the selected profile using the The AS informs the client of the selected profile using the
"profile" parameter in the token response. "profile" parameter in the token response.
OAuth 2.0 requires the use of TLS both to protect the communication OAuth 2.0 requires the use of TLS both to protect the communication
between AS and client when requesting an access token; between client between AS and client when requesting an access token; between client
and RS when accessing a resource and between AS and RS for and RS when accessing a resource and between AS and RS if
introspection. In constrained settings TLS is not always feasible, introspection is used. In constrained settings TLS is not always
or desirable. Nevertheless it is REQUIRED that the data exchanged feasible, or desirable. Nevertheless it is REQUIRED that the data
with the AS is encrypted and integrity protected. It is furthermore exchanged with the AS is encrypted and integrity protected. It is
REQUIRED that the AS and the endpoint communicating with it (client furthermore REQUIRED that the AS and the endpoint communicating with
or RS) perform mutual authentication. it (client or RS) perform mutual authentication.
Profiles MUST specify how mutual authentication is done, depending Profiles MUST specify how mutual authentication is done, depending
e.g. on the communication protocol and the credentials used by the e.g. on the communication protocol and the credentials used by the
client or the RS. client or the RS.
In OAuth 2.0 the communication with the Token and the Introspection In OAuth 2.0 the communication with the Token and the Introspection
endpoints at the AS is assumed to be via HTTP and may use Uri-query endpoints at the AS is assumed to be via HTTP and may use Uri-query
parameters. This framework RECOMMENDS to use CoAP instead and parameters. This framework RECOMMENDS to use CoAP instead and
RECOMMENDS the use of the following alternative instead of Uri-query RECOMMENDS the use of the following alternative instead of Uri-query
parameters: The sender (client or RS) encodes the parameters of its parameters: The sender (client or RS) encodes the parameters of its
request as a CBOR map and submits that map as the payload of the POST request as a CBOR map and submits that map as the payload of the POST
request. The Content-format depends on the security applied to the request. The Content-format depends on the security applied to the
content and MUST be specified by the profile that is used. content and MUST be specified by the profile that is used.
The OAuth 2.0 AS uses a JSON structure in the payload of its The OAuth 2.0 AS uses a JSON structure in the payload of its
responses both to client and RS. This framework RECOMMENDS the use responses both to client and RS. This framework REQUIRES the use of
of CBOR [RFC7049] instead. The requesting device can explicitly CBOR [RFC7049] instead. Depending on the profile, the CBOR payload
request this encoding by setting the CoAP Accept option in the MAY be enclosed in a non-CBOR cryptographic wrapper.
request to "application/cbor". Depending on the profile, the content
MAY arrive in a different format wrapping a CBOR payload.
5.1. Authorization Grants 5.1. Discovering Authorization Servers
In order to determine the AS in charge of a resource hosted at the
RS, C MAY send an initial Unauthorized Resource Request message to
RS. RS then denies the request and sends the address of its AS back
to C.
Instead of the initial Unauthorized Resource Request message, C MAY
look up the desired resource in a resource directory (cf.
[I-D.ietf-core-resource-directory]).
5.1.1. Unauthorized Resource Request Message
The optional Unauthorized Resource Request message is a request for a
resource hosted by RS for which no proper authorization is granted.
RS MUST treat any request for a protected resource as Unauthorized
Resource Request message when any of the following holds:
o The request has been received on an unprotected channel.
o RS has no valid access token for the sender of the request
regarding the requested action on that resource.
o RS has a valid access token for the sender of the request, but
this does not allow the requested action on the requested
resource.
Note: These conditions ensure that RS can handle requests
autonomously once access was granted and a secure channel has been
established between C and RS. The authz-info endpoint MUST NOT be
protected as specified above, in order to allow clients to upload
access tokens to RS (cf. Section 5.8.1).
Unauthorized Resource Request messages MUST be denied with a client
error response. In this response, the Resource Server SHOULD provide
proper AS Information to enable the Client to request an access token
from RS's AS as described in Section 5.1.2.
The response code MUST be 4.01 (Unauthorized) in case the sender of
the Unauthorized Resource Request message is not authenticated, or if
RS has no valid access token for C. If RS has an access token for C
but not for the resource that C has requested, RS MUST reject the
request with a 4.03 (Forbidden). If RS has an access token for C but
it does not cover the action C requested on the resource, RS MUST
reject the request with a 4.05 (Method Not Allowed).
Note: The use of the response codes 4.03 and 4.05 is intended to
prevent infinite loops where a dumb Client optimistically tries to
access a requested resource with any access token received from AS.
As malicious clients could pretend to be C to determine C's
privileges, these detailed response codes must be used only when a
certain level of security is already available which can be achieved
only when the Client is authenticated.
5.1.2. AS Information
The AS Information is sent by RS as a response to an Unauthorized
Resource Request message (see Section 5.1.1) to point the sender of
the Unauthorized Resource Request message to RS's AS. The AS
information is a set of attributes containing an absolute URI (see
Section 4.3 of [RFC3986]) that specifies the AS in charge of RS.
The message MAY also contain a nonce generated by RS to ensure
freshness in case that the RS and AS do not have synchronized clocks.
Figure 2 summarizes the parameters that may be part of the AS
Information.
/----------------+----------+-------------------\
| Parameter name | CBOR Key | Major Type |
|----------------+----------+-------------------|
| AS | 0 | 3 (text string) |
| nonce | 5 | 2 (byte string) |
\----------------+----------+-------------------/
Figure 2: AS Information parameters
Figure 3 shows an example for an AS Information message payload using
CBOR [RFC7049] diagnostic notation, using the parameter names instead
of the CBOR keys for better human readability.
4.01 Unauthorized
Content-Format: application/ace+cbor
{AS: "coaps://as.example.com/token",
nonce: h'e0a156bb3f'}
Figure 3: AS Information payload example
In this example, the attribute AS points the receiver of this message
to the URI "coaps://as.example.com/token" to request access
permissions. The originator of the AS Information payload (i.e., RS)
uses a local clock that is loosely synchronized with a time scale
common between RS and AS (e.g., wall clock time). Therefore, it has
included a parameter "nonce" for replay attack prevention.
Note: There is an ongoing discussion how freshness of access
tokens
can be achieved in constrained environments. This specification
for now assumes that RS and AS do not have a common understanding
of time that allows RS to achieve its security objectives without
explicitly adding a nonce.
Figure 4 illustrates the mandatory to use binary encoding of the
message payload shown in Figure 3.
a2 # map(2)
00 # unsigned(0) (=AS)
78 1c # text(28)
636f6170733a2f2f61732e657861
6d706c652e636f6d2f746f6b656e # "coaps://as.example.com/token"
05 # unsigned(5) (=nonce)
45 # bytes(5)
e0a156bb3f
Figure 4: AS Information example encoded in CBOR
5.2. Authorization Grants
To request an access token, the client obtains authorization from the To request an access token, the client obtains authorization from the
resource owner or uses its client credentials as grant. The resource owner or uses its client credentials as grant. The
authorization is expressed in the form of an authorization grant. authorization is expressed in the form of an authorization grant.
The OAuth framework defines four grant types. The grant types can be The OAuth framework defines four grant types. The grant types can be
split up into two groups, those granted on behalf of the resource split up into two groups, those granted on behalf of the resource
owner (password, authorization code, implicit) and those for the owner (password, authorization code, implicit) and those for the
client (client credentials). client (client credentials).
The grant type is selected depending on the use case. In cases where The grant type is selected depending on the use case. In cases where
the client acts on behalf of the resource owner, authorization code the client acts on behalf of the resource owner, authorization code
grant is recommended. If the client acts on behalf of the resource grant is recommended. If the client acts on behalf of the resource
owner, but does not have any display or very limited interaction owner, but does not have any display or very limited interaction
possibilities it is recommended to use the device code grant defined possibilities it is recommended to use the device code grant defined
in [I-D.ietf-oauth-device-flow]. In cases where the client does not in [I-D.ietf-oauth-device-flow]. In cases where the client does not
act on behalf of the resource owner, client credentials grant is act on behalf of the resource owner, client credentials grant is
recommended. recommended.
For details on the different grant types see the OAuth 2.0 framework. For details on the different grant types, see the OAuth 2.0 framework
The OAuth 2.0 framework provides an extension mechanism for defining [RFC6749]. The OAuth 2.0 framework provides an extension mechanism
additional grant types so profiles of this framework MAY define for defining additional grant types so profiles of this framework MAY
additional grant types if needed. define additional grant types, if needed.
5.2. Client Credentials 5.3. Client Credentials
Authentication of the client is mandatory independent of the grant Authentication of the client is mandatory independent of the grant
type when requesting the access token from the token endpoint. In type when requesting the access token from the token endpoint. In
the case of client credentials grant type the authentication and the case of client credentials grant type, the authentication and
grant coincides. grant coincide.
Client registration and provisioning of client credentials to the Client registration and provisioning of client credentials to the
client is out of scope for this specification. client is out of scope for this specification.
The OAuth framework, [RFC6749], defines one client credential type, The OAuth framework [RFC6749] defines one client credential type,
client id and client secret. Profiles of this framework MAY extend client id and client secret. [I-D.erdtman-ace-rpcc] adds raw-public-
with additional client credentials such as DTLS pre-shared keys or key and pre-shared-key to the client credentials types. Profiles of
client certificates. this framework MAY extend with additional client credentials client
certificates.
5.3. AS Authentication 5.4. AS Authentication
Client credential does not by default authenticate the AS that the Client credential does not, by default, authenticate the AS that the
client connects to. In classic OAuth the AS is authenticated with a client connects to. In classic OAuth, the AS is authenticated with a
TLS server certificate. TLS server certificate.
Profiles of this framework SHOULD specify how clients authenticate Profiles of this framework MUST specify how clients authenticate the
the AS and how communication security is implemented, otherwise AS and how communication security is implemented, otherwise server
server side TLS certificates as defined by OAuth 2.0 is required. side TLS certificates, as defined by OAuth 2.0, are required.
5.4. The 'Authorize' Endpoint 5.5. The Authorization Endpoint
The authorization endpoint is used to interact with the resource The authorization endpoint is used to interact with the resource
owner and obtain an authorization grant in certain grant flows. owner and obtain an authorization grant in certain grant flows.
Since it requires the use of a user agent (i.e. browser), it is not Since it requires the use of a user agent (i.e., browser), it is not
expected that these types of grant flow will be used by constrained expected that these types of grant flow will be used by constrained
clients. This endpoint is therefore out of scope for this clients. This endpoint is therefore out of scope for this
specification. Implementations should use the definition and specification. Implementations should use the definition and
recommendations of [RFC6749] and [RFC6819]. recommendations of [RFC6749] and [RFC6819].
If clients involved cannot support HTTP and TLS profiles MAY define If clients involved cannot support HTTP and TLS, profiles MAY define
mappings for the authorization endpoint. mappings for the authorization endpoint.
5.5. The 'Token' Endpoint 5.6. The Token Endpoint
In plain OAuth 2.0 the AS provides the /token endpoint for submitting In standard OAuth 2.0, the AS provides the token endpoint for
access token requests. This framework extends the functionality of submitting access token requests. This framework extends the
the /token endpoint, giving the AS the possibility to help client and functionality of the token endpoint, giving the AS the possibility to
RS to establish shared keys or to exchange their public keys. help the client and RS to establish shared keys or to exchange their
Furthermore this framework defines encodings using CoAP and CBOR, in public keys. Furthermore, this framework defines encodings using
addition to HTTP and JSON. CBOR, as a substitute for JSON.
For the AS to be able to issue a token the client MUST be For the AS to be able to issue a token, the client MUST be
authenticated and present a valid grant for the scopes requested. authenticated and present a valid grant for the scopes requested.
Profiles of this framework MUST specify how the AS authenticates the
client and how the communication between client and AS is protected.
The figures of this section uses CBOR diagnostic notation without the The figures of this section use CBOR diagnostic notation without the
integer abbreviations for the parameters or their values for better integer abbreviations for the parameters or their values for
readability. illustrative purposes. Note that implementations MUST use the
integer abbreviations and the binary CBOR encoding.
5.5.1. Client-to-AS Request 5.6.1. Client-to-AS Request
The client sends a CoAP POST request to the token endpoint at the AS, The client sends a POST request to the token endpoint at the AS. The
the profile MUST specify the Content-Type and wrapping of the profile MUST specify the Content-Type and wrapping of the payload.
payload. The content of the request consists of the parameters The content of the request consists of the parameters specified in
specified in section 4 of the OAuth 2.0 specification [RFC6749] section 4 of the OAuth 2.0 specification [RFC6749], encoded as a CBOR
encoded as a CBOR map. map.
In addition to these parameters, this framework defines the following In addition to these parameters, this framework defines the following
parameters for requesting an access token from a /token endpoint: parameters for requesting an access token from a token endpoint:
aud aud
OPTIONAL. Specifies the audience for which the client is OPTIONAL. Specifies the audience for which the client is
requesting an access token. If this parameter is missing it is requesting an access token. If this parameter is missing, it is
assumed that the client and the AS have a pre-established assumed that the client and the AS have a pre-established
understanding of the audience that an access token should address. understanding of the audience that an access token should address.
If a client submits a request for an access token without If a client submits a request for an access token without
specifying an "aud" parameter, and the AS does not have a default specifying an "aud" parameter, and the AS does not have an
"aud" value for this client, then the AS MUST respond with an implicit understanding of the "aud" value for this client, then
error message with the CoAP response code 4.00 (Bad Request). the AS MUST respond with an error message using a response code
equivalent to the CoAP response code 4.00 (Bad Request).
cnf cnf
OPTIONAL. This field contains information about the key the OPTIONAL. This field contains information about the key the
client would like to bind to the access token for proof-of- client would like to bind to the access token for proof-of-
possession. It is RECOMMENDED that an AS reject a request possession. It is RECOMMENDED that an AS reject a request
containing a symmetric key value in the 'cnf' field. See containing a symmetric key value in the 'cnf' field, since the AS
Section 5.5.4.5 for more details on the formatting of the 'cnf' is expected to be able to generate better symmetric keys than a
parameter. potentially constrained client. See Section 5.6.4.5 for more
details on the formatting of the 'cnf' parameter.
The following examples illustrate different types of requests for The following examples illustrate different types of requests for
proof-of-possession tokens. proof-of-possession tokens.
Figure 2 shows a request for a token with a symmetric proof-of- Figure 5 shows a request for a token with a symmetric proof-of-
possession key. Note that in this example we assume a DTLS-based possession key. Note that in this example it is assumed that
communication security profile, therefore the Content-Type is transport layer communication security is used, therefore the
"application/cbor". The content is displayed in CBOR diagnostic Content-Type is "application/cbor". The content is displayed in CBOR
notation, without abbreviations for better readability. diagnostic notation, without abbreviations for better readability.
Header: POST (Code=0.02) Header: POST (Code=0.02)
Uri-Host: "server.example.com" Uri-Host: "server.example.com"
Uri-Path: "token" Uri-Path: "token"
Content-Type: "application/cbor" Content-Type: "application/cbor"
Payload: Payload:
{ {
"grant_type" : "client_credentials", "grant_type" : "client_credentials",
"aud" : "tempSensor4711", "client_id" : "myclient",
"aud" : "tempSensor4711"
} }
Figure 2: Example request for an access token bound to a symmetric Figure 5: Example request for an access token bound to a symmetric
key. key.
Figure 3 shows a request for a token with an asymmetric proof-of- Figure 6 shows a request for a token with an asymmetric proof-of-
possession key. Note that in this example we assume an object possession key. Note that in this example COSE is used to provide
security-based profile, therefore the Content-Type is "application/ object-security, therefore the Content-Type is "application/cose".
cose".
Header: POST (Code=0.02) Header: POST (Code=0.02)
Uri-Host: "server.example.com" Uri-Host: "server.example.com"
Uri-Path: "token" Uri-Path: "token"
Content-Type: "application/cose" Content-Type: "application/cose"
Payload: Payload:
"COSE_Encrypted" : { "COSE_Encrypted" : {
16( 16(
[ h'a1010a', # protected header: {"alg" : "AES-CCM-16-64-128"} [ h'a1010a', # protected header: {"alg" : "AES-CCM-16-64-128"}
{5 : b64'ifUvZaHFgJM7UmGnjA'}, # unprotected header, IV {5 : b64'ifUvZaHFgJM7UmGnjA'}, # unprotected header, IV
b64'WXThuZo6TMCaZZqi6ef/8WHTjOdGk8kNzaIhIQ' # ciphertext b64'WXThuZo6TMCaZZqi6ef/8WHTjOdGk8kNzaIhIQ' # ciphertext
] ]
) )
} }
Decrypted payload: Decrypted payload:
{ {
"grant_type" : "client_credentials", "grant_type" : "client_credentials",
"client_id" : "myclient",
"cnf" : { "cnf" : {
"COSE_Key" : { "COSE_Key" : {
"kty" : "EC", "kty" : "EC",
"kid" : h'11', "kid" : h'11',
"crv" : "P-256", "crv" : "P-256",
"x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8', "x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8',
"y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4' "y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4'
} }
} }
} }
Figure 3: Example token request bound to an asymmetric key. Figure 6: Example token request bound to an asymmetric key.
Figure 4 shows a request for a token where a previously communicated Figure 7 shows a request for a token where a previously communicated
proof-of-possession key is only referenced. Note that we assume a proof-of-possession key is only referenced. Note that a transport
DTLS-based communication security profile for this example, therefore layer based communication security profile is assumed in this
the Content-Type is "application/cbor". Also note that the client example, therefore the Content-Type is "application/cbor". Also note
performs a password based authentication in this example by that the client performs a password based authentication in this
submitting its client_secret (see section 2.3.1. of [RFC6749]). example by submitting its client_secret (see section 2.3.1. of
[RFC6749]).
Header: POST (Code=0.02) Header: POST (Code=0.02)
Uri-Host: "server.example.com" Uri-Host: "server.example.com"
Uri-Path: "token" Uri-Path: "token"
Content-Type: "application/cbor" Content-Type: "application/cbor"
Payload: Payload:
{ {
"grant_type" : "client_credentials", "grant_type" : "client_credentials",
"client_id" : "myclient", "client_id" : "myclient",
"client_secret" : "mysecret234", "client_secret" : "mysecret234",
"aud" : "valve424", "aud" : "valve424",
"scope" : "read", "scope" : "read",
"cnf" : { "cnf" : {
"kid" : b64'6kg0dXJM13U' "kid" : b64'6kg0dXJM13U'
} }
} }
Figure 4: Example request for an access token bound to a key Figure 7: Example request for an access token bound to a key
reference. reference.
5.5.2. AS-to-Client Response 5.6.2. AS-to-Client Response
If the access token request has been successfully verified by the AS If the access token request has been successfully verified by the AS
and the client is authorized to obtain an access token corresponding and the client is authorized to obtain an access token corresponding
to its access token request, the AS sends a response with the CoAP to its access token request, the AS sends a response with the
response code 2.01 (Created). If client request was invalid, or not response code equivalent to the CoAP response code 2.01 (Created).
authorized, the AS returns an error response as described in If client request was invalid, or not authorized, the AS returns an
Section 5.5.3. error response as described in Section 5.6.3.
Note that the AS decides which token type and profile to use when Note that the AS decides which token type and profile to use when
issuing a successful response. It is assumed that the AS has prior issuing a successful response. It is assumed that the AS has prior
knowledge of the capabilities of the client, and the RS (see knowledge of the capabilities of the client and the RS (see
Appendix D. This prior knowledge may, for example, be set by the use Appendix D. This prior knowledge may, for example, be set by the use
of a dynamic client registration protocol exchange [RFC7591]. of a dynamic client registration protocol exchange [RFC7591].
The content of the successful reply is the RS Information. It MUST The content of the successful reply is the RS Information. It MUST
be encoded as CBOR map, containing parameters as specified in section be encoded as CBOR map, containing parameters as specified in section
5.1 of [RFC6749]. In addition to these parameters, the following 5.1 of [RFC6749]. In addition to these parameters, the following
parameters are also part of a successful response: parameters are also part of a successful response:
profile profile
REQUIRED. This indicates the profile that the client MUST use OPTIONAL. This indicates the profile that the client MUST use
towards the RS. See Section 5.5.4.4 for the formatting of this towards the RS. See Section 5.6.4.4 for the formatting of this
parameter. parameter.
. If this parameter is absent, the AS assumes that the client
implicitly knows which profile to use towards the RS.
cnf cnf
REQUIRED if the token type is 'pop'. OPTIONAL otherwise. If a REQUIRED if the token type is "pop" and a symmetric key is used.
symmetric proof-of-possession algorithms was selected, this field MUST NOT be present otherwise. This field contains the symmetric
contains the proof-of-possession key. If an asymmetric algorithm proof-of-possession key the client is supposed to use. See
was selected, this field contains information about the public key Section 5.6.4.5 for details on the use of this parameter.
used by the RS to authenticate. See Section 5.5.4.5 for the rs_cnf
formatting of this parameter. OPTIONAL if the token type is "pop" and asymmetric keys are used.
MUST NOT be present otherwise. This field contains information
about the public key used by the RS to authenticate. See
Section 5.6.4.5 for details on the use of this parameter. If this
parameter is absent, the AS assumes that the client already knows
the public key of the RS.
token_type token_type
OPTIONAL. By default implementations of this framework SHOULD OPTIONAL. By default implementations of this framework SHOULD
assume that the token_type is 'pop'. If a specific use case assume that the token_type is "pop". If a specific use case
requires another token_type (e.g. 'Bearer') to be used then this requires another token_type (e.g., "Bearer") to be used then this
parameter is REQUIRED. parameter is REQUIRED.
Note that if CBOR Web Tokens [I-D.ietf-ace-cbor-web-token] are used, Note that if CBOR Web Tokens [I-D.ietf-ace-cbor-web-token] are used,
the access token can also contain a 'cnf' claim. This claim is the access token can also contain a "cnf" claim
however consumed by a different party. The access token is created [I-D.jones-ace-cwt-proof-of-possession]. This claim is however
by the AS and processed by the RS (and opaque to the client) whereas consumed by a different party. The access token is created by the AS
the RS Information is created by the AS and processed by the client; and processed by the RS (and opaque to the client) whereas the RS
it is never forwarded to the resource server. Information is created by the AS and processed by the client; it is
never forwarded to the resource server.
Figure Figure 5 summarizes the parameters that may be part of the RS Figure 8 summarizes the parameters that may be part of the RS
Information. Information.
/-------------------+--------------------------\ /-------------------+--------------------------\
| Parameter name | Specified in | | Parameter name | Specified in |
|-------------------+--------------------------| |-------------------+--------------------------|
| access_token | RFC 6749 | | access_token | RFC 6749 |
| token_type | RFC 6749 | | token_type | RFC 6749 |
| expires_in | RFC 6749 | | expires_in | RFC 6749 |
| refresh_token | RFC 6749 | | refresh_token | RFC 6749 |
| scope | RFC 6749 | | scope | RFC 6749 |
| state | RFC 6749 | | state | RFC 6749 |
| error | RFC 6749 |
| error_description | RFC 6749 |
| error_uri | RFC 6749 |
| profile | [[ this specification ]] | | profile | [[ this specification ]] |
| cnf | [[ this specification ]] | | cnf | [[ this specification ]] |
| rs_cnf | [[ this specification ]] |
\-------------------+--------------------------/ \-------------------+--------------------------/
Figure 5: RS Information parameters Figure 8: RS Information parameters
Figure 6 shows a response containing a token and a 'cnf' parameter Figure 9 shows a response containing a token and a "cnf" parameter
with a symmetric proof-of-possession key. Note that we assume a with a symmetric proof-of-possession key. Note that transport layer
DTLS-based communication security profile for this example, therefore security is assumed in this example, therefore the Content-Type is
the Content-Type is "application/cbor". "application/cbor".
Header: Created (Code=2.01) Header: Created (Code=2.01)
Content-Type: "application/cbor" Content-Type: "application/cbor"
Payload: Payload:
{ {
"access_token" : b64'SlAV32hkKG ... "access_token" : b64'SlAV32hkKG ...
(remainder of CWT omitted for brevity; (remainder of CWT omitted for brevity;
CWT contains COSE_Key in the 'cnf' claim)', CWT contains COSE_Key in the "cnf" claim)',
"profile" : "coap_dtls", "profile" : "coap_dtls",
"expires_in" : "3600", "expires_in" : "3600",
"cnf" : { "cnf" : {
"COSE_Key" : { "COSE_Key" : {
"kty" : "Symmetric", "kty" : "Symmetric",
"kid" : b64'39Gqlw', "kid" : b64'39Gqlw',
"k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh'
} }
} }
} }
Figure 6: Example AS response with an access token bound to a Figure 9: Example AS response with an access token bound to a
symmetric key. symmetric key.
5.5.3. Error Response 5.6.3. Error Response
The error responses for CoAP-based interactions with the AS are The error responses for CoAP-based interactions with the AS are
equivalent to the ones for HTTP-based interactions as defined in equivalent to the ones for HTTP-based interactions as defined in
section 5.2 of [RFC6749], with the following differences: section 5.2 of [RFC6749], with the following differences:
o The Content-Type MUST be specified by the communication security o The Content-Type MUST be specified by the communication security
profile used between client and AS. The raw payload before being profile used between client and AS. The raw payload before being
processed by the communication security protocol MUST be encoded processed by the communication security protocol MUST be encoded
as a CBOR map. as a CBOR map.
o The CoAP response code 4.00 (Bad Request) MUST be used for all o A response code equivalent to the CoAP code 4.00 (Bad Request)
error responses, except for invalid_client where the CoAP response MUST be used for all error responses, except for invalid_client
code 4.01 (Unauthorized) MAY be used under the same conditions as where a response code equivalent to the CoAP code 4.01
specified in section 5.2 of [RFC6749]. (Unauthorized) MAY be used under the same conditions as specified
o The parameters "error", "error_description" and "error_uri" MAY be in section 5.2 of [RFC6749].
abbreviated using the codes specified in table Figure 13. o The parameters "error", "error_description" and "error_uri" MUST
o The error codes MAY be abbreviated using the codes specified in be abbreviated using the codes specified in Figure 12.
table Figure 7. o The error code (i.e., value of the "error" parameter) MUST be
abbreviated as specified in Figure 10.
/------------------------+----------+--------------\ /------------------------+-------------------\
| error code | CBOR Key | Major Type | | error code | CBOR Value (uint) |
|------------------------+----------+--------------| |------------------------+-------------------|
| invalid_request | 0 | 0 (uint) | | invalid_request | 0 |
| invalid_client | 1 | 0 | | invalid_client | 1 |
| invalid_grant | 2 | 0 | | invalid_grant | 2 |
| unauthorized_client | 3 | 0 | | unauthorized_client | 3 |
| unsupported_grant_type | 4 | 0 | | unsupported_grant_type | 4 |
| invalid_scope | 5 | 0 | | invalid_scope | 5 |
| unsupported_pop_key | 6 | 0 | | unsupported_pop_key | 6 |
\------------------------+----------+--------------/ \------------------------+-------------------/
Figure 7: CBOR abbreviations for common error codes Figure 10: CBOR abbreviations for common error codes
In addition to the error responses defined in OAuth 2.0, the In addition to the error responses defined in OAuth 2.0, the
follwoing behaviour MUST be implemented by the AS: If the client following behavior MUST be implemented by the AS: If the client
submits an asymmetric key in the token request that the RS cannot submits an asymmetric key in the token request that the RS cannot
process, the AS MUST reject that request with the CoAP response code process, the AS MUST reject that request with a response code
4.00 (Bad Request) with the error code "unsupported_pop_key" defined equivalent to the CoAP code 4.00 (Bad Request) including the error
in figure Figure 7. code "unsupported_pop_key" defined in Figure 10.
5.5.4. Request and Response Parameters 5.6.4. Request and Response Parameters
This section provides more detail about the new parameters that can This section provides more detail about the new parameters that can
be used in access token requests and responses, as well as be used in access token requests and responses, as well as
abbreviations for more compact encoding of existing parameters and abbreviations for more compact encoding of existing parameters and
common parameter values. common parameter values.
5.5.4.1. Audience 5.6.4.1. Audience
This parameter specifies for which audience the client is requesting This parameter specifies for which audience the client is requesting
a token. It should be encoded as CBOR text string (major type 3). a token. It should be encoded as CBOR text string (major type 3).
The formatting and semantics of these strings are application The formatting and semantics of these strings are application
specific. specific.
5.5.4.2. Grant Type 5.6.4.2. Grant Type
The abbreviations in Figure 8 MAY be used in CBOR encodings instead The abbreviations in Figure 11 MUST be used in CBOR encodings instead
of the string values defined in [RFC6749]. of the string values defined in [RFC6749].
/--------------------+----------+--------------\ /--------------------+-------------------\
| grant_type | CBOR Key | Major Type | | grant_type | CBOR Value (uint) |
|--------------------+----------+--------------| |--------------------+-------------------|
| password | 0 | 0 (uint) | | password | 0 |
| authorization_code | 1 | 0 | | authorization_code | 1 |
| client_credentials | 2 | 0 | | client_credentials | 2 |
| refresh_token | 3 | 0 | | refresh_token | 3 |
\--------------------+----------+--------------/ \--------------------+-------------------/
Figure 8: CBOR abbreviations for common grant types Figure 11: CBOR abbreviations for common grant types
5.5.4.3. Token Type 5.6.4.3. Token Type
The token_type parameter is defined in [RFC6749], allowing the AS to The token_type parameter is defined in [RFC6749], allowing the AS to
indicate to the client which type of access token it is receiving indicate to the client which type of access token it is receiving
(e.g. a bearer token). (e.g., a bearer token).
This document registers the new value "pop" for the OAuth Access This document registers the new value "pop" for the OAuth Access
Token Types registry, specifying a Proof-of-Possession token. How Token Types registry, specifying a Proof-of-Possession token. How
the proof-of-possession is performed MUST be specified by the the proof-of-possession is performed MUST be specified by the
profiles. profiles.
The values in the 'token_type' parameter MUST be CBOR text strings The values in the "token_type" parameter MUST be CBOR text strings
(major type 3). (major type 3).
In this framework token type 'pop' MUST be assumed by default if the In this framework token type "pop" MUST be assumed by default if the
AS does not provide a different value. AS does not provide a different value.
5.5.4.4. Profile 5.6.4.4. Profile
Profiles of this framework MUST define the communication protocol and Profiles of this framework MUST define the communication protocol and
the communication security protocol between the client and the RS. the communication security protocol between the client and the RS.
Furthermore profiles MUST define proof-of-possession methods, if they The security protocol MUST provide encryption, integrity and replay
support proof-of-possession tokens. protection. Furthermore profiles MUST define proof-of-possession
methods, if they support proof-of-possession tokens.
A profile MUST specify an identifier that is used to uniquely A profile MUST specify an identifier that can be used to uniquely
identify itself in the 'profile' parameter. identify itself in the "profile" parameter.
Profiles MAY define additional parameters for both the token request Profiles MAY define additional parameters for both the token request
and the RS Information in the access token response in order to and the RS Information in the access token response in order to
support negotiation or signalling of profile specific parameters. support negotiation or signaling of profile specific parameters.
5.5.4.5. Confirmation 5.6.4.5. Confirmation
The "cnf" parameter identifies or provides the key used for proof-of- The "cnf" parameter identifies or provides the key used for proof-of-
possession or for authenticating the RS depending on the proof-of- possession, while the "rs_cnf" parameter provides the raw public key
possession algorithm and the context cnf is used in. This framework of the RS. Both parameters use the same formatting and semantics as
extends the definition of 'cnf' from [RFC7800] by adding CBOR/COSE the "cnf" claim specified in [I-D.jones-ace-cwt-proof-of-possession].
encodings and the use of 'cnf' for transporting keys in the RS
Information.
The "cnf" parameter is used in the following contexts with the In addition to the use as a claim in a CWT, the "cnf" parameter is
following meaning: used in the following contexts with the following meaning:
o In the access token, to indicate the proof-of-possession key bound
to this token.
o In the token request C -> AS, to indicate the client's raw public o In the token request C -> AS, to indicate the client's raw public
key, or the key-identifier of a previously established key between key, or the key-identifier of a previously established key between
C and RS. C and RS.
o In the token response AS -> C, to indicate either the symmetric o In the token response AS -> C, to indicate the symmetric key
key generated by the AS for proof-of-possession or the raw public generated by the AS for proof-of-possession.
key used by the RS to authenticate.
o In the introspection response AS -> RS, to indicate the proof-of- o In the introspection response AS -> RS, to indicate the proof-of-
possession key bound to the introspected token. possession key bound to the introspected token.
o In the client token AS -> RS -> C, to indicate the proof-of- o In the client token AS -> RS -> C, to indicate the proof-of-
possession key bound to the access token. possession key bound to the access token.
A CBOR encoded payload MAY contain the 'cnf' parameter with the Note that the COSE_Key structure in a "cnf" claim or parameter may
following contents: contain an "alg" or "key_ops" parameter. If such parameters are
present, a client MUST NOT use a key that is not compatible with the
COSE_Key In this case the 'cnf' parameter contains the proof-of- profile or proof-of-possession algorithm according to those
possession key to be used by the client. An example is shown in parameters. An RS MUST reject a proof-of-possession using such a
Figure 9. key.
"cnf" : {
"COSE_Key" : {
"kty" : "EC",
"kid" : h'11',
"crv" : "P-256",
"x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8',
"y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4'
}
}
Figure 9: Confirmation parameter containing a public key
Note that the COSE_Key structure may contain an "alg" or "key_ops"
parameter. If such parameters are present, a client MUST NOT use
a key that is not compatible with the profile or proof-of-
possession algorithm according to those parameters.
COSE_Encrypted In this case the 'cnf' parameter contains an
encrypted symmetric key destined for the client. The client is
assumed to be able to decrypt the ciphertext of this parameter.
The parameter is encoded as COSE_Encrypted object wrapping a
COSE_Key object. Figure 10 shows an example of this type of
encoding.
"cnf" : {
"COSE_Encrypted" : {
993(
[ h'a1010a' # protected header : {"alg" : "AES-CCM-16-64-128"}
"iv" : b64'ifUvZaHFgJM7UmGnjA', # unprotected header
b64'WXThuZo6TMCaZZqi6ef/8WHTjOdGk8kNzaIhIQ' # ciphertext
]
)
}
}
Figure 10: Confirmation parameter containing an encrypted symmetric
key
The ciphertext here could e.g. contain a symmetric key as in
Figure 11.
{
"kty" : "Symmetric",
"kid" : b64'39Gqlw',
"k" : b64'hJtXhkV8FJG+Onbc6mxCcQh'
}
Figure 11: Example plaintext of an encrypted cnf parameter
Key Identifier In this case the 'cnf' parameter references a key
that is assumed to be previously known by the recipient. This
allows clients that perform repeated requests for an access token
for the same audience but e.g. with different scopes to omit key
transport in the access token, token request and token response.
Figure 12 shows such an example.
"cnf" : {
"kid" : b64'39Gqlw'
}
Figure 12: A Confirmation parameter with just a key identifier
This specification establishes the IANA "CWT Confirmation Methods" 5.6.5. Mapping parameters to CBOR
registry for these types of confirmation methods in Section 8.10 and
registers the methods defined by this specification. Other
specifications can register other methods used for confirmation. The
registry is meant to be analogous to the "JWT Confirmation Methods"
registry defined by [RFC7800].
5.5.5. Mapping parameters to CBOR All OAuth parameters in access token requests and responses MUST be
mapped to CBOR types as specified in Figure 12, using the given
integer abbreviation for the key.
All OAuth parameters in access token requests and responses are Note that we have aligned these abbreviations with the claim
mapped to CBOR types as follows and are given an integer key value to abbreviations defined in [I-D.ietf-ace-cbor-web-token].
save space.
/-------------------+----------+-----------------\ /-------------------+----------+------------------\
| Parameter name | CBOR Key | Major Type | | Parameter name | CBOR Key | Type |
|-------------------+----------+-----------------| |-------------------+----------+------------------|
| aud | 3 | 3 | | aud | 3 | text string |
| client_id | 8 | 3 (text string) | | client_id | 8 | text string |
| client_secret | 9 | 2 (byte string) | | client_secret | 9 | byte string |
| response_type | 10 | 3 | | response_type | 10 | text string |
| redirect_uri | 11 | 3 | | redirect_uri | 11 | text string |
| scope | 12 | 3 | | scope | 12 | text string |
| state | 13 | 3 | | state | 13 | text string |
| code | 14 | 2 | | code | 14 | byte string |
| error | 15 | 3 | | error | 15 | text string |
| error_description | 16 | 3 | | error_description | 16 | text string |
| error_uri | 17 | 3 | | error_uri | 17 | text string |
| grant_type | 18 | 0 | | grant_type | 18 | unsigned integer |
| access_token | 19 | 3 | | access_token | 19 | text string |
| token_type | 20 | 0 | | token_type | 20 | unsigned integer |
| expires_in | 21 | 0 | | expires_in | 21 | unsigned integer |
| username | 22 | 3 | | username | 22 | text string |
| password | 23 | 3 | | password | 23 | text string |
| refresh_token | 24 | 3 | | refresh_token | 24 | text string |
| cnf | 25 | 5 (map) | | cnf | 25 | map |
| profile | 26 | 3 | | profile | 26 | text string |
\-------------------+----------+-----------------/ | rs_cnf | 31 | map |
\-------------------+----------+------------------/
Figure 13: CBOR mappings used in token requests Figure 12: CBOR mappings used in token requests
5.6. The 'Introspect' Endpoint 5.7. The 'Introspect' Endpoint
Token introspection [RFC7662] is used by the RS and potentially the Token introspection [RFC7662] can be OPTIONALLY provided by the AS,
client to query the AS for metadata about a given token e.g. validity and is then used by the RS and potentially the client to query the AS
or scope. Analogous to the protocol defined in RFC 7662 [RFC7662] for metadata about a given token e.g., validity or scope. Analogous
for HTTP and JSON, this section defines adaptations to more to the protocol defined in RFC 7662 [RFC7662] for HTTP and JSON, this
constrained environments using CoAP and CBOR. section defines adaptations to more constrained environments using
CBOR and leaving the choice of the application protocol to the
profile.
Communication between the RS and the introspection endpoint at the AS Communication between the RS and the introspection endpoint at the AS
MUST be integrity protected and encrypted. Furthermore AS and RS MUST be integrity protected and encrypted. Furthermore AS and RS
MUST perform mutual authentication. Finally the AS SHOULD verify MUST perform mutual authentication. Finally the AS SHOULD verify
that the RS has the right to access introspection information about that the RS has the right to access introspection information about
the provided token. Profiles of this framework that support the provided token. Profiles of this framework that support
introspection MUST specify how authentication and communication introspection MUST specify how authentication and communication
security between RS and AS is implemented. security between RS and AS is implemented.
The figures of this section uses CBOR diagnostic notation without the The figures of this section uses CBOR diagnostic notation without the
integer abbreviations for the parameters or their values for better integer abbreviations for the parameters or their values for better
readability. readability.
5.6.1. RS-to-AS Request Note that supporting introspection is OPTIONAL for implementations of
this framework.
The RS sends a CoAP POST request to the introspection endpoint at the 5.7.1. RS-to-AS Request
AS, the profile MUST specify the Content-Type and wrapping of the
payload. The payload MUST be encoded as a CBOR map with a 'token' The RS sends a POST request to the introspection endpoint at the AS,
parameter containing the access token along with optional parameters the profile MUST specify the Content-Type and wrapping of the
representing additional context that is known by the RS to aid the AS payload. The payload MUST be encoded as a CBOR map with a "token"
in its response. parameter containing either the access token or a reference to the
token (e.g., the cti). Further optional parameters representing
additional context that is known by the RS to aid the AS in its
response MAY be included.
The same parameters are required and optional as in section 2.1 of The same parameters are required and optional as in section 2.1 of
RFC 7662 [RFC7662]. RFC 7662 [RFC7662].
For example, Figure 14 shows a RS calling the token introspection For example, Figure 13 shows a RS calling the token introspection
endpoint at the AS to query about an OAuth 2.0 proof-of-possession endpoint at the AS to query about an OAuth 2.0 proof-of-possession
token. Note that we assume a object security-based communication token. Note that object security based on COSE is assumed in this
security profile for this example, therefore the Content-Type is example, therefore the Content-Type is "application/cose+cbor".
"application/cose+cbor".
Header: POST (Code=0.02) Header: POST (Code=0.02)
Uri-Host: "server.example.com" Uri-Host: "server.example.com"
Uri-Path: "introspect" Uri-Path: "introspect"
Content-Type: "application/cose+cbor" Content-Type: "application/cose+cbor"
Payload: Payload:
{ {
"token" : b64'7gj0dXJQ43U', "token" : b64'7gj0dXJQ43U',
"token_type_hint" : "pop" "token_type_hint" : "pop"
} }
Figure 14: Example introspection request. Figure 13: Example introspection request.
5.6.2. AS-to-RS Response 5.7.2. AS-to-RS Response
If the introspection request is authorized and successfully If the introspection request is authorized and successfully
processed, the AS sends a response with the CoAP response code 2.01 processed, the AS sends a response with the response code equivalent
(Created). If the introspection request was invalid, not authorized to the CoAP code 2.01 (Created). If the introspection request was
or couldn't be processed the AS returns an error response as invalid, not authorized or couldn't be processed the AS returns an
described in Section 5.6.3. error response as described in Section 5.7.3.
In a successful response, the AS encodes the response parameters in a In a successful response, the AS encodes the response parameters in a
CBOR map including with the same required and optional parameters as CBOR map including with the same required and optional parameters as
in section 2.2. of RFC 7662 [RFC7662] with the following additions: in section 2.2. of RFC 7662 [RFC7662] with the following additions:
cnf cnf
OPTIONAL. This field contains information about the proof-of- OPTIONAL. This field contains information about the proof-of-
possession key that binds the client to the access token. See possession key that binds the client to the access token. See
Section 5.5.4.5 for more details on the formatting of the 'cnf' Section 5.6.4.5 for more details on the use of the "cnf"
parameter. parameter.
profile profile
OPTIONAL. This indicates the profile that the RS MUST use with OPTIONAL. This indicates the profile that the RS MUST use with
the client. See Section 5.5.4.4 for more details on the the client. See Section 5.6.4.4 for more details on the
formatting of this parameter. formatting of this parameter.
client_token client_token
OPTIONAL. This parameter contains information that the RS MUST OPTIONAL. This parameter contains information that the RS MUST
pass on to the client. See Section 5.6.4 for more details. pass on to the client. See Section 5.7.4 for more details.
For example, Figure 15 shows an AS response to the introspection For example, Figure 14 shows an AS response to the introspection
request in Figure 14. Note that we assume a DTLS-based communication request in Figure 13. Note that transport layer security is assumed
security profile for this example, therefore the Content-Type is in this example, therefore the Content-Type is "application/cbor".
"application/cbor".
Header: Created Code=2.01) Header: Created Code=2.01)
Content-Type: "application/cbor" Content-Type: "application/cbor"
Payload: Payload:
{ {
"active" : true, "active" : true,
"scope" : "read", "scope" : "read",
"profile" : "coap_dtls", "profile" : "coap_dtls",
"client_token" : b64'2QPhg0OhAQo ... "client_token" : b64'2QPhg0OhAQo ...
(remainder of client token omitted for brevity)', (remainder of client token omitted for brevity)',
"cnf" : { "cnf" : {
"COSE_Key" : { "COSE_Key" : {
"kty" : "Symmetric", "kty" : "Symmetric",
"kid" : b64'39Gqlw', "kid" : b64'39Gqlw',
"k" : b64'hJtXhkV8FJG+Onbc6mxCcQh' "k" : b64'hJtXhkV8FJG+Onbc6mxCcQh'
} }
} }
} }
Figure 15: Example introspection response. Figure 14: Example introspection response.
5.6.3. Error Response 5.7.3. Error Response
The error responses for CoAP-based interactions with the AS are The error responses for CoAP-based interactions with the AS are
equivalent to the ones for HTTP-based interactions as defined in equivalent to the ones for HTTP-based interactions as defined in
section 2.3 of [RFC7662], with the following differences: section 2.3 of [RFC7662], with the following differences:
o If content is sent, the Content-Type MUST be set according to the o If content is sent, the Content-Type MUST be set according to the
specification of the communication security profile, and the specification of the communication security profile, and the
content payload MUST be encoded as a CBOR map. content payload MUST be encoded as a CBOR map.
o If the credentials used by the RS are invalid the AS MUST respond o If the credentials used by the RS are invalid the AS MUST respond
with the CoAP response code 4.01 (Unauthorized) and use the with the response code equivalent to the CoAP code 4.01
required and optional parameters from section 5.2 in RFC 6749 (Unauthorized) and use the required and optional parameters from
[RFC6749]. section 5.2 in RFC 6749 [RFC6749].
o If the RS does not have the right to perform this introspection o If the RS does not have the right to perform this introspection
request, the AS MUST respond with the CoAP response code 4.03 request, the AS MUST respond with a response code equivalent to
(Forbidden). In this case no payload is returned. the CoAP code 4.03 (Forbidden). In this case no payload is
o The parameters "error", "error_description" and "error_uri" MAY be returned.
abbreviated using the codes specified in table Figure 13. o The parameters "error", "error_description" and "error_uri" MUST
o The error codes MAY be abbreviated using the codes specified in be abbreviated using the codes specified in Figure 12.
table Figure 7. o The error codes MUST be abbreviated using the codes specified in
Figure 10.
Note that a properly formed and authorized query for an inactive or Note that a properly formed and authorized query for an inactive or
otherwise invalid token does not warrant an error response by this otherwise invalid token does not warrant an error response by this
specification. In these cases, the authorization server MUST instead specification. In these cases, the authorization server MUST instead
respond with an introspection response with the "active" field set to respond with an introspection response with the "active" field set to
"false". "false".
5.6.4. Client Token 5.7.4. Client Token
EDITORIAL NOTE: We have tentatively introduced this concept and would
specifically like feedback whether this is viewed as a useful
addition to the framework.
In cases where the client has limited connectivity and needs to get In cases where the client has limited connectivity and needs to get
access to a previously unknown resource servers, this framework access to a previously unknown resource servers, this framework
suggests the following approach: The client is pre-configured with a suggests the following OPTIONAL approach: The client is pre-
generic, long-term access token when it is commissioned. When the configured with a long-term access token, which is not self-contained
client then tries to access a RS it transmits this access token. The (i.e. it is only a reference to a token at the AS) when it is
RS then performs token introspection to learn what access this token commissioned. When the client then tries to access a RS it transmits
grants. In the introspection response, the AS also relays this access token. The RS then performs token introspection to learn
information for the client, such as the proof-of-possession key, what access this token grants. In the introspection response, the AS
through the RS. The RS passes on this Client Token to the client in also relays information for the client, such as the proof-of-
response to the submission of the token. possession key, through the RS. The RS passes on this Client Token
to the client in response to the submission of the token.
The client_token parameter is designed to carry such information, and The client_token parameter is designed to carry such information, and
is intended to be used as described in Figure 16. is intended to be used as described in Figure 15.
Resource Authorization Resource Authorization
Client Server Server Client Server Server
| | | | | |
| | | | | |
C: +--------------->| | C: +--------------->| |
| POST | | | POST | |
| Access Token | | | Access Token | |
| D: +--------------->| | D: +--------------->|
| | Introspection | | | Introspection |
| | Request | | | Request |
| | | | | |
| E: +<---------------+ | E: +<---------------+
| | Introspection | | | Introspection |
| | Response | | | Response |
| | + Client Token | | | + Client Token |
|<---------------+ | |<---------------+ |
| 2.01 Created | | | 2.01 Created | |
| + Client Token | | + Client Token |
Figure 16: Use of the client_token parameter. Figure 15: Use of the client_token parameter.
The client token is a COSE_Encrypted object, containing as payload a The client token is a COSE_Encrypted object, containing as payload a
CBOR map with the following claims: CBOR map with the following claims:
cnf cnf
REQUIRED if the token type is 'pop', OPTIONAL otherwise. Contains REQUIRED if the token type is "pop", OPTIONAL otherwise. Contains
information about the proof-of-possession key the client is to use information about the proof-of-possession key the client is to use
with its access token. See Section 5.5.4.5. with its access token. See Section 5.6.4.5.
token_type token_type
OPTIONAL. See Section 5.5.4.3. OPTIONAL. See Section 5.6.4.3.
profile profile
REQUIRED. See Section 5.5.4.4. REQUIRED. See Section 5.6.4.4.
rs_cnf rs_cnf
OPTIONAL. Contains information about the key that the RS uses to OPTIONAL. Contains information about the key that the RS uses to
authenticate towards the client. If the key is symmetric then authenticate towards the client. If the key is symmetric then
this claim MUST NOT be part of the Client Token, since this is the this claim MUST NOT be part of the Client Token, since this is the
same key as the one specified through the 'cnf' claim. This claim same key as the one specified through the "cnf" claim. This claim
uses the same encoding as the 'cnf' parameter. See uses the same encoding as the "cnf" parameter. See
Section 5.5.4.4. Section 5.6.4.4.
The AS encrypts this token using a key shared between the AS and the The AS encrypts this token using a key shared between the AS and the
client, so that only the client can decrypt it and access its client, so that only the client can decrypt it and access its
payload. How this key is established is out of scope of this payload. How this key is established is out of scope of this
framework, however it can be established at the same time at which framework, however it can be established at the same time at which
the client's long term token is created. the client's long term token is created.
5.6.5. Mapping Introspection parameters to CBOR An RS that is configured to perform introspection, MUST do so
immediately after receiving an access token, in order to be able to
return a potential client token to the client. This does not
preclude the RS to perform additional introspection asynchronously,
e.g., when the token is later used.
The introspection request and response parameters are mapped to CBOR 5.7.5. Mapping Introspection parameters to CBOR
types as follows and are given an integer key value to save space.
The introspection request and response parameters MUST be mapped to
CBOR types as specified in Figure 16, using the given integer
abbreviation for the key.
Note that we have aligned these abbreviatations with the claim
abbreviations defined in [I-D.ietf-ace-cbor-web-token].
/-----------------+----------+-----------------\ /-----------------+----------+-----------------\
| Parameter name | CBOR Key | Major Type | | Parameter name | CBOR Key | Major Type |
|-----------------+----------+-----------------| |-----------------+----------+-----------------|
| iss | 1 | 3 (text string) | | iss | 1 | 3 (text string) |
| sub | 2 | 3 | | sub | 2 | 3 |
| aud | 3 | 3 | | aud | 3 | 3 |
| exp | 4 | 6 tag value 1 | | exp | 4 | 6 tag value 1 |
| nbf | 5 | 6 tag value 1 | | nbf | 5 | 6 tag value 1 |
| iat | 6 | 6 tag value 1 | | iat | 6 | 6 tag value 1 |
skipping to change at page 31, line 33 skipping to change at page 33, line 43
| username | 22 | 3 | | username | 22 | 3 |
| cnf | 25 | 5 (map) | | cnf | 25 | 5 (map) |
| profile | 26 | 0 (uint) | | profile | 26 | 0 (uint) |
| token | 27 | 3 | | token | 27 | 3 |
| token_type_hint | 28 | 3 | | token_type_hint | 28 | 3 |
| active | 29 | 0 | | active | 29 | 0 |
| client_token | 30 | 3 | | client_token | 30 | 3 |
| rs_cnf | 31 | 5 | | rs_cnf | 31 | 5 |
\-----------------+----------+-----------------/ \-----------------+----------+-----------------/
Figure 17: CBOR Mappings to Token Introspection Parameters. Figure 16: CBOR Mappings to Token Introspection Parameters.
5.7. The Access Token 5.8. The Access Token
This framework RECOMMENDS the use of CBOR web token (CWT) as This framework RECOMMENDS the use of CBOR web token (CWT) as
specified in [I-D.ietf-ace-cbor-web-token]. specified in [I-D.ietf-ace-cbor-web-token].
In order to facilitate offline processing of access tokens, this In order to facilitate offline processing of access tokens, this
draft specifies the "cnf" and "scope" claims for CBOR web tokens. draft uses the "cnf" claim from
[I-D.jones-ace-cwt-proof-of-possession] and specifies the "scope"
claim for CBOR web tokens.
The "scope" claim explicitly encodes the scope of a given access The "scope" claim explicitly encodes the scope of a given access
token. This claim follows the same encoding rules as defined in token. This claim follows the same encoding rules as defined in
section 3.3 of [RFC6749]. The meaning of a specific scope value is section 3.3 of [RFC6749]. The meaning of a specific scope value is
application specific and expected to be known to the RS running that application specific and expected to be known to the RS running that
application. application.
The "cnf" claim follows the same rules as specified for JOSE web 5.8.1. The 'Authorization Information' Endpoint
token in RFC7800 [RFC7800], except that it is encoded in COSE in the
same way as specified for the "cnf" parameter in Section 5.5.4.5.
5.7.1. The 'Authorization Information' Endpoint
The access token, containing authorization information and The access token, containing authorization information and
information about the key used by the client, needs to be transported information about the key used by the client, needs to be transported
to the RS so that the RS can authenticate and authorize the client to the RS so that the RS can authenticate and authorize the client
request. request.
This section defines a method for transporting the access token to This section defines a method for transporting the access token to
the RS using CoAP. Profiles of this framework MAY define other the RS using a RESTful protocol such as CoAP. Profiles of this
methods for token transport. framework MAY define other methods for token transport.
The method consists of an /authz-info endpoint, implemented by the The method consists of an authz-info endpoint, implemented by the RS.
RS. A client using this method MUST make a POST request to /authz- A client using this method MUST make a POST request to the authz-info
info at the RS with the access token in the payload. The RS endpoint at the RS with the access token in the payload. The RS
receiving the token MUST verify the validity of the token. If the receiving the token MUST verify the validity of the token. If the
token is valid, the RS MUST respond to the POST request with 2.01 token is valid, the RS MUST respond to the POST request with 2.01
(Created). This response MAY contain the identifier of the token (Created). This response MAY contain an identifier of the token
(e.g. the cti for a CWT) as a payload. (e.g., the cti for a CWT) as a payload, in order to allow the client
to refer to the token.
If the token is not valid, the RS MUST respond with the CoAP response The RS MUST be prepared to store at least one access token for future
code 4.01 (Unauthorized). If the token is valid but the audience of use. This is a difference to how access tokens are handled in OAuth
the token does not match the RS, the RS MUST respond with the CoAP 2.0, where the access token is typically sent along with each
response code 4.03 (Forbidden). If the token is valid but is request, and therefore not stored at the RS.
associated to claims that the RS cannot process (e.g. an unknown
scope) the RS MUST respond with the CoAP response code 4.00 (Bad If the token is not valid, the RS MUST respond with a response code
Request). In the latter case the RS MAY provide additional equivalent to the CoAP code 4.01 (Unauthorized). If the token is
information in the error response, in order to clarify what went valid but the audience of the token does not match the RS, the RS
wrong. MUST respond with a response code equivalent to the CoAP code 4.03
(Forbidden). If the token is valid but is associated to claims that
the RS cannot process (e.g., an unknown scope) the RS MUST respond
with a response code equivalent to the CoAP code 4.00 (Bad Request).
In the latter case the RS MAY provide additional information in the
error response, in order to clarify what went wrong.
The RS MAY make an introspection request to validate the token before The RS MAY make an introspection request to validate the token before
responding to the POST /authz-info request. If the introspection responding to the POST request to the authz-info endpoint. If the
response contains a client token (Section 5.6.4) then this token introspection response contains a client token (Section 5.7.4) then
SHALL be included in the payload of the 2.01 (Created) response. this token SHALL be included in the payload of the 2.01 (Created)
response.
Profiles MUST specify how the /authz-info endpoint is protected. Profiles MUST specify how the authz-info endpoint is protected. Note
Note that since the token contains information that allow the client that since the token contains information that allow the client and
and the RS to establish a security context in the first place, mutual the RS to establish a security context in the first place, mutual
authentication may not be possible at this point. authentication may not be possible at this point.
The RS MUST be prepared to store more than one token for each client, 5.8.2. Token Expiration
and MUST apply the combined permissions granted by all applicable,
valid tokens to client requests.
5.7.2. Token Expiration
Depending on the capabilities of the RS, there are various ways in Depending on the capabilities of the RS, there are various ways in
which it can verify the validity of a received access token. We list which it can verify the validity of a received access token. Here
the possibilities here including what functionality they require of follows a list of the possibilities including what functionality they
the RS. require of the RS.
o The token is a CWT/JWT and includes a 'exp' claim and possibly the o The token is a CWT and includes an "exp" claim and possibly the
'nbf' claim. The RS verifies these by comparing them to values "nbf" claim. The RS verifies these by comparing them to values
from its internal clock as defined in [RFC7519]. In this case the from its internal clock as defined in [RFC7519]. In this case the
RS's internal clock must reflect the current date and time, or at RS's internal clock must reflect the current date and time, or at
least be synchronized with the AS's clock. How this clock least be synchronized with the AS's clock. How this clock
synchronization would be performed is out of scope for this memo. synchronization would be performed is out of scope for this
specification.
o The RS verifies the validity of the token by performing an o The RS verifies the validity of the token by performing an
introspection request as specified in Section 5.6. This requires introspection request as specified in Section 5.7. This requires
the RS to have a reliable network connection to the AS and to be the RS to have a reliable network connection to the AS and to be
able to handle two secure sessions in parallel (C to RS and AS to able to handle two secure sessions in parallel (C to RS and AS to
RS). RS).
o The RS and the AS both store a sequence number linked to their o The RS and the AS both store a sequence number linked to their
common security association. The AS increments this number for common security association. The AS increments this number for
each access token it issues and includes it in the access token, each access token it issues and includes it in the access token,
which is a CWT. The RS keeps track of the most recently received which is a CWT. The RS keeps track of the most recently received
sequence number, and only accepts tokens as valid, that are in a sequence number, and only accepts tokens as valid, that are in a
certain range around this number. This method does only require certain range around this number. This method does only require
the RS to keep track of the sequence number. The method does not the RS to keep track of the sequence number. The method does not
provide timely expiration, but it makes sure that older tokens provide timely expiration, but it makes sure that older tokens
cease to be valid after a certain number of newer ones got issued. cease to be valid after a certain number of newer ones got issued.
For a constrained RS with no network connectivity and no means of For a constrained RS with no network connectivity and no means of
reliably measuring time, this is the best that can be achieved. reliably measuring time, this is the best that can be achieved.
If a token, that authorizes a long running request such as e.g. a If a token that authorizes a long running request such as a CoAP
CoAP Observe [RFC7641], expires, the RS MUST send an error response Observe [RFC7641] expires, the RS MUST send an error response with
with the response code 4.01 Unauthorized to the client and then the response code 4.01 Unauthorized to the client and then terminate
terminate processing the long running request. processing the long running request.
6. Security Considerations 6. Security Considerations
Security considerations applicable to authentication and Security considerations applicable to authentication and
authorization in RESTful environments provided in OAuth 2.0 [RFC6749] authorization in RESTful environments provided in OAuth 2.0 [RFC6749]
apply to this work, as well as the security considerations from apply to this work, as well as the security considerations from
[I-D.ietf-ace-actors]. Furthermore [RFC6819] provides additional [I-D.ietf-ace-actors]. Furthermore [RFC6819] provides additional
security considerations for OAuth which apply to IoT deployments as security considerations for OAuth which apply to IoT deployments as
well. well.
A large range of threats can be mitigated by protecting the contents A large range of threats can be mitigated by protecting the contents
of the access token by using a digital signature or a keyed message of the access token by using a digital signature or a keyed message
digest (MAC) or an AEAD algorithm. Consequently, the token integrity digest (MAC) or an Authenticated Encryption with Associated Data
protection MUST be applied to prevent the token from being modified, (AEAD) algorithm. Consequently, the token integrity protection MUST
particularly since it contains a reference to the symmetric key or be applied to prevent the token from being modified, particularly
the asymmetric key. If the access token contains the symmetric key, since it contains a reference to the symmetric key or the asymmetric
this symmetric key MUST be encrypted by the authorization server so key. If the access token contains the symmetric key, this symmetric
that only the resource server can decrypt it. Note that using an key MUST be encrypted by the authorization server so that only the
AEAD algorithm is preferrable over using a MAC unless the message resource server can decrypt it. Note that using an AEAD algorithm is
needs to be publicly readable. preferable over using a MAC unless the message needs to be publicly
readable.
It is important for the authorization server to include the identity It is important for the authorization server to include the identity
of the intended recipient (the audience), typically a single resource of the intended recipient (the audience), typically a single resource
server (or a list of resource servers), in the token. Using a single server (or a list of resource servers), in the token. Using a single
shared secret with multiple resource servers to simplify key shared secret with multiple resource servers to simplify key
management is NOT RECOMMENDED since the benefit from using the proof- management is NOT RECOMMENDED since the benefit from using the proof-
of-possession concept is significantly reduced. of-possession concept is significantly reduced.
The authorization server MUST offer confidentiality protection for The authorization server MUST offer confidentiality protection for
any interactions with the client. This step is extremely important any interactions with the client. This step is extremely important
since the client may obtion the proof-of-possession key from the since the client may obtain the proof-of-possession key from the
authorization server for use with a specific access token. Not using authorization server for use with a specific access token. Not using
confidentiality protection exposes this secret (and the access token) confidentiality protection exposes this secret (and the access token)
to an eavesdropper thereby completely negating proof-of-possession to an eavesdropper thereby completely negating proof-of-possession
security. Profiles MUST specify how confidentiality protection is security. Profiles MUST specify how confidentiality protection is
provided, and additional protection can be applied by encrypting the provided, and additional protection can be applied by encrypting the
token, for example encryption of CWTs is specified in section 5.1 of token, for example encryption of CWTs is specified in section 5.1 of
[I-D.ietf-ace-cbor-web-token]. [I-D.ietf-ace-cbor-web-token].
Developers MUST ensure that the ephemeral credentials (i.e., the Developers MUST ensure that the ephemeral credentials (i.e., the
private key or the session key) are not leaked to third parties. An private key or the session key) are not leaked to third parties. An
adversary in possession of the ephemeral credentials bound to the adversary in possession of the ephemeral credentials bound to the
access token will be able to impersonate the client. Be aware that access token will be able to impersonate the client. Be aware that
this is a real risk with many constrained environments, since this is a real risk with many constrained environments, since
adversaries can often easily get physical access to the devices. adversaries can often easily get physical access to the devices.
Clients can at any time request a new proof-of-possession capable Clients can at any time request a new proof-of-possession capable
access token. If clients have that capability, the AS can keep the access token. If clients have that capability, the AS can keep the
lifetime of the access token and the associated proof-of-possesion lifetime of the access token and the associated proof-of-possession
key short and therefore use shorter proof-of-possession key sizes, key short and therefore use shorter proof-of-possession key sizes,
which translate to a performance benefit for the client and for the which translate to a performance benefit for the client and for the
resource server. Shorter keys also lead to shorter messages resource server. Shorter keys also lead to shorter messages
(particularly with asymmetric keying material). (particularly with asymmetric keying material).
When authorization servers bind symmetric keys to access tokens, they When authorization servers bind symmetric keys to access tokens, they
SHOULD scope these access tokens to a specific permissions. SHOULD scope these access tokens to a specific permissions.
Furthermore access tokens using symmetric keys for proof-of- Furthermore access tokens using symmetric keys for proof-of-
possession SHOULD NOT be targeted at an audience that contains more possession SHOULD NOT be targeted at an audience that contains more
than one RS, since otherwise any RS in the audience that receives than one RS, since otherwise any RS in the audience that receives
that access token can impersonate the client towards the other that access token can impersonate the client towards the other
members of the audience. members of the audience.
6.1. Unprotected AS Information
Initially, no secure channel exists to protect the communication
between C and RS. Thus, C cannot determine if the AS information
contained in an unprotected response from RS to an unauthorized
request (c.f. Section 5.1.2) is authentic. It is therefore
advisable to provide C with a (possibly hard-coded) list of
trustworthy authorization servers. AS information responses
referring to a URI not listed there would be ignored.
6.2. Use of Nonces for Replay Protection
RS may add a nonce to the AS Information message sent as a response
to an unauthorized request to ensure freshness of an Access Token
subsequently presented to RS. While a timestamp of some granularity
would be sufficient to protect against replay attacks, using
randomized nonce is preferred to prevent disclosure of information
about RS's internal clock characteristics.
6.3. Combining profiles
There may exist reasonable use cases where implementers want to
combine different profiles of this framework, e.g., using an MQTT
profile between client and RS, while using a DTLS profile for
interactions between client and AS. Profiles should be designed in a
way that the security of a protocol interaction does not depend on
the specific security mechanisms used in other protocol interactions.
6.4. Error responses
The various error responses defined in this framework may leak
information to an adversary. For example errors responses for
requests to the Authorization Information endpoint can reveal
information about an otherwise opaque access token to an adversary
who has intercepted this token. This framework is written under the
assumption that, in general, the benefits of detailed error messages
outweigh the risk due to information leakage. For particular use
cases, where this assessment does not apply, detailed error messages
can be replaced by more generic ones.
7. Privacy Considerations 7. Privacy Considerations
Implementers and users should be aware of the privacy implications of Implementers and users should be aware of the privacy implications of
the different possible deployments of this framework. the different possible deployments of this framework.
The AS is in a very central position can potentially learn sensitive The AS is in a very central position and can potentially learn
information about the clients requesting access tokens. If the sensitive information about the clients requesting access tokens. If
client credentials grant is used, the AS can track what kind of the client credentials grant is used, the AS can track what kind of
access the client intends to perform. With other grants this can be access the client intends to perform. With other grants this can be
prevented by the Resource Owner. To do so the resource owner needs prevented by the Resource Owner. To do so, the resource owner needs
to bind the grants it issues to anonymous, ephemeral credentials, to bind the grants it issues to anonymous, ephemeral credentials that
that do not allow the AS to link different grants and thus different do not allow the AS to link different grants and thus different
access token requests by the same client. access token requests by the same client.
If access tokens are only integrity protected and not encrypted, they If access tokens are only integrity protected and not encrypted, they
may reveal information to attackers listening on the wire, or able to may reveal information to attackers listening on the wire, or able to
acquire the access tokens in some other way. In the case of CWTs or acquire the access tokens in some other way. In the case of CWTs the
JWTs the token may e.g. reveal the audience, the scope and the token may e.g., reveal the audience, the scope and the confirmation
confirmation method used by the client. The latter may reveal the method used by the client. The latter may reveal the identity of the
client's identity. device or application running the client. This may be linkable to
the identity of the person using the client (if there is a person and
not a machine-to-machine interaction).
Clients using asymmetric keys for proof-of-possession should be aware Clients using asymmetric keys for proof-of-possession should be aware
of the consequences of using the same key pair for proof-of- of the consequences of using the same key pair for proof-of-
possession towards different RS. A set of colluding RS or an possession towards different RSs. A set of colluding RSs or an
attacker able to obtain the access tokens will be able to link the attacker able to obtain the access tokens will be able to link the
requests, or even to determine the client's identity. requests, or even to determine the client's identity.
An unprotected response to an unauthorized request (c.f.
Section 5.1.2) may disclose information about RS and/or its existing
relationship with C. It is advisable to include as little
information as possible in an unencrypted response. Means of
encrypting communication between C and RS already exist, more
detailed information may be included with an error response to
provide C with sufficient information to react on that particular
error.
8. IANA Considerations 8. IANA Considerations
This specification registers new parameters for OAuth and establishes This specification registers new parameters for OAuth and establishes
registries for mappings to CBOR. registries for mappings to CBOR.
8.1. OAuth Introspection Response Parameter Registration 8.1. OAuth Introspection Response Parameter Registration
This specification registers the following parameters in the OAuth This specification registers the following parameters in the OAuth
introspection response parameters introspection response parameters
o Name: "cnf" o Name: "cnf"
o Description: Key to prove the right to use an access token, as o Description: Key to prove the right to use an access token,
defined in [RFC7800]. formatted as specified in [I-D.jones-ace-cwt-proof-of-possession].
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): this document o Specification Document(s): this document
o Name: "aud"
o Description: Reference to intended receiving RS, as defined in PoP
token specification.
o Change Controller: IESG
o Specification Document(s): this document
o Name: "profile" o Name: "profile"
o Description: The communication and communication security profile o Description: The communication and communication security profile
used between client and RS, as defined in ACE profiles. used between client and RS, as defined in ACE profiles.
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): this document o Specification Document(s): this document
o Name: "client_token" o Name: "client_token"
o Description: Information that the RS MUST pass to the client e.g. o Description: Information that the RS MUST pass to the client e.g.,
about the proof-of-possession keys. about the proof-of-possession keys.
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): this document o Specification Document(s): this document
o Name: "rs_cnf" o Name: "rs_cnf"
o Description: Describes the public key the RS uses to authenticate. o Description: Describes the public key the RS uses to authenticate.
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): this document o Specification Document(s): this document
8.2. OAuth Parameter Registration 8.2. OAuth Parameter Registration
This specification registers the following parameters in the OAuth This specification registers the following parameters in the OAuth
Parameters Registry Parameters Registry
o Parameter name: "profile" o Parameter name: "profile"
o Parameter usage location: token request, and token response o Parameter usage location: token request, and token response
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): this document o Specification Document(s): this document
o Name: "cnf" o Name: "cnf"
o Description: Key to prove the right to use an access token, as o Description: Key to prove the right to use an access token,
defined in [RFC7800]. formatted as defined in [I-D.jones-ace-cwt-proof-of-possession].
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): this document o Specification Document(s): this document
8.3. OAuth Access Token Types 8.3. OAuth Access Token Types
This specification registers the following new token type in the This specification registers the following new token type in the
OAuth Access Token Types Registry OAuth Access Token Types Registry
o Name: "PoP" o Name: "PoP"
o Description: A proof-of-possession token. o Description: A proof-of-possession token.
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): this document o Specification Document(s): this document
8.4. Token Type Mappings 8.4. OAuth Token Type CBOR Mappings
A new registry will be requested from IANA, entitled "Token Type A new registry will be requested from IANA, entitled "Token Type
Mappings". The registry is to be created as Expert Review Required. Mappings". The registry is to be created as Expert Review Required.
8.4.1. Registration Template 8.4.1. Registration Template
Token Type: Token Type:
Name of token type as registered in the OAuth token type registry Name of token type as registered in the OAuth token type registry
e.g. "Bearer". e.g., "Bearer".
Mapped value: Mapped value:
Integer representation for the token type value. The key value Integer representation for the token type value. The key value
MUST be an integer in the range of 1 to 65536. MUST be an integer. Integer values from -65536 to 65535 are
designated as Specification Required. Integer values of greater
than 65535 designated as expert review. Integer values less than
-65536 are marked as private use.
Change Controller: Change Controller:
For Standards Track RFCs, list the "IESG". For others, give the For Standards Track RFCs, list the "IESG". For others, give the
name of the responsible party. Other details (e.g., postal name of the responsible party. Other details (e.g., postal
address, email address, home page URI) may also be included. address, email address, home page URI) may also be included.
Specification Document(s): Specification Document(s):
Reference to the document or documents that specify the Reference to the document or documents that specify the
parameter,preferably including URIs that can be used to retrieve parameter,preferably including URIs that can be used to retrieve
copies of the documents. An indication of the relevant sections copies of the documents. An indication of the relevant sections
may also be included but is not required. may also be included but is not required.
skipping to change at page 37, line 46 skipping to change at page 41, line 16
This specification registers the following new claims in the CBOR Web This specification registers the following new claims in the CBOR Web
Token (CWT) registry: Token (CWT) registry:
o Claim Name: "scope" o Claim Name: "scope"
o Claim Description: The scope of an access token as defined in o Claim Description: The scope of an access token as defined in
[RFC6749]. [RFC6749].
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): this document o Specification Document(s): this document
o Claim Name: "cnf" 8.6. ACE OAuth Profile Registry
o Claim Description: The proof-of-possession key of an access token
as defined in [RFC7800].
o Change Controller: IESG
o Specification Document(s): this document
8.6. ACE Profile Registry
A new registry will be requested from IANA, entitled "ACE Profile A new registry will be requested from IANA, entitled "ACE Profile
Registry". The registry is to be created as Expert Review Required. Registry". The registry is to be created as Expert Review Required.
8.6.1. Registration Template 8.6.1. Registration Template
Profile name: Profile name:
Name of the profile to be included in the profile attribute. Name of the profile to be included in the profile attribute.
Profile description: Profile description:
Text giving an overview of the profile and the context it is Text giving an overview of the profile and the context it is
developed for. developed for.
Profile ID: Profile ID:
Integer value to identify the profile. The value MUST be an Integer value to identify the profile. Integer values from -65536
integer in the range of 1 to 65536. to 65535 are designated as Specification Required. Integer values
of greater than 65535 designated as expert review. Integer values
less than -65536 are marked as private use.
Change Controller: Change Controller:
For Standards Track RFCs, list the "IESG". For others, give the For Standards Track RFCs, list the "IESG". For others, give the
name of the responsible party. Other details (e.g., postal name of the responsible party. Other details (e.g., postal
address, email address, home page URI) may also be included. address, email address, home page URI) may also be included.
Specification Document(s): Specification Document(s):
Reference to the document or documents that specify the Reference to the document or documents that specify the
parameter,preferably including URIs that can be used to retrieve parameter,preferably including URIs that can be used to retrieve
copies of the documents. An indication of the relevant sections copies of the documents. An indication of the relevant sections
may also be included but is not required. may also be included but is not required.
8.7. OAuth Parameter Mappings Registry 8.7. OAuth CBOR Parameter Mappings Registry
A new registry will be requested from IANA, entitled "Token Endpoint A new registry will be requested from IANA, entitled "Token Endpoint
CBOR Mappings Registry". The registry is to be created as Expert CBOR Mappings Registry". The registry is to be created as Expert
Review Required. Review Required.
8.7.1. Registration Template 8.7.1. Registration Template
Parameter name: Parameter name:
OAuth Parameter name, refers to the name in the OAuth parameter OAuth Parameter name, refers to the name in the OAuth parameter
registry e.g. "client_id". registry e.g., "client_id".
CBOR key value: CBOR key value:
Key value for the claim. The key value MUST be an integer in the Key value for the claim. The key value MUST be an integer.
range of 1 to 65536. Integer values from -65536 to 65535 are designated as
Specification Required. Integer values of greater than 65535
designated as expert review. Integer values less than -65536 are
marked as private use.
Change Controller: Change Controller:
For Standards Track RFCs, list the "IESG". For others, give the For Standards Track RFCs, list the "IESG". For others, give the
name of the responsible party. Other details (e.g., postal name of the responsible party. Other details (e.g., postal
address, email address, home page URI) may also be included. address, email address, home page URI) may also be included.
Specification Document(s): Specification Document(s):
Reference to the document or documents that specify the Reference to the document or documents that specify the
parameter,preferably including URIs that can be used to retrieve parameter,preferably including URIs that can be used to retrieve
copies of the documents. An indication of the relevant sections copies of the documents. An indication of the relevant sections
may also be included but is not required. may also be included but is not required.
skipping to change at page 41, line 19 skipping to change at page 44, line 41
8.8. Introspection Endpoint CBOR Mappings Registry 8.8. Introspection Endpoint CBOR Mappings Registry
A new registry will be requested from IANA, entitled "Introspection A new registry will be requested from IANA, entitled "Introspection
Endpoint CBOR Mappings Registry". The registry is to be created as Endpoint CBOR Mappings Registry". The registry is to be created as
Expert Review Required. Expert Review Required.
8.8.1. Registration Template 8.8.1. Registration Template
Response parameter name: Response parameter name:
Name of the response parameter as defined in the "OAuth Token Name of the response parameter as defined in the "OAuth Token
Introspection Response" registry e.g. "active". Introspection Response" registry e.g., "active".
CBOR key value: CBOR key value:
Key value for the claim. The key value MUST be an integer in the Key value for the claim. The key value MUST be an integer.
range of 1 to 65536. Integer values from -65536 to 65535 are designated as
Specification Required. Integer values of greater than 65535
designated as expert review. Integer values less than -65536 are
marked as private use.
Change Controller: Change Controller:
For Standards Track RFCs, list the "IESG". For others, give the For Standards Track RFCs, list the "IESG". For others, give the
name of the responsible party. Other details (e.g., postal name of the responsible party. Other details (e.g., postal
address, email address, home page URI) may also be included. address, email address, home page URI) may also be included.
Specification Document(s): Specification Document(s):
Reference to the document or documents that specify the Reference to the document or documents that specify the
parameter,preferably including URIs that can be used to retrieve parameter,preferably including URIs that can be used to retrieve
copies of the documents. An indication of the relevant sections copies of the documents. An indication of the relevant sections
may also be included but is not required. may also be included but is not required.
8.8.2. Initial Registry Contents 8.8.2. Initial Registry Contents
o Response parameter name: "iss" o Response parameter name: "iss"
o CBOR key value: 1 o CBOR key value: 1
skipping to change at page 44, line 4 skipping to change at page 47, line 29
[This document]. [This document].
Meaning in Request Meaning in Request
Contains an Access Token according to [This document] containing Contains an Access Token according to [This document] containing
access permissions of the client. access permissions of the client.
Meaning in Response Meaning in Response
Not used in response Not used in response
Safe-to-Forward Safe-to-Forward
Yes Yes
Format Format
Based on the observer the format is perceived differently. Opaque Based on the observer the format is perceived differently. Opaque
data to the client and CWT or reference token to the RS. data to the client and CWT or reference token to the RS.
Length Length
Less then 255 bytes Less then 255 bytes
8.10. CWT Confirmation Methods Registry 9. Acknowledgments
This specification establishes the IANA "CWT Confirmation Methods"
registry for CWT "cnf" member values. The registry records the
confirmation method member and a reference to the specification that
defines it.
8.10.1. Registration Template
Confirmation Method Name:
The name requested (e.g., "kid"). This name is intended to be
human readable and be used for debugging purposes. It is case
sensitive. Names may not match other registered names in a case-
insensitive manner unless the Designated Experts state that there
is a compelling reason to allow an exception.
Confirmation Method Value:
Integer representation for the confirmation method value.
Intended for use to uniquely identify the confirmation method.
The value MUST be an integer in the range of 1 to 65536.
Confirmation Method Description:
Brief description of the confirmation method (e.g. "Key
Identifier").
Change Controller:
For Standards Track RFCs, list the "IESG". For others, give the
name of the responsible party. Other details (e.g., postal
address, email address, home page URI) may also be included.
Specification Document(s):
Reference to the document or documents that specify the parameter,
preferably including URIs that can be used to retrieve copies of
the documents. An indication of the relevant sections may also be
included but is not required.
8.10.2. Initial Registry Contents
o Confirmation Method Name: "COSE_Key"
o Confirmation Method Value: 1
o Confirmation Method Description: A COSE_Key that is either a
public key or a symmetric key.
o Change Controller: IESG
o Specification Document(s): this document
o Confirmation Method Name: "COSE_Encrypted"
o Confirmation Method Value: 2
o Confirmation Method Description: A COSE_Encrypted structure that
wraps a COSE_Key containing a symmetric key.
o Change Controller: IESG
o Specification Document(s): this document
o Confirmation Method Name: "Key Identifier" This document is a product of the ACE working group of the IETF.
o Confirmation Method Value: 3
o Confirmation Method Description: A key identifier.
o Change Controller: IESG
o Specification Document(s): this document
9. Acknowledgments Thanks to Eve Maler for her contributions to the use of OAuth 2.0 and
UMA in IoT scenarios, Robert Taylor for his discussion input, and
Malisa Vucinic for his input on the predecessors of this proposal.
We would like to thank Eve Maler for her contributions to the use of Thanks to the authors of draft-ietf-oauth-pop-key-distribution, from
OAuth 2.0 and UMA in IoT scenarios, Robert Taylor for his discussion where large parts of the security considerations where copied.
input, and Malisa Vucinic for his input on the predecessors of this
proposal. Finally, we would like to thank the ACE working group in
general for their feedback.
We would like to thank the authors of draft-ietf-oauth-pop-key- Thanks to Stefanie Gerdes, Olaf Bergmann, and Carsten Bormann for
distribution, from where we copied large parts of our security contributing their work on AS discovery from draft-gerdes-ace-dcaf-
considerations. authorize (see Section 5.1).
Ludwig Seitz and Goeran Selander worked on this document as part of Ludwig Seitz and Goeran Selander worked on this document as part of
the CelticPlus project CyberWI, with funding from Vinnova. the CelticPlus project CyberWI, with funding from Vinnova.
10. References 10. References
10.1. Normative References 10.1. Normative References
[I-D.ietf-ace-cbor-web-token]
Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig,
"CBOR Web Token (CWT)", draft-ietf-ace-cbor-web-token-08
(work in progress), August 2017.
[I-D.jones-ace-cwt-proof-of-possession]
Jones, M., Seitz, L., Selander, G., Wahlstroem, E.,
Erdtman, S., and H. Tschofenig, "Proof-of-Possession Key
Semantics for CBOR Web Tokens (CWTs)", draft-jones-ace-
cwt-proof-of-possession-01 (work in progress), June 2017.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc2119>. editor.org/info/rfc2119>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, DOI 10.17487/RFC3986, January 2005,
<https://www.rfc-editor.org/info/rfc3986>.
[RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer
Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347,
January 2012, <http://www.rfc-editor.org/info/rfc6347>. January 2012, <https://www.rfc-editor.org/info/rfc6347>.
[RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained
Application Protocol (CoAP)", RFC 7252, Application Protocol (CoAP)", RFC 7252,
DOI 10.17487/RFC7252, June 2014, DOI 10.17487/RFC7252, June 2014, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc7252>. editor.org/info/rfc7252>.
[RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection", [RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection",
RFC 7662, DOI 10.17487/RFC7662, October 2015, RFC 7662, DOI 10.17487/RFC7662, October 2015,
<http://www.rfc-editor.org/info/rfc7662>. <https://www.rfc-editor.org/info/rfc7662>.
[RFC7800] Jones, M., Bradley, J., and H. Tschofenig, "Proof-of-
Possession Key Semantics for JSON Web Tokens (JWTs)",
RFC 7800, DOI 10.17487/RFC7800, April 2016,
<http://www.rfc-editor.org/info/rfc7800>.
[RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)",
RFC 8152, DOI 10.17487/RFC8152, July 2017, RFC 8152, DOI 10.17487/RFC8152, July 2017,
<http://www.rfc-editor.org/info/rfc8152>. <https://www.rfc-editor.org/info/rfc8152>.
10.2. Informative References 10.2. Informative References
[I-D.erdtman-ace-rpcc]
Seitz, L. and S. Erdtman, "Raw-Public-Key and Pre-Shared-
Key as OAuth client credentials", draft-erdtman-ace-
rpcc-01 (work in progress), August 2017.
[I-D.ietf-ace-actors] [I-D.ietf-ace-actors]
Gerdes, S., Seitz, L., Selander, G., and C. Bormann, "An Gerdes, S., Seitz, L., Selander, G., and C. Bormann, "An
architecture for authorization in constrained architecture for authorization in constrained
environments", draft-ietf-ace-actors-05 (work in environments", draft-ietf-ace-actors-05 (work in
progress), March 2017. progress), March 2017.
[I-D.ietf-ace-cbor-web-token]
Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig,
"CBOR Web Token (CWT)", draft-ietf-ace-cbor-web-token-07
(work in progress), July 2017.
[I-D.ietf-core-object-security] [I-D.ietf-core-object-security]
Selander, G., Mattsson, J., Palombini, F., and L. Seitz, Selander, G., Mattsson, J., Palombini, F., and L. Seitz,
"Object Security of CoAP (OSCOAP)", draft-ietf-core- "Object Security for Constrained RESTful Environments
object-security-04 (work in progress), July 2017. (OSCORE)", draft-ietf-core-object-security-05 (work in
progress), September 2017.
[I-D.ietf-core-resource-directory]
Shelby, Z., Koster, M., Bormann, C., Stok, P., and C.
Amsuess, "CoRE Resource Directory", draft-ietf-core-
resource-directory-11 (work in progress), July 2017.
[I-D.ietf-oauth-device-flow] [I-D.ietf-oauth-device-flow]
Denniss, W., Bradley, J., Jones, M., and H. Tschofenig, Denniss, W., Bradley, J., Jones, M., and H. Tschofenig,
"OAuth 2.0 Device Flow for Browserless and Input "OAuth 2.0 Device Flow for Browserless and Input
Constrained Devices", draft-ietf-oauth-device-flow-06 Constrained Devices", draft-ietf-oauth-device-flow-06
(work in progress), May 2017. (work in progress), May 2017.
[I-D.ietf-oauth-discovery]
Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0
Authorization Server Metadata", draft-ietf-oauth-
discovery-07 (work in progress), September 2017.
[I-D.ietf-oauth-native-apps] [I-D.ietf-oauth-native-apps]
Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps", Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps",
draft-ietf-oauth-native-apps-12 (work in progress), June draft-ietf-oauth-native-apps-12 (work in progress), June
2017. 2017.
[Margi10impact]
Margi, C., de Oliveira, B., de Sousa, G., Simplicio Jr,
M., Barreto, P., Carvalho, T., Naeslund, M., and R. Gold,
"Impact of Operating Systems on Wireless Sensor Networks
(Security) Applications and Testbeds", Proceedings of
the 19th International Conference on Computer
Communications and Networks (ICCCN), 2010 August.
[RFC4949] Shirey, R., "Internet Security Glossary, Version 2", [RFC4949] Shirey, R., "Internet Security Glossary, Version 2",
FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007,
<http://www.rfc-editor.org/info/rfc4949>. <https://www.rfc-editor.org/info/rfc4949>.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, (TLS) Protocol Version 1.2", RFC 5246,
DOI 10.17487/RFC5246, August 2008, DOI 10.17487/RFC5246, August 2008, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc5246>. editor.org/info/rfc5246>.
[RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link
Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, Format", RFC 6690, DOI 10.17487/RFC6690, August 2012,
<http://www.rfc-editor.org/info/rfc6690>. <https://www.rfc-editor.org/info/rfc6690>.
[RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework",
RFC 6749, DOI 10.17487/RFC6749, October 2012, RFC 6749, DOI 10.17487/RFC6749, October 2012,
<http://www.rfc-editor.org/info/rfc6749>. <https://www.rfc-editor.org/info/rfc6749>.
[RFC6819] Lodderstedt, T., Ed., McGloin, M., and P. Hunt, "OAuth 2.0 [RFC6819] Lodderstedt, T., Ed., McGloin, M., and P. Hunt, "OAuth 2.0
Threat Model and Security Considerations", RFC 6819, Threat Model and Security Considerations", RFC 6819,
DOI 10.17487/RFC6819, January 2013, DOI 10.17487/RFC6819, January 2013, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc6819>. editor.org/info/rfc6819>.
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
October 2013, <http://www.rfc-editor.org/info/rfc7049>. October 2013, <https://www.rfc-editor.org/info/rfc7049>.
[RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data
Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March
2014, <http://www.rfc-editor.org/info/rfc7159>. 2014, <https://www.rfc-editor.org/info/rfc7159>.
[RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for
Constrained-Node Networks", RFC 7228, Constrained-Node Networks", RFC 7228,
DOI 10.17487/RFC7228, May 2014, DOI 10.17487/RFC7228, May 2014, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc7228>. editor.org/info/rfc7228>.
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Semantics and Content", RFC 7231, Protocol (HTTP/1.1): Semantics and Content", RFC 7231,
DOI 10.17487/RFC7231, June 2014, DOI 10.17487/RFC7231, June 2014, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc7231>. editor.org/info/rfc7231>.
[RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token
(JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015,
<http://www.rfc-editor.org/info/rfc7519>. <https://www.rfc-editor.org/info/rfc7519>.
[RFC7521] Campbell, B., Mortimore, C., Jones, M., and Y. Goland, [RFC7521] Campbell, B., Mortimore, C., Jones, M., and Y. Goland,
"Assertion Framework for OAuth 2.0 Client Authentication "Assertion Framework for OAuth 2.0 Client Authentication
and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521, and Authorization Grants", RFC 7521, DOI 10.17487/RFC7521,
May 2015, <http://www.rfc-editor.org/info/rfc7521>. May 2015, <https://www.rfc-editor.org/info/rfc7521>.
[RFC7591] Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and [RFC7591] Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and
P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol", P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol",
RFC 7591, DOI 10.17487/RFC7591, July 2015, RFC 7591, DOI 10.17487/RFC7591, July 2015,
<http://www.rfc-editor.org/info/rfc7591>. <https://www.rfc-editor.org/info/rfc7591>.
[RFC7641] Hartke, K., "Observing Resources in the Constrained [RFC7641] Hartke, K., "Observing Resources in the Constrained
Application Protocol (CoAP)", RFC 7641, Application Protocol (CoAP)", RFC 7641,
DOI 10.17487/RFC7641, September 2015, DOI 10.17487/RFC7641, September 2015, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc7641>. editor.org/info/rfc7641>.
[RFC7744] Seitz, L., Ed., Gerdes, S., Ed., Selander, G., Mani, M., [RFC7744] Seitz, L., Ed., Gerdes, S., Ed., Selander, G., Mani, M.,
and S. Kumar, "Use Cases for Authentication and and S. Kumar, "Use Cases for Authentication and
Authorization in Constrained Environments", RFC 7744, Authorization in Constrained Environments", RFC 7744,
DOI 10.17487/RFC7744, January 2016, DOI 10.17487/RFC7744, January 2016, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc7744>. editor.org/info/rfc7744>.
[RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in
the Constrained Application Protocol (CoAP)", RFC 7959, the Constrained Application Protocol (CoAP)", RFC 7959,
DOI 10.17487/RFC7959, August 2016, DOI 10.17487/RFC7959, August 2016, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc7959>. editor.org/info/rfc7959>.
Appendix A. Design Justification Appendix A. Design Justification
This section provides further insight into the design decisions of This section provides further insight into the design decisions of
the solution documented in this document. Section 3 lists several the solution documented in this document. Section 3 lists several
building blocks and briefly summarizes their importance. The building blocks and briefly summarizes their importance. The
justification for offering some of those building blocks, as opposed justification for offering some of those building blocks, as opposed
to using OAuth 2.0 as is, is given below. to using OAuth 2.0 as is, is given below.
Common IoT constraints are: Common IoT constraints are:
Low Power Radio: Low Power Radio:
Many IoT devices are equipped with a small battery which needs to Many IoT devices are equipped with a small battery which needs to
last for a long time. For many constrained wireless devices the last for a long time. For many constrained wireless devices, the
highest energy cost is associated to transmitting or receiving highest energy cost is associated to transmitting or receiving
messages. It is therefore important to keep the total messages (roughly by a factor of 10 compared to e.g. AES)
[Margi10impact]. It is therefore important to keep the total
communication overhead low, including minimizing the number and communication overhead low, including minimizing the number and
size of messages sent and received, which has an impact of choice size of messages sent and received, which has an impact of choice
on the message format and protocol. By using CoAP over UDP, and on the message format and protocol. By using CoAP over UDP and
CBOR encoded messages some of these aspects are addressed. CBOR encoded messages, some of these aspects are addressed.
Security protocols contribute to the communication overhead and Security protocols contribute to the communication overhead and
can in some cases be optimized. For example authentication and can, in some cases, be optimized. For example, authentication and
key establishment may in certain cases where security requirements key establishment may, in certain cases where security
so allows be replaced by provisioning of security context by a requirements allow, be replaced by provisioning of security
trusted third party, using transport or application layer context by a trusted third party, using transport or application
security. layer security.
Low CPU Speed: Low CPU Speed:
Some IoT devices are equipped with processors that are Some IoT devices are equipped with processors that are
significantly slower than those found in most current devices on significantly slower than those found in most current devices on
the Internet. This typically has implications on what timely the Internet. This typically has implications on what timely
cryptographic operations a device is capable to perform, which in cryptographic operations a device is capable of performing, which
turn impacts e.g. protocol latency. Symmetric key cryptography in turn impacts e.g., protocol latency. Symmetric key
may be used instead of the computationally more expensive public cryptography may be used instead of the computationally more
key cryptography where the security requirements so allows, but expensive public key cryptography where the security requirements
this may also require support for trusted third party assisted so allows, but this may also require support for trusted third
secret key establishment using transport or application layer party assisted secret key establishment using transport or
security. application layer security.
Small Amount of Memory: Small Amount of Memory:
Microcontrollers embedded in IoT devices are often equipped with Microcontrollers embedded in IoT devices are often equipped with
small amount of RAM and flash memory, which places limitations small amount of RAM and flash memory, which places limitations
what kind of processing can be performed and how much code can be what kind of processing can be performed and how much code can be
put on those devices. To reduce code size fewer and smaller put on those devices. To reduce code size fewer and smaller
protocol implementations can be put on the firmware of such a protocol implementations can be put on the firmware of such a
device. In this case, CoAP may be used instead of HTTP, symmetric device. In this case, CoAP may be used instead of HTTP, symmetric
key cryptography instead of public key cryptography, and CBOR key cryptography instead of public key cryptography, and CBOR
instead of JSON. Authentication and key establishment protocol, instead of JSON. Authentication and key establishment protocol,
e.g. the DTLS handshake, in comparison with assisted key e.g., the DTLS handshake, in comparison with assisted key
establishment also has an impact on memory and code. establishment also has an impact on memory and code.
User Interface Limitations: User Interface Limitations:
Protecting access to resources is both an important security as Protecting access to resources is both an important security as
well as privacy feature. End users and enterprise customers do well as privacy feature. End users and enterprise customers may
not want to give access to the data collected by their IoT device not want to give access to the data collected by their IoT device
or to functions it may offer to third parties. Since the or to functions it may offer to third parties. Since the
classical approach of requesting permissions from end users via a classical approach of requesting permissions from end users via a
rich user interface does not work in many IoT deployment scenarios rich user interface does not work in many IoT deployment
these functions need to be delegated to user controlled devices scenarios, these functions need to be delegated to user-controlled
that are better suitable for such tasks, such as smart phones and devices that are better suitable for such tasks, such as smart
tablets. phones and tablets.
Communication Constraints: Communication Constraints:
In certain constrained settings an IoT device may not be able to In certain constrained settings an IoT device may not be able to
communicate with a given device at all times. Devices may be communicate with a given device at all times. Devices may be
sleeping, or just disconnected from the Internet because of sleeping, or just disconnected from the Internet because of
general lack of connectivity in the area, for cost reasons, or for general lack of connectivity in the area, for cost reasons, or for
security reasons, e.g. to avoid an entry point for Denial-of- security reasons, e.g., to avoid an entry point for Denial-of-
Service attacks. Service attacks.
The communication interactions this framework builds upon (as The communication interactions this framework builds upon (as
shown graphically in Figure 1) may be accomplished using a variety shown graphically in Figure 1) may be accomplished using a variety
of different protocols, and not all parts of the message flow are of different protocols, and not all parts of the message flow are
used in all applications due to the communication constraints. used in all applications due to the communication constraints.
While we envision deployments to make use of CoAP we explicitly Deployments making use of CoAP are expected, but not limited to,
want to support HTTP, HTTP/2 or specific protocols, such as other protocols such as HTTP, HTTP/2 or other specific protocols,
Bluetooth Smart communication, which does not necessarily use IP. such as Bluetooth Smart communication, that do not necessarily use
The latter raises the need for application layer security over the IP could also be used. The latter raises the need for application
various interfaces. layer security over the various interfaces.
In the light of these constraints we have made the following design
decisions:
CBOR, COSE, CWT:
This framework REQUIRES the use of CBOR [RFC7049] as data format.
Where CBOR data needs to be protected, the use of COSE [RFC8152]
is RECOMMENDED. Furthermore where self-contained tokens are
needed, this framework RECOMMENDS the use of CWT
[I-D.ietf-ace-cbor-web-token]. These measures aim at reducing the
size of messages sent over the wire, the RAM size of data objects
that need to be kept in memory and the size of libraries that
devices need to support.
CoAP:
This framework RECOMMENDS the use of CoAP [RFC7252] instead of
HTTP. This does not preclude the use of other protocols
specifically aimed at constrained devices, like e.g. Bluetooth
Low energy (see Section 3.2). This aims again at reducing the
size of messages sent over the wire, the RAM size of data objects
that need to be kept in memory and the size of libraries that
devices need to support.
RS Information:
This framework defines the name "RS Information" for data
concerning the RS that the AS returns to the client in an access
token response (see Section 5.6.2). This includes the "profile"
and the "rs_cnf" parameters. This aims at enabling scenarios,
where a powerful client, supporting multiple profiles, needs to
interact with a RS for which it does not know the supported
profiles and the raw public key.
Proof-of-Possession:
This framework makes use of proof-of-possession tokens, using the
"cnf" claim [I-D.jones-ace-cwt-proof-of-possession]. A
semantically and syntactically identical request and response
parameter is defined for the token endpoint, to allow requesting
and stating confirmation keys. This aims at making token theft
harder. Token theft is specifically relevant in constrained use
cases, as communication often passes through middle-boxes, which
could be able to steal bearer tokens and use them to gain
unauthorized access.
Auth-Info endpoint:
This framework introduces a new way of providing access tokens to
a RS by exposing a authz-info endpoint, to which access tokens can
be POSTed. This aims at reducing the size of the request message
and the code complexity at the RS. The size of the request
message is problematic, since many constrained protocols have
severe message size limitations at the physical layer (e.g. in the
order of 100 bytes). This means that larger packets get
fragmented, which in turn combines badly with the high rate of
packet loss, and the need to retransmit the whole message if one
packet gets lost. Thus separating sending of the request and
sending of the access tokens helps to reduce fragmentation.
Client Credentials Grant:
This framework RECOMMENDS the use of the client credentials grant
for machine-to-machine communication use cases, where manual
intervention of the resource owner to produce a grant token is not
feasible. The intention is that the resource owner would instead
pre-arrange authorization with the AS, based on the client's own
credentials. The client can the (without manual intervention)
obtain access tokens from the AS.
Introspection:
This framework RECOMMENDS the use of access token introspection in
cases where the client is constrained in a way that it can not
easily obtain new access tokens (i.e. it has connectivity issues
that prevent it from communicating with the AS). In that case
this framework RECOMMENDS the use of a long-term token, that could
be a simple reference. The RS is assumed to be able to
communicate with the AS, and can therefore perform introspection,
in order to learn the claims associated with the token reference.
The advantage of such an approach is that the resource owner can
change the claims associated to the token reference without having
to be in contact with the client, thus granting or revoking access
rights.
Client Token:
In cases where the client is constrained and does not have
connectivity to the AS, and furthermore does not have a previous
security relation to the RS that it needs to communicate with,
this framework proposes the use of "client tokens". A client
token is a data object obtained from the AS by the RS, during
access token introspection. The RS passes the client token on to
the client. It contains information that allows the client to
perform the proof of possession for its access token and to
authenticate the RS (e.g. with it's public key).
Appendix B. Roles and Responsibilities Appendix B. Roles and Responsibilities
Resource Owner Resource Owner
* Make sure that the RS is registered at the AS. This includes * Make sure that the RS is registered at the AS. This includes
making known to the AS which profiles, token_types, scopes, and making known to the AS which profiles, token_types, scopes, and
key types (symmetric/asymmetric) the RS supports. Also making key types (symmetric/asymmetric) the RS supports. Also making
it known to the AS which audience(s) the RS identifies itself it known to the AS which audience(s) the RS identifies itself
with. with.
* Make sure that clients can discover the AS which is in charge * Make sure that clients can discover the AS that is in charge of
of the RS. the RS.
* If the client-credentials grant is used, make sure that the AS * If the client-credentials grant is used, make sure that the AS
has the necessary, up-to-date, access control policies for the has the necessary, up-to-date, access control policies for the
RS. RS.
Requesting Party Requesting Party
* Make sure that the client is provisioned the necessary * Make sure that the client is provisioned the necessary
credentials to authenticate to the AS. credentials to authenticate to the AS.
* Make sure that the client is configured to follow the security * Make sure that the client is configured to follow the security
requirements of the Requesting Party, when issuing requests requirements of the Requesting Party when issuing requests
(e.g. minimum communication security requirements, trust (e.g., minimum communication security requirements, trust
anchors). anchors).
* Register the client at the AS. This includes making known to * Register the client at the AS. This includes making known to
the AS which profiles, token_types, and key types (symmetric/ the AS which profiles, token_types, and key types (symmetric/
asymmetric) the client. asymmetric) the client.
Authorization Server Authorization Server
* Register RS and manage corresponding security contexts. * Register the RS and manage corresponding security contexts.
* Register clients and including authentication credentials. * Register clients and authentication credentials.
* Allow Resource Owners to configure and update access control * Allow Resource Owners to configure and update access control
policies related to their registered RS' policies related to their registered RSs.
* Expose the /token endpoint to allow clients to request tokens. * Expose the token endpoint to allow clients to request tokens.
* Authenticate clients that wish to request a token. * Authenticate clients that wish to request a token.
* Process a token request using the authorization policies
* Process a token request against the authorization policies
configured for the RS. configured for the RS.
* Optionally: Expose the /introspection endpoint that allows RS's
* Optionally: Expose the introspection endpoint that allows RS's
to submit token introspection requests. to submit token introspection requests.
* If providing an introspection endpoint: Authenticate RS's that * If providing an introspection endpoint: Authenticate RSs that
wish to get an introspection response. wish to get an introspection response.
* If providing an introspection endpoint: Process token * If providing an introspection endpoint: Process token
introspection requests. introspection requests.
* Optionally: Handle token revocation. * Optionally: Handle token revocation.
* Optionally: Provide discovery metadta. See
[I-D.ietf-oauth-discovery]
Client Client
* Discover the AS in charge of the RS that is to be targeted with * Discover the AS in charge of the RS that is to be targeted with
a request. a request.
* Submit the token request (A). * Submit the token request (see step (A) of Figure 1).
+ Authenticate towards the AS. + Authenticate to the AS.
+ Optionally (if not pre-configured): Specify which RS, which + Optionally (if not pre-configured): Specify which RS, which
resource(s), and which action(s) the request(s) will target. resource(s), and which action(s) the request(s) will target.
+ If raw public key (rpk) or certificate is used, make sure + If raw public keys (rpk) or certificates are used, make sure
the AS has the right rpk or certificate for this client. the AS has the right rpk or certificate for this client.
* Process the access token and RS Information (B) * Process the access token and RS Information (see step (B) of
Figure 1).
+ Check that the RS Information provides the necessary + Check that the RS Information provides the necessary
security parameters (e.g. PoP key, information on security parameters (e.g., PoP key, information on
communication security protocols supported by the RS). communication security protocols supported by the RS).
* Send the token and request to the RS (C) * Send the token and request to the RS (see step (C) of
Figure 1).
+ Authenticate towards the RS (this could coincide with the + Authenticate towards the RS (this could coincide with the
proof of possession process). proof of possession process).
+ Transmit the token as specified by the AS (default is to the + Transmit the token as specified by the AS (default is to the
/authz-info endpoint, alternative options are specified by authz-info endpoint, alternative options are specified by
profiles). profiles).
+ Perform the proof-of-possession procedure as specified by + Perform the proof-of-possession procedure as specified by
the profile in use (this may already have been taken care of the profile in use (this may already have been taken care of
through the authentication procedure). through the authentication procedure).
* Process the RS response (F) requirements of the Requesting * Process the RS response (see step (F) of Figure 1) of the RS.
Party, when issuing requests (e.g. minimum communication
security requirements, trust anchors).
* Register the client at the AS.
Resource Server Resource Server
* Expose a way to submit access tokens. By default this is the * Expose a way to submit access tokens. By default this is the
/authz-info endpoint. authz-info endpoint.
* Process an access token. * Process an access token.
+ Verify the token is from the right AS. + Verify the token is from a recognized AS.
+ Verify that the token applies to this RS. + Verify that the token applies to this RS.
+ Check that the token has not expired (if the token provides + Check that the token has not expired (if the token provides
expiration information). expiration information).
+ Check the token's integrity. + Check the token's integrity.
+ Store the token so that it can be retrieved in the context + Store the token so that it can be retrieved in the context
of a matching request. of a matching request.
* Process a request. * Process a request.
+ Set up communication security with the client. + Set up communication security with the client.
+ Authenticate the client. + Authenticate the client.
+ Match the client against existing tokens. + Match the client against existing tokens.
skipping to change at page 52, line 26 skipping to change at page 57, line 25
+ Check that tokens belonging to the client actually authorize + Check that tokens belonging to the client actually authorize
the requested action. the requested action.
+ Optionally: Check that the matching tokens are still valid, + Optionally: Check that the matching tokens are still valid,
using introspection (if this is possible.) using introspection (if this is possible.)
* Send a response following the agreed upon communication * Send a response following the agreed upon communication
security. security.
Appendix C. Requirements on Profiles Appendix C. Requirements on Profiles
This section lists the requirements on profiles of this framework, This section lists the requirements on profiles of this framework,
for the convenience of a profile designer. for the convenience of profile designers.
o Optionally Specify the discovery process of how the client finds
the right AS for an RS it wants to send a request to. Section 4
o Specify the communication protocol the client and RS the must use o Specify the communication protocol the client and RS the must use
(e.g. CoAP). Section 5 and Section 5.5.4.4 (e.g., CoAP). Section 5 and Section 5.6.4.4
o Specify the security protocol the client and RS must use to o Specify the security protocol the client and RS must use to
protect their communication (e.g. OSCOAP or DTLS over CoAP). protect their communication (e.g., OSCOAP or DTLS over CoAP).
This must provide encryption and integrity protection. This must provide encryption, integrity and replay protection.
Section 5.5.4.4 Section 5.6.4.4
o Specify how the client and the RS mutually authenticate. o Specify how the client and the RS mutually authenticate.
Section 4 Section 4
o Specify the Content-format of the protocol messages (e.g. o Specify the Content-format of the protocol messages (e.g.,
"application/cbor" or "application/cose+cbor"). Section 4 "application/cbor" or "application/cose+cbor"). Section 4
o Specify the proof-of-possession protocol(s) and how to select one, o Specify the proof-of-possession protocol(s) and how to select one,
if several are available. Also specify which key types (e.g. if several are available. Also specify which key types (e.g.,
symmetric/asymmetric) are supported by a specific proof-of- symmetric/asymmetric) are supported by a specific proof-of-
possession protocol. Section 5.5.4.3 possession protocol. Section 5.6.4.3
o Specify a unique profile identifier. Section 5.5.4.4 o Specify a unique profile identifier. Section 5.6.4.4
o Optionally specify how the RS talks to the AS for o If introspection is supported: Specify the communication and
introspection.Section 5.6 security protocol for introspection.Section 5.7
o Optionally specify how the client talks to the AS for requesting a o Specify the communication and security protocol for interactions
token. Section 5.5 between client and AS. Section 5.6
o Specify how/if the /authz-info endpoint is protected. o Specify how/if the authz-info endpoint is protected.
Section 5.7.1 Section 5.8.1
o Optionally define other methods of token transport than the o Optionally define other methods of token transport than the authz-
/authz-info endpoint. Section 5.7.1 info endpoint. Section 5.8.1
Appendix D. Assumptions on AS knowledge about C and RS Appendix D. Assumptions on AS knowledge about C and RS
This section lists the assumptions on what an AS should know about a This section lists the assumptions on what an AS should know about a
client and a RS in order to be able to respond to requests to the client and a RS in order to be able to respond to requests to the
/token and /introspect endpoints. How this information is token and introspection endpoints. How this information is
established is out of scope for this document. established is out of scope for this document.
o The identifier of the client or RS. o The identifier of the client or RS.
o The profiles that the client or RS supports. o The profiles that the client or RS supports.
o The scopes that the RS supports. o The scopes that the RS supports.
o The audiences that the RS identifies with. o The audiences that the RS identifies with.
o The key types (e.g. pre-shared symmetric key, raw public key, key o The key types (e.g., pre-shared symmetric key, raw public key, key
length, other key parameters) that the client or RS supports. length, other key parameters) that the client or RS supports.
o The types of access tokens the RS supports (e.g. CWT). o The types of access tokens the RS supports (e.g., CWT).
o If the RS supports CWTs, the COSE parameters for the crypto o If the RS supports CWTs, the COSE parameters for the crypto
wrapper (e.g. algorithm, key-wrap algorithm, key-length). wrapper (e.g., algorithm, key-wrap algorithm, key-length).
o The expiration time for access tokens issued to this RS (unless o The expiration time for access tokens issued to this RS (unless
the RS accepts a default time chosen by the AS). the RS accepts a default time chosen by the AS).
o The symmetric key shared between client or RS and AS (if any). o The symmetric key shared between client or RS and AS (if any).
o The raw public key of the client or RS (if any). o The raw public key of the client or RS (if any).
Appendix E. Deployment Examples Appendix E. Deployment Examples
There is a large variety of IoT deployments, as is indicated in There is a large variety of IoT deployments, as is indicated in
Appendix A, and this section highlights a few common variants. This Appendix A, and this section highlights a few common variants. This
section is not normative but illustrates how the framework can be section is not normative but illustrates how the framework can be
applied. applied.
For each of the deployment variants there are a number of possible For each of the deployment variants, there are a number of possible
security setups between clients, resource servers and authorization security setups between clients, resource servers and authorization
servers. The main focus in the following subsections is on how servers. The main focus in the following subsections is on how
authorization of a client request for a resource hosted by a RS is authorization of a client request for a resource hosted by a RS is
performed. This requires the the security of the requests and performed. This requires the security of the requests and responses
responses between the clients and the RS to consider. between the clients and the RS to consider.
Note: CBOR diagnostic notation is used for examples of requests and Note: CBOR diagnostic notation is used for examples of requests and
responses. responses.
E.1. Local Token Validation E.1. Local Token Validation
In this scenario we consider the case where the resource server is In this scenario, the case where the resource server is offline is
offline, i.e. it is not connected to the AS at the time of the access considered, i.e., it is not connected to the AS at the time of the
request. This access procedure involves steps A, B, C, and F of access request. This access procedure involves steps A, B, C, and F
Figure 1. of Figure 1.
Since the resource server must be able to verify the access token Since the resource server must be able to verify the access token
locally, self-contained access tokens must be used. locally, self-contained access tokens must be used.
This example shows the interactions between a client, the This example shows the interactions between a client, the
authorization server and a temperature sensor acting as a resource authorization server and a temperature sensor acting as a resource
server. Message exchanges A and B are shown in Figure 18. server. Message exchanges A and B are shown in Figure 17.
A: The client first generates a public-private key pair used for A: The client first generates a public-private key pair used for
communication security with the RS. communication security with the RS.
The client sends the POST request to /token at the AS. The The client sends the POST request to the token endpoint at the AS.
security of this request can be transport or application layer, it The security of this request can be transport or application
is up the the communication security profile to define. In the layer. It is up the the communication security profile to define.
example transport layer identification of the AS is done and the In the example transport layer identification of the AS is done
client identifies with client_id and client_secret as in classic and the client identifies with client_id and client_secret as in
OAuth. The request contains the public key of the client and the classic OAuth. The request contains the public key of the client
Audience parameter set to "tempSensorInLivingRoom", a value that and the Audience parameter set to "tempSensorInLivingRoom", a
the temperature sensor identifies itself with. The AS evaluates value that the temperature sensor identifies itself with. The AS
the request and authorizes the client to access the resource. evaluates the request and authorizes the client to access the
B: The AS responds with a PoP token and RS Information. The PoP resource.
token contains the public key of the client, and the RS B: The AS responds with a PoP access token and RS Information.
Information contains the public key of the RS. For communication The PoP access token contains the public key of the client, and
security this example uses DTLS RawPublicKey between the client the RS Information contains the public key of the RS. For
and the RS. The issued token will have a short validity time, communication security this example uses DTLS RawPublicKey between
i.e. 'exp' close to 'iat', to protect the RS from replay attacks. the client and the RS. The issued token will have a short
The token includes the claim such as "scope" with the authorized validity time, i.e., "exp" close to "iat", to protect the RS from
access that an owner of the temperature device can enjoy. In this replay attacks. The token includes the claim such as "scope" with
example, the 'scope' claim, issued by the AS, informs the RS that the authorized access that an owner of the temperature device can
the owner of the token, that can prove the possession of a key is enjoy. In this example, the "scope" claim, issued by the AS,
authorized to make a GET request against the /temperature resource informs the RS that the owner of the token, that can prove the
and a POST request on the /firmware resource. Note that the possession of a key is authorized to make a GET request against
syntax and semantics of the scope claim are application specific. the /temperature resource and a POST request on the /firmware
Note: In this example we assume that the client knows what resource. Note that the syntax and semantics of the scope claim
are application specific.
Note: In this example it is assumed that the client knows what
resource it wants to access, and is therefore able to request resource it wants to access, and is therefore able to request
specific audience and scope claims for the access token. specific audience and scope claims for the access token.
Authorization Authorization
Client Server Client Server
| | | |
|<=======>| DTLS Connection Establishment |<=======>| DTLS Connection Establishment
| | to identify the AS | | to identify the AS
| | | |
A: +-------->| Header: POST (Code=0.02) A: +-------->| Header: POST (Code=0.02)
| POST | Uri-Path:"token" | POST | Uri-Path:"token"
| | Content-Type: application/cbor | | Content-Type: application/cbor
| | Payload: <Request-Payload> | | Payload: <Request-Payload>
| | | |
B: |<--------+ Header: 2.05 Content B: |<--------+ Header: 2.05 Content
| 2.05 | Content-Type: application/cbor | 2.05 | Content-Type: application/cbor
| | Payload: <Response-Payload> | | Payload: <Response-Payload>
| | | |
Figure 18: Token Request and Response Using Client Credentials. Figure 17: Token Request and Response Using Client Credentials.
The information contained in the Request-Payload and the Response- The information contained in the Request-Payload and the Response-
Payload is shown in Figure 19. Note that we assume a DTLS-based Payload is shown in Figure 18. Note that a transport layer security
communication security profile for this example, therefore the based communication security profile is used in this example,
Content-Type is "application/cbor". therefore the Content-Type is "application/cbor".
Request-Payload : Request-Payload :
{ {
"grant_type" : "client_credentials", "grant_type" : "client_credentials",
"aud" : "tempSensorInLivingRoom", "aud" : "tempSensorInLivingRoom",
"client_id" : "myclient", "client_id" : "myclient",
"client_secret" : "qwerty" "client_secret" : "qwerty"
} }
Response-Payload : Response-Payload :
{ {
"access_token" : b64'SlAV32hkKG ...', "access_token" : b64'SlAV32hkKG ...',
"token_type" : "pop", "token_type" : "pop",
"csp" : "DTLS", "csp" : "DTLS",
"cnf" : { "rs_cnf" : {
"COSE_Key" : { "COSE_Key" : {
"kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk',
"kty" : "EC", "kty" : "EC",
"crv" : "P-256", "crv" : "P-256",
"x" : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4', "x" : b64'MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4',
"y" : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM' "y" : b64'4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM'
} }
} }
} }
Figure 19: Request and Response Payload Details. Figure 18: Request and Response Payload Details.
The content of the access token is shown in Figure 20. The content of the access token is shown in Figure 19.
{ {
"aud" : "tempSensorInLivingRoom", "aud" : "tempSensorInLivingRoom",
"iat" : "1360189224", "iat" : "1360189224",
"exp" : "1360289224", "exp" : "1360289224",
"scope" : "temperature_g firmware_p", "scope" : "temperature_g firmware_p",
"cnf" : { "cnf" : {
"jwk" : { "COSE_Key" : {
"kid" : b64'1Bg8vub9tLe1gHMzV76e8', "kid" : b64'1Bg8vub9tLe1gHMzV76e8',
"kty" : "EC", "kty" : "EC",
"crv" : "P-256", "crv" : "P-256",
"x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU', "x" : b64'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU',
"y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0' "y" : b64'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0'
} }
} }
} }
Figure 20: Access Token including Public Key of the Client. Figure 19: Access Token including Public Key of the Client.
Messages C and F are shown in Figure 21 - Figure 22. Messages C and F are shown in Figure 20 - Figure 21.
C: The client then sends the PoP token to the /authz-info endpoint C: The client then sends the PoP access token to the authz-info
at the RS. This is a plain CoAP request, i.e. no transport or endpoint at the RS. This is a plain CoAP request, i.e., no
application layer security between client and RS, since the token transport or application layer security between client and RS,
is integrity protected between AS and RS. The RS verifies that since the token is integrity protected between the AS and RS. The
the PoP token was created by a known and trusted AS, is valid, and RS verifies that the PoP access token was created by a known and
responds to the client. The RS caches the security context trusted AS, is valid, and responds to the client. The RS caches
together with authorization information about this client the security context together with authorization information about
contained in the PoP token. this client contained in the PoP access token.
Resource Resource
Client Server Client Server
| | | |
C: +-------->| Header: POST (Code=0.02) C: +-------->| Header: POST (Code=0.02)
| POST | Uri-Path:"authz-info" | POST | Uri-Path:"authz-info"
| | Payload: SlAV32hkKG ... | | Payload: SlAV32hkKG ...
| | | |
|<--------+ Header: 2.04 Changed |<--------+ Header: 2.04 Changed
| 2.04 | | 2.04 |
| | | |
Figure 21: Access Token provisioning to RS Figure 20: Access Token provisioning to RS
The client and the RS runs the DTLS handshake using the raw public The client and the RS runs the DTLS handshake using the raw public
keys established in step B and C. keys established in step B and C.
The client sends the CoAP request GET to /temperature on RS over The client sends the CoAP request GET to /temperature on RS over
DTLS. The RS verifies that the request is authorized, based on DTLS. The RS verifies that the request is authorized, based on
previously established security context. previously established security context.
F: The RS responds with a resource representation over DTLS. F: The RS responds with a resource representation over DTLS.
Resource Resource
Client Server Client Server
skipping to change at page 57, line 25 skipping to change at page 62, line 25
| | | |
+-------->| Header: GET (Code=0.01) +-------->| Header: GET (Code=0.01)
| GET | Uri-Path: "temperature" | GET | Uri-Path: "temperature"
| | | |
| | | |
| | | |
F: |<--------+ Header: 2.05 Content F: |<--------+ Header: 2.05 Content
| 2.05 | Payload: <sensor value> | 2.05 | Payload: <sensor value>
| | | |
Figure 22: Resource Request and Response protected by DTLS. Figure 21: Resource Request and Response protected by DTLS.
E.2. Introspection Aided Token Validation E.2. Introspection Aided Token Validation
In this deployment scenario we assume that a client is not able to In this deployment scenario it is assumed that a client is not able
access the AS at the time of the access request. Since the RS is, to access the AS at the time of the access request, whereas the RS is
however, connected to the back-end infrastructure it can make use of assumed to be connected to the back-end infrastructure. Thus the RS
token introspection. This access procedure involves steps A-F of can make use of token introspection. This access procedure involves
Figure 1, but assumes steps A and B have been carried out during a steps A-F of Figure 1, but assumes steps A and B have been carried
phase when the client had connectivity to AS. out during a phase when the client had connectivity to AS.
Since the client is assumed to be offline, at least for a certain Since the client is assumed to be offline, at least for a certain
period of time, a pre-provisioned access token has to be long-lived. period of time, a pre-provisioned access token has to be long-lived.
The resource server may use its online connectivity to validate the Since the client is constrained, the token will not be self contained
access token with the authorization server, which is shown in the (i.e. not a CWT) but instead just a reference. The resource server
example below. uses its connectivity to learn about the claims assoicated to the
access token by using introspection, which is shown in the example
below.
In the example interactions between an offline client (key fob), a RS In the example interactions between an offline client (key fob), a RS
(online lock), and an AS is shown. We assume that there is a (online lock), and an AS is shown. It is assumed that there is a
provisioning step where the client has access to the AS. This provisioning step where the client has access to the AS. This
corresponds to message exchanges A and B which are shown in corresponds to message exchanges A and B which are shown in
Figure 23. Figure 22.
Authorization consent from the resource owner can be pre-configured, Authorization consent from the resource owner can be pre-configured,
but it can also be provided via an interactive flow with the resource but it can also be provided via an interactive flow with the resource
owner. An example of this for the key fob case could be that the owner. An example of this for the key fob case could be that the
resource owner has a connected car, he buys a generic key that he resource owner has a connected car, he buys a generic key that he
wants to use with the car. To authorize the key fob he connects it wants to use with the car. To authorize the key fob he connects it
to his computer that then provides the UI for the device. After that to his computer that then provides the UI for the device. After that
OAuth 2.0 implicit flow can used to authorize the key for his car at OAuth 2.0 implicit flow can used to authorize the key for his car at
the the car manufacturers AS. the the car manufacturers AS.
Note: In this example the client does not know the exact door it will Note: In this example the client does not know the exact door it will
be used to access since the token request is not send at the time of be used to access since the token request is not send at the time of
access. So the scope and audience parameters is set quite wide to access. So the scope and audience parameters are set quite wide to
start with and new values different form the original once can be start with and new values different form the original once can be
returned from introspection later on. returned from introspection later on.
A: The client sends the request using POST to /token at AS. The A: The client sends the request using POST to the token endpoint
request contains the Audience parameter set to "PACS1337" (PACS, at AS. The request contains the Audience parameter set to
Physical Access System), a value the that the online door in "PACS1337" (PACS, Physical Access System), a value the that the
question identifies itself with. The AS generates an access token online door in question identifies itself with. The AS generates
as on opaque string, which it can match to the specific client, a an access token as an opaque string, which it can match to the
targeted audience and a symmetric key. The security is provided specific client, a targeted audience and a symmetric key. The
by identifying the AS on transport layer using a pre shared security is provided by identifying the AS on transport layer
security context (psk, rpk or certificate) and then the client is using a pre shared security context (psk, rpk or certificate) and
identified using client_id and client_secret as in classic OAuth then the client is identified using client_id and client_secret as
in classic OAuth.
B: The AS responds with the an access token and RS Information, B: The AS responds with the an access token and RS Information,
the latter containing a symmetric key. Communication security the latter containing a symmetric key. Communication security
between C and RS will be DTLS and PreSharedKey. The PoP key being between C and RS will be DTLS and PreSharedKey. The PoP key is
used as the PreSharedKey. used as the PreSharedKey.
Authorization Authorization
Client Server Client Server
| | | |
| | | |
A: +-------->| Header: POST (Code=0.02) A: +-------->| Header: POST (Code=0.02)
| POST | Uri-Path:"token" | POST | Uri-Path:"token"
| | Content-Type: application/cbor | | Content-Type: application/cbor
| | Payload: <Request-Payload> | | Payload: <Request-Payload>
| | | |
B: |<--------+ Header: 2.05 Content B: |<--------+ Header: 2.05 Content
| | Content-Type: application/cbor | | Content-Type: application/cbor
| 2.05 | Payload: <Response-Payload> | 2.05 | Payload: <Response-Payload>
| | | |
Figure 23: Token Request and Response using Client Credentials. Figure 22: Token Request and Response using Client Credentials.
The information contained in the Request-Payload and the Response- The information contained in the Request-Payload and the Response-
Payload is shown in Figure 24. Payload is shown in Figure 23.
Request-Payload: Request-Payload:
{ {
"grant_type" : "client_credentials", "grant_type" : "client_credentials",
"aud" : "lockOfDoor4711", "aud" : "lockOfDoor4711",
"client_id" : "keyfob", "client_id" : "keyfob",
"client_secret" : "qwerty" "client_secret" : "qwerty"
} }
Response-Payload: Response-Payload:
skipping to change at page 59, line 28 skipping to change at page 64, line 28
"cnf" : { "cnf" : {
"COSE_Key" : { "COSE_Key" : {
"kid" : b64'c29tZSBwdWJsaWMga2V5IGlk', "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk',
"kty" : "oct", "kty" : "oct",
"alg" : "HS256", "alg" : "HS256",
"k": b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE' "k": b64'ZoRSOrFzN_FzUA5XKMYoVHyzff5oRJxl-IXRtztJ6uE'
} }
} }
} }
Figure 24: Request and Response Payload for C offline Figure 23: Request and Response Payload for C offline
The access token in this case is just an opaque string referencing The access token in this case is just an opaque string referencing
the authorization information at the AS. the authorization information at the AS.
C: Next, the client POSTs the access token to the /authz-info C: Next, the client POSTs the access token to the authz-info
endpoint in the RS. This is a plain CoAP request, i.e. no DTLS endpoint in the RS. This is a plain CoAP request, i.e., no DTLS
between client and RS. Since the token is an opaque string, the between client and RS. Since the token is an opaque string, the
RS cannot verify it on its own, and thus defers to respond the RS cannot verify it on its own, and thus defers to respond the
client with a status code until after step E. client with a status code until after step E.
D: The RS forwards the token to the /introspect endpoint on the D: The RS forwards the token to the introspection endpoint on the
AS. Introspection assumes a secure connection between the AS and AS. Introspection assumes a secure connection between the AS and
the RS, e.g. using transport of application layer security. In the RS, e.g., using transport of application layer security. In
the example AS is identified using pre shared security context the example AS is identified using pre shared security context
(psk, rpk or certificate) while RS is acting as client and is (psk, rpk or certificate) while RS is acting as client and is
identified with client_id and client_secret. identified with client_id and client_secret.
E: The AS provides the introspection response containing E: The AS provides the introspection response containing
parameters about the token. This includes the confirmation key parameters about the token. This includes the confirmation key
(cnf) parameter that allows the RS to verify the client's proof of (cnf) parameter that allows the RS to verify the client's proof of
possession in step F. possession in step F.
After receiving message E, the RS responds to the client's POST in After receiving message E, the RS responds to the client's POST in
step C with the CoAP response code 2.01 (Created). step C with the CoAP response code 2.01 (Created).
skipping to change at page 60, line 30 skipping to change at page 65, line 30
| | | | | |
| E: |<---------+ Header: 2.05 Content | E: |<---------+ Header: 2.05 Content
| | 2.05 | Content-Type: "application/cbor" | | 2.05 | Content-Type: "application/cbor"
| | | Payload: <Response-Payload> | | | Payload: <Response-Payload>
| | | | | |
| | | |
|<--------+ Header: 2.01 Created |<--------+ Header: 2.01 Created
| 2.01 | | 2.01 |
| | | |
Figure 25: Token Introspection for C offline Figure 24: Token Introspection for C offline
The information contained in the Request-Payload and the Response- The information contained in the Request-Payload and the Response-
Payload is shown in Figure 26. Payload is shown in Figure 25.
Request-Payload: Request-Payload:
{ {
"token" : b64'SlAV32hkKG...', "token" : b64'SlAV32hkKG...',
"client_id" : "FrontDoor", "client_id" : "FrontDoor",
"client_secret" : "ytrewq" "client_secret" : "ytrewq"
} }
Response-Payload: Response-Payload:
{ {
"active" : true, "active" : true,
"aud" : "lockOfDoor4711", "aud" : "lockOfDoor4711",
"scope" : "open, close", "scope" : "open, close",
"iat" : 1311280970, "iat" : 1311280970,
"cnf" : { "cnf" : {
"kid" : b64'JDLUhTMjU2IiwiY3R5Ijoi ...' "kid" : b64'JDLUhTMjU2IiwiY3R5Ijoi ...'
} }
} }
Figure 26: Request and Response Payload for Introspection Figure 25: Request and Response Payload for Introspection
The client uses the symmetric PoP key to establish a DTLS The client uses the symmetric PoP key to establish a DTLS
PreSharedKey secure connection to the RS. The CoAP request PUT is PreSharedKey secure connection to the RS. The CoAP request PUT is
sent to the uri-path /state on RS changing state of the door to sent to the uri-path /state on the RS, changing the state of the
locked. door to locked.
F: The RS responds with a appropriate over the secure DTLS F: The RS responds with a appropriate over the secure DTLS
channel. channel.
Resource Resource
Client Server Client Server
| | | |
|<=======>| DTLS Connection Establishment |<=======>| DTLS Connection Establishment
| | using Pre Shared Key | | using Pre Shared Key
| | | |
+-------->| Header: PUT (Code=0.03) +-------->| Header: PUT (Code=0.03)
| PUT | Uri-Path: "state" | PUT | Uri-Path: "state"
| | Payload: <new state for the lock> | | Payload: <new state for the lock>
| | | |
F: |<--------+ Header: 2.04 Changed F: |<--------+ Header: 2.04 Changed
| 2.04 | Payload: <new state for the lock> | 2.04 | Payload: <new state for the lock>
| | | |
Figure 27: Resource request and response protected by OSCOAP Figure 26: Resource request and response protected by OSCOAP
Appendix F. Document Updates Appendix F. Document Updates
F.1. Version -06 to -07 F.1. Version -08 to -09
o Moved AS discovery from the DTLS profile to the framework, see
Section 5.1.
o Made the use of CBOR mandatory. If you use JSON you can use
vanilla OAuth.
o Made it mandatory for profiles to specify C-AS security and RS-AS
security (the latter only if introspection is supported).
o Made the use of CBOR abbreviations mandatory.
o Added text to clarify the use of token references as an
alternative to CWTs.
o Added text to clarify that introspection must not be delayed, in
case the RS has to return a client token.
o Added security considerations about leakage through unprotected AS
discovery information, combining profiles and leakage through
error responses.
o Added privacy considerations about leakage through unprotected AS
discovery.
o Added text that clarifies that introspection is optional.
o Made profile parameter optional since it can be implicit.
o Clarified that CoAP is not mandatory and other protocols can be
used.
o Clarified the design justification for specific features of the
framework in appendix A.
o Clarified appendix E.2.
F.2. Version -07 to -08
o Removed specification of the "cnf" claim for CBOR/COSE, and
replaced with references to
[I-D.jones-ace-cwt-proof-of-possession]
F.3. Version -06 to -07
o Various clarifications added. o Various clarifications added.
o Fixed erroneous author email. o Fixed erroneous author email.
F.2. Version -05 to -06 F.4. Version -05 to -06
o Moved sections that define the ACE framework into a subsection of o Moved sections that define the ACE framework into a subsection of
the framework Section 5. the framework Section 5.
o Split section on client credentials and grant into two separate o Split section on client credentials and grant into two separate
sections, Section 5.1, and Section 5.2. sections, Section 5.2, and Section 5.3.
o Added Section 5.3 on AS authentication. o Added Section 5.4 on AS authentication.
o Added Section 5.4 on the Authorize endpoint. o Added Section 5.5 on the Authorization endpoint.
F.3. Version -04 to -05 F.5. Version -04 to -05
o Added RFC 2119 language to the specification of the required o Added RFC 2119 language to the specification of the required
behavior of profile specifications. behavior of profile specifications.
o Added Section 5.2 on the relation to the OAuth2 grant types. o Added Section 5.3 on the relation to the OAuth2 grant types.
o Added CBOR abbreviations for error and the error codes defined in o Added CBOR abbreviations for error and the error codes defined in
OAuth2. OAuth2.
o Added clarification about token expiration and long-running o Added clarification about token expiration and long-running
requests in Section 5.7.2 requests in Section 5.8.2
o Added security considerations about tokens with symmetric pop keys o Added security considerations about tokens with symmetric pop keys
valid for more than one RS. valid for more than one RS.
o Added privacy considerations section. o Added privacy considerations section.
o Added IANA registry mapping the confirmation types from RFC 7800 o Added IANA registry mapping the confirmation types from RFC 7800
to equivalent COSE types. to equivalent COSE types.
o Added appendix D, describing assumptions about what the AS knows o Added appendix D, describing assumptions about what the AS knows
about the client and the RS. about the client and the RS.
F.4. Version -03 to -04 F.6. Version -03 to -04
o Added a description of the terms "framework" and "profiles" as o Added a description of the terms "framework" and "profiles" as
used in this document. used in this document.
o Clarified protection of access tokens in section 3.1. o Clarified protection of access tokens in section 3.1.
o Clarified uses of the 'cnf' parameter in section 6.4.5. o Clarified uses of the "cnf" parameter in section 6.4.5.
o Clarified intended use of Client Token in section 7.4. o Clarified intended use of Client Token in section 7.4.
F.5. Version -02 to -03 F.7. Version -02 to -03
o Removed references to draft-ietf-oauth-pop-key-distribution since o Removed references to draft-ietf-oauth-pop-key-distribution since
the status of this draft is unclear. the status of this draft is unclear.
o Copied and adapted security considerations from draft-ietf-oauth- o Copied and adapted security considerations from draft-ietf-oauth-
pop-key-distribution. pop-key-distribution.
o Renamed "client information" to "RS information" since it is o Renamed "client information" to "RS information" since it is
information about the RS. information about the RS.
o Clarified the requirements on profiles of this framework. o Clarified the requirements on profiles of this framework.
o Clarified the token endpoint protocol and removed negotiation of o Clarified the token endpoint protocol and removed negotiation of
'profile' and 'alg' (section 6). "profile" and "alg" (section 6).
o Renumbered the abbreviations for claims and parameters to get a o Renumbered the abbreviations for claims and parameters to get a
consistent numbering across different endpoints. consistent numbering across different endpoints.
o Clarified the introspection endpoint. o Clarified the introspection endpoint.
o Renamed token, introspection and authz-info to 'endpoint' instead o Renamed token, introspection and authz-info to "endpoint" instead
of 'resource' to mirror the OAuth 2.0 terminology. of "resource" to mirror the OAuth 2.0 terminology.
o Updated the examples in the appendices. o Updated the examples in the appendices.
F.6. Version -01 to -02 F.8. Version -01 to -02
o Restructured to remove communication security parts. These shall o Restructured to remove communication security parts. These shall
now be defined in profiles. now be defined in profiles.
o Restructured section 5 to create new sections on the OAuth o Restructured section 5 to create new sections on the OAuth
endpoints /token, /introspect and /authz-info. endpoints token, introspection and authz-info.
o Pulled in material from draft-ietf-oauth-pop-key-distribution in o Pulled in material from draft-ietf-oauth-pop-key-distribution in
order to define proof-of-possession key distribution. order to define proof-of-possession key distribution.
o Introduced the 'cnf' parameter as defined in RFC7800 to reference o Introduced the "cnf" parameter as defined in RFC7800 to reference
or transport keys used for proof of possession. or transport keys used for proof of possession.
o Introduced the 'client-token' to transport client information from o Introduced the "client-token" to transport client information from
the AS to the client via the RS in conjunction with introspection. the AS to the client via the RS in conjunction with introspection.
o Expanded the IANA section to define parameters for token request, o Expanded the IANA section to define parameters for token request,
introspection and CWT claims. introspection and CWT claims.
o Moved deployment scenarios to the appendix as examples. o Moved deployment scenarios to the appendix as examples.
F.7. Version -00 to -01 F.9. Version -00 to -01
o Changed 5.1. from "Communication Security Protocol" to "Client o Changed 5.1. from "Communication Security Protocol" to "Client
Information". Information".
o Major rewrite of 5.1 to clarify the information exchanged between o Major rewrite of 5.1 to clarify the information exchanged between
C and AS in the PoP token request profile for IoT. C and AS in the PoP access token request profile for IoT.
* Allow the client to indicate preferences for the communication * Allow the client to indicate preferences for the communication
security protocol. security protocol.
* Defined the term "Client Information" for the additional * Defined the term "Client Information" for the additional
information returned to the client in addition to the access information returned to the client in addition to the access
token. token.
* Require that the messages between AS and client are secured, * Require that the messages between AS and client are secured,
either with (D)TLS or with COSE_Encrypted wrappers. either with (D)TLS or with COSE_Encrypted wrappers.
* Removed dependency on OSCOAP and added generic text about * Removed dependency on OSCOAP and added generic text about
object security instead. object security instead.
* Defined the "rpk" parameter in the client information to * Defined the "rpk" parameter in the client information to
transmit the raw public key of the RS from AS to client. transmit the raw public key of the RS from AS to client.
* (D)TLS MUST use the PoP key in the handshake (either as PSK or * (D)TLS MUST use the PoP key in the handshake (either as PSK or
as client RPK with client authentication). as client RPK with client authentication).
* Defined the use of x5c, x5t and x5tS256 parameters when a * Defined the use of x5c, x5t and x5tS256 parameters when a
client certificate is used for proof of possession. client certificate is used for proof of possession.
* Defined "tktn" parameter for signaling for how to transfer the * Defined "tktn" parameter for signaling for how to transfer the
access token. access token.
skipping to change at page 63, line 46 skipping to change at page 69, line 30
expiration in the absence of reliable time. expiration in the absence of reliable time.
o Appendix B Added list of roles and responsibilities for C, AS and o Appendix B Added list of roles and responsibilities for C, AS and
RS. RS.
Authors' Addresses Authors' Addresses
Ludwig Seitz Ludwig Seitz
RISE SICS RISE SICS
Scheelevaegen 17 Scheelevaegen 17
Lund 223 70 Lund 223 70
SWEDEN Sweden
Email: ludwig.seitz@ri.se Email: ludwig.seitz@ri.se
Goeran Selander Goeran Selander
Ericsson Ericsson
Faroegatan 6 Faroegatan 6
Kista 164 80 Kista 164 80
SWEDEN Sweden
Email: goran.selander@ericsson.com Email: goran.selander@ericsson.com
Erik Wahlstroem Erik Wahlstroem
(no affiliation) (no affiliation)
Sweden Sweden
Email: erik@wahlstromtekniska.se Email: erik@wahlstromtekniska.se
Samuel Erdtman Samuel Erdtman
Spotify AB Spotify AB
Birger Jarlsgatan 61, 4tr Birger Jarlsgatan 61, 4tr
Stockholm 113 56 Stockholm 113 56
Sweden Sweden
Email: erdtman@spotify.com Email: erdtman@spotify.com
Hannes Tschofenig Hannes Tschofenig
ARM Ltd. ARM Ltd.
 End of changes. 333 change blocks. 
932 lines changed or deleted 1188 lines changed or added

This html diff was produced by rfcdiff 1.46. The latest version is available from http://tools.ietf.org/tools/rfcdiff/