idnits 2.17.1 draft-ietf-oauth-v2-bearer-18.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (March 12, 2012) is 4427 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p1-messaging-18 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p7-auth-18 == Outdated reference: A later version (-31) exists of draft-ietf-oauth-v2-25 ** Obsolete normative reference: RFC 2246 (Obsoleted by RFC 4346) ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) -- Possible downref: Non-RFC (?) normative reference: ref. 'USASCII' -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) -- Obsolete informational reference (is this intentional?): RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) Summary: 3 errors (**), 0 flaws (~~), 5 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 OAuth Working Group M. Jones 3 Internet-Draft Microsoft 4 Intended status: Standards Track D. Hardt 5 Expires: September 13, 2012 independent 6 D. Recordon 7 Facebook 8 March 12, 2012 10 The OAuth 2.0 Authorization Protocol: Bearer Tokens 11 draft-ietf-oauth-v2-bearer-18 13 Abstract 15 This specification describes how to use bearer tokens in HTTP 16 requests to access OAuth 2.0 protected resources. Any party in 17 possession of a bearer token (a "bearer") can use it to get access to 18 the associated resources (without demonstrating possession of a 19 cryptographic key). To prevent misuse, bearer tokens need to be 20 protected from disclosure in storage and in transport. 22 Status of this Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on September 13, 2012. 39 Copyright Notice 41 Copyright (c) 2012 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 57 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 3 58 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 59 1.3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 4 60 2. Authenticated Requests . . . . . . . . . . . . . . . . . . . . 5 61 2.1. Authorization Request Header Field . . . . . . . . . . . . 5 62 2.2. Form-Encoded Body Parameter . . . . . . . . . . . . . . . 6 63 2.3. URI Query Parameter . . . . . . . . . . . . . . . . . . . 7 64 3. The WWW-Authenticate Response Header Field . . . . . . . . . . 7 65 3.1. Error Codes . . . . . . . . . . . . . . . . . . . . . . . 9 66 4. Example Access Token Response . . . . . . . . . . . . . . . . 9 67 5. Security Considerations . . . . . . . . . . . . . . . . . . . 10 68 5.1. Security Threats . . . . . . . . . . . . . . . . . . . . . 10 69 5.2. Threat Mitigation . . . . . . . . . . . . . . . . . . . . 11 70 5.3. Summary of Recommendations . . . . . . . . . . . . . . . . 12 71 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 72 6.1. OAuth Access Token Type Registration . . . . . . . . . . . 13 73 6.1.1. The "Bearer" OAuth Access Token Type . . . . . . . . . 13 74 6.2. Authentication Scheme Registration . . . . . . . . . . . . 14 75 6.2.1. The "Bearer" Authentication Scheme . . . . . . . . . . 14 76 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 14 77 7.1. Normative References . . . . . . . . . . . . . . . . . . . 14 78 7.2. Informative References . . . . . . . . . . . . . . . . . . 15 79 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 16 80 Appendix B. Document History . . . . . . . . . . . . . . . . . . 16 81 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22 83 1. Introduction 85 OAuth enables clients to access protected resources by obtaining an 86 access token, which is defined in OAuth 2.0 Authorization 87 [I-D.ietf-oauth-v2] as "a string representing an access authorization 88 issued to the client", rather than using the resource owner's 89 credentials directly. 91 Tokens are issued to clients by an authorization server with the 92 approval of the resource owner. The client uses the access token to 93 access the protected resources hosted by the resource server. This 94 specification describes how to make protected resource requests when 95 the OAuth access token is a bearer token. 97 This specification defines the use of bearer tokens over HTTP/1.1 98 [I-D.ietf-httpbis-p1-messaging] using TLS [RFC5246] to access 99 protected resources. TLS is mandatory to implement and use with this 100 specification; other specifications may extend this specification for 101 use with other transport protocols. While designed for use with 102 access tokens resulting from OAuth 2.0 Authorization 103 [I-D.ietf-oauth-v2] flows to access OAuth protected resources, this 104 specification actually defines a general HTTP authorization method 105 that can be used with bearer tokens from any source to access any 106 resources protected by those bearer tokens. 108 1.1. Notational Conventions 110 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 111 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this 112 document are to be interpreted as described in Key words for use in 113 RFCs to Indicate Requirement Levels [RFC2119]. 115 This document uses the Augmented Backus-Naur Form (ABNF) notation of 116 HTTP/1.1, Part 1 [I-D.ietf-httpbis-p1-messaging], which is based upon 117 the Augmented Backus-Naur Form (ABNF) [RFC5234] notation. 118 Additionally, the following rules are included from HTTP/1.1, Part 7 119 [I-D.ietf-httpbis-p7-auth]: auth-param, auth-scheme, and b64token; 120 and from Uniform Resource Identifier (URI) [RFC3986]: URI-Reference. 122 Unless otherwise noted, all the protocol parameter names and values 123 are case sensitive. 125 1.2. Terminology 126 Bearer Token 127 A security token with the property that any party in possession of 128 the token (a "bearer") can use the token in any way that any other 129 party in possession of it can. Using a bearer token does not 130 require a bearer to prove possession of cryptographic key material 131 (proof-of-possession). 133 All other terms are as defined in OAuth 2.0 Authorization 134 [I-D.ietf-oauth-v2]. 136 1.3. Overview 138 OAuth provides a method for clients to access a protected resource on 139 behalf of a resource owner. In the general case, before a client can 140 access a protected resource, it must first obtain an authorization 141 grant from the resource owner and then exchange the authorization 142 grant for an access token. The access token represents the grant's 143 scope, duration, and other attributes granted by the authorization 144 grant. The client accesses the protected resource by presenting the 145 access token to the resource server. In some cases, a client can 146 directly present its own credentials to an authorization server to 147 obtain an access token without having to first obtain an 148 authorization grant from a resource owner. 150 The access token provides an abstraction, replacing different 151 authorization constructs (e.g. username and password, assertion) for 152 a single token understood by the resource server. This abstraction 153 enables issuing access tokens valid for a short time period, as well 154 as removing the resource server's need to understand a wide range of 155 authentication schemes. 157 +--------+ +---------------+ 158 | |--(A)- Authorization Request ->| Resource | 159 | | | Owner | 160 | |<-(B)-- Authorization Grant ---| | 161 | | +---------------+ 162 | | 163 | | Authorization Grant & +---------------+ 164 | |--(C)--- Client Credentials -->| Authorization | 165 | Client | | Server | 166 | |<-(D)----- Access Token -------| | 167 | | +---------------+ 168 | | 169 | | +---------------+ 170 | |--(E)----- Access Token ------>| Resource | 171 | | | Server | 172 | |<-(F)--- Protected Resource ---| | 173 +--------+ +---------------+ 175 Figure 1: Abstract Protocol Flow 177 The abstract flow illustrated in Figure 1 describes the overall OAuth 178 2.0 protocol architecture. The following steps are specified within 179 this document: 181 E) The client makes a protected resource request to the resource 182 server by presenting the access token. 184 F) The resource server validates the access token, and if valid, 185 serves the request. 187 2. Authenticated Requests 189 This section defines three methods of sending bearer access tokens in 190 resource requests to resource servers. Clients MUST NOT use more 191 than one method to transmit the token in each request. 193 2.1. Authorization Request Header Field 195 When sending the access token in the "Authorization" request header 196 field defined by HTTP/1.1, Part 7 [I-D.ietf-httpbis-p7-auth], the 197 client uses the "Bearer" authentication scheme to transmit the access 198 token. 200 For example: 201 GET /resource HTTP/1.1 202 Host: server.example.com 203 Authorization: Bearer mF_9.B5f-4.1JqM 205 The "Authorization" header field uses the framework defined by 206 HTTP/1.1, Part 7 [I-D.ietf-httpbis-p7-auth] as follows: 207 credentials = "Bearer" 1*SP b64token 209 The b64token syntax was chosen over the alternative #auth-param 210 syntax also defined by HTTP/1.1, Part 7 [I-D.ietf-httpbis-p7-auth] 211 both for simplicity and for compatibility with existing 212 implementations. If additional parameters are needed in the future, 213 a different scheme would need to be defined. 215 Clients SHOULD make authenticated requests with a bearer token using 216 the "Authorization" request header field with the "Bearer" HTTP 217 authorization scheme. Resource servers MUST support this method. 219 2.2. Form-Encoded Body Parameter 221 When sending the access token in the HTTP request entity-body, the 222 client adds the access token to the request body using the 223 "access_token" parameter. The client MUST NOT use this method unless 224 all of the following conditions are met: 226 o The HTTP request entity-header includes the "Content-Type" header 227 field set to "application/x-www-form-urlencoded". 229 o The entity-body follows the encoding requirements of the 230 "application/x-www-form-urlencoded" content-type as defined by 231 HTML 4.01 [W3C.REC-html401-19991224]. 233 o The HTTP request entity-body is single-part. 235 o The content to be encoded in the entity-body MUST consist entirely 236 of ASCII [USASCII] characters. 238 o The HTTP request method is one for which the request body has 239 defined semantics. In particular, this means that the "GET" 240 method MUST NOT be used. 242 The entity-body MAY include other request-specific parameters, in 243 which case, the "access_token" parameter MUST be properly separated 244 from the request-specific parameters using "&" character(s) (ASCII 245 code 38). 247 For example, the client makes the following HTTP request using 248 transport-layer security: 249 POST /resource HTTP/1.1 250 Host: server.example.com 251 Content-Type: application/x-www-form-urlencoded 253 access_token=mF_9.B5f-4.1JqM 255 The "application/x-www-form-urlencoded" method SHOULD NOT be used 256 except in application contexts where participating browsers do not 257 have access to the "Authorization" request header field. Resource 258 servers MAY support this method. 260 2.3. URI Query Parameter 262 When sending the access token in the HTTP request URI, the client 263 adds the access token to the request URI query component as defined 264 by Uniform Resource Identifier (URI) [RFC3986] using the 265 "access_token" parameter. 267 For example, the client makes the following HTTP request using 268 transport-layer security: 269 GET /resource?access_token=mF_9.B5f-4.1JqM HTTP/1.1 270 Host: server.example.com 272 The HTTP request URI query can include other request-specific 273 parameters, in which case, the "access_token" parameter MUST be 274 properly separated from the request-specific parameters using "&" 275 character(s) (ASCII code 38). 277 For example: 278 https://server.example.com/resource?x=y&access_token=mF_9.B5f-4.1JqM&p=q 280 Because of the security weaknesses associated with the URI method 281 (see Section 5), including the high likelihood that the URL 282 containing the access token will be logged, it SHOULD NOT be used 283 unless it is impossible to transport the access token in the 284 "Authorization" request header field or the HTTP request entity-body. 285 Resource servers MAY support this method. 287 3. The WWW-Authenticate Response Header Field 289 If the protected resource request does not include authentication 290 credentials or does not contain an access token that enables access 291 to the protected resource, the resource server MUST include the HTTP 292 "WWW-Authenticate" response header field; it MAY include it in 293 response to other conditions as well. The "WWW-Authenticate" header 294 field uses the framework defined by HTTP/1.1, Part 7 295 [I-D.ietf-httpbis-p7-auth]. 297 All challenges defined by this specification MUST use the auth-scheme 298 value "Bearer". This scheme MUST be followed by one or more auth- 299 param values. The auth-param attributes used or defined by this 300 specification are as follows. Other auth-param attributes MAY be 301 used as well. 303 A "realm" attribute MAY be included to indicate the scope of 304 protection in the manner described in HTTP/1.1, Part 7 305 [I-D.ietf-httpbis-p7-auth]. The "realm" attribute MUST NOT appear 306 more than once. 308 The "scope" attribute is a space-delimited list of scope values 309 indicating the required scope of the access token for accessing the 310 requested resource. In some cases, the "scope" value will be used 311 when requesting a new access token with sufficient scope of access to 312 utilize the protected resource. Use of the "scope" attribute is 313 OPTIONAL. The "scope" attribute MUST NOT appear more than once. The 314 "scope" value is intended for programmatic use and is not meant to be 315 displayed to end users. 317 If the protected resource request included an access token and failed 318 authentication, the resource server SHOULD include the "error" 319 attribute to provide the client with the reason why the access 320 request was declined. The parameter value is described in 321 Section 3.1. In addition, the resource server MAY include the 322 "error_description" attribute to provide developers a human-readable 323 explanation that is not meant to be displayed to end users. It also 324 MAY include the "error_uri" attribute with an absolute URI 325 identifying a human-readable web page explaining the error. The 326 "error", "error_description", and "error_uri" attributes MUST NOT 327 appear more than once. 329 Values for the "scope" attribute MUST NOT include characters outside 330 the set %x21 / %x23-5B / %x5D-7E for representing scope values and 331 %x20 for delimiters between scope values. Values for the "error" and 332 "error_description" attributes MUST NOT include characters outside 333 the set %x20-21 / %x23-5B / %x5D-7E. Values for the "error_uri" 334 attribute MUST conform to the URI-Reference syntax, and thus MUST NOT 335 include characters outside the set %x21 / %x23-5B / %x5D-7E. 337 For example, in response to a protected resource request without 338 authentication: 339 HTTP/1.1 401 Unauthorized 340 WWW-Authenticate: Bearer realm="example" 341 And in response to a protected resource request with an 342 authentication attempt using an expired access token: 343 HTTP/1.1 401 Unauthorized 344 WWW-Authenticate: Bearer realm="example", 345 error="invalid_token", 346 error_description="The access token expired" 348 3.1. Error Codes 350 When a request fails, the resource server responds using the 351 appropriate HTTP status code (typically, 400, 401, 403, or 405), and 352 includes one of the following error codes in the response: 354 invalid_request 355 The request is missing a required parameter, includes an 356 unsupported parameter or parameter value, repeats the same 357 parameter, uses more than one method for including an access 358 token, or is otherwise malformed. The resource server SHOULD 359 respond with the HTTP 400 (Bad Request) status code. 361 invalid_token 362 The access token provided is expired, revoked, malformed, or 363 invalid for other reasons. The resource SHOULD respond with 364 the HTTP 401 (Unauthorized) status code. The client MAY 365 request a new access token and retry the protected resource 366 request. 368 insufficient_scope 369 The request requires higher privileges than provided by the 370 access token. The resource server SHOULD respond with the HTTP 371 403 (Forbidden) status code and MAY include the "scope" 372 attribute with the scope necessary to access the protected 373 resource. 375 If the request lacks any authentication information (i.e. the client 376 was unaware authentication is necessary or attempted using an 377 unsupported authentication method), the resource server SHOULD NOT 378 include an error code or other error information. 380 For example: 381 HTTP/1.1 401 Unauthorized 382 WWW-Authenticate: Bearer realm="example" 384 4. Example Access Token Response 386 Typically a bearer token is returned to the client as part of an 387 OAuth 2.0 [I-D.ietf-oauth-v2] access token response. An example of 388 such a response is: 389 HTTP/1.1 200 OK 390 Content-Type: application/json;charset=UTF-8 391 Cache-Control: no-store 392 Pragma: no-cache 394 { 395 "access_token":"mF_9.B5f-4.1JqM", 396 "token_type":"Bearer", 397 "expires_in":3600, 398 "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA" 399 } 401 5. Security Considerations 403 This section describes the relevant security threats regarding token 404 handling when using bearer tokens and describes how to mitigate these 405 threats. 407 5.1. Security Threats 409 The following list presents several common threats against protocols 410 utilizing some form of tokens. This list of threats is based on NIST 411 Special Publication 800-63 [NIST800-63]. Since this document builds 412 on the OAuth 2.0 specification, we exclude a discussion of threats 413 that are described there or in related documents. 415 Token manufacture/modification: An attacker may generate a bogus 416 token or modify the token contents (such as the authentication or 417 attribute statements) of an existing token, causing the resource 418 server to grant inappropriate access to the client. For example, 419 an attacker may modify the token to extend the validity period; a 420 malicious client may modify the assertion to gain access to 421 information that they should not be able to view. 423 Token disclosure: Tokens may contain authentication and attribute 424 statements that include sensitive information. 426 Token redirect: An attacker uses a token generated for consumption 427 by one resource server to gain access to a different resource 428 server that mistakenly believes the token to be for it. 430 Token replay: An attacker attempts to use a token that has already 431 been used with that resource server in the past. 433 5.2. Threat Mitigation 435 A large range of threats can be mitigated by protecting the contents 436 of the token by using a digital signature or a Message Authentication 437 Code (MAC). Alternatively, a bearer token can contain a reference to 438 authorization information, rather than encoding the information 439 directly. Such references MUST be infeasible for an attacker to 440 guess; using a reference may require an extra interaction between a 441 server and the token issuer to resolve the reference to the 442 authorization information. The mechanics of such an interaction are 443 not defined by this specification. 445 This document does not specify the encoding or the contents of the 446 token; hence detailed recommendations about the means of guaranteeing 447 token integrity protection are outside the scope of this document. 448 The token integrity protection MUST be sufficient to prevent the 449 token from being modified. 451 To deal with token redirect, it is important for the authorization 452 server to include the identity of the intended recipients (the 453 audience), typically a single resource server (or a list of resource 454 servers), in the token. Restricting the use of the token to a 455 specific scope is also RECOMMENDED. 457 The authorization server MUST implement TLS. Which version(s) ought 458 to be implemented will vary over time, and depend on the widespread 459 deployment and known security vulnerabilities at the time of 460 implementation. At the time of this writing, TLS version 1.2 461 [RFC5246] is the most recent version, but has very limited actual 462 deployment, and might not be readily available in implementation 463 toolkits. TLS version 1.0 [RFC2246] is the most widely deployed 464 version, and will give the broadest interoperability. 466 To protect against token disclosure, confidentiality protection MUST 467 be applied using TLS [RFC5246] with a ciphersuite that provides 468 confidentiality and integrity protection. This requires that the 469 communication interaction between the client and the authorization 470 server, as well as the interaction between the client and the 471 resource server, utilize confidentiality and integrity protection. 472 Since TLS is mandatory to implement and to use with this 473 specification, it is the preferred approach for preventing token 474 disclosure via the communication channel. For those cases where the 475 client is prevented from observing the contents of the token, token 476 encryption MUST be applied in addition to the usage of TLS 477 protection. As a further defense against token disclosure, the 478 client MUST validate the TLS certificate chain when making requests 479 to protected resources, including checking the Certificate Revocation 480 List (CRL) [RFC5280]. 482 Cookies are typically transmitted in the clear. Thus, any 483 information contained in them is at risk of disclosure. Therefore, 484 bearer tokens MUST NOT be stored in cookies that can be sent in the 485 clear. 487 In some deployments, including those utilizing load balancers, the 488 TLS connection to the resource server terminates prior to the actual 489 server that provides the resource. This could leave the token 490 unprotected between the front end server where the TLS connection 491 terminates and the back end server that provides the resource. In 492 such deployments, sufficient measures MUST be employed to ensure 493 confidentiality of the token between the front end and back end 494 servers; encryption of the token is one possible such measure. 496 To deal with token capture and replay, the following recommendations 497 are made: First, the lifetime of the token MUST be limited; one means 498 of achieving this is by putting a validity time field inside the 499 protected part of the token. Note that using short-lived (one hour 500 or less) tokens reduces the impact of them being leaked. Second, 501 confidentiality protection of the exchanges between the client and 502 the authorization server and between the client and the resource 503 server MUST be applied. As a consequence, no eavesdropper along the 504 communication path is able to observe the token exchange. 505 Consequently, such an on-path adversary cannot replay the token. 506 Furthermore, when presenting the token to a resource server, the 507 client MUST verify the identity of that resource server, as per 508 Section 3.1 of HTTP Over TLS [RFC2818]. Note that the client MUST 509 validate the TLS certificate chain when making these requests to 510 protected resources. Presenting the token to an unauthenticated and 511 unauthorized resource server or failing to validate the certificate 512 chain will allow adversaries to steal the token and gain unauthorized 513 access to protected resources. 515 5.3. Summary of Recommendations 517 Safeguard bearer tokens: Client implementations MUST ensure that 518 bearer tokens are not leaked to unintended parties, as they will 519 be able to use them to gain access to protected resources. This 520 is the primary security consideration when using bearer tokens and 521 underlies all the more specific recommendations that follow. 523 Validate SSL certificate chains: The client MUST validate the TLS 524 certificate chain when making requests to protected resources. 525 Failing to do so may enable DNS hijacking attacks to steal the 526 token and gain unintended access. 528 Always use TLS (https): Clients MUST always use TLS [RFC5246] 529 (https) or equivalent transport security when making requests with 530 bearer tokens. Failing to do so exposes the token to numerous 531 attacks that could give attackers unintended access. 533 Don't store bearer tokens in cookies: Implementations MUST NOT store 534 bearer tokens within cookies that can be sent in the clear (which 535 is the default transmission mode for cookies). Implementations 536 that do store bearer tokens in cookies MUST take precautions 537 against cross site request forgery. 539 Issue short-lived bearer tokens: Token servers SHOULD issue short- 540 lived (one hour or less) bearer tokens, particularly when issuing 541 tokens to clients that run within a web browser or other 542 environments where information leakage may occur. Using short- 543 lived bearer tokens can reduce the impact of them being leaked. 545 Issue scoped bearer tokens: Token servers SHOULD issue bearer tokens 546 that contain an audience restriction, scoping their use to the 547 intended relying party or set of relying parties. 549 Don't pass bearer tokens in page URLs: Bearer tokens SHOULD NOT be 550 passed in page URLs (for example as query string parameters). 551 Instead, bearer tokens SHOULD be passed in HTTP message headers or 552 message bodies for which confidentiality measures are taken. 553 Browsers, web servers, and other software may not adequately 554 secure URLs in the browser history, web server logs, and other 555 data structures. If bearer tokens are passed in page URLs, 556 attackers might be able to steal them from the history data, logs, 557 or other unsecured locations. 559 6. IANA Considerations 561 6.1. OAuth Access Token Type Registration 563 This specification registers the following access token type in the 564 OAuth Access Token Type Registry. 566 6.1.1. The "Bearer" OAuth Access Token Type 568 Type name: 569 Bearer 571 Additional Token Endpoint Response Parameters: 572 (none) 574 HTTP Authentication Scheme(s): 575 Bearer 577 Change controller: 578 IETF 580 Specification document(s): 581 [[ this document ]] 583 6.2. Authentication Scheme Registration 585 This specification registers the following authentication scheme in 586 the Authentication Scheme Registry defined in HTTP/1.1, Part 7 587 [I-D.ietf-httpbis-p7-auth]. 589 6.2.1. The "Bearer" Authentication Scheme 591 Authentication Scheme Name: 592 Bearer 594 Pointer to specification text: 595 [[ this document ]] 597 Notes (optional): 598 (none) 600 7. References 602 7.1. Normative References 604 [I-D.ietf-httpbis-p1-messaging] 605 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 606 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., and 607 J. Reschke, "HTTP/1.1, part 1: URIs, Connections, and 608 Message Parsing", draft-ietf-httpbis-p1-messaging-18 (work 609 in progress), January 2012. 611 [I-D.ietf-httpbis-p7-auth] 612 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 613 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., and 614 J. Reschke, "HTTP/1.1, part 7: Authentication", 615 draft-ietf-httpbis-p7-auth-18 (work in progress), 616 January 2012. 618 [I-D.ietf-oauth-v2] 619 Hammer-Lahav, E., Recordon, D., and D. Hardt, "The OAuth 620 2.0 Authorization Protocol", draft-ietf-oauth-v2-25 (work 621 in progress), March 2012. 623 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 624 Requirement Levels", BCP 14, RFC 2119, March 1997. 626 [RFC2246] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", 627 RFC 2246, January 1999. 629 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 631 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 632 Resource Identifier (URI): Generic Syntax", STD 66, 633 RFC 3986, January 2005. 635 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 636 Specifications: ABNF", STD 68, RFC 5234, January 2008. 638 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 639 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 641 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 642 Housley, R., and W. Polk, "Internet X.509 Public Key 643 Infrastructure Certificate and Certificate Revocation List 644 (CRL) Profile", RFC 5280, May 2008. 646 [USASCII] American National Standards Institute, "Coded Character 647 Set -- 7-bit American Standard Code for Information 648 Interchange", ANSI X3.4, 1986. 650 [W3C.REC-html401-19991224] 651 Hors, A., Raggett, D., and I. Jacobs, "HTML 4.01 652 Specification", World Wide Web Consortium 653 Recommendation REC-html401-19991224, December 1999, 654 . 656 7.2. Informative References 658 [NIST800-63] 659 Burr, W., Dodson, D., Perlner, R., Polk, T., Gupta, S., 660 and E. Nabbus, "NIST Special Publication 800-63-1, 661 INFORMATION SECURITY", December 2008. 663 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 664 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 665 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 667 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 668 Leach, P., Luotonen, A., and L. Stewart, "HTTP 669 Authentication: Basic and Digest Access Authentication", 670 RFC 2617, June 1999. 672 Appendix A. Acknowledgements 674 The following people contributed to preliminary versions of this 675 document: Blaine Cook (BT), Brian Eaton (Google), Yaron Y. Goland 676 (Microsoft), Brent Goldman (Facebook), Raffi Krikorian (Twitter), 677 Luke Shepard (Facebook), and Allen Tom (Yahoo!). The content and 678 concepts within are a product of the OAuth community, the WRAP 679 community, and the OAuth Working Group. 681 The OAuth Working Group has dozens of very active contributors who 682 proposed ideas and wording for this document, including: Michael 683 Adams, Amanda Anganes, Andrew Arnott, Dirk Balfanz, John Bradley, 684 Brian Campbell, Leah Culver, Bill de hOra, Brian Ellin, Igor 685 Faynberg, Stephen Farrell, George Fletcher, Tim Freeman, Evan 686 Gilbert, Yaron Y. Goland, Thomas Hardjono, Justin Hart, Phil Hunt, 687 John Kemp, Eran Hammer, Chasen Le Hara, Barry Leiba, Michael B. 688 Jones, Torsten Lodderstedt, Eve Maler, James Manger, Laurence Miao, 689 William J. Mills, Chuck Mortimore, Anthony Nadalin, Julian Reschke, 690 Justin Richer, Peter Saint-Andre, Nat Sakimura, Rob Sayre, Marius 691 Scurtescu, Naitik Shah, Justin Smith, Jeremy Suriel, Christian 692 Stuebner, Paul Tarjan, Hannes Tschofenig, Franklin Tse, and Shane 693 Weeden. 695 Appendix B. Document History 697 [[ to be removed by the RFC editor before publication as an RFC ]] 699 -18 701 o Changed example bearer token value from vF9dft4qmT to mF_9.B5f- 702 4.1JqM. 704 o Added example access token response returning a Bearer token. 706 -17 708 o Restore RFC 2818 reference for server identity verification and 709 add RFC 5280 reference for certificate revocation lists, per Gen- 710 ART review comments. 712 -16 713 o Use the HTTPbis auth-param syntax for Bearer challenge attributes. 715 o Dropped the sentence "The "realm" value is intended for 716 programmatic use and is not meant to be displayed to end users". 718 o Reordered form-encoded body parameter description bullets for 719 better readability. 721 o Added [USASCII] reference. 723 -15 725 o Clarified that form-encoded content must consist entirely of ASCII 726 characters. 728 o Added TLS version requirements. 730 o Applied editorial improvements suggested by Mark Nottingham during 731 the APPS area review. 733 -14 735 o Changes made in response to review comments by Security Area 736 Director Stephen Farrell. Specifically: 738 o Strengthened warnings about passing an access token as a query 739 parameter and more precisely described the limitations placed upon 740 the use of this method. 742 o Clarified that the "realm" attribute MAY included to indicate the 743 scope of protection in the manner described in HTTP/1.1, Part 7 744 [I-D.ietf-httpbis-p7-auth]. 746 o Normatively stated that "the token integrity protection MUST be 747 sufficient to prevent the token from being modified". 749 o Added statement that "TLS is mandatory to implement and use with 750 this specification" to the introduction. 752 o Stated that TLS MUST be used with "a ciphersuite that provides 753 confidentiality and integrity protection". 755 o Added "As a further defense against token disclosure, the client 756 MUST validate the TLS certificate chain when making requests to 757 protected resources" to the Threat Mitigation section. 759 o Clarified that putting a validity time field inside the protected 760 part of the token is one means, but not the only means, of 761 limiting the lifetime of the token. 763 o Dropped the confusing phrase "for instance, through the use of 764 TLS" from the sentence about confidentiality protection of the 765 exchanges. 767 o Reference RFC 6125 for identity verification, rather than RFC 768 2818. 770 o Stated that the token MUST be protected between front end and back 771 end servers when the TLS connection terminates at a front end 772 server that is distinct from the actual server that provides the 773 resource. 775 o Stated that bearer tokens MUST NOT be stored in cookies that can 776 be sent in the clear in the Threat Mitigation section. 778 o Replaced sole remaining reference to [RFC2616] with HTTPbis 779 [I-D.ietf-httpbis-p1-messaging] reference. 781 o Replaced all references where the reference is used as if it were 782 part of the sentence (such as "defined by [I-D.whatever]") with 783 ones where the specification name is used, followed by the 784 reference (such as "defined by Whatever [I-D.whatever]"). 786 o Other on-normative editorial improvements. 788 -13 790 o At the request of Hannes Tschofenig, made ABNF changes to make it 791 clear that no special WWW-Authenticate response header field 792 parsers are needed. The "scope", "error-description", and 793 "error-uri" parameters are all now defined as quoted-string in the 794 ABNF (as "error" already was). Restrictions on these values that 795 were formerly described in the ABNFs are now described in 796 normative text instead. 798 -12 800 o Made non-normative editorial changes that Hannes Tschofenig 801 requested be applied prior to forwarding the specification to the 802 IESG. 804 o Added rationale for the choice of the b64token syntax. 806 o Added rationale stating that receivers are free to parse the 807 "scope" attribute using a standard quoted-string parser, since it 808 will correctly process all legal "scope" values. 810 o Added additional active working group contributors to the 811 Acknowledgements section. 813 -11 815 o Replaced uses of <"> with DQUOTE to pass ABNF syntax check. 817 -10 819 o Removed the #auth-param option from Authorization header syntax 820 (leaving only the b64token syntax). 822 o Restricted the "scope" value character set to %x21 / %x23-5B / 823 %x5D-7E (printable ASCII characters excluding double-quote and 824 backslash). Indicated that scope is intended for programmatic use 825 and is not meant to be displayed to end users. 827 o Restricted the character set for "error_description" strings to SP 828 / VCHAR and indicated that they are not meant to be displayed to 829 end users. 831 o Included more description in the Abstract, since Hannes Tschofenig 832 indicated that the RFC editor would require this. 834 o Changed "Access Grant" to "Authorization Grant", as was done in 835 the core spec. 837 o Simplified the introduction to the Authenticated Requests section. 839 -09 841 o Incorporated working group last call comments. Specific changes 842 were: 844 o Use definitions from [I-D.ietf-httpbis-p7-auth] rather than 845 [RFC2617]. 847 o Update credentials definition to conform to 848 [I-D.ietf-httpbis-p7-auth]. 850 o Further clarified that query parameters may occur in any order. 852 o Specify that error_description is UTF-8 encoded (matching the core 853 specification). 855 o Registered "Bearer" Authentication Scheme in Authentication Scheme 856 Registry defined by [I-D.ietf-httpbis-p7-auth]. 858 o Updated references to oauth-v2, httpbis-p1-messaging, and httpbis- 859 p7-auth drafts. 861 o Other wording improvements not introducing normative changes. 863 -08 865 o Updated references to oauth-v2 and HTTPbis drafts. 867 -07 869 o Added missing comma in error response example. 871 -06 873 o Changed parameter name "bearer_token" to "access_token", per 874 working group consensus. 876 o Changed HTTP status code for "invalid_request" error code from 877 HTTP 401 (Unauthorized) back to HTTP 400 (Bad Request), per input 878 from HTTP working group experts. 880 -05 882 o Removed OAuth Errors Registry, per design team input. 884 o Changed HTTP status code for "invalid_request" error code from 885 HTTP 400 (Bad Request) to HTTP 401 (Unauthorized) to match HTTP 886 usage [[ change pending working group consensus ]]. 888 o Added missing quotation marks in error-uri definition. 890 o Added note to add language and encoding information to 891 error_description if the core specification does. 893 o Explicitly reference the Augmented Backus-Naur Form (ABNF) defined 894 in [RFC5234]. 896 o Use auth-param instead of repeating its definition, which is ( 897 token "=" ( token / quoted-string ) ). 899 o Clarify security considerations about including an audience 900 restriction in the token and include a recommendation to issue 901 scoped bearer tokens in the summary of recommendations. 903 -04 904 o Edits responding to working group last call feedback on -03. 905 Specific edits enumerated below. 907 o Added Bearer Token definition in Terminology section. 909 o Changed parameter name "oauth_token" to "bearer_token". 911 o Added realm parameter to "WWW-Authenticate" response to comply 912 with [RFC2617]. 914 o Removed "[ RWS 1#auth-param ]" from "credentials" definition since 915 it did not comply with the ABNF in [I-D.ietf-httpbis-p7-auth]. 917 o Removed restriction that the "bearer_token" (formerly 918 "oauth_token") parameter be the last parameter in the entity-body 919 and the HTTP request URI query. 921 o Do not require WWW-Authenticate Response in a reply to a malformed 922 request, as an HTTP 400 Bad Request response without a WWW- 923 Authenticate header is likely the right response in some cases of 924 malformed requests. 926 o Removed OAuth Parameters registry extension. 928 o Numerous editorial improvements suggested by working group 929 members. 931 -03 933 o Restored the WWW-Authenticate response header functionality 934 deleted from the framework specification in draft 12 based upon 935 the specification text from draft 11. 937 o Augmented the OAuth Parameters registry by adding two additional 938 parameter usage locations: "resource request" and "resource 939 response". 941 o Registered the "oauth_token" OAuth parameter with usage location 942 "resource request". 944 o Registered the "error" OAuth parameter. 946 o Created the OAuth Error registry and registered errors. 948 o Changed the "OAuth2" OAuth access token type name to "Bearer". 950 -02 951 o Incorporated feedback received on draft 01. Most changes were to 952 the security considerations section. No normative changes were 953 made. Specific changes included: 955 o Changed terminology from "token reuse" to "token capture and 956 replay". 958 o Removed sentence "Encrypting the token contents is another 959 alternative" from the security considerations since it was 960 redundant and potentially confusing. 962 o Corrected some references to "resource server" to be 963 "authorization server" in the security considerations. 965 o Generalized security considerations language about obtaining 966 consent of the resource owner. 968 o Broadened scope of security considerations description for 969 recommendation "Don't pass bearer tokens in page URLs". 971 o Removed unused reference to OAuth 1.0. 973 o Updated reference to framework specification and updated David 974 Recordon's e-mail address. 976 o Removed security considerations text on authenticating clients. 978 o Registered the "OAuth2" OAuth access token type and "oauth_token" 979 parameter. 981 -01 983 o First public draft, which incorporates feedback received on -00 984 including enhanced Security Considerations content. This version 985 is intended to accompany OAuth 2.0 draft 11. 987 -00 989 o Initial draft based on preliminary version of OAuth 2.0 draft 11. 991 Authors' Addresses 993 Michael B. Jones 994 Microsoft 996 Email: mbj@microsoft.com 997 URI: http://self-issued.info/ 999 Dick Hardt 1000 independent 1002 Email: dick.hardt@gmail.com 1003 URI: http://dickhardt.org/ 1005 David Recordon 1006 Facebook 1008 Email: dr@fb.com 1009 URI: http://www.davidrecordon.com/