-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdraft-ietf-ace-oauth-authz.xml
4721 lines (4558 loc) · 230 KB
/
draft-ietf-ace-oauth-authz.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
<!ENTITY nbsp " ">
<!ENTITY zwsp "​">
<!ENTITY nbhy "‑">
<!ENTITY wj "⁠">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" docName="draft-ietf-ace-oauth-authz-45" number="9200" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" category="std" consensus="true" xml:lang="en" tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" version="3">
<!--[rfced] *AD, as several new versions of the I-D were submitted after approval,
please review and let us know if you approve these changes:
a) the addition of the definition of "cti" in Section 5.9.2.
b) updated text in Section 5.8.4.4
c) RFC 4648 added as a normative reference
For all changes, please see this diff file:
https://www.ietf.org/rfcdiff?url1=draft-ietf-ace-oauth-authz-43&url2=draft-ietf-ace-oauth-authz-46
(Note: This includes noise such as changes to the characters in bulleted lists.)
-->
<!-- xml2rfc v2v3 conversion 3.9.1 -->
<!-- ***** FRONT MATTER ***** -->
<front>
<title abbrev="ACE-OAuth">Authentication and Authorization for Constrained Environments Using the OAuth 2.0 Framework (ACE-OAuth)</title>
<!--[rfced] Regarding the title, is "(ACE)" necessary? It seems redundant with
"(ACE-OAuth)" later.
Current:
Authentication and Authorization for Constrained Environments (ACE)
Using the OAuth 2.0 Framework (ACE-OAuth)
Perhaps:
Authentication and Authorization for Constrained Environments
Using the OAuth 2.0 Framework (ACE-OAuth)
Ludwig: Agreed fixed
-->
<seriesInfo name="RFC" value="9200"/>
<author fullname="Ludwig Seitz" initials="L." surname="Seitz">
<organization>Combitech</organization>
<address>
<postal>
<street>Djäknegatan 31</street>
<code>211 35</code>
<city>Malmö</city>
<country>Sweden</country>
</postal>
<email>ludwig.seitz@combitech.com</email>
</address>
</author>
<author fullname="Göran Selander" initials="G." surname="Selander">
<organization>Ericsson</organization>
<address>
<postal>
<street>Faroegatan 6</street>
<code>164 80</code>
<city>Kista</city>
<country>Sweden</country>
</postal>
<email>goran.selander@ericsson.com</email>
</address>
</author>
<author fullname="Erik Wahlstroem" initials="E." surname="Wahlstroem">
<!--[rfced] Erik, would you like your surname to appear
as Wahlström or Wahlstroem in the RFC?
Ludwig: Erik preferes "oe" for consistency with previously published RFCs
-->
<organization/>
<address>
<postal>
<street/>
<code/>
<city/>
<country>Sweden</country>
</postal>
<email>erik@wahlstromstekniska.se</email>
</address>
</author>
<author fullname="Samuel Erdtman" initials="S." surname="Erdtman">
<organization>Spotify AB</organization>
<address>
<postal>
<street>Birger Jarlsgatan 61, 4tr</street>
<code>113 56</code>
<city>Stockholm</city>
<country>Sweden</country>
</postal>
<email>erdtman@spotify.com</email>
</address>
</author>
<author fullname="Hannes Tschofenig" initials="H." surname="Tschofenig">
<organization>Arm Ltd.</organization>
<address>
<postal>
<street/>
<code>6067</code>
<city>Absam</city>
<country>Austria</country>
</postal>
<email>Hannes.Tschofenig@arm.com</email>
</address>
</author>
<date year="2022" month="March" />
<area>Security</area>
<workgroup>ACE</workgroup>
<keyword>CoAP</keyword>
<keyword>OAuth 2.0</keyword>
<keyword>Access Control</keyword>
<keyword>Authorization</keyword>
<keyword>Internet of Things</keyword>
<abstract>
<t>This specification defines a framework for authentication and
authorization in Internet of Things (IoT) environments called ACE&nbhy;OAuth.
The framework is based on a set of building blocks including OAuth 2.0
and the Constrained Application Protocol (CoAP), thus transforming a
well-known and widely used authorization solution into a form suitable
for IoT devices. Existing specifications are used where possible, but
extensions are added and profiles are defined to better serve the IoT use
cases.
</t>
</abstract>
</front>
<middle>
<!-- ***************************************************** -->
<section anchor="intro" numbered="true" toc="default">
<name>Introduction</name>
<t>Authorization is the process for granting approval to an entity to
access a generic resource <xref target="RFC4949" format="default"/>. The authorization
task itself can best be described as granting access to a requesting client for
a resource hosted on a device, i.e., the resource server (RS). This exchange is
mediated by one or multiple authorization servers (ASes). Managing
authorization for a large number of devices and users can be a complex task.
</t>
<t>While prior work on authorization solutions for the Web and for the mobile
environment also applies to the Internet of Things (IoT) environment, many
IoT devices are constrained, for example, in terms of processing
capabilities, available memory, etc. For such devices, the Constrained
Application Protocol (CoAP) <xref target="RFC7252" format="default"/> can alleviate some
resource concerns when used instead of HTTP to implement the communication
flows of this specification.</t>
<t><xref target="constraints" format="default"/> gives an overview of the constraints
considered in this design, and a more detailed treatment of constraints can
be found in <xref target="RFC7228" format="default"/>. This design aims to accommodate
different IoT deployments as well as a continuous range of device and network
capabilities. Taking energy consumption as an example, at one end, there are
energy-harvesting or battery-powered devices that have a tight power
budget; on the other end, there are mains-powered devices; and all levels exist in
between.</t>
<t>Hence, IoT devices may be very different in terms of available processing
and message exchange capabilities, and there is a need to support many
different authorization use cases <xref target="RFC7744" format="default"/>.</t>
<t>This specification describes a framework for Authentication and Authorization
for Constrained Environments (ACE) built on reuse of OAuth 2.0
<xref target="RFC6749" format="default"/>, thereby extending authorization to Internet of Things
devices. This specification contains the necessary building blocks
for adjusting OAuth 2.0 to IoT environments.</t>
<t>Profiles of this framework are available in separate specifications, such as
<xref target="RFC9202" format="default"/> or <xref target="RFC9203" format="default"/>.
Such profiles may specify the use of the framework for a specific security protocol
and the underlying transports for use in a specific deployment environment to improve interoperability.
Implementations may claim conformance with a specific profile, whereby
implementations utilizing the same profile interoperate, while
implementations of different profiles are not expected to be interoperable.
More powerful devices, such as mobile phones and tablets, may implement multiple
profiles and will therefore be able to interact with a wider range of constrained devices.
Requirements on profiles are described at contextually
appropriate places throughout this specification and also summarized in
<xref target="app_profileRequirements" format="default"/>.
</t>
</section>
<!-- ***************************************************** -->
<section anchor="terminology" numbered="true" toc="default">
<name>Terminology</name>
<t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and
"<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119" format="default"/> <xref target="RFC8174" format="default"/> when, and only when, they appear in all capitals, as shown here.</t>
<t>Certain security-related terms, such as "authentication",
"authorization", "confidentiality", "(data) integrity", "message
authentication code", and "verify", are taken from <xref target="RFC4949" format="default"/>.
</t>
<!--[rfced] FYI, we have added this sentence to explain "RESTful".
(Similar text appears in RFC 8613 and others.)
Original:
Since exchanges in this specification are described as RESTful
protocol interactions, HTTP [RFC7231] offers useful terminology.
Current:
Since exchanges in this specification are described as RESTful
protocol interactions, HTTP [RFC7231] offers useful terminology.
(Note that "RESTful" refers to the Representational State Transfer
(REST) architecture.)
Ludwig: Good catch! Agreed.
-->
<t>Since exchanges in this specification are described as RESTful protocol
interactions, HTTP <xref target="RFC7231" format="default"/> offers useful terminology.
(Note that "RESTful" refers to the Representational State Transfer (REST) architecture.)
</t>
<t>Terminology for entities in the architecture is defined in OAuth
2.0 <xref target="RFC6749" format="default"/>, such as client (C), resource server (RS),
and authorization server (AS).</t>
<t>Note that the term "endpoint" is used here following its OAuth
definition, which is to denote resources, such as token and
introspection at the AS and authz-info at the RS (see <xref target="tokenAuthInfoEndpoint" format="default"/> for a definition of the authz-info endpoint).
The CoAP definition, which is "[a]n entity
participating in the CoAP protocol" <xref target="RFC7252" format="default"/>, is not used in this specification.</t>
<t>The specification in this document is called the "framework" or "ACE framework".
When referring to "profiles of this framework", it refers to additional specifications that
define the use of this specification with concrete transport and communication
security protocols (e.g., CoAP over DTLS).
</t>
<t>The term "Access Information" is used for parameters, other than the access token, provided to the client by the AS to enable it to access the RS
(e.g., public key of the RS or profile supported by RS).</t>
<t>The term "authorization information" is used to denote all information,
including the claims of relevant access tokens, that an RS uses to determine whether an access request should be granted.</t>
<t>Throughout this document, examples for CBOR data items are expressed in
CBOR extended diagnostic notation as defined in
<xref section="8" sectionFormat="of" target="RFC8949"/> and
<xref section="G" sectionFormat="of" target="RFC8610"/>
("diagnostic notation"), unless noted otherwise.
We often use diagnostic notation comments to provide
a textual representation of the numeric parameter names and values.</t>
</section>
<!-- ***************************************************** -->
<section anchor="overview" numbered="true" toc="default">
<name>Overview</name>
<t>This specification defines the ACE framework for authorization in the Internet
of Things environment. It consists of a set of building blocks.</t>
<t>
The basic block is the OAuth 2.0 <xref target="RFC6749" format="default"/>
framework, which enjoys widespread deployment. Many IoT devices can support
OAuth 2.0 without any additional extensions, but for certain constrained
settings, additional profiling is needed.
</t>
<t>Another building block is the lightweight web transfer protocol CoAP
<xref target="RFC7252" format="default"/>, for those communication environments where HTTP is
not appropriate. CoAP typically runs on top of UDP, which further reduces
overhead and message exchanges. While this specification defines extensions
for the use of OAuth over CoAP, other underlying protocols are not prohibited
from being supported in the future, such as HTTP/2 <xref target="RFC7540" format="default"/>,
Message Queuing Telemetry Transport (MQTT) <xref target="MQTT5.0" format="default"/>,
Bluetooth Low Energy (BLE) <xref target="BLE" format="default"/>, and QUIC <xref target="RFC9000" format="default"/>. Note that this document specifies
protocol exchanges in terms of RESTful verbs, such as GET and POST.
Future profiles using protocols that do not support these verbs <bcp14>MUST</bcp14>
specify how the corresponding protocol messages are transmitted instead.</t>
<t>A third building block is the Concise Binary Object Representation
(CBOR) <xref target="RFC8949" format="default"/>, for encodings where JSON
<xref target="RFC8259" format="default"/> is not sufficiently compact. CBOR is a binary
encoding designed for small code and message size. Self-contained tokens
and protocol message payloads are encoded in CBOR when CoAP is used. When CoAP
is not used, the use of CBOR remains <bcp14>RECOMMENDED</bcp14>.
</t>
<t>A fourth building block is CBOR Object Signing and Encryption (COSE)
<xref target="RFC8152" format="default"/>, which enables object-level layer security as an
alternative or complement to transport layer security (DTLS
<xref target="RFC6347" format="default"/> or TLS <xref target="RFC8446" format="default"/>). COSE is used to
secure self-contained tokens, such as proof-of-possession (PoP) tokens,
which are an extension to the OAuth bearer tokens. The default token format
is defined in CBOR Web Token (CWT) <xref target="RFC8392" format="default"/>.
Application-layer security for CoAP using COSE can be provided with Object Security for
Constrained RESTful Environments (OSCORE)
<xref target="RFC8613" format="default"/>.</t>
<t>With the building blocks listed above, solutions satisfying various
IoT device and network constraints are possible. A list of constraints is
described in detail in <xref target="RFC7228" format="default"/>, and a description
of how the building blocks mentioned above relate to the various constraints
can be found in <xref target="constraints" format="default"/>.</t>
<t>Luckily, not every IoT device suffers from all constraints. Nevertheless, the ACE
framework takes all these aspects into account and allows
several different deployment variants to coexist, rather than mandating a
one-size-fits-all solution. It is important to cover the wide
range of possible interworking use cases and the different requirements from
a security point of view. Once IoT deployments mature, popular deployment
variants will be documented in the form of ACE profiles.</t>
<section anchor="oauth2Overview" numbered="true" toc="default">
<name>OAuth 2.0</name>
<t>The OAuth 2.0 authorization framework enables a client to obtain
scoped access to a resource with the permission of a resource
owner. Authorization information, or references to it, is passed between the nodes
using access tokens. These access tokens are issued to clients by an
authorization server with the approval of the resource owner. The client
uses the access token to access the protected resources hosted by the
resource server.</t>
<t>A number of OAuth 2.0 terms are used within this specification:
</t>
<dl newline="true" spacing="normal">
<dt>Access Tokens:</dt>
<dd>
<t>
Access tokens are credentials needed to access protected resources. An
access token is a data structure representing authorization permissions
issued by the AS to the client. Access tokens are generated by the AS
and consumed by the RS. The access token content is opaque
to the client.
</t>
<t>
Access tokens can have different formats and various methods
of utilization (e.g., cryptographic properties) based on the security
requirements of the given deployment.
</t>
</dd>
<dt>Introspection:</dt>
<dd>
Introspection is a method for a resource server, or potentially a client,
to query the authorization server for the active state and content of a
received access token. This is particularly useful in those cases where
the authorization decisions are very dynamic and/or where the received
access token itself is an opaque reference, rather than a self-contained
token. More information about introspection in OAuth 2.0 can be
found in <xref target="RFC7662" format="default"/>.
</dd>
<dt>Refresh Tokens:</dt>
<dd>
<t>
Refresh tokens are credentials used to obtain access tokens.
Refresh tokens are issued to the client by the authorization
server and are used to obtain a new access token when the current
access token expires or to obtain additional access tokens with
identical or narrower scope (such access tokens may have a shorter
lifetime and fewer permissions than authorized by the resource owner).
Issuing a refresh token is optional at the discretion of the
authorization server. If the authorization server issues a refresh
token, it is included when issuing an access token (i.e., step (B) in
<xref target="fig_protocolFlow" format="default"/>).
</t>
<t>
A refresh token in OAuth 2.0 is a string representing the authorization
granted to the client by the resource owner. The string is usually
opaque to the client. The token denotes an identifier used to retrieve
the authorization information. Unlike access tokens, refresh
tokens are intended for use only with authorization servers and
are never sent to resource servers. In this framework, refresh
tokens are encoded in binary instead of strings, if used.
</t>
</dd>
<dt>Proof-of-Possession Tokens:</dt>
<dd>
<t>
A token may be bound to a cryptographic key, which is then used
to bind the token to a request authorized by the token. Such tokens
are called proof-of-possession tokens (or PoP tokens).
</t>
<t>
The proof-of-possession security concept used here assumes that
the AS acts as a trusted third party that binds keys to tokens.
In the case of access tokens, these so-called PoP keys are then used by
the client to demonstrate the possession of the secret to the RS when
accessing the resource. The RS, when receiving an access token, needs
to verify that the key used by the client matches the one bound to the
access token. When this specification uses the term "access token", it
is assumed to be a PoP access token unless specifically stated
otherwise.
</t>
<t>
The key bound to the token (the PoP key) may use either symmetric or
asymmetric cryptography. The appropriate choice of the kind of
cryptography depends on the constraints of the IoT devices as well as
on the security requirements of the use case.
</t>
<dl newline="true" spacing="normal">
<dt>Symmetric PoP key:</dt>
<dd>
<t>
The AS generates a random, symmetric PoP key. The key is either
stored to be returned on introspection calls or included in the
token. Either the whole token or only the key <bcp14>MUST</bcp14> be encrypted
in the latter case. The PoP key is also returned to
client together with the token, protected by the secure channel.</t>
</dd>
<dt>Asymmetric PoP key:</dt>
<dd>
An asymmetric key pair is generated by the client and the public key
is sent to the AS (if it does not already have knowledge of the
client's public key). Information about the public key, which is the
PoP key in this case, is either stored to be returned on
introspection calls or included inside the token and sent
back to the client. The resource server consuming the token can
identify the public key from the information in the token, which
allows the client to use the corresponding private key for the
proof of possession.
</dd>
</dl>
<t> The token is either a simple reference
or a structured information object (e.g., CWT <xref target="RFC8392" format="default"/>)
protected by a cryptographic wrapper (e.g., COSE <xref target="RFC8152" format="default"/>). The choice of PoP key does not necessarily imply
a specific credential type for the integrity protection of the
token.</t>
</dd>
<dt>Scopes and Permissions:</dt>
<dd>
<t>
In OAuth 2.0, the client specifies the type of permissions it is
seeking to obtain (via the <tt>scope</tt> parameter) in the access token
request. In turn, the AS may use the <tt>scope</tt> response parameter to
inform the client of the scope of the access token issued. As the
client could be a constrained device as well, this specification
defines the use of CBOR encoding (see <xref target="oauthProfile" format="default"/>) for such requests and responses.
</t>
<t>
The values of the <tt>scope</tt> parameter in OAuth 2.0 are expressed as a list
of space-delimited, case-sensitive strings with a semantic that is
well known to the AS and the RS.
<!--[rfced] We see a number of author-inserted comments in the XML
file for this document. We are unsure if these have been resolved.
Please review and let us know if these can be deleted or if they
need to be addressed.
Ludwig: This comment contains text that we removed by didn't want to delete yet.
The other comments were added to help the authors navigate the document while editing
and can also be deleted
-->
More details about the concept of scopes are found under
<xref target="RFC6749" sectionFormat="of" section="3.3"/>.</t>
</dd>
<dt>Claims:</dt>
<dd>
<t>
Information carried in the access token or returned from introspection, called claims, is in the form of
name-value pairs. An access token may, for example, include a claim
identifying the AS that issued the token (via the <tt>iss</tt> claim) and
what audience the access token is intended for (via the <tt>aud</tt> claim).
The audience of an access token can be a specific resource, one resource, or
many resource servers. The resource owner policies influence what
claims are put into the access token by the authorization server.
</t>
<t>
While the structure and encoding of the access token varies throughout
deployments, a standardized format has been defined with the JSON Web
Token (JWT) <xref target="RFC7519" format="default"/>, where claims are encoded as a
JSON object. In <xref target="RFC8392" format="default"/>, the CBOR Web Token (CWT)
has been defined as an equivalent format using CBOR encoding.
</t>
</dd>
<dt>Token and Introspection Endpoints:</dt>
<dd>
<t>
The AS hosts the token endpoint that allows a client to request access
tokens. The client makes a POST request to the token endpoint on the AS
and receives the access token in the response (if the request was
successful).
</t>
<t>
In some deployments, a token introspection endpoint is provided by
the AS, which can be used by the RS and potentially the client, if they
need to request additional information regarding a received access
token. The requesting entity makes a POST request to the introspection
endpoint on the AS and receives information about the access token in
the response. (See "Introspection" above.)
</t>
</dd>
</dl>
</section>
<section anchor="coap" numbered="true" toc="default">
<name>CoAP</name>
<t>
CoAP is an application-layer protocol similar to HTTP but specifically
designed for constrained environments. CoAP typically uses
datagram-oriented transport, such as UDP, where reordering and loss
of packets can occur. A security solution needs to take the latter aspects
into account.</t>
<t>While HTTP uses headers and query strings to convey additional
information about a request, CoAP encodes such information into header
parameters called 'options'.</t>
<t>CoAP supports application-layer fragmentation of the CoAP payloads
through block-wise transfers <xref target="RFC7959" format="default"/>. However,
block-wise transfer does not increase the size limits of CoAP options;
therefore, data encoded in options has to be kept small.
</t>
<t>Transport layer security for CoAP can be provided by DTLS or TLS
<xref target="RFC6347" format="default"/> <xref target="RFC8446" format="default"/>
<xref target="RFC9147" format="default"/>.
CoAP defines a number of proxy operations that require transport layer
security to be terminated at the proxy. One approach for protecting CoAP communication
end-to-end through proxies, and also to support security for CoAP over
a different transport in a uniform way, is to provide security at the application
layer using an object-based security mechanism, such as COSE <xref target="RFC8152" format="default"/>.
</t>
<t>
One application of COSE is OSCORE
<xref target="RFC8613" format="default"/>, which provides end-to-end confidentiality,
integrity and replay protection, and a secure binding between CoAP request
and response messages. In OSCORE, the CoAP messages are wrapped in COSE
objects and sent using CoAP.
</t>
<t>In this framework, the use of CoAP as replacement for HTTP is <bcp14>RECOMMENDED</bcp14>
for use in constrained environments. For communication security, this
framework does not make an explicit protocol recommendation, since the choice
depends on the requirements of the specific application. DTLS
<xref target="RFC6347" format="default"/> <xref target="RFC9147" format="default"/> and OSCORE
<xref target="RFC8613" format="default"/> are mentioned as examples; other protocols fulfilling
the requirements from <xref target="minimalCommSecReq" format="default"/> are also
applicable.</t>
</section>
</section>
<!-- ***************************************************** -->
<section anchor="specs" numbered="true" toc="default">
<name>Protocol Interactions</name>
<t>
The ACE framework is based on the OAuth 2.0 protocol interactions using
the token endpoint and optionally the introspection endpoint.
A client obtains an access token, and optionally a refresh token, from an
AS using the token endpoint and subsequently presents the access token to
an RS to gain access to a protected resource. In most deployments, the RS can
process the access token locally; however, in some cases, the RS may present
it to the AS via the introspection endpoint to get fresh information.
These interactions are shown in <xref target="fig_protocolFlow" format="default"/>. An
overview of various OAuth concepts is provided in <xref target="oauth2Overview" format="default"/>.
</t>
<figure anchor="fig_protocolFlow">
<name>Basic Protocol Flow</name>
<artwork align="left" name="" type="" alt=""><![CDATA[
+--------+ +---------------+
| |---(A)-- Token Request ------->| |
| | | Authorization |
| |<--(B)-- Access Token ---------| Server |
| | + Access Information | |
| | + Refresh Token (optional) +---------------+
| | ^ |
| | Introspection Request (D)| |
| Client | Response | |(E)
| | (optional exchange) | |
| | | v
| | +--------------+
| |---(C)-- Token + Request ----->| |
| | | Resource |
| |<--(F)-- Protected Resource ---| Server |
| | | |
+--------+ +--------------+
]]></artwork>
</figure>
<dl newline="true" spacing="normal">
<dt>Requesting an Access Token (A):</dt>
<dd>
<t>
The client makes an access token request to the token endpoint at the AS.
This framework assumes the use of PoP access tokens (see <xref target="oauth2Overview" format="default"/> for a short description) wherein the AS binds a
key to an access token. The client may include permissions it seeks to
obtain and information about the credentials it wants to use for
proof of possession (e.g., symmetric/asymmetric cryptography or a
reference to a specific key) of the access token.</t>
</dd>
<dt>Access Token Response (B):</dt>
<dd>
<t>
If the request from the client has been successfully verified,
authenticated, and authorized, the AS returns an access token and optionally a refresh
token. Note that only certain grant types support refresh tokens. The AS
can also return additional parameters, referred to as "Access
Information". In addition to the response parameters defined by OAuth
2.0 and the PoP access token extension, this framework defines parameters
that can be used to inform the client about capabilities of the RS, e.g.,
the profile the RS supports. More information about these parameters
can be found in <xref target="tokenParams" format="default"/>.
</t>
</dd>
<dt>Resource Request (C):</dt>
<dd>
<t>
The client interacts with the RS to request access to the protected
resource and provides the access token. The protocol to use
between the client and the RS is not restricted to CoAP. HTTP, HTTP/2
<xref target="RFC7540" format="default"/>, QUIC <xref target="RFC9000" format="default"/>,
MQTT <xref target="MQTT5.0" format="default"/>, Bluetooth Low Energy <xref target="BLE" format="default"/>,
etc., are also viable candidates.
</t>
<t>
Depending on the device limitations and the selected protocol, this
exchange may be split up into two parts:</t>
<ol type="(%d)" spacing="normal">
<li>the client sends the access token containing, or referencing, the
authorization information to the RS that will be used for subsequent
resource requests by the client, and </li>
<li>the client makes the resource access request using the communication
security protocol and other Access Information obtained from the AS.</li>
</ol>
<t>
The client and the RS mutually authenticate using the security protocol
specified in the profile (see step (B)) and the keys obtained in the access
token or the Access Information. The RS verifies that the token is
integrity protected and originated by the AS. It then compares the claims
contained in the access token with the resource request. If the RS is
online, validation can be handed over to the AS using token introspection
(see messages (D) and (E)) over HTTP or CoAP.</t>
</dd>
<dt>Token Introspection Request (D):</dt>
<dd>
<t>
A resource server may be configured to introspect the access token by
including it in a request to the introspection endpoint at that AS.
Token introspection over
CoAP is defined in <xref target="introspectionEndpoint" format="default"/> and for HTTP in
<xref target="RFC7662" format="default"/>.
</t>
<t>
Note that token introspection is an optional step and can be omitted if
the token is self-contained and the resource server is prepared to
perform the token validation on its own.</t>
</dd>
<dt>Token Introspection Response (E):</dt>
<dd>
<t>
The AS validates the token and returns the most recent parameters, such
as <tt>scope</tt>, <tt>audience</tt>, validity, etc., associated with it back to the RS. The
RS then uses the received parameters to process the request to either
accept or to deny it.</t>
</dd>
<dt>Protected Resource (F):</dt>
<dd>
If the request from the client is authorized, the RS fulfills the request
and returns a response with the appropriate response code. The RS uses
the dynamically established keys to protect the response according to
the communication security protocol used.
</dd>
</dl>
<t>The OAuth 2.0 framework defines a number of "protocol flows" via grant types,
which have been extended
further with extensions to OAuth 2.0 (such as <xref target="RFC7521"
format="default"/> and <xref target="RFC8628" format="default"/>).
What grant type works best depends on the usage scenario; <xref
target="RFC7744" format="default"/> describes many different IoT use cases, but
there are two grant types that cover a majority of these scenarios, namely the
authorization code grant (described in <xref target="RFC6749" format="default"
sectionFormat="of" section="4.1"/>) and
<!--[rfced] Citations
a) Note that as RFC 7521 does not have a Section 4.4, we
have updated this citation to be Section 4.4 of RFC 6749. Please
let us know if this is not correct.
Original:
and the Client Credentials
Grant (described in Section 4.4 of [RFC7521]).
Current:
and the client credentials
grant (described in Section 4.4 of [RFC6749]).
===
Ludwig: Agreed. Note that the previous citation is also wrong and should refer to RFC6749 as well
Original:
namely the
authorization code grant (described in <xref target="RFC7521"
Current:
namely the
authorization code grant (described in <xref target="RFC6749"
===
b) We note that RFC 8392 does not contain a Section 5.1.
How should this citation be updated?
Original:
Additional protection for the access token can be applied by
encrypting it, for example encryption of CWTs is specified in
Section 5.1 of [RFC8392].
===
Ludwig: Probably a reference to a draft version of the RFC.
Current:
Additional protection for the access token can be applied by
encrypting it, for example encryption of CWTs is specified in
Section 7.1 of [RFC8392].
===
-->
the client credentials grant (described
in <xref target="RFC6749" sectionFormat="of" section="4.4"/>). The authorization
code grant is a good fit for use with apps running on smartphones and tablets that request access to IoT devices, a common scenario in the smart home environment, where users need to go through an authentication and authorization phase (at least during the initial setup phase). The native apps guidelines described in <xref target="RFC8252" format="default"/> are applicable to this use case. The client credentials grant is a good fit for use with IoT devices where the OAuth client itself is constrained. In such a case, the resource owner has prearranged access rights for the client with the authorization server, which is often accomplished using a commissioning tool.</t>
<t>
The consent of the resource owner, for giving a client access to a protected
resource, can be provided dynamically as in the classical OAuth flows, or it
could be preconfigured by the resource owner as authorization policies at
the AS, which the AS evaluates when a token request arrives. The resource
owner and the requesting party (i.e., client owner) are not shown in <xref target="fig_protocolFlow" format="default"/>.
</t>
<t>
This framework supports a wide variety of communication security mechanisms
between the ACE entities, such as the client,
AS, and RS. It is assumed that the client has been
registered (also called enrolled or onboarded) to an AS using a mechanism defined
outside the scope of this document.
In practice, various techniques for onboarding have been used, such as
factory-based provisioning or the use of
commissioning tools. Regardless of the onboarding technique, this provisioning
procedure implies that the client and the AS exchange credentials and
configuration parameters. These credentials are used to mutually authenticate each
other and to protect messages exchanged between the client and the AS.</t>
<t>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 the AS.
Established keying material between the AS and the RS allows the AS to apply
cryptographic protection to the access token to ensure that its content cannot
be modified and, if needed, that the content is confidentiality protected. Confidentiality protection of the access token content would be provided on top of
confidentiality protection via a communication security protocol. </t>
<t>The keying material necessary for establishing communication security
between the C and RS is dynamically established as part of the protocol described
in this document.
</t>
<t>
At the start of the protocol, there is an optional discovery step where the
client discovers the resource server and the resources this server hosts.
In this step, the client might also determine what permissions are needed to
access the protected resource. A generic procedure is described in <xref target="asDiscovery" format="default"/>; profiles <bcp14>MAY</bcp14> define other procedures for
discovery.</t>
<t>In Bluetooth Low Energy, for example, advertisements are broadcast by
a peripheral, including information about the primary services. In CoAP,
as a second example, a client can make a request to "/.well-known/core" to
obtain information about available resources, which are returned in a
standardized format, as described in <xref target="RFC6690" format="default"/>.
</t>
</section>
<!-- ***************************************************** -->
<section anchor="oauthProfile" numbered="true" toc="default">
<name>Framework</name>
<t>The following sections detail the profiling and extensions of OAuth 2.0
for constrained environments, which constitutes the ACE framework.
</t>
<dl newline="true" spacing="normal">
<dt>Credential Provisioning</dt>
<dd>
<t>
In constrained environments, it cannot be assumed that the client and the RS
are part of a common key infrastructure. Therefore, the AS provisions
credentials and associated information to allow mutual authentication
between the client and the RS. The resulting security association between the client
and the RS may then also be used to bind these credentials to the
access tokens the client uses.
</t>
</dd>
<dt>Proof of Possession</dt>
<dd>
<t>
The ACE framework, by default, implements proof of possession for
access tokens, i.e., that the token holder can prove being a holder of
the key bound to the token. The binding is provided by the <tt>cnf</tt> (confirmation)
claim
<xref target="RFC8747" format="default"/>, indicating what key is used for
proof of possession. If a client needs to submit a new access token,
e.g., to obtain additional access rights, they can request
that the AS binds this token to the same key as the previous one.
</t>
</dd>
<dt>ACE Profiles</dt>
<dd>
The client or RS may be limited in the encodings or protocols it
supports. To support a variety of different deployment settings,
specific interactions between the client and RS are defined in an ACE
profile. In the ACE framework, the AS is expected to manage the matching
of compatible profile choices between a client and an RS. The AS
informs the client of the selected profile using the <tt>ace_profile</tt>
parameter in the token response.
</dd>
</dl>
<t>OAuth 2.0 requires the use of TLS to protect the communication
between the AS and client when requesting an access token between the client and RS
when accessing a resource and between the AS and RS if introspection is used.
In constrained settings, TLS is not always feasible or desirable.
Nevertheless, it is <bcp14>REQUIRED</bcp14> that the communications named above are
encrypted, integrity protected, and protected against message replay. It is
also <bcp14>REQUIRED</bcp14> that the communicating endpoints perform mutual authentication.
Furthermore, it <bcp14>MUST</bcp14> be assured that responses are bound to the requests in
the sense that the receiver of a response can be certain that the response
actually belongs to a certain request. Note that setting up such a secure
communication may require some unprotected messages to be exchanged first
(e.g., sending the token from the client to the RS).</t>
<t>Profiles <bcp14>MUST</bcp14> specify a communication security protocol between the
client and RS that provides the features required above. Profiles
<bcp14>MUST</bcp14> specify a
communication security protocol <bcp14>RECOMMENDED</bcp14> to be used between the
client and AS that provides the features required above. Profiles <bcp14>MUST</bcp14>
specify, for introspection, a communication security protocol
<bcp14>RECOMMENDED</bcp14> to be used
between the RS and AS that provides the features required above. These
recommendations enable interoperability between different implementations
without the need to define a new profile if the communication between the C and
AS, or between the RS and AS, is protected with a different security protocol
complying with the security requirements above.</t>
<t>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
parameters. When profiles of this framework use CoAP instead, it is
<bcp14>REQUIRED</bcp14> to use of the following alternative instead of Uri-query
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.
The CBOR encoding for a number of OAuth 2.0 parameters is specified in this
document; if a profile needs to use other OAuth 2.0 parameters with CoAP, it
<bcp14>MUST</bcp14> specify their CBOR encoding.</t>
<t>Profiles that use CBOR encoding of protocol message parameters at the
outermost encoding layer <bcp14>MUST</bcp14> use the Content-Format "application/ace+cbor".
If CoAP is used for communication, the Content-Format <bcp14>MUST</bcp14> be abbreviated
with the ID: 19 (see <xref target="IANAcoapContentFormat" format="default"/>).</t>
<t>The OAuth 2.0 AS uses a JSON structure in the payload of its responses
both to the client and RS. If CoAP is used, it is <bcp14>REQUIRED</bcp14> to use
CBOR <xref target="RFC8949" format="default"/> instead of JSON. Depending on the profile,
the CBOR payload <bcp14>MAY</bcp14> be enclosed in a non-CBOR cryptographic wrapper.</t>
<section anchor="asDiscovery" numbered="true" toc="default">
<name>Discovering Authorization Servers</name>
<!--[rfced] Throughout this document and especially in Section 5.1,
the article "the" has been added before "C" and "RS" as it appears
elsewhere in this document. Please review usage and let us know if
any further updates are needed.
Ludwig: I won't argue grammar with professional document editors ;-). Agreed
-->
<t>The C must discover the AS in charge of the RS to determine where to request the
access token. To do so, the C 1) must find out the AS URI to which the token
request message must be sent and 2) <bcp14>MUST</bcp14> validate that the AS with this
URI is authorized to provide access tokens for this RS.
</t>
<t> In order to determine the AS URI, the C <bcp14>MAY</bcp14> send an initial Unauthorized
Resource Request message to the RS. The RS then denies the request and sends
the address of its AS back to the C (see <xref target="rreq" format="default"/>). How the C validates the
AS authorization is not in scope for this document. The C may, for example, ask
its owner if this AS is authorized for this RS. The C may also use a
mechanism that addresses both problems at once (e.g., by querying a dedicated secure service provided by the client owner) .</t>
</section>
<!--AS Discovery -->
<section anchor="rreq" numbered="true" toc="default">
<name>Unauthorized Resource Request Message</name>
<t>An Unauthorized Resource Request message is a request for any
resource hosted by the RS for which the client does not have authorization granted.
The RSs <bcp14>MUST</bcp14>
treat any request for a protected resource as an Unauthorized Resource
Request message when any of the following hold:
</t>
<ul spacing="normal">
<li>The request has been received on an unsecured channel.</li>
<li>The RS has no valid access token for the sender of the request
regarding the requested action on that resource.</li>
<li>The RS has a valid access token for the sender of the request, but
that token does not authorize the requested action on the requested
resource.</li>
</ul>
<t>Note: These conditions ensure that the RS can handle requests autonomously
once access was granted and a secure channel has been established between the C
and RS. The authz-info endpoint, as part of the process for authorizing
to protected resources, is not itself a protected resource and <bcp14>MUST
NOT</bcp14> be protected as specified above (cf. <xref
target="tokenAuthInfoEndpoint" format="default"/>).</t>
<t>Unauthorized Resource Request messages <bcp14>MUST</bcp14> be denied with an
"unauthorized_client" error response. In this response, the resource server
<bcp14>SHOULD</bcp14> provide proper
AS Request Creation Hints to enable the client to request an access token
from the RS's AS, as described in <xref target="asInfo" format="default"/>.</t>
<t>The handling of all client requests (including unauthorized ones)
by the RS is described in <xref target="requestC2RS" format="default"/>.</t>
</section>
<!-- Unauthorized Request -->
<section anchor="asInfo" numbered="true" toc="default">
<name>AS Request Creation Hints</name>
<t>The AS Request Creation Hints are sent by an RS as a response to
an Unauthorized Resource Request message (see <xref target="rreq"
format="default"/>) to help
the sender of the Unauthorized Resource Request message acquire a valid
access token. The AS Request Creation Hints are a CBOR or JSON map,
with an <bcp14>OPTIONAL</bcp14> element <tt>AS</tt> specifying an absolute URI (see
<xref target="RFC3986" sectionFormat="of" section="4.3"/>) that identifies the
appropriate AS for the RS.</t>
<t>The message can also contain the following <bcp14>OPTIONAL</bcp14>
parameters:</t>
<ul spacing="normal">
<li>An <tt>audience</tt> element containing an identifier the client
should request at the AS, as suggested by the RS. With this parameter,
when included in the access token request to the AS, the AS is able to
restrict the use of the access token to specific RSs. See
<xref target="audience" format="default"/> for a discussion of this parameter.</li>
<li>A <tt>kid</tt> (key identifier) element contains the key identifier of a key used in
an existing security association between the client and the RS.
The RS expects the client to request an access token bound to this
key in order to avoid having to reestablish the security
association.</li>
<li>A <tt>cnonce</tt> element contains a client-nonce. See <xref target="cnonceParam"
format="default"/>.</li>
<li>A <tt>scope</tt> element contains the suggested scope that the client
should request towards the AS.</li>
</ul>
<t><xref target="table_asinfo" format="default"/> summarizes the parameters that may
be part of the AS Request Creation Hints.</t>
<table anchor="table_asinfo">
<name>AS Request Creation Hints</name>
<thead>
<tr>
<th>Name</th>
<th>CBOR Key</th>
<th>Value Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>AS</td>
<td>1</td>
<td>text string</td>
</tr>
<tr>
<td>kid</td>
<td>2</td>
<td>byte string</td>
</tr>
<tr>
<td>audience</td>
<td>5</td>
<td>text string</td>
</tr>
<tr>
<td>scope</td>
<td>9</td>
<td>text or byte string</td>
</tr>
<tr>
<td>cnonce</td>
<td>39</td>
<td>byte string</td>
</tr>
</tbody>
</table>
<t>Note that the schema part of the AS parameter may need to be
adapted to the security protocol that is used between the client
and the AS. Thus, the example AS value "coap://as.example.com/token"
might need to be transformed to "coaps://as.example.com/token".
It is assumed that the client can determine the correct schema part on
its own depending on the way it communicates with the AS.</t>
<t><xref target="fig_as-info-payload" format="default"/> shows an example for an AS
Request Creation Hints payload using diagnostic notation.</t>
<!-- [rfced] Please review the "type" attribute of each sourcecode element
in the XML file to ensure correctness. If the current list of preferred
values for "type" (https://www.rfc-editor.org/materials/sourcecode-types.txt)
does not contain an applicable type, then feel free to let us know.
Ludwig: Done. Corrected one from json -> cbor-diag
-->
<figure anchor="fig_as-info-payload">
<name>AS Request Creation Hints Payload Example</name>
<sourcecode type="cbor-diag"><![CDATA[
4.01 Unauthorized
Content-Format: application/ace+cbor
Payload :
{
/ AS / 1 : "coaps://as.example.com/token",
/ audience / 5 : "coaps://rs.example.com",
/ scope / 9 : "rTempC",
/ cnonce / 39 : h'e0a156bb3f'
}
]]></sourcecode>
</figure>
<t>In the example above, the response parameter <tt>AS</tt> points the receiver of
this message to the URI "coaps://as.example.com/token" to request access
tokens. The RS sending this response uses an internal clock
that is not synchronized with the clock of the AS. Therefore, it
cannot reliably verify the expiration time of access tokens it receives.
Nevertheless, to ensure a certain level of access token freshness, the RS has
included a <tt>cnonce</tt> parameter (see <xref target="cnonceParam" format="default"/>) in the response. (The hex sequence of the <tt>cnonce</tt> parameter
is encoded in CBOR-based notation in this example.)</t>
<t><xref target="fig_as-info-cbor" format="default"/> illustrates the mandatory use
of binary encoding of the message payload shown in
<xref target="fig_as-info-payload" format="default"/>.</t>
<figure anchor="fig_as-info-cbor">
<name>AS Request Creation Hints Example Encoded in CBOR</name>
<sourcecode name="" type="cbor-pretty"><![CDATA[
a4 # map(4)
01 # unsigned(1) (=AS)
78 1c # text(28)
636f6170733a2f2f61732e657861
6d706c652e636f6d2f746f6b656e # "coaps://as.example.com/token"
05 # unsigned(5) (=audience)
76 # text(22)
636f6170733a2f2f72732e657861
6d706c652e636f6d # "coaps://rs.example.com"
09 # unsigned(9) (=scope)
66 # text(6)
7254656d7043 # "rTempC"
18 27 # unsigned(39) (=cnonce)
45 # bytes(5)
e0a156bb3f #
]]></sourcecode>
</figure>
<section anchor="cnonceParam" numbered="true" toc="default">
<name>The Client-Nonce Parameter</name>
<t>If the RS does not synchronize its clock with the AS, it could be
tricked into accepting old access tokens that are either expired or have
been compromised. In order to ensure some level of token freshness
in that case, the RS can use the <tt>cnonce</tt> (client-nonce) parameter.
The processing requirements for this parameter are as follows:
</t>
<ul spacing="normal">