-
Notifications
You must be signed in to change notification settings - Fork 1
/
draft-ietf-oauth-v2-bearer-draft11.ja.xml
1191 lines (1134 loc) · 49.5 KB
/
draft-ietf-oauth-v2-bearer-draft11.ja.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 SYSTEM 'rfc2629.dtd'>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<rfc category='std' ipr='trust200902' docName='draft-ietf-oauth-v2-bearer-11'>
<?rfc strict='yes' ?>
<?rfc toc='yes' ?>
<?rfc tocdepth='3' ?>
<?rfc symrefs='yes' ?>
<?rfc sortrefs='yes' ?>
<?rfc compact='yes' ?>
<?rfc subcompact='no' ?>
<front>
<!--title abbrev='OAuth 2.0 Bearer Tokens'>The OAuth 2.0 Authorization Protocol: Bearer Tokens</title-->
<title abbrev='OAuth 2.0 Bearer Tokens'>The OAuth 2.0 Authorization Protocol: Bearer Tokens(日本語)</title>
<author fullname="Michael B. Jones" surname="Jones" initials="M.B."> <!-- role="editor" -->
<organization>Microsoft</organization>
<address>
<email>mbj@microsoft.com</email>
<uri>http://self-issued.info/</uri>
</address>
</author>
<author fullname='Dick Hardt' surname='Hardt' initials='D'>
<organization>independent</organization>
<address>
<email>dick.hardt@gmail.com</email>
<uri>http://dickhardt.org/</uri>
</address>
</author>
<author fullname='David Recordon' surname='Recordon' initials='D'>
<organization>Facebook</organization>
<address>
<email>dr@fb.com</email>
<uri>http://www.davidrecordon.com/</uri>
</address>
</author>
<date year="2011" month="October" day="25" />
<abstract>
<!--t>
This specification describes how to use bearer tokens in HTTP
requests to access OAuth 2.0 protected resources. Any party
in possession of a bearer token (a "bearer") can use it to get
access to granted resources (without demonstrating possession
of a cryptographic key). To prevent misuse, the bearer token
MUST be protected from disclosure in storage and in transport.
</t-->
<t>
この仕様書は、OAuth 2.0の保護リソースへアクセスするために、無記名トークンをHTTPリクエスト中でどのように利用するか記述したものである。
無記名トークンを所有する任意のパーティ(持参人)は、認可済みリソースへアクセスするために無記名トークンを利用できる。(暗号鍵の所有を示す必要はない。)
誤った利用を避けるために、無記名トークンは保存場所や流通経路での値の露見から守られなければならない(MUST)。
</t>
</abstract>
</front>
<middle>
<!--section title='Introduction'-->
<section title='はじめに'>
<!--t>
OAuth enables clients to access protected resources by
obtaining an access token, which is defined in <xref
target="I-D.ietf-oauth-v2"/> as "a string representing an access
authorization issued to the client", rather than using the
resource owner's credentials directly.
</t-->
<t>
OAuthは、クライアントがアクセストークンを取得することで、保護リソースへのアクセスを可能にする。
アクセストークンは<xref target="I-D.ietf-oauth-v2"/>中で「クライアントに対するアクセス認可の文字列表現」と定義されており、
リソース所有者のクレデンシャルを直接利用することではない。
</t>
<!--t>
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. This specification describes how to make protected resource
requests when the OAuth access token is a bearer token.
</t-->
<t>
トークンはリソース所有者の承認を伴い、認可サーバによってクライアントに対して発行される。
クライアントはアクセストークンを、リソースサーバが持つ保護リソースにアクセスするために利用する。
この仕様書では、アクセストークンが無記名トークンである場合に、保護リソースを要求する方法を記載する。
</t>
<!--t>
This specification defines the use of bearer tokens with OAuth
over <xref target='RFC2616'>HTTP</xref> using <xref
target='RFC5246'>TLS</xref>. Other specifications may extend
it for use with other transport protocols.
</t-->
<t>
この仕様書では<xref target='RFC2616'>HTTP</xref>及び<xref
target='RFC5246'>TLS</xref>で定義された、TLSを用いたHTTP上でのOAuthで、無記名トークンを利用する方法を定める.
他の仕様書がその他の転送プロトコルの元での利用について本仕様を拡張する可能性もある.
</t>
<!--section title='Notational Conventions'-->
<section title='要求記法および規則'>
<!--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' />.
</t-->
<t>
本文書で用いられる各キーワード「MUST (しなければならない)」、「MUST NOT (してはならない)」、「REQUIRED (必須である)」、「SHALL (するものとする)」、「SHALL NOT (しないものとする)」、「SHOULD (すべきである)」、「SHOULD NOT (すべきではない)」、「RECOMMENDED (推奨される)」、「MAY (してもよい)」、「OPTIONAL (任意である)」は<xref target='RFC2119' />で述べられている通りに解釈されるべきものである。
</t>
<!--t>
This document uses the Augmented Backus-Naur Form (ABNF)
notation of <xref target='I-D.ietf-httpbis-p1-messaging' />,
which is based upon the Augmented Backus-Naur Form (ABNF)
notation of <xref target='RFC5234' />. Additionally, the
following rules are included
from <xref target='I-D.ietf-httpbis-p7-auth' />: b64token, auth-param, and realm;
from <xref target='I-D.ietf-httpbis-p1-messaging' />: quoted-string;
and from <xref target='RFC3986' />: URI-Reference.
</t-->
<t>
このドキュメントでは<xref target='RFC5234' />におけるAugmented Backus-Naur Form (ABNF)表記法を元にした、<xref target='I-D.ietf-httpbis-p1-messaging' />におけるAugmented Backus-Naur Form(ABNF)表記法を利用している.
加えて, 次の規則(<xref target='I-D.ietf-httpbis-p7-auth' /> 記載: b64token, auth-param および realm; <xref target='I-D.ietf-httpbis-p1-messaging' />記載: quoted-string; <xref target='RFC3986'/>記載: URI-Reference)に従う.
</t>
<!--t>
Unless otherwise noted, all the protocol parameter names and values are case sensitive.
</t-->
<t>
特に記載が無い限り, 全てのプロトコルパラメーター名と値は, 大文字・小文字を区別する.
</t>
</section>
<!--section title='Terminology'-->
<section title='用語定義'>
<t>
<list style='hanging'>
<!--t hangText="Bearer Token">
<vspace />
A security token with the property that any party in
possession of the token (a "bearer") can use the token
in any way that any other party in possession of it can.
Using a bearer token does not require a bearer to prove
possession of cryptographic key material
(proof-of-possession).
</t-->
<t hangText="無記名トークン">
<vspace />
セキュリティトークン。
トークンを所有する任意のパーティ(持参人)は、それを所有する他の任意のパーティーにとって可能ないかなる方法でもトークンを利用することができるという特性を持っている。
無記名トークンを利用する際、持参人は、暗号鍵の所持を証明(proof-of-posession)するよう要求されない。
</t>
</list>
</t>
<!--t>
All other terms are as defined in <xref target="I-D.ietf-oauth-v2" />.
</t-->
<t>
他の全ての用語は<xref target="I-D.ietf-oauth-v2" />で定義されている通りである。
</t>
</section>
<section title='Overview'>
<t>
OAuth provides a method for clients to access a protected resource on behalf of a
resource owner. In the general case,
before a client can access a protected resource, it must first obtain
an authorization grant from the resource owner and then exchange the authorization grant for
an access token.
The access token represents the grant's scope, duration, and
other attributes granted by the authorization grant. The
client accesses the protected resource by presenting the
access token to the resource server.
In some cases, a client can directly present its own
credentials to an authorization server to obtain an access
token without having to first obtain an authorization grant from a
resource owner.
</t>
<t>
The access token provides an abstraction layer, replacing different authorization
constructs (e.g. username and password, assertion) for a single token understood by the
resource server. This abstraction enables issuing access tokens valid for a short time
period, as well as removing the resource server's need to understand a wide range of
authentication schemes.
</t>
<figure title='Abstract Protocol Flow' anchor='Figure-1'>
<artwork>
<![CDATA[+--------+ +---------------+
| |--(A)- Authorization Request ->| Resource |
| | | Owner |
| |<-(B)-- Authorization Grant ---| |
| | +---------------+
| |
| | Authorization Grant & +---------------+
| |--(C)--- Client Credentials -->| Authorization |
| Client | | Server |
| |<-(D)----- Access Token -------| |
| | +---------------+
| |
| | +---------------+
| |--(E)----- Access Token ------>| Resource |
| | | Server |
| |<-(F)--- Protected Resource ---| |
+--------+ +---------------+]]>
</artwork>
</figure>
<t>
The abstract flow illustrated in <xref target='Figure-1' /> describes the overall
OAuth 2.0 protocol architecture. The following steps are specified within this
document:
<list>
<t>
E) The client makes a protected resource request to the resource server by presenting
the access token.
</t>
<t>
F) The resource server validates the access token, and if valid, serves the request.
</t>
</list>
</t>
</section>
</section>
<section title='Authenticated Requests'>
<t>
Clients MAY use bearer tokens to make authenticated requests
to access protected resources. This section defines three
methods of sending bearer access tokens in resource requests
to resource servers. Clients MUST NOT use more than one
method to transmit the token in each request.
</t>
<section title='The Authorization Request Header Field' anchor='authz-header'>
<t>
When sending the access token in the <spanx
style='verb'>Authorization</spanx> request header field
defined by <xref target='I-D.ietf-httpbis-p7-auth' />, the
client uses the <spanx style='verb'>Bearer</spanx>
authentication scheme to transmit the access token.
</t>
<figure>
<preamble>
For example:
</preamble>
<artwork>
<![CDATA[GET /resource HTTP/1.1
Host: server.example.com
Authorization: Bearer vF9dft4qmT]]>
</artwork>
</figure>
<t>
The <spanx style='verb'>Authorization</spanx> header field uses the framework defined by
<xref target='I-D.ietf-httpbis-p7-auth' /> follows:
</t>
<figure>
<artwork>
<![CDATA[credentials = "Bearer" 1*SP b64token]]>
</artwork>
</figure>
<t>
Clients SHOULD make authenticated requests with a bearer
token using the <spanx style='verb'>Authorization</spanx>
request header field with the <spanx
style='verb'>Bearer</spanx> HTTP authorization scheme.
Resource servers MUST support this method.
</t>
</section>
<!--section title='Form-Encoded Body Parameter' anchor='body-param'-->
<section title='フォームエンコードされたボディパラメータ' anchor='body-param'>
<t>
<!--
When sending the access token in the HTTP request
entity-body, the client adds the access token to the request
body using the <spanx style='verb'>access_token</spanx>
parameter. The client MUST NOT use this method unless
all of the following conditions are met: -->
HTTPリクエストのエンティティボディの中でアクセストークンを送信する際、クライアントは<spanx style='verb'>access_token</spanx>パラメータを用いてアクセストークンをリクエストボディに追加する。クライアントは下記のすべての条件を満たさなければこの方法を利用してはならない(MUST NOT):
<list style='symbols'>
<t>
<!--
The HTTP request entity-body is single-part.
-->
HTTPリクエストのエンティティボディはシングルパートである。
</t>
<t>
<!--
The entity-body follows the encoding requirements of the
<spanx style='verb'>application/x-www-form-urlencoded</spanx> content-type as
defined by <xref target='W3C.REC-html401-19991224' />.
-->
エンティティボディは<xref target='W3C.REC-html401-19991224' />で定義されたコンテントタイプ<spanx style='verb'>application/x-www-form-urlencoded</spanx>のエンコーディング要件に従う。
</t>
<t>
<!--
The HTTP request entity-header includes the <spanx style='verb'>Content-Type</spanx>
header field set to <spanx style='verb'>application/x-www-form-urlencoded</spanx>.
-->
HTTPリクエストのエンティティヘッダは<spanx style='verb'>Content-Type</spanx>ヘッダを含み、フィールドの値は<spanx style='verb'>application/x-www-form-urlencoded</spanx>にセットされている。
</t>
<t>
<!--
The HTTP request method is one for which the request
body has defined semantics. In particular,
this means that the <spanx style='verb'>GET</spanx>
method MUST NOT be used.
-->
HTTPリクエストメソッドはそのリクエストボディが定義しているうちのどれか一つである。
これは特に<spanx style='verb'>GET</spanx>を利用してはならない(MUST NOT)ことを意味する。
</t>
</list>
</t>
<t>
<!--
The entity-body MAY include other request-specific
parameters, in which case, the <spanx
style='verb'>access_token</spanx> parameter MUST be properly
separated from the request-specific parameters using <spanx
style='verb'>&</spanx> character(s) (ASCII code 38).
-->
エンティティボディはリクエストに特化した他のパラメータを含んでも良い(MAY)。
その場合、<spanx style='verb'>access_token</spanx>パラメータは<spanx
style='verb'>&</spanx> 文字 (ASCII コード 38)を使い、他のリクエストに特化したパラメータと適切に分離されていなければならない(MUST)。
</t>
<figure>
<preamble>
<!--
For example, the client makes the following HTTP request using transport-layer
security:
-->
たとえば、クライアントは次のようなHTTPリクエストをトランスポートレイヤセキュリティを利用して送信する:
</preamble>
<artwork>
<![CDATA[POST /resource HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded
access_token=vF9dft4qmT]]>
</artwork>
</figure>
<t>
<!--
The <spanx style='verb'>application/x-www-form-urlencoded</spanx>
method SHOULD NOT be used except in application contexts
where participating browsers do not have access to the
<spanx style='verb'>Authorization</spanx> request header
field. Resource servers MAY support this method.
-->
<spanx style='verb'>application/x-www-form-urlencoded</spanx>方式は、アクセスしてくるブラウザが<spanx style='verb'>Authorization</spanx>リクエストヘッダフィールドにアクセスすることが出来ないようなアプリケーションの事情を除いて利用すべきではない(SHOULD NOT)
リソースサーバはこの方法をサポートしても良い(MAY)。
The <spanx style='verb'>application/x-www-form-urlencoded</spanx>
method SHOULD NOT be used except in application contexts
where participating browsers do not have access to the
<spanx style='verb'>Authorization</spanx> request header
field. Resource servers MAY support this method.
</t>
</section>
<section title='URIクエリパラメータ' anchor='query-param'>
<t>
<!--
When sending the access token in the HTTP request URI, the client adds the access
token to the request URI query component as defined by <xref target='RFC3986' /> using
the <spanx style='verb'>access_token</spanx> parameter.
-->
HTTPリクエストURIの中でアクセストークンを送信する際、クライアントは<spanx style='verb'>access_token</spanx>パラメータを用いてアクセストークンを<xref target='RFC3986' />で定義されているURIクエリコンポーネントに追加する。
When sending the access token in the HTTP request URI, the client adds the access
token to the request URI query component as defined by <xref target='RFC3986' /> using
the <spanx style='verb'>access_token</spanx> parameter.
</t>
<figure>
<preamble>
<!--
For example, the client makes the following HTTP request using transport-layer
security:
-->
たとえば、クライアントは次のようなHTTPリクエストをトランスポートレイヤセキュリティを利用して送信する:
</preamble>
<artwork>
<![CDATA[GET /resource?access_token=vF9dft4qmT HTTP/1.1
Host: server.example.com]]>
</artwork>
</figure>
<t>
<!--
The HTTP request URI query can include other
request-specific parameters, in which case, the <spanx
style='verb'>access_token</spanx> parameter MUST be properly
separated from the request-specific parameters using <spanx
style='verb'>&</spanx> character(s) (ASCII code 38).
-->
HTTPリクエストURIはリクエストに特化した他のパラメータを含むことができる。
その場合、<spanx style='verb'>access_token</spanx>パラメータは<spanx style='verb'>&</spanx> 文字 (ASCII コード 38)を使い、他のリクエストに特化したパラメータと適切に分離されていなければならない(MUST)。
</t>
<figure>
<preamble>
For example:
</preamble>
<artwork>
<![CDATA[https://server.example.com/resource?x=y&access_token=vF9dft4qmT&p=q]]>
</artwork>
</figure>
<t>
<!--
Because of the <xref target="sec-con">Security
Considerations</xref> associated with the URI method, it
SHOULD NOT be used unless it is the only feasible method.
Resource servers MAY support this method.
-->
URI方式に関係する<xref target="sec-con">セキュリティに関する考慮事項</xref>のため、この方法は単に実現可能な方法であるということを除いては利用すべきではない(SHOULD NOT)。リソースサーバはこの方式をサポートしても良い(MAY)。
</t>
</section>
</section>
<section title='The WWW-Authenticate Response Header Field' anchor='authn-header'>
<t>
If the protected resource request does not include
authentication credentials or does not contain an access
token that enables access to the protected resource,
the resource server MUST include the HTTP <spanx
style='verb'>WWW-Authenticate</spanx> response header field;
it MAY include it in response to other conditions as well.
The <spanx style='verb'>WWW-Authenticate</spanx> header
field uses the framework defined by
<xref target='I-D.ietf-httpbis-p7-auth' /> as follows:
</t>
<figure>
<artwork>
<![CDATA[challenge = "Bearer" [ 1*SP 1#param ]
param = realm / scope /
error / error-desc / error-uri /
auth-param
scope = "scope" "=" DQUOTE scope-val *( SP scope-val ) DQUOTE
scope-val = 1*scope-val-char
scope-val-char = %x21 / %x23-5B / %x5D-7E
; HTTPbis P1 qdtext except whitespace, restricted to US-ASCII
error = "error" "=" quoted-string
error-desc = "error_description" "=" DQUOTE *error-desc-char DQUOTE
error-desc-char = SP / VCHAR
error-uri = "error_uri" "=" DQUOTE URI-reference DQUOTE]]>
</artwork>
</figure>
<t>
The <spanx style='verb'>scope</spanx> attribute is a space-delimited list of scope values
indicating the required scope of the access token for accessing the requested resource.
The <spanx style='verb'>scope</spanx> attribute MUST NOT appear more than once.
The <spanx style='verb'>scope</spanx> value is intended for
programmatic use and is not meant to be displayed to
end users.
</t>
<t>
If the protected resource request included an access token and failed authentication, the
resource server SHOULD include the <spanx style='verb'>error</spanx> attribute to provide
the client with the reason why the access request was declined. The parameter value is
described in <xref target='resource-error-codes' />.
In addition, the resource server MAY include the <spanx
style='verb'>error_description</spanx> attribute to provide
developers a human-readable explanation that is not meant
to be displayed to end users.
It also MAY include
the <spanx style='verb'>error_uri</spanx> attribute with
an absolute URI identifying a human-readable web page explaining the error.
The <spanx style='verb'>error</spanx>, <spanx style='verb'>error_description</spanx>, and
<spanx style='verb'>error_uri</spanx> attribute MUST NOT appear more than once.
</t>
<figure>
<preamble>
For example, in response to a protected resource request without authentication:
</preamble>
<artwork>
<![CDATA[HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="example"]]>
</artwork>
</figure>
<figure>
<preamble>
And in response to a protected resource request with an authentication attempt using an
expired access token:
</preamble>
<artwork>
<![CDATA[HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="example",
error="invalid_token",
error_description="The access token expired"]]>
</artwork>
</figure>
<section title='Error Codes' anchor='resource-error-codes'>
<t>
When a request fails, the resource server responds using the appropriate HTTP status
code (typically, 400, 401, or 403), and includes one of the following error codes in
the response:
<list style='hanging' hangIndent='6'>
<t hangText='invalid_request'>
<vspace />
The request is missing a required parameter, includes an unsupported parameter or
parameter value, repeats the same parameter, uses more than one method for
including an access token, or is otherwise malformed. The resource server SHOULD
respond with the HTTP 400 (Bad Request) status code.
</t>
<t hangText='invalid_token'>
<vspace />
The access token provided is expired, revoked, malformed, or invalid for other
reasons. The resource SHOULD respond with the HTTP 401 (Unauthorized) status
code. The client MAY request a new access token and retry the protected resource
request.
</t>
<t hangText='insufficient_scope'>
<vspace />
The request requires higher privileges than provided by the access token. The
resource server SHOULD respond with the HTTP 403 (Forbidden) status code and MAY
include the <spanx style='verb'>scope</spanx> attribute with the scope necessary to
access the protected resource.
</t>
</list>
</t>
<t>
If the request lacks any authentication information (i.e. the client was unaware
authentication is necessary or attempted using an unsupported authentication method),
the resource server SHOULD NOT include an error code or other error information.
</t>
<figure>
<preamble>
For example:
</preamble>
<artwork>
<![CDATA[HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="example"]]>
</artwork>
</figure>
</section>
</section>
<!-- section title='Security Considerations' anchor="sec-con" -->
<section title='セキュリティに関する考慮事項' anchor="sec-con">
<t>
<!--
This section describes the relevant security threats regarding
token handling when using bearer tokens and describes how to
mitigate these threats.
-->
本章では、無記名トークン利用時におけるトークンの取り扱い方法に関するセキュリティ上の脅威、およびこれらの脅威をどのように軽減するかを記述する。
</t>
<!-- section title="Security Threats" anchor="threats" -->
<section title="セキュリティ上の脅威" anchor="threats">
<t>
<!--
The following list presents several common threats against
protocols utilizing some form of tokens. This list of
threats is based on NIST Special Publication 800-63 <xref
target="NIST800-63"/>. Since this document builds on the
OAuth 2.0 specification, we exclude a discussion of threats
that are described there or in related documents.
-->
次のリストは何らかのトークン形式を取り扱うプロトコルにおける共通の脅威を表したものである。
この脅威リストはNIST Special Publication 800-63 <xref
target="NIST800-63"/>をベースにしたものである。この文書はOAuth 2.0仕様を前提として作成されたものであるため、その仕様や関連文章中に記載されている脅威に関する議論は行わないものとする。
</t>
<t>
<list style="hanging">
<!--
<t hangText="Token manufacture/modification:">
An attacker may generate a bogus token or modify the
token contents (such as the authentication or attribute
statements) of an existing token, causing the resource
server to grant inappropriate access to the client.
For example, an attacker may modify the token to extend
the validity period; a malicious client may modify the
assertion to gain access to information that they
should not be able to view.
-->
<t hangText="トークン偽装/改ざん:">
攻撃者が偽装トークンを生成したり、既存のトークンの(認証や属性の記述内容といった)コンテンツを改ざんすることで、リソースサーバはクライアントに対して不適切なアクセス権限を許してしまう可能性がある。
例えば、攻撃者はトークンが妥当である期間を拡張するようにトークンを改ざんするかもしれない。悪意のあるクライアントは本来見ることができるべきではない情報へのアクセスを得るためのアサーションを改ざんするかもしれない。
</t>
<!--
<t hangText="Token disclosure:">
Tokens may contain authentication and attribute
statements that include sensitive information.
</t>
-->
<t hangText="トークン露見:">
トークンは認証や属性の記述など機微情報を含む可能性がある。
</t>
<!--
<t hangText="Token redirect:">
An attacker uses a token generated for consumption by
one resource server to gain access to a different
resource server that mistakenly believes the token to be
for it.
</t>
-->
<t hangText="トークンリダイレクト:">
攻撃者はあるリソースサーバで利用することを目的として生成されたトークンを、
別のリソースサーバが誤ってそのトークンが自身で利用できるものと思い込ませてアクセスを行うために利用する。
</t>
<!--
<t hangText="Token replay:">
An attacker attempts to use a token that has already
been used with that resource server in the past.
</t>
-->
<t hangText="トークンリプレイ:">
攻撃者は過去にリソースサーバで利用済みのトークンの再利用を試みる。
</t>
</list>
</t>
</section>
<section title="Threat Mitigation" anchor="mitigation">
<t>
A large range of threats can be mitigated by protecting the
contents of the token by using a digital signature or a
Message Authentication Code (MAC).
Alternatively, a bearer token can contain a reference to
authorization information, rather than encoding the
information directly. Such references MUST be infeasible for
an attacker to guess; using a reference may require an extra
interaction between a server and the token issuer to resolve
the reference to the authorization information.
The mechanics of such an interaction are not defined by this
specification.
</t>
<t>
This document does not specify the encoding or the contents
of the token; hence detailed recommendations for token
integrity protection are outside the scope of this document.
We assume that the token integrity protection is sufficient
to prevent the token from being modified.
</t>
<t>
To deal with token redirect, it is important for the
authorization server to include the identity of the intended
recipients (the audience), typically a single resource
server (or a list of resource servers), in the token.
Restricting the use of the token to a specific scope is also
recommended.
</t>
<t>
To provide protection against token disclosure,
confidentiality protection is applied via <xref
target='RFC5246'>TLS</xref> with a
ciphersuite that offers confidentiality protection. This
requires that the communication interaction between the
client and the authorization server, as well as the
interaction between the client and the resource server,
utilize confidentiality protection.
Since TLS is mandatory to
implement and to use with this specification, it is the
preferred approach for preventing token disclosure via the
communication channel. For those cases where the client
is prevented from observing the contents of the token, token
encryption MUST be applied in addition to the usage of TLS
protection.
</t>
<t>
To deal with token capture and replay,
the following recommendations are
made: First, the lifetime of the token MUST be limited by
putting a validity time field inside the protected part of
the token. Note that using short-lived (one hour or less)
tokens reduces the impact of them being
leaked. Second, confidentiality protection of the exchanges
between the client and the authorization server and between
the client and the resource server MUST be applied, for instance,
through the use of <xref target='RFC5246'>TLS</xref>. As a
consequence, no eavesdropper along the communication path is
able to observe the token exchange. Consequently, such an
on-path adversary cannot replay the token.
Furthermore, when
presenting the token to a resource server, the client MUST
verify the identity of that resource server, as per <xref target="RFC2818" />.
Note that the
client MUST validate the TLS certificate chain when making
these requests to protected resources. Presenting the token
to an unauthenticated and unauthorized resource server or
failing to validate the certificate chain will allow
adversaries to steal the token and gain unauthorized access
to protected resources.
</t>
</section>
<section title="Summary of Recommendations">
<t>
<list style="hanging">
<t hangText="Safeguard bearer tokens">
Client implementations MUST ensure that bearer tokens
are not leaked to unintended parties, as they will be
able to use them to gain access to protected resources.
This is the primary security consideration when using
bearer tokens and underlies all the more
specific recommendations that follow.
</t>
<t hangText="Validate SSL certificate chains">
The client MUST validate the TLS certificate chain when
making requests to protected resources. Failing to do
so may enable DNS hijacking attacks to steal the token
and gain unintended access.
</t>
<t hangText="Always use TLS (https)">
Clients MUST always use <xref target='RFC5246'>TLS</xref>
(https) or equivalent transport security when making requests
with bearer tokens. Failing to do so exposes the token
to numerous attacks that could give attackers unintended
access.
</t>
<t hangText="Don't store bearer tokens in cookies">
Implementations MUST NOT store bearer tokens within
cookies that can be sent in the clear (which is the
default transmission mode for cookies).
Implementations that do store bearer tokens in cookies
MUST take precautions against cross site request forgery.
</t>
<t hangText="Issue short-lived bearer tokens">
Token servers SHOULD issue short-lived (one hour or
less) bearer tokens, particularly when issuing tokens to
clients that run within a web browser or other
environments where information leakage may occur. Using
short-lived bearer tokens can reduce the impact of them
being leaked.
</t>
<t hangText="Issue scoped bearer tokens">
Token servers SHOULD issue bearer tokens that contain an audience
restriction, scoping their use to the intended relying
party or set of relying parties.
</t>
<t hangText="Don't pass bearer tokens in page URLs">
Bearer tokens SHOULD NOT be passed in page URLs (for
example as query string parameters). Instead, bearer
tokens SHOULD be passed in HTTP message headers or
message bodies for which confidentiality measures are
taken. Browsers, web servers, and other software may not
adequately secure URLs in the browser history, web
server logs, and other data structures. If bearer tokens
are passed in page URLs, attackers might be able to
steal them from the history data, logs, or other
unsecured locations.
</t>
</list>
</t>
</section>
</section>
<section title='IANA Considerations'>
<section title='OAuth Access Token Type Registration'>
<t>
This specification registers the following access token type in the OAuth Access Token
Type Registry.
</t>
<section title='The "Bearer" OAuth Access Token Type'>
<t>
<list style='hanging'>
<t hangText='Type name:'>
<vspace />
Bearer
</t>
<t hangText='Additional Token Endpoint Response Parameters:'>
<vspace />
(none)
</t>
<t hangText='HTTP Authentication Scheme(s):'>
<vspace />
Bearer
</t>
<t hangText='Change controller:'>
<vspace />
IETF
</t>
<t hangText='Specification document(s):'>
<vspace />
[[ this document ]]
</t>
</list>
</t>
</section>
</section>
<section title='Authentication Scheme Registration'>
<t>
This specification registers the following authentication
scheme in the Authentication Scheme Registry defined in
<xref target='I-D.ietf-httpbis-p7-auth' />.
</t>
<section title='The "Bearer" Authentication Scheme'>
<t>
<list style='hanging'>
<t hangText='Authentication Scheme Name:'>
<vspace />
Bearer
</t>
<t hangText='Pointer to specification text:'>
<vspace />
[[ this document ]]
</t>
<t hangText='Notes (optional):'>
<vspace />
(none)
</t>
</list>
</t>
</section>
</section>
</section>
</middle>
<back>
<references title='Normative References'>
<?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml' ?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml' ?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.2818.xml' ?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml' ?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml' ?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml' ?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-html401-19991224.xml' ?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p1-messaging-16.xml'?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p7-auth-16.xml'?>
<?rfc include='http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-oauth-v2-22.xml' ?>
</references>
<references title="Informative References">
<?rfc include='http://xml.resource.org/public/rfc/bibxml/reference.RFC.2617.xml' ?>
<reference anchor="NIST800-63">
<front>
<title>NIST Special Publication 800-63-1, INFORMATION SECURITY</title>
<author fullname="William E. Burr" initials="W." surname="Burr">
<organization>NIST</organization>
</author>
<author fullname="Donna F. Dodson" initials="D." surname="Dodson">
<organization>NIST</organization>
</author>
<author fullname="Ray A. Perlner" initials="R." surname="Perlner">
<organization>NIST</organization>
</author>
<author fullname="W. Timothy Polk" initials="T." surname="Polk">
<organization>NIST</organization>
</author>
<author fullname="Sarbari Gupta" initials="S." surname="Gupta">
<organization>NIST</organization>
</author>
<author fullname="Emad A. Nabbus" initials="E." surname="Nabbus">
<organization>NIST</organization>
</author>
<date month="December" year="2008"/>
</front>
<format target="http://csrc.nist.gov/publications/PubsDrafts.html#SP-800-63-Rev.%201" type="HTML"/>
</reference>
</references>
<section title='Acknowledgements'>
<t>
The following people contributed to preliminary versions of this document:
Blaine Cook (BT), Brian Eaton (Google), Yaron Y. Goland (Microsoft), Brent Goldman (Facebook),
Raffi Krikorian (Twitter), Luke Shepard (Facebook), and Allen Tom (Yahoo!). The content and
concepts within are a product of the OAuth community, the WRAP community, and the OAuth Working
Group.
</t>
<t>
The OAuth Working Group has dozens of very active contributors who proposed ideas and
wording for this document, including:
Michael Adams, Amanda Anganes, Andrew Arnott, Dirk Balfanz, Brian Campbell, Leah Culver, Bill de hÓra,
Brian Ellin, Igor Faynberg, George Fletcher, Tim Freeman, Evan Gilbert, Justin Hart,
John Kemp, Eran Hammer-Lahav, Chasen Le Hara, Michael B. Jones, Torsten Lodderstedt,
Eve Maler, James Manger, Laurence Miao,
Chuck Mortimore, Anthony Nadalin, Justin Richer, Peter Saint-Andre, Nat Sakimura, Rob Sayre,
Marius Scurtescu, Naitik Shah, Justin Smith, Jeremy Suriel, Christian Stübner, Paul Tarjan,
and Franklin Tse.
</t>
</section>
<section title='Document History'>
<t>
[[ to be removed by the RFC editor before publication as an RFC ]]
</t>
<t>
-11
<list style='symbols'>
<t>
Replaced uses of <"> with DQUOTE to pass ABNF syntax check.
</t>
</list>
</t>
<t>
-10
<list style='symbols'>
<t>
Removed the #auth-param option from Authorization header
syntax (leaving only the b64token syntax).
</t>
<t>
Restricted the <spanx style='verb'>scope</spanx> value
character set to %x21 / %x23-5B / %x5D-7E (printable ASCII
characters excluding double-quote and backslash).
Indicated that scope is intended for programmatic use and
is not meant to be displayed to end users.
</t>
<t>
Restricted the character set for <spanx
style='verb'>error_description</spanx> strings to SP /
VCHAR and indicated that they are not meant to be
displayed to end users.
</t>
<t>
Included more description in the Abstract, since Hannes
Tschofenig indicated that the RFC editor would require
this.
</t>
<t>
Changed "Access Grant" to "Authorization Grant", as was
done in the core spec.
</t>
<t>
Simplified the introduction to the Authenticated Requests
section.
</t>
</list>
</t>
<t>
-09
<list style='symbols'>
<t>
Incorporated working group last call comments. Specific changes were:
</t>
<t>
Use definitions from <xref
target='I-D.ietf-httpbis-p7-auth' /> rather than <xref
target='RFC2617' />.
</t>
<t>
Update credentials definition to conform to <xref
target='I-D.ietf-httpbis-p7-auth' />.
</t>
<t>
Further clarified that query parameters may occur in any order.
</t>
<t>
Specify that error_description is UTF-8 encoded
(matching the core specification).
</t>
<t>
Registered "Bearer" Authentication Scheme in
Authentication Scheme Registry defined by
<xref target='I-D.ietf-httpbis-p7-auth' />.
</t>
<t>
Updated references to oauth-v2, httpbis-p1-messaging, and
httpbis-p7-auth drafts.
</t>
<t>
Other wording improvements not introducing normative changes.
</t>
</list>
</t>
<t>
-08
<list style='symbols'>
<t>
Updated references to oauth-v2 and httpbis drafts.
</t>
</list>
</t>
<t>
-07
<list style='symbols'>
<t>
Added missing comma in error response example.
</t>
</list>
</t>
<t>
-06
<list style='symbols'>
<t>
Changed parameter name <spanx
style="verb">bearer_token</spanx> to <spanx
style="verb">access_token</spanx>, per working group