forked from KantaraInitiative/wg-uma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraft-uma-core.xml
2319 lines (1950 loc) · 102 KB
/
draft-uma-core.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="US-ASCII"?>
<!DOCTYPE rfc PUBLIC "-//IETF//DTD RFC 2629//EN"
"http://xml.resource.org/authoring/rfc2629.dtd" [
<!ENTITY RFC2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2617 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2617.xml">
<!ENTITY UMA PUBLIC "" "http://kantarainitiative.org/confluence/display/uma/Home">
<!ENTITY UMAreqs PUBLIC "" "http://kantarainitiative.org/confluence/display/uma/UMA+Requirements">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC4627 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4627.xml">
]>
<rfc category="std" docName="draft-hardjono-oauth-umacore-02"
ipr="trust200902">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc='yes' ?>
<?rfc tocdepth='3' ?>
<?rfc symrefs='yes' ?>
<?rfc sortrefs='yes' ?>
<?rfc compact='yes' ?>
<?rfc subcompact='no' ?>
<front>
<title abbrev="UMA Core Protocol">User-Managed Access (UMA) Core
Protocol</title>
<author fullname="Thomas Hardjono" initials="T" role="editor"
surname="Hardjono">
<organization>MIT</organization>
<address>
<email>hardjono@mit.edu</email>
</address>
</author>
<date day="22" month="October" year="2011" />
<abstract>
<t>This specification defines the User-Managed Access (UMA) core
protocol. This protocol provides a method for users to control access to
their protected resources, residing on any number of host sites, through
an authorization manager that governs access decisions based on user
policy.</t>
</abstract>
</front>
<middle>
<section anchor="introduction" title="Introduction">
<t>The User-Managed Access (UMA) core protocol provides a method based
on <xref target="OAuth2"></xref> (currently draft 16) for users to
control access to their protected resources, residing on any number of
host sites, through a single authorization manager (AM) that governs
access decisions based on user policy.</t>
<t>There are numerous use cases for UMA, where a resource owner elects
to have a third party to control access to these resources potentially
without the real-time presence of the resource owner. A typical example
is the following: a web user (authorizing user) can authorize a web app
(requester) to gain one-time or ongoing access to a resource containing
his home address stored at a "personal data store" service (host), by
telling the host to act on access decisions made by his authorization
decision-making service (authorization manager or AM). The requesting
party might be an e-commerce company whose site is acting on behalf of
the user himself to assist him/her in arranging for shipping a purchased
item, or it might be his friend who is using an online address book
service to collect addresses, or it might be a survey company that uses
an online service to compile population demographics. Other scenarios
and use cases for UMA usage can be found in <xref
target="UMA-usecases"></xref> and <xref
target="UMA-userstories"></xref>.</t>
<t>In enterprise settings, application access management often involves
letting back-office applications serve only as policy enforcement points
(PEPs), depending entirely on access decisions coming from a central
policy decision point (PDP) to govern the access they give to
requesters. This separation eases auditing and allows policy
administration to scale in several dimensions. UMA makes use of a
separation similar to this, letting the authorizing user serve as a
policy administrator crafting authorization strategies on his or her own
behalf.</t>
<t>The UMA protocol can be considered an advanced application of <xref
target="OAuth2"></xref> in that it profiles, extends, and embeds OAuth
in various ways. An AM can be thought of as an enhanced OAuth
authorization server; a host as an enhanced resource server; and a
requester as an enhanced client, acquiring an access token and the
requisite authorization to access a protected resource at the host.</t>
<t>The UMA protocol has three broad phases, as shown in <xref
target="UMA-phases"></xref>.</t>
<figure align="center" anchor="UMA-phases">
<preamble>The Three Phases of the UMA Protocol</preamble>
<artwork align="left"><![CDATA[ +-----+----------------+
| UA | authorizing |
+-------Manage (A)--| | user |
| +-----+----------------+
| Phase 1: | UA |
| protect a +----------------+
| resource |
| Control (B)
| |
v v
+-----------+ +-----+----------------+
| host |<-Protect-(C)-|prot | authorization |
| | | API | manager (AM) |
+-----------+ +-----+----------------+
| protected | | authorization |
| resource | | API |
+-----------+ +----------------+
^ |
| Phases 2 and 3: Authorize (D)
| get authz and |
| access a resource v
| +----------------+
+-------Access (E)--------| requester |
+----------------+
(requesting party)]]></artwork>
</figure>
<t>In broad strokes, the phases are as follows:<list style="numbers">
<t>Protect a resource (described in <xref
target="protecting-a-resource"></xref>).</t>
<t>Get authorization (described in <xref
target="getting-authz-accessing-resource"></xref>).</t>
<t>Access a resource (described along with Phase 2 in <xref
target="getting-authz-accessing-resource"></xref>).</t>
</list></t>
<t>In more detail, the phases work as follows: <list style="numbers">
<t><spanx>Protect a resource:</spanx> The authorizing user has
chosen to use a host for managing online resources ("A"), and
introduces this host to an AM using an OAuth-mediated interaction
that results in the AM giving the host an access token. The host
uses AM's protection API to tell the AM what sets of resources to
protect ("C"). Out of band of the UMA protocol, the authorizing user
instructs the AM what policies to attach to the registered resource
sets ("B"). Requesters are not yet in the picture.</t>
<t><spanx>Get authorization:</spanx> This phase involves the
requester, host, and AM. It may also involve synchronous action by
the authorizing user if this person is the same person as the
requesting party. This phase is dominated by a loop of activity in
which the requester approaches the host seeking access to a
protected resource ("E"), is sent to obtain an access token from the
AM if it does not have one, and then must demonstrate to the AM that
it satisfies the user's authorization policy governing the
sought-for resource and scope of access if it does not already have
the required access permission ("D").</t>
<t><spanx>Access a resource:</spanx> This phase involves the
requester successfully presenting an access token that has
sufficient permission associated with it to the host in order to
gain access to the desired resource ("E"). In this sense, it is the
"happy path" within phase 2.</t>
</list></t>
<section title="Notational Conventions">
<t>The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT',
'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this
document are to be interpreted as described in <xref
target="RFC2119"></xref>.</t>
<t>Unless otherwise noted, all the protocol properties and values are
case sensitive.</t>
<t>The assignment in this document of URI labels is temporary,
awaiting final standardization in the eventual standards body within
which this specification is taken up as a work item.</t>
</section>
<section anchor="terminology" title="Basic Terminology">
<t>UMA introduces the following terms, utilizing OAuth and other
identity and access management concepts.<list hangIndent="6"
style="hanging">
<t hangText="authorizing user"><vspace />An UMA-defined variant of
an OAuth end-user resource owner; a web user who configures an
authorization manager with policies that control how it assigns
access permissions to requesters for a protected resource.</t>
<t hangText="authorization manager (AM)"><vspace />An UMA-defined
variant of an OAuth authorization server that carries out an
authorizing user's policies governing access to a protected
resource.</t>
<t hangText="protected resource"><vspace />An access-restricted
resource at a host, which is being policy-protected by an AM.</t>
<t hangText="host"><vspace />An UMA-defined variant of an OAuth
resource server that enforces access to the protected resources it
hosts, as governed by an authorization manager.</t>
<t hangText="claim"><vspace />A statement of the value or values
of one or more identity attributes of a requesting party. A
requesting party may need to provide claims to an authorization
manager in order to satisfy policy and gain permission for access
to a protected resource.</t>
<t hangText="requester"><vspace />An UMA-defined variant of an
OAuth client that seeks access to a protected resource.</t>
<t hangText="requesting party"><vspace />A web user, or a
corporation or other legal person, that uses a requester to seek
access to a protected resource. If the requesting party is a
natural person, it may or may not be the same person as the
authorizing user.</t>
<t hangText="resource set">A host-managed set of one or more
resources to be AM-protected. In authorization policy terminology,
a resource set is the "object" being protected.</t>
<t hangText="scope">A bounded extent of access that is possible to
perform on a resource set. In authorization policy terminology, a
scope is one of the potentially many "verbs" that can logically
apply to a resource set. Whereas OAuth scopes apply to resource
sets that are implicit, UMA associates scopes with explicitly
labeled resource sets.</t>
<t hangText="permission">A scope of access over a particular
resource set at a particular host that is being asked for by, or
being granted to, a requester. In authorization policy
terminology, a permission is the "verb" portion of an entire
policy that also includes a "subject" (requesting party) and an
"object" (resource set).</t>
</list></t>
</section>
<section anchor="endpoint-discussion"
title="Endpoints, Endpoint Protection, and Tokens">
<t>Various UMA entities present APIs for other UMA entities to use.
These APIs are as follows:<list style="symbols">
<t>The AM presents a <spanx>protection API</spanx> to the host, as
standardized by this specification. This API is OAuth-protected,
requiring a host access token (issued by the AM) for successful
access (see <xref target="host-access-token"></xref> for this
issuance process).</t>
<t>The AM presents an <spanx>authorization API</spanx> to the
requester, as standardized by this specification. This API is
OAuth-protected, requiring a requester access token (issued by the
AM) for successful access (see <xref
target="r-am-obtain-token"></xref> for this issuance process).</t>
<t>The host presents a <spanx>protected resource</spanx> to the
requester, which can be considered -- and may in fact be -- an
application-specific or proprietary API. This API is
UMA-protected, requiring a requester access token (issued by the
AM) and sufficient permissions (also issued by the AM) for
successful access (see <xref target="r-am-authz-scope"></xref> for
this latter issuance process).</t>
</list></t>
<t>The AM presents the following endpoints to the host as part of its
protection API:<list hangIndent="6" style="hanging">
<t hangText="host access token endpoint">Part of standard OAuth,
as profiled by UMA. The endpoint at which the host asks for a host
access token on the authorizing user's behalf. (The AM may also
choose to issue a refresh token.) It will use this token to gain
access to the other protection API endpoints.</t>
<t hangText="host user authorization endpoint">Part of standard
OAuth, as profiled by UMA. The endpoint to which the host
redirects the authorizing user to authorize the host to use this
AM for protecting resources, if the OAuth authorization code grant
type is being used.</t>
<t hangText="resource set registration endpoint">The endpoint at
which the host registers resource sets it wants the AM to
protect.</t>
<t hangText="permission registration endpoint">The endpoint at
which the host registers permissions that it anticipates a
requester will shortly be asking for from the AM.</t>
<t hangText="token status endpoint">The endpoint at which the host
submits requester access tokens that have accompanied an access
request, to learn what currently valid permissions are associated
with them.</t>
</list></t>
<t>The AM presents the following endpoints to the requester as part of
its authorization API:<list hangIndent="6" style="hanging">
<t hangText="requester access token endpoint">Part of standard
OAuth, as profiled by UMA. The endpoint at which the requester
asks for a requester access token. (The AM may also choose to
issue a refresh token.) It will use this token to gain access to
the other authorization API endpoint.</t>
<t hangText="permission endpoint">The endpoint at which the
requester asks for authorization to have a new permission
associated with its requester access token.</t>
</list></t>
<t>Finally, the host presents one or more protected resource endpoints
to the requester:<list hangIndent="6" style="hanging">
<t hangText="protected resource endpoint">An endpoint at which a
requester attempts to access resources. This can be a singular API
endpoint, one of a set of API endpoints, a URI corresponding to an
HTML document, or any other URI. The requester needs to present a
requester access token associated with sufficient permissions in
order to gain access.</t>
</list></t>
<t>Similarly to OAuth authorization servers, an UMA AM has the
opportunity to manage the validity periods of the access tokens, the
corresponding refresh tokens, and even the client credentials that it
issues. Different lifetime strategies may be suitable for different
resources and scopes of access, and the AM has the opportunity to give
the authorizing user control through policy.</t>
<t>Access tokens are currently assumed to be merely opaque strings (as
discussed in <xref target="am-endpoints"></xref> and <xref
target="conformance"></xref>). Thus, when an AM associates a
permission with a requester access token, a host cannot subsequently
inspect such a token locally to assess whether a needed permission has
been granted. It must instead ask the AM to provide the token's
status.</t>
</section>
<section anchor="scope-discussion"
title="Scopes, Resource Sets, Permissions, and Authorization">
<t>UMA extends the OAuth concept of a "scope" by defining scopes as
applying to particular labeled resource sets, rather than leaving the
relevant resources (such as API endpoints or URIs) implicit. A
resource set can have any number of scopes, which together describe
the universe of actions that <spanx>can be</spanx> taken on this
protected resource set. For example, a resource set representing a
status update API might have scopes that include adding an update or
reading updates. A resource set representing a photo album might have
scopes that include viewing a slideshow or printing the album. Hosts
register resource sets and their scopes when there is not yet any
requesting party or requester in the picture.</t>
<t>Resource sets and scopes have meaning only to hosts and their
users, in the same way that application-specific host APIs have
meaning only to these entities. The AM is merely a conveyor of labels
and descriptions for these constructs, to help the authorizing user
set policies that guide eventual authorization processes.</t>
<t>In contrast to an UMA scope, an UMA permission reflects an <spanx>actual</spanx>
authorization process for a requester to access a particular resource
set in a scoped (bounded) manner. Hosts register permission requests
on behalf of requesters that have attempted access. Requesters
subsequently ask AMs for permissions to be associated with their
tokens. AMs grant (or deny) permissions to requesters.</t>
<t>In order to represent meaningful, auditable, and potentially
legally enforceable authorization (see <xref
target="UMA-trustmodel"></xref>), a permission is bound to a
particular set of UMA entities and parties. This includes the
requesting party, the requester (so that the same requesting party
would have to go through the authorization process for each client
application they use), the host, the resource set on which access is
being attempted, and therefore also the AM protecting it and the
authorizing user who is controlling access.</t>
<t>Unlike scopes (but similarly to tokens themselves; see <xref
target="endpoint-discussion"></xref>), permissions have a validity
period.</t>
</section>
<section anchor="am-endpoints" title="AM Metadata">
<t>The AM MUST provide an XRD 1.0-formatted document at the hostmeta
location (see <xref target="hostmeta">hostmeta</xref>), documenting
the following: <list style="symbols">
<t>Major conformance options supported by the AM (described
further in <xref target="conformance"></xref>)</t>
<t>Protection and authorization API endpoints (as described in
<xref target="endpoint-discussion"></xref>)</t>
</list></t>
<t>See <xref target="am-metadata-example"></xref> for a full example
of AM metadata.</t>
<t>XRD property type values for conformance options:<list
hangIndent="6" style="hanging">
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/client_reg"><vspace />OPTIONAL
(zero or one). Whether dynamic client registration, such as
through <xref target="OCDynClientReg"></xref>, is supported for
both hosts and requesters. The only values for this property
currently available are "yes" (dynamic registration is supported,
using an unspecified method) and "no" (it is not supported; hosts
and requesters are required to pre-register). The default is
AM-specific. This property is not currently extensible. (This
conformance option is largely a placeholder for now.)</t>
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/token_types"><vspace />REQUIRED
(one or more). An access token type produced by this AM. Currently
the only value for this property defined by this specification is
"artifact", meaning an opaque token string whose associations the
host MUST determine through a token status interaction with the AM
(see <xref target="h-am-token-validation"></xref>). The AM is
REQUIRED to support the artifact token type, and to supply this
value explicitly in the metadata. The AM MAY declare its support
for additional access token types by assigning each one a unique
absolute URI as the value of this property.</t>
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/host_authz_grant_types"><vspace />REQUIRED
(one or more). An OAuth grant type supported by this AM. The value
MUST be one of the grant_type values defined in <xref
target="OAuth2"></xref>, or alternatively an extension grant type
indicated by a unique absolute URI. The AM is REQUIRED to support
the authorization_code and client_credentials grant types, and to
supply these values explicitly in the metadata. The
authorization_code grant type is primarily intended for use with
hosts, and the client_credentials grant type is primarily intended
for use with requesters.</t>
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/claim_types"><vspace />OPTIONAL
(zero or more). A claim format and associated sub-protocol for
gathering claims from requesting parties, as supported by this AM.
Currently the only value for this property defined by this
specification is "openid", for which details are supplied in <xref
target="trusted-claims"></xref>. The AM MAY declare its support
for claim types other than "openid" by assigning each one a unique
absolute URI as the value of this property.</t>
</list></t>
<t>XRD link relationship rel values for protection API endpoints:
<list hangIndent="6" style="hanging">
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/host_token_uri"><vspace />REQUIRED.
The host access token endpoint. Available HTTP methods are as
defined by <xref target="OAuth2"></xref> for a token endpoint.
Supplies the endpoint the host uses to ask for a host access
token.</t>
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/host_user_uri"><vspace />REQUIRED.
The host user authorization endpoint. Available HTTP methods are
as defined by <xref target="OAuth2"></xref> for an end-user
authorization endpoint. Supplies the endpoint the host uses to
gather the consent of the authorizing user for a host-AM
relationship if it is using the authorization code grant type. The
AM MUST support the authorization code grant type method of
obtaining the authorizing user's consent.</t>
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/host_resource_reg_uri"><vspace />REQUIRED.
The resource set registration endpoint. Requests to this endpoint
require a host access token to be present. Supplies the endpoint
the host uses for registering resource sets with the AM to be
protected (see <xref target="reg-api"></xref>). This endpoint
SHOULD require the use of a transport-layer security mechanism
such as TLS.</t>
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/host_token_status_uri"><vspace />REQUIRED.
The token status endpoint. Requests to this endpoint require a
host access token to be present. Supplies the endpoint the host
uses to request the status of access tokens presented to them by
requesters with respect to currently valid permissions. This
endpoint SHOULD require the use of a transport-layer security
mechanism such as TLS.</t>
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/host_perm_reg_uri"><vspace />REQUIRED.
The permission registration endpoint. Requests to this endpoint
require a host access token to be present. Supplies the endpoint
the host uses for registering permissions with the AM for which a
requester will be seeking authorization (see <xref
target="h-am-register-scope"></xref>). This endpoint SHOULD
require the use of a transport-layer security mechanism such as
TLS.</t>
</list></t>
<t>XRD link relationship rel values for authorization API endpoints:
<list hangIndent="6" style="hanging">
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/req_token_uri"><vspace />REQUIRED.
The requester access token endpoint. Available HTTP methods are as
defined by <xref target="OAuth2"></xref> for a token issuance
endpoint. Supplies the endpoint the requester uses to ask for an
access token. This endpoint SHOULD require the use of a
transport-layer security mechanism such as TLS.</t>
<t
hangText="http://docs.kantarainitiative.org/uma/1.0/req_perm_uri"><vspace />REQUIRED.
The permission endpoint. Supplies the endpoint the requester uses
to ask for authorization to have a new permission associated with
its existing requester access token, which MUST accompany the
request. This endpoint SHOULD require the use of a transport-layer
security mechanism such as TLS.</t>
</list></t>
</section>
</section>
<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
<section anchor="protecting-a-resource" title="Protecting a Resource">
<t>Phase 1 of UMA is protecting a resource. The user, host, and AM
perform the following steps in order to successfully complete Phase 1:
<list style="numbers">
<t>The host (having learned the general location of the relevant AM
out of band) looks up the AM's metadata and learns about its
protection API endpoints and supported formats.</t>
<t>If the host has not yet obtained a unique OAuth client identifier
and optional secret from the AM, it registers with the AM as
required. It MAY do this using <xref
target="OCDynClientReg"></xref>, if the AM supports it.</t>
<t>The host obtains a host access token from the AM with the
authorizing user's consent.</t>
<t>The host registers any resource sets with the AM that are
intended to be protected. (This step is repeated when and as
needed.)</t>
</list></t>
<t>If the host undertakes these actions successfully, the results are as
follows:<list style="symbols">
<t>The host has received metadata about the AM, such as endpoints it
needs to use in interacting with the AM.</t>
<t>The host has received an OAuth host access token that represents
this authorizing user's approval for the host to work with the AM in
protecting resources.</t>
<t>The AM has acquired information about resource sets at this host
that it is supposed to protect on behalf of this authorizing
user.</t>
</list></t>
<section title="Host Looks Up AM Metadata">
<t>The host needs to learn the AM's protection API endpoints before
they can begin interacting. To get the host started in this process,
the authorizing user might provide the AM's location to it, for
example, by typing a URL into a web form field or clicking a button.
Alternatively, the host might already be configured to work with a
single AM without requiring any user input. The exact process is
beyond the scope of this specification, and it is up to the host to
choose a method to learn the AM's general location.</t>
<t>From the data provided, discovered, or configured, the host MUST
use the process described in Section 2 of <xref
target="hostmeta">hostmeta</xref> to retrieve the AM hostmeta
document. For example, if the user supplied "am.example.com" as the
Authorization Manager's domain, the host creates the URL
"https://am.example.com/.well-known/host-meta" and performs a GET
request on it. The AM MUST return content that includes UMA protection
API endpoints as defined in <xref target="am-endpoints"></xref>.</t>
</section>
<section title="Host Registers with AM">
<t>If the host has not already obtained an OAuth client identifier and
optional secret from this AM, in this step it MUST do so in order to
engage in OAuth-based interactions with the AM. It MAY do this using
<xref target="OCDynClientReg"></xref>, if the AM supports it (see
<xref target="am-endpoints"></xref> for how the AM MAY indicate
support).</t>
</section>
<section anchor="host-access-token"
title="Host Obtains Host Access Token">
<t>In this step, the host acquires a host access token from the AM.
The token represents the approval of the authorizing user for this
host to trust this AM for protecting resources belonging to this
user.</t>
<t>The host MUST use <xref target="OAuth2">OAuth2</xref> to obtain the
host access token. Here the host acts in the role of an OAuth client;
the authorizing user acts in the role of an OAuth end-user resource
owner; and the AM acts in the role of an OAuth authorization server.
Once the host has obtained an access token, it presents it to the AM
at various protection API endpoints; in presenting these endpoints the
AM acts in the role of a resource server.</t>
<t>The AM MAY support the use of any grant type, but MUST support the
authorization_code grant type, and SHOULD support the SAML bearer
token grant type <xref target="OAuth-SAML"></xref>
(urn:ietf:params:oauth:grant-type:saml2-bearer) if it anticipates
working with hosts that are operating in environments where the use of
SAML is prevalent. The AM MUST indicate all grant types it supports in
its metadata, as defined in <xref target="am-endpoints"></xref>.</t>
<t>The host has completed this step successfully when it possesses a
host access token it can use at the AM's protection API.</t>
</section>
<section title="Host Registers Sets of Resources to Be Protected">
<t>Once the host has received a host access token, for any of the
user's sets of resources that are to be protected by this AM, it MUST
register these resource sets at the AM's registration endpoint.</t>
<t>Note that the host is free to offer the option to protect any
subset of the user's resources using different AMs or other means
entirely, or to protect some resources and not others. Additionally,
the choice of protection regimes can be made explicitly by the user or
implicitly by the host. Any such partitioning by the host or user is
outside the scope of this specification.</t>
<t>See <xref target="resource-reg-example"></xref> for an extended
example of registering resource sets.</t>
<section anchor="action-desc" title="Scope Descriptions">
<t>A scope is a bounded extent of access that is possible to perform
on a resource set. A scope description is a <xref format="default"
target="RFC4627">JSON</xref> document with the following properties
and a Content-Type of application/uma-scope+json:<list
style="hanging">
<t hangText="name">REQUIRED. A human-readable string describing
some scope (extent) of access. This name is intended for
ultimate use in the AM's user interface to assist the user in
setting policies for protected resource sets that have this
available scope.</t>
<t hangText="icon_uri">OPTIONAL. A URI for a graphic icon
representing the scope. The referenced icon is intended for
ultimate use in the AM's user interface to assist the user in
setting policies for protected resource sets that have this
available scope.</t>
</list></t>
<figure>
<preamble>For example, this description characterizes a scope that
involves reading or viewing resources (vs. creating them or
editing them in some fashion):</preamble>
<artwork><![CDATA[
{
"name": "View",
"icon_uri": "http://www.example.com/icons/reading-glasses"
}
]]></artwork>
</figure>
<t>Scope descriptions MAY contain extension properties that are not
defined in this specification. The names of extension properties
MUST consist of a fully qualified URL, or begin with "x-" or
"X-".</t>
<t>A host MUST list a resource set's available scopes using URI
references (as defined in <xref target="resource-set-desc"></xref>).
The scopes available for use at any one host MUST have unique URI
references so that the host's scope descriptions are uniquely
distinguishable. A scope URI reference MAY include a fragment
identifier. Scope descriptions MAY reside anywhere. The host is not
required to self-host scope descriptions and may wish to point to
standardized scope descriptions residing elsewhere. Scope
description documents MUST be accessible to AMs through GET calls
made to these URI references</t>
<t>See <xref target="scope-discussion"></xref> for further
discussion of scope-related concepts, and <xref
target="resource-reg-example"></xref> for a long-form example of
scopes used in resource set registration.</t>
</section>
<section anchor="resource-set-desc" title="Resource Set Descriptions">
<t>The host defines a resource set that needs protection by
registering a resource set description at the AM. The host registers
the description and manages its lifecycle at the AM's host resource
set registration endpoint by using the resource set registration
API, as defined in <xref target="reg-api"></xref>.</t>
<t>A resource set description is a <xref format="default"
target="RFC4627">JSON</xref> document with the following properties
and a Content-Type of application/uma-resource-set+json.:<list
style="hanging">
<t hangText="name">REQUIRED. A human-readable string describing
a set of one or more resources. The AM SHOULD use the name in
its user interface to assist the user in setting policies for
protecting this resource set.</t>
<t hangText="icon_uri">OPTIONAL. A URI for a graphic icon
representing the resource set. If provided, the AM SHOULD use
the referenced icon in its user interface to assist the user in
setting policies for protecting this resource set.</t>
<t hangText="scopes">REQUIRED. An array providing the URI
references of scope descriptions that are available for this
resource set. The AM SHOULD use the scope names and any icons
defined as part of the referenced scopes in its user interface
to assist the user in setting policies for protecting this
resource set.</t>
</list></t>
<figure>
<preamble>For example, this description characterizes a resource
set (a photo album) that can potentially be only viewed, or
alternatively to which full access can be granted; the URIs point
to scope descriptions as defined in <xref
target="action-desc"></xref>:</preamble>
<artwork><![CDATA[
{
"name": "Photo Album",
"icon_uri": "http://www.example.com/icons/flower.png",
"scopes": [
"http://photoz.example.com/dev/scopes/view",
"http://photoz.example.com/dev/scopes/all"
]
}
]]></artwork>
</figure>
<t>Resource set descriptions MAY contain extension properties that
are not defined in this specification. The names of extension
properties MUST consist of a fully qualified URL or begin with "x-"
or "X-".</t>
<t>When a host creates or updates a resource set description (see
<xref target="reg-api"></xref>), the AM MUST attempt to retrieve the
referenced scope descriptions. It MAY cache such descriptions as
long as indicated in the HTTP cache-control header for the scope
description resource unless the resource set description is
subsequently updated within the validity period. At the beginning of
an authorizing user's login session at the AM, the AM MUST attempt
to re-retrieve scope descriptions applying to that user whose cached
versions have expired.</t>
</section>
<section anchor="reg-api" title="Resource Set Registration API">
<t>The host uses the RESTful API at the AM's resource set
registration endpoint to create, read, update, and delete resource
set descriptions, along with listing groups of such descriptions.
The host MUST use its valid host access token obtained previously to
gain access to this endpoint.</t>
<t>(Note carefully the similar but distinct senses in which the word
"resource" is used in this section. UMA resource set descriptions
are themselves managed as web resources at the AM through this
API.)</t>
<t>The AM MUST present an API for registering resource set
descriptions at a set of URIs with the structure
"{rsreguri}/resource_set/{rsid}", where the host access token
provides sufficient context to distinguish between identical
resource set identifiers assigned by different hosts.</t>
<t>The components of these URIs are defined as follows:<list
style="hanging">
<t hangText="{rsreguri}">The AM's resource set registration
endpoint as advertised in its metadata (see <xref
target="am-endpoints"></xref>).</t>
<t hangText="{rsid}">An identifier for a resource set
description.</t>
</list></t>
<t>Without a specific resource set identifier path component, the
URI applies to the set of resource set descriptions already
registered.</t>
<t>Following is a summary of the five registration operations the AM
is REQUIRED to support. Each is defined in its own section below.
All other methods are unsupported. This API uses ETag and If-Match
to ensure the desired resource at the AM is targeted.<list
style="symbols">
<t>Create resource set description: PUT /resource_set/{rsid}</t>
<t>Read resource set description: GET /resource_set/{rsid}</t>
<t>Update resource set description: PUT /resource_set/{rsid}
with If-Match</t>
<t>Delete resource set description: DELETE
/resource_set/{rsid}</t>
<t>List resource set descriptions: GET /resource_set/ with
If-Match</t>
</list></t>
<t>If the request to the resource set registration endpoint is
incorrect, then the AM responds with an error message (see <xref
target="uma-error-response"></xref>) by including one of the
following error codes with the response: <list style="hanging">
<t hangText="unsupported_method_type">The host request used an
unsupported HTTP method. The AM MUST respond with the HTTP 405
(Method Not Allowed) status code and MUST fail to act on the
request.</t>
<t hangText="not_found">The resource set requested from the AM
cannot be found. The AM MUST respond with HTTP 404 (Not Found)
status code.</t>
<t hangText="precondition_failed">The resource set that was
requested to be deleted or updated at the AM did not match the
If-Match value present in the request. The AM MUST respond with
HTTP 412 (Precondition Failed) status code and MUST fail to act
on the request.</t>
</list></t>
<section anchor="create-resource-set"
title="Create Resource Set Description">
<t>Adds a new resource set description using the PUT method,
thereby putting it under the AM's protection. If the request is
successful, the AM MUST respond with a status message that
includes an ETag header and _id and _rev properties for managing
resource set description versioning.</t>
<t>The host is free to use its own methods of identifying and
describing resource sets. The AM MUST treat them as opaque for the
purpose of authorizing access, other than associating them with
the authorizing user represented by the host access token used to
access the API. On successfully registering a resource set, the
host MUST use UMA mechanisms to limit access to any resources
corresponding to this resource set, relying on the AM to supply
currently valid permissions for authorized access.</t>
<figure>
<preamble>Form of a "create resource set description" HTTP
request:</preamble>
<artwork><![CDATA[
PUT /resource_set/{rsid} HTTP/1.1
Content-Type: application/uma-resource-set+json
...
(body contains JSON resource set description to be created)
]]></artwork>
</figure>
<figure>
<preamble>Form of a successful HTTP response:</preamble>
<artwork><![CDATA[
HTTP/1.1 201 Created
Content-Type: application/uma-status+json
ETag: (matches "_rev" property in returned object)
...
{
"status": "created",
"_id": (id of created resource set),
"_rev": (ETag of created resource set)
}
]]></artwork>
</figure>
</section>
<section anchor="read-resource-set"
title="Read Resource Set Description">
<t>Reads a previously registered resource set description using
the GET method. If the request is successful, the AM MUST respond
with a status message that includes an ETag header and _id and
_rev properties for managing resource set description
versioning.</t>
<figure>
<preamble>Form of a "read resource set description" HTTP
request:</preamble>
<artwork><![CDATA[
GET /resource_set/{rsid} HTTP/1.1
...
]]></artwork>
</figure>
<figure>
<preamble>Form of a successful HTTP response:</preamble>
<artwork><![CDATA[
HTTP/1.1 200 OK
Content-Type: application/uma-resource-set+json
...
(body contains JSON resource set description, including _id and _rev)
]]></artwork>
</figure>
<t>If the referenced resource does not exist, the AM MUST produce
an error response with an error property value of "not_found", as
defined in <xref target="reg-api"></xref>.</t>
</section>
<section anchor="update-resource-set"
title="Update Resource Set Description">
<t>Updates a previously registered resource set description using
the PUT method, thereby changing the resource set's protection
characteristics. If the request is successful, the AM MUST respond
with a status message that includes an ETag header and _id and
_rev properties for managing resource set description
versioning.</t>
<figure>
<preamble>Form of an "update resource set description" HTTP
request:</preamble>
<artwork><![CDATA[
PUT /resource_set/{rsid} HTTP/1.1
Content-Type: application/resource-set+json
If-Match: (entity tag of resource)
...
(body contains JSON resource set description to be updated)
]]></artwork>
</figure>
<figure>
<preamble>Form of a successful HTTP response:</preamble>
<artwork><![CDATA[
HTTP/1.1 204 No Content
ETag: "2"
...
]]></artwork>
</figure>
<t>If the entity tag does not match, the AM MUST produce an error
response with an error property value of "precondition_failed", as
defined in <xref target="reg-api"></xref>.</t>
</section>
<section anchor="delete-resource-set"
title="Delete Resource Set Description">
<t>Deletes a previously registered resource set description using
the DELETE method, thereby removing it from the AM's protection
regime.</t>
<figure>
<preamble>Form of a "delete resource set description" HTTP
request:</preamble>
<artwork><![CDATA[
DELETE /resource_set/{rsid}
If-Match: (entity tag of resource)
...
]]></artwork>
</figure>
<figure>
<preamble>Form of a successful HTTP response:</preamble>
<artwork><![CDATA[
HTTP/1.1 204 No content
...
]]></artwork>
</figure>
<t>As defined in <xref target="reg-api"></xref>, if the referenced
resource does not exist the AM MUST produce an error response with
an error property value of "not_found", and if the entity tag does
not match the AM MUST produce an error response with an error
property value of "precondition_failed".</t>
</section>
<section anchor="list-resource-sets"
title="List Resource Set Descriptions">
<t>Lists all previously registered resource set identifiers for
this user using the GET method. The AM MUST return the list in the
form of a JSON array of {rsid} values.</t>
<t>The host uses this method as a first step in checking whether
its understanding of protected resources is in full
synchronization with the AM's understanding.</t>
<figure>
<preamble>Form of a "list resource set descriptions" HTTP
request:</preamble>
<artwork><![CDATA[
GET /resource_set HTTP/1.1
...
]]></artwork>
</figure>
<figure>
<preamble>HTTP response:</preamble>
<artwork><![CDATA[
HTTP/1.1 200 OK
Content-Type: application/json
...
(body contains JSON array of {rsid} values)
]]></artwork>
</figure>
</section>
</section>
</section>
</section>
<section anchor="getting-authz-accessing-resource"
title="Getting Authorization and Accessing a Resource">
<t>Phase 2 of UMA is getting authorization, and Phase 3 is accessing a
resource. In these phases, an AM orchestrates and controls requesting
parties' access to a user's protected resources at a host, under
conditions dictated by that user.</t>
<t>Phase 3 is merely the successful completion of a requester's access
attempt (see <xref target="sufficient-scope"></xref>) that initially
involved several embedded interactions among the requester, AM, and host
in Phase 2. Phase 2 always begins with the requester attempting access
at a protected resource endpoint at the host. How the requester came to
learn about this endpoint is out of scope for UMA. The authorizing user
might, for example, have advertised its availability publicly on a blog