idnits 2.17.1 draft-ietf-oauth-v2-19.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 : ---------------------------------------------------------------------------- -- The draft header indicates that this document obsoletes RFC5849, but the abstract doesn't seem to mention this, which it should. 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 (July 25, 2011) is 4652 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) ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) ** Downref: Normative reference to an Informational RFC: RFC 4949 ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) == Outdated reference: A later version (-23) exists of draft-ietf-oauth-saml2-bearer-03 == Outdated reference: A later version (-23) exists of draft-ietf-oauth-v2-bearer-04 == Outdated reference: A later version (-05) exists of draft-ietf-oauth-v2-http-mac-00 == Outdated reference: A later version (-08) exists of draft-ietf-oauth-v2-threatmodel-00 -- Obsolete informational reference (is this intentional?): RFC 5849 (Obsoleted by RFC 6749) Summary: 7 errors (**), 0 flaws (~~), 6 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group E. Hammer-Lahav, Ed. 3 Internet-Draft Yahoo! 4 Obsoletes: 5849 (if approved) D. Recordon 5 Intended status: Standards Track Facebook 6 Expires: January 26, 2012 D. Hardt 7 Microsoft 8 July 25, 2011 10 The OAuth 2.0 Authorization Protocol 11 draft-ietf-oauth-v2-19 13 Abstract 15 The OAuth 2.0 authorization protocol enables a third-party 16 application to obtain limited access to an HTTP service, either on 17 behalf of a resource owner by orchestrating an approval interaction 18 between the resource owner and the HTTP service, or by allowing the 19 third-party application to obtain access on its own behalf. 21 Status of this Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on January 26, 2012. 38 Copyright Notice 40 Copyright (c) 2011 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 56 1.1. Roles . . . . . . . . . . . . . . . . . . . . . . . . . . 6 57 1.2. Protocol Flow . . . . . . . . . . . . . . . . . . . . . . 6 58 1.3. Access Token . . . . . . . . . . . . . . . . . . . . . . 7 59 1.4. Authorization Grant . . . . . . . . . . . . . . . . . . . 8 60 1.4.1. Authorization Code . . . . . . . . . . . . . . . . . . 8 61 1.4.2. Implicit . . . . . . . . . . . . . . . . . . . . . . . 8 62 1.4.3. Resource Owner Password Credentials . . . . . . . . . 9 63 1.4.4. Client Credentials . . . . . . . . . . . . . . . . . . 9 64 1.4.5. Extensions . . . . . . . . . . . . . . . . . . . . . . 9 65 1.5. Refresh Token . . . . . . . . . . . . . . . . . . . . . . 9 66 1.6. Notational Conventions . . . . . . . . . . . . . . . . . 11 67 2. Client Registration . . . . . . . . . . . . . . . . . . . . . 11 68 2.1. Client Types . . . . . . . . . . . . . . . . . . . . . . 12 69 2.2. Registration Requirements . . . . . . . . . . . . . . . . 13 70 2.3. Client Identifier . . . . . . . . . . . . . . . . . . . . 13 71 2.4. Client Authentication . . . . . . . . . . . . . . . . . . 13 72 2.4.1. Client Password . . . . . . . . . . . . . . . . . . . 14 73 2.4.2. Other Authentication Methods . . . . . . . . . . . . . 15 74 2.5. Unregistered Clients . . . . . . . . . . . . . . . . . . 15 75 3. Protocol Endpoints . . . . . . . . . . . . . . . . . . . . . . 15 76 3.1. Authorization Endpoint . . . . . . . . . . . . . . . . . 15 77 3.1.1. Response Type . . . . . . . . . . . . . . . . . . . . 16 78 3.1.2. Redirection Endpoint . . . . . . . . . . . . . . . . . 16 79 3.2. Token Endpoint . . . . . . . . . . . . . . . . . . . . . 18 80 3.2.1. Client Authentication . . . . . . . . . . . . . . . . 19 81 4. Obtaining Authorization . . . . . . . . . . . . . . . . . . . 19 82 4.1. Authorization Code . . . . . . . . . . . . . . . . . . . 20 83 4.1.1. Authorization Request . . . . . . . . . . . . . . . . 21 84 4.1.2. Authorization Response . . . . . . . . . . . . . . . . 22 85 4.1.3. Access Token Request . . . . . . . . . . . . . . . . . 24 86 4.1.4. Access Token Response . . . . . . . . . . . . . . . . 25 87 4.2. Implicit Grant . . . . . . . . . . . . . . . . . . . . . 26 88 4.2.1. Authorization Request . . . . . . . . . . . . . . . . 28 89 4.2.2. Access Token Response . . . . . . . . . . . . . . . . 29 90 4.3. Resource Owner Password Credentials . . . . . . . . . . . 31 91 4.3.1. Authorization Request and Response . . . . . . . . . . 32 92 4.3.2. Access Token Request . . . . . . . . . . . . . . . . . 33 93 4.3.3. Access Token Response . . . . . . . . . . . . . . . . 34 94 4.4. Client Credentials . . . . . . . . . . . . . . . . . . . 34 95 4.4.1. Authorization Request and Response . . . . . . . . . . 35 96 4.4.2. Access Token Request . . . . . . . . . . . . . . . . . 35 97 4.4.3. Access Token Response . . . . . . . . . . . . . . . . 36 98 4.5. Extensions . . . . . . . . . . . . . . . . . . . . . . . 36 99 5. Issuing an Access Token . . . . . . . . . . . . . . . . . . . 37 100 5.1. Successful Response . . . . . . . . . . . . . . . . . . . 37 101 5.2. Error Response . . . . . . . . . . . . . . . . . . . . . 39 102 6. Refreshing an Access Token . . . . . . . . . . . . . . . . . . 40 103 7. Accessing Protected Resources . . . . . . . . . . . . . . . . 41 104 7.1. Access Token Types . . . . . . . . . . . . . . . . . . . 42 105 8. Extensibility . . . . . . . . . . . . . . . . . . . . . . . . 43 106 8.1. Defining Access Token Types . . . . . . . . . . . . . . . 43 107 8.2. Defining New Endpoint Parameters . . . . . . . . . . . . 43 108 8.3. Defining New Authorization Grant Types . . . . . . . . . 44 109 8.4. Defining New Authorization Endpoint Response Types . . . 44 110 8.5. Defining Additional Error Codes . . . . . . . . . . . . . 44 111 9. Native Applications . . . . . . . . . . . . . . . . . . . . . 45 112 10. Security Considerations . . . . . . . . . . . . . . . . . . . 46 113 10.1. Client Authentication . . . . . . . . . . . . . . . . . . 46 114 10.2. Client Impersonation . . . . . . . . . . . . . . . . . . 47 115 10.3. Access Tokens . . . . . . . . . . . . . . . . . . . . . . 47 116 10.4. Refresh Tokens . . . . . . . . . . . . . . . . . . . . . 48 117 10.5. Authorization Codes . . . . . . . . . . . . . . . . . . . 48 118 10.6. Authorization Code Leakage . . . . . . . . . . . . . . . 49 119 10.7. Resource Owner Password Credentials . . . . . . . . . . . 49 120 10.8. Request Confidentiality . . . . . . . . . . . . . . . . . 50 121 10.9. Endpoints Authenticity . . . . . . . . . . . . . . . . . 50 122 10.10. Credentials Guessing Attacks . . . . . . . . . . . . . . 50 123 10.11. Phishing Attacks . . . . . . . . . . . . . . . . . . . . 50 124 10.12. Cross-Site Request Forgery . . . . . . . . . . . . . . . 51 125 10.13. Clickjacking . . . . . . . . . . . . . . . . . . . . . . 51 126 10.14. Code Injection and Input Validation . . . . . . . . . . . 52 127 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 52 128 11.1. The OAuth Access Token Type Registry . . . . . . . . . . 52 129 11.1.1. Registration Template . . . . . . . . . . . . . . . . 53 130 11.2. The OAuth Parameters Registry . . . . . . . . . . . . . . 53 131 11.2.1. Registration Template . . . . . . . . . . . . . . . . 54 132 11.2.2. Initial Registry Contents . . . . . . . . . . . . . . 54 133 11.3. The OAuth Authorization Endpoint Response Type 134 Registry . . . . . . . . . . . . . . . . . . . . . . . . 56 135 11.3.1. Registration Template . . . . . . . . . . . . . . . . 57 136 11.3.2. Initial Registry Contents . . . . . . . . . . . . . . 57 137 11.4. The OAuth Extensions Error Registry . . . . . . . . . . . 58 138 11.4.1. Registration Template . . . . . . . . . . . . . . . . 58 139 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 59 140 Appendix A. Editor's Notes . . . . . . . . . . . . . . . . . . . 60 141 13. References . . . . . . . . . . . . . . . . . . . . . . . . . . 60 142 13.1. Normative References . . . . . . . . . . . . . . . . . . 60 143 13.2. Informative References . . . . . . . . . . . . . . . . . 61 145 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 62 147 1. Introduction 149 In the traditional client-server authentication model, the client 150 accesses a protected resource on the server by authenticating with 151 the server using the resource owner's credentials. In order to 152 provide third-party applications access to protected resources, the 153 resource owner shares its credentials with the third-party. This 154 creates several problems and limitations: 156 o Third-party applications are required to store the resource 157 owner's credentials for future use, typically a password in clear- 158 text. 159 o Servers are required to support password authentication, despite 160 the security weaknesses created by passwords. 161 o Third-party applications gain overly broad access to the resource 162 owner's protected resources, leaving resource owners without any 163 ability to restrict duration or access to a limited subset of 164 resources. 165 o Resource owners cannot revoke access to an individual third-party 166 without revoking access to all third-parties, and must do so by 167 changing their password. 168 o Compromise of any third-party application results in compromise of 169 the end-user's password and all of the data protected by that 170 password. 172 OAuth addresses these issues by introducing an authorization layer 173 and separating the role of the client from that of the resource 174 owner. In OAuth, the client requests access to resources controlled 175 by the resource owner and hosted by the resource server, and is 176 issued a different set of credentials than those of the resource 177 owner. 179 Instead of using the resource owner's credentials to access protected 180 resources, the client obtains an access token - a string denoting a 181 specific scope, lifetime, and other access attributes. Access tokens 182 are issued to third-party clients by an authorization server with the 183 approval of the resource owner. The client uses the access token to 184 access the protected resources hosted by the resource server. 186 For example, an end-user (resource owner) can grant a printing 187 service (client) access to her protected photos stored at a photo 188 sharing service (resource server), without sharing her username and 189 password with the printing service. Instead, she authenticates 190 directly with a server trusted by the photo sharing service 191 (authorization server) which issues the printing service delegation- 192 specific credentials (access token). 194 This specification is designed for use with HTTP [RFC2616]. The use 195 of OAuth with any transport protocol other than HTTP is undefined. 197 1.1. Roles 199 OAuth includes four roles working together to grant and provide 200 access to protected resources - access restricted resources requiring 201 authentication: 203 resource owner 204 An entity capable of granting access to a protected resource (e.g. 205 end-user). 206 resource server 207 The server hosting the protected resources, capable of accepting 208 and responding to protected resource requests using access tokens. 209 client 210 An application making protected resource requests on behalf of the 211 resource owner and with its authorization. 212 authorization server 213 The server issuing access tokens to the client after successfully 214 authenticating the resource owner and obtaining authorization. 216 The interaction between the authorization server and resource server 217 is beyond the scope of this specification. The authorization server 218 may be the same server as the resource server or a separate entity. 219 A single authorization server may issue access tokens accepted by 220 multiple resource servers. 222 1.2. Protocol Flow 224 +--------+ +---------------+ 225 | |--(A)- Authorization Request ->| Resource | 226 | | | Owner | 227 | |<-(B)-- Authorization Grant ---| | 228 | | +---------------+ 229 | | 230 | | +---------------+ 231 | |--(C)-- Authorization Grant -->| Authorization | 232 | Client | | Server | 233 | |<-(D)----- Access Token -------| | 234 | | +---------------+ 235 | | 236 | | +---------------+ 237 | |--(E)----- Access Token ------>| Resource | 238 | | | Server | 239 | |<-(F)--- Protected Resource ---| | 240 +--------+ +---------------+ 241 Figure 1: Abstract Protocol Flow 243 The abstract flow illustrated in Figure 1 describes the interaction 244 between the four roles and includes the following steps: 246 (A) The client requests authorization from the resource owner. The 247 authorization request can be made directly to the resource owner 248 (as shown), or preferably indirectly via an intermediary such as 249 an authorization server. 250 (B) The client receives an authorization grant which represents the 251 authorization provided by the resource owner. The authorization 252 grant type depends on the method used by the client and 253 supported by the authorization server to obtain it. 254 (C) The client requests an access token by authenticating with the 255 authorization server and presenting the authorization grant. 256 (D) The authorization server authenticates the client and validates 257 the authorization grant, and if valid issues an access token. 258 (E) The client requests the protected resource from the resource 259 server and authenticates by presenting the access token. 260 (F) The resource server validates the access token, and if valid, 261 serves the request. 263 1.3. Access Token 265 Access tokens are credentials used to access protected resources. An 266 access token is a string representing an authorization issued to the 267 client. The string is usually opaque to the client. Tokens 268 represent specific scopes and durations of access, granted by the 269 resource owner, and enforced by the resource server and authorization 270 server. 272 The token may denote an identifier used to retrieve the authorization 273 information, or self-contain the authorization information in a 274 verifiable manner (i.e. a token string consisting of some data and a 275 signature). Additional authentication credentials, which are beyond 276 the scope of this specification, may be required in order for the 277 client to use a token. 279 The access token provides an abstraction layer, replacing different 280 authorization constructs (e.g. username and password) with a single 281 token understood by the resource server. This abstraction enables 282 issuing access tokens more restrictive than the authorization grant 283 used to obtain them, as well as removing the resource server's need 284 to understand a wide range of authentication methods. 286 Access tokens can have different formats, structures, and methods of 287 utilization (e.g. cryptographic properties) based on the resource 288 server security requirements. Access token attributes and the 289 methods used to access protected resources are beyond the scope of 290 this specification and are defined by companion specifications. 292 1.4. Authorization Grant 294 An authorization grant is a general term used to describe the 295 intermediate credentials representing the resource owner 296 authorization (to access its protected resources), and serves as an 297 abstraction layer. An authorization grant is used by the client to 298 obtain an access token. 300 This specification defines four grant types: authorization code, 301 implicit, resource owner password credentials, and client 302 credentials, as well as an extensibility mechanism for defining 303 additional types. 305 1.4.1. Authorization Code 307 The authorization code is obtained by using an authorization server 308 as an intermediary between the client and resource owner. Instead of 309 requesting authorization directly from the resource owner, the client 310 directs the resource owner to an authorization server (via its user- 311 agent as defined in [RFC2616]), which in turn directs the resource 312 owner back to the client with the authorization code. 314 Before directing the resource owner back to the client with the 315 authorization code, the authorization server authenticates the 316 resource owner and obtains authorization. Because the resource owner 317 only authenticates with the authorization server, the resource 318 owner's credentials are never shared with the client. 320 The authorization code provides a few important security benefits 321 such as the ability to authenticate the client and issuing the access 322 token directly to the client without potentially exposing it to 323 others, including the resource owner. 325 1.4.2. Implicit 327 The authorization grant is implicit when an access token is issued to 328 the client directly as the result of the resource owner 329 authorization, without using intermediate credentials (such as an 330 authorization code). 332 When issuing an implicit grant, the authorization server does not 333 authenticate the client and the client identity is verified via the 334 redirection URI used to deliver the access token to the client. The 335 access token may be exposed to the resource owner or other 336 applications with access to the resource owner's user-agent. 338 Implicit grants improve the responsiveness and efficiency of some 339 clients (such as a client implemented as an in-browser application) 340 since it reduces the number of round trips required to obtain an 341 access token. However, this convenience should be weighted against 342 the security implications of using implicit grants, especially when 343 the authorization code grant type is available. 345 1.4.3. Resource Owner Password Credentials 347 The resource owner password credentials (e.g. a username and 348 password) can be used directly as an authorization grant to obtain an 349 access token. The credentials should only be used when there is a 350 high degree of trust between the resource owner and the client (e.g. 351 its device operating system or a highly privileged application), and 352 when other authorization grant types are not available (such as an 353 authorization code). 355 Even though this grant type requires direct client access to the 356 resource owner credentials, the resource owner credentials are used 357 for a single request and are exchanged for an access token. Unlike 358 the HTTP Basic authentication scheme defined in [RFC2617], this grant 359 type (when combined with a refresh token) eliminates the need for the 360 client to store the resource owner credentials for future use. 362 1.4.4. Client Credentials 364 The client credentials (or other forms of client authentication) can 365 be used as an authorization grant when the authorization scope is 366 limited to the protected resources under the control of the client, 367 or to protected resources previously arranged with the authorization 368 server. Client credentials are used as an authorization grant 369 typically when the client is acting on its own behalf (the client is 370 also the resource owner). 372 1.4.5. Extensions 374 Additional grant types may be defined to provide a bridge between 375 OAuth and other protocols. 377 1.5. Refresh Token 379 Refresh tokens are credentials used to obtain access tokens. Refresh 380 tokens are issued to the client by the authorization server and are 381 used to obtain a new access token when the current access token 382 becomes invalid or expires, or to obtain additional access tokens 383 with identical or narrower scope (access tokens may have a shorter 384 lifetime and fewer permissions than authorized by the resource 385 owner). Issuing a refresh token is optional and is included when 386 issuing an access token. 388 A refresh token is a string representing the authorization granted to 389 the client by the resource owner. The string is usually opaque to 390 the client. The token denotes an identifier used to retrieve the 391 authorization information. Unlike access tokens, refresh tokens are 392 intended for use only with authorization servers and are never sent 393 to resource servers. 395 +--------+ +---------------+ 396 | |--(A)------- Authorization Grant --------->| | 397 | | | | 398 | |<-(B)----------- Access Token -------------| | 399 | | & Refresh Token | | 400 | | | | 401 | | +----------+ | | 402 | |--(C)---- Access Token ---->| | | | 403 | | | | | | 404 | |<-(D)- Protected Resource --| Resource | | Authorization | 405 | Client | | Server | | Server | 406 | |--(E)---- Access Token ---->| | | | 407 | | | | | | 408 | |<-(F)- Invalid Token Error -| | | | 409 | | +----------+ | | 410 | | | | 411 | |--(G)----------- Refresh Token ----------->| | 412 | | | | 413 | |<-(H)----------- Access Token -------------| | 414 +--------+ & Optional Refresh Token +---------------+ 416 Figure 2: Refreshing an Expired Access Token 418 The flow illustrated in Figure 2 includes the following steps: 420 (A) The client requests an access token by authenticating with the 421 authorization server, and presenting an authorization grant. 422 (B) The authorization server authenticates the client and validates 423 the authorization grant, and if valid issues an access token and 424 a refresh token. 425 (C) The client makes a protected resource requests to the resource 426 server by presenting the access token. 427 (D) The resource server validates the access token, and if valid, 428 serves the request. 430 (E) Steps (C) and (D) repeat until the access token expires. If the 431 client knows the access token expired, it skips to step (G), 432 otherwise it makes another protected resource request. 433 (F) Since the access token is invalid, the resource server returns 434 an invalid token error. 435 (G) The client requests a new access token by authenticating with 436 the authorization server and presenting the refresh token. 437 (H) The authorization server authenticates the client and validates 438 the refresh token, and if valid issues a new access token (and 439 optionally, a new refresh token). 441 1.6. Notational Conventions 443 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 444 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this 445 specification are to be interpreted as described in [RFC2119]. 447 This specification uses the Augmented Backus-Naur Form (ABNF) 448 notation of [RFC5234]. 450 Certain security-related terms are to be understood in the sense 451 defined in [RFC4949]. These terms include, but are not limited to, 452 'attack', 'authentication', 'authorization', 'certificate', 453 'confidentiality', 'credential', 'encryption', 'identity', 'sign', 454 'signature', 'trust', 'validate', and 'verify'. 456 Unless otherwise noted, all the protocol parameter names and values 457 are case sensitive. 459 2. Client Registration 461 Before initiating the protocol, the client registers with the 462 authorization server. The means through which the client registers 463 with the authorization server are beyond the scope of this 464 specification, but typically involve end-user interaction with an 465 HTML registration form. 467 Client registration does not require a direct interaction between the 468 client and the authorization server. When supported by the 469 authorization server, registration can rely on other means for 470 establishing trust and obtaining the required client properties (e.g. 471 redirection URI, client type). For example, registration can be 472 accomplished using a self-issued or third-party-issued assertion, or 473 by the authorization server performing client discovery using a 474 trusted channel. 476 2.1. Client Types 478 OAuth defines two client types, based on their ability to 479 authenticate securely with the authorization server (i.e. ability to 480 maintain the confidentiality of their client credentials): 482 private 483 Clients capable of maintaining the confidentiality of their 484 credentials (e.g. client implemented on a secure server with 485 restricted access to the client credentials), or capable of secure 486 client authentication using other means. 487 public 488 Clients incapable of maintaining the confidentiality of their 489 credentials (e.g. clients executing on the resource owner's device 490 such as an installed native application or a user-agent-based 491 application), and incapable of secure client authentication via 492 any other mean. 494 The client type designation is based on the authorization server's 495 definition of secure authentication and its acceptable exposure 496 levels of client credentials. 498 This specification has been designed around the following client 499 profiles: 501 web application 502 A web application is a private client running on a web server. 503 Resource owners access the client via an HTML user interface 504 rendered in a user-agent on the resource owner's device. The 505 client credentials as well as any access token issued to the 506 client are stored on the web server and are not exposed to or 507 accessible by the resource owner. 508 user-agent-based application 509 A user-agent-based application is a public client in which the 510 client code is downloaded from a web server and executes within a 511 user-agent on the resource owner's device. Protocol data and 512 credentials are easily accessible (and often visible) to the 513 resource owner. Since such applications reside within the user- 514 agent, they can make seamless use of the user-agent capabilities 515 when requesting authorization. 516 native application 517 A native application is a public client installed and executed on 518 the resource owner's device. Protocol data and credentials are 519 accessible to the resource owner. It is assumed that any client 520 authentication credentials included in the application can be 521 extracted. On the other hand, dynamically issued credentials such 522 access tokens or refresh tokens, can receive an acceptable level 523 of protection. At a minimum, these credentials are protected from 524 hostile servers which the application may interact with. On some 525 platform these credentials might be protected from other 526 applications residing on the same device. 528 2.2. Registration Requirements 530 When registering a client, the client developer: 532 o specifies the client type as described in Section 2.1, 533 o provides its client redirection URIs as described in 534 Section 3.1.2, and 535 o includes any other information required by the authorization 536 server (e.g. application name, website, description, logo image, 537 the acceptance of legal terms). 539 2.3. Client Identifier 541 The authorization server issues the registered client a client 542 identifier - a unique string representing the registration 543 information provided by the client. The client identifier is not a 544 secret, it is exposed to the resource owner, and cannot be used alone 545 for client authentication. 547 2.4. Client Authentication 549 If the client type is private, the client and authorization server 550 establish a client authentication method suitable for the security 551 requirements of the authorization server. The authorization server 552 MAY accept any form of client authentication meeting its security 553 requirements. 555 Private clients are typically issued (or establish) a set of client 556 credentials used for authenticating with the authorization server 557 (e.g. password, public/private key pair). 559 The authorization server SHOULD NOT make assumptions about the client 560 type or accept the type information provided without establishing 561 trust with the client or its developer. The authorization server MAY 562 establish a client authentication method with public clients. 563 However, the authorization server MUST NOT rely on public client 564 authentication for the purpose of identifying the client. 566 The client MUST NOT use more than one authentication method in each 567 request. 569 2.4.1. Client Password 571 Clients in possession of a client password MAY use the HTTP Basic 572 authentication scheme as defined in [RFC2617] to authenticate with 573 the authorization server. The client identifier is used as the 574 username, and the client password is used as the password. 576 For example (extra line breaks are for display purposes only): 578 Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW 580 Alternatively, the authorization server MAY allow including the 581 client credentials in the request body using the following 582 parameters: 584 client_id 585 REQUIRED. The client identifier issued to the client during 586 the registration process described by Section 2.3. 587 client_secret 588 REQUIRED. The client secret. 590 Including the client credentials in the request body using the two 591 parameters is NOT RECOMMENDED, and should be limited to clients 592 unable to directly utilize the HTTP Basic authentication scheme (or 593 other password-based HTTP authentication schemes). 595 For example, requesting to refresh an access token (Section 6) using 596 the body parameters (extra line breaks are for display purposes 597 only): 599 POST /token HTTP/1.1 600 Host: server.example.com 601 Content-Type: application/x-www-form-urlencoded;charset=UTF-8 603 grant_type=refresh_token&refresh_token=tGzv3JOkF0XG5Qx2TlKWIA 604 &client_id=s6BhdRkqt3&client_secret=7Fjfp0ZBr1KtDRbnfVdmIw 606 The authorization server MUST require the use of a transport-layer 607 security mechanism when sending requests to the token endpoint, as 608 requests using this authentication method result in the transmission 609 of clear-text credentials. 611 2.4.2. Other Authentication Methods 613 The authorization server MAY support any suitable HTTP authentication 614 scheme matching its security requirements. When using other 615 authentication methods, the authorization server MUST define a 616 mapping between the client identifier (registration record) and 617 authentication scheme. 619 2.5. Unregistered Clients 621 This specification does not exclude the use of unregistered clients. 622 However, the use with such clients is beyond the scope of this 623 specification, and requires additional security analysis and review 624 of its interoperability impact. 626 3. Protocol Endpoints 628 The authorization process utilizes two endpoints (HTTP resources): 630 o Authorization endpoint - used to obtain authorization from the 631 resource owner via user-agent redirection. 632 o Token endpoint - used to exchange an authorization grant for an 633 access token, typically with client authentication. 635 Not every authorization grant type utilizes both endpoints. 636 Extension grant types MAY define additional endpoints as needed. 638 3.1. Authorization Endpoint 640 The authorization endpoint is used to interact with the resource 641 owner and obtain authorization which is expressed explicitly as an 642 authorization code (later exchanged for an access token), or 643 implicitly by direct issuance of an access token. 645 The authorization server MUST first verify the identity of the 646 resource owner. The way in which the authorization server 647 authenticates the resource owner (e.g. username and password login, 648 session cookies) is beyond the scope of this specification. 650 The means through which the client obtains the location of the 651 authorization endpoint are beyond the scope of this specification but 652 the location is typically provided in the service documentation. The 653 endpoint URI MAY include a query component as defined by [RFC3986] 654 section 3, which MUST be retained when adding additional query 655 parameters. The endpoint URI MUST NOT include a fragment component. 657 Since requests to the authorization endpoint result in user 658 authentication and the transmission of clear-text credentials (in the 659 HTTP response), the authorization server MUST require the use of a 660 transport-layer security mechanism when sending requests to the 661 authorization endpoint. The authorization server MUST support TLS 662 1.2 as defined in [RFC5246], and MAY support additional transport- 663 layer mechanisms meeting its security requirements. 665 The authorization server MUST support the use of the HTTP "GET" 666 method [RFC2616] for the authorization endpoint, and MAY support the 667 use of the "POST" method as well. 669 Parameters sent without a value MUST be treated as if they were 670 omitted from the request. The authorization server SHOULD ignore 671 unrecognized request parameters. Request and response parameters 672 MUST NOT be included more than once. 674 3.1.1. Response Type 676 The authorization endpoint is used by the authorization code grant 677 type and implicit grant type flows. The client informs the 678 authorization server of the desired grant type using the following 679 parameter: 681 response_type 682 REQUIRED. The value MUST be one of "code" for requesting an 683 authorization code as described by Section 4.1.1, "token" for 684 requesting an access token (implicit grant) as described by 685 Section 4.2.1, or a registered extension value as described by 686 Section 8.4. If the response type contains one or more space 687 characters (%x20), it is interpreted as a space-delimited list 688 of values, where the order of values does not matter (e.g. "a 689 b" is the same as "b a"). 691 If an authorization request is missing the "response_type" parameter, 692 the authorization server SHOULD return an error response as described 693 in Section 4.1.2.1. 695 3.1.2. Redirection Endpoint 697 After completing its interaction with the resource owner, the 698 authorization server directs the resource owner's user-agent back to 699 the client. The authorization server redirects the user-agent to the 700 client's redirection endpoint previously established with the 701 authorization server during the client registration process or when 702 initiating the authorization request. 704 The redirection endpoint URI MUST be an absolute URI as defined by 705 [RFC3986] section 4.3, MAY include a query component which MUST be 706 retained by the authorization server when adding additional query 707 parameters, and MUST NOT include a fragment component. 709 3.1.2.1. Endpoint Confidentiality 711 If a redirection request will result in the transmission of an 712 authorization code or access token over an open network (between the 713 resource owner's user-agent and the client), the client SHOULD 714 require the use of a transport-layer security mechanism. 716 Lack of transport-layer security can have a severe impact on the 717 security of the client and the protected resources it is authorized 718 to access. The use of transport-layer security is particularly 719 critical when the authorization process is used as a form of 720 delegated end-user authentication by the client (e.g. third-party 721 sign-in service). 723 3.1.2.2. Registration Requirements 725 The authorization server MUST require public clients to register 726 their redirection URI, MUST require all clients to register their 727 redirection URI prior to utilizing the implicit grant type, and 728 SHOULD require all clients to register their redirection URI prior to 729 utilizing the authorization code grant type. 731 The authorization server SHOULD require the client to provide the 732 complete redirection URI (the client MAY use the "state" request 733 parameter to achieve per-request customization). The authorization 734 server MAY allow the client to register multiple redirection URIs. 735 If requiring the registration of the complete redirection URI is not 736 possible, the authorization server SHOULD require the registration of 737 the URI scheme, authority, and path. 739 3.1.2.3. Dynamic Configuration 741 If multiple redirection URIs have been registered, if only part of 742 the redirection URI has been registered, or if no redirection URI has 743 been registered, the client MUST include a redirection URI with the 744 authorization request using the "redirect_uri" request parameter. 746 When a redirection URI is included in an authorization request, the 747 authorization server MUST compare and match the value received 748 against at least one of the registered redirection URIs (or URI 749 components) as defined in [RFC3986] section 6, if any redirection 750 URIs were registered. 752 If the authorization server allows the client to dynamically change 753 the query component of the redirection URI, the client MUST ensure 754 that manipulation of the query component by an attacker cannot lead 755 to an abuse of the redirection endpoint as an open redirector. 757 3.1.2.4. Invalid Endpoint 759 If an authorization request fails validation due to a missing, 760 invalid, or mismatching redirection URI, the authorization server 761 SHOULD inform the resource owner of the error, and MUST NOT 762 automatically redirect the user-agent to the invalid redirection URI. 764 The authorization server SHOULD NOT redirect the user-agent to 765 unregistered or untrusted URIs to prevent the authorization endpoint 766 from being used as an open redirector. 768 3.1.2.5. Endpoint Content 770 The redirection request to the client's endpoint typically results in 771 an HTML document response, processed by the user-agent. If the HTML 772 response is served directly as the result of the redirection request, 773 any script included in the HTML document will execute with full 774 access to the redirection URI and the credentials it contains. 776 The client SHOULD NOT include any third-party scripts in the 777 redirection endpoint response. Instead, it should extract the 778 credentials from the URI and redirect the user-agent again to another 779 endpoint without the credentials in the URI. 781 The client MUST NOT include any untrusted third-party scripts in the 782 redirection endpoint response (e.g. third-party analytics, social 783 plug-ins, ad networks) without first ensuring that its own scripts 784 used to extract and remove the credentials from the URI will execute 785 first. 787 3.2. Token Endpoint 789 The token endpoint is used by the client to obtain an access token by 790 presenting its authorization grant or refresh token. The token 791 endpoint is used with every authorization grant except for the 792 implicit grant type (since an access token is issued directly). 794 The means through which the client obtains the location of the token 795 endpoint are beyond the scope of this specification but is typically 796 provided in the service documentation. The endpoint URI MAY include 797 a query component, which MUST be retained when adding additional 798 query parameters. 800 Since requests to the token endpoint result in the transmission of 801 clear-text credentials (in the HTTP request and response), the 802 authorization server MUST require the use of a transport-layer 803 security mechanism when sending requests to the token endpoint. The 804 authorization server MUST support TLS 1.2 as defined in [RFC5246], 805 and MAY support additional transport-layer mechanisms meeting its 806 security requirements. 808 The client MUST use the HTTP "POST" method when making access token 809 requests. 811 Parameters sent without a value MUST be treated as if they were 812 omitted from the request. The authorization server SHOULD ignore 813 unrecognized request parameters. Request and response parameters 814 MUST NOT be included more than once. 816 3.2.1. Client Authentication 818 Private clients, clients issued client credentials, or clients 819 assigned other authentication requirements, MUST authenticate with 820 the authorization server as described in Section 2.4 when making 821 requests to the token endpoint. Client authentication is used for: 823 o Enforcing the binding of refresh tokens and authorization codes to 824 the client they are issued. Client authentication is critical 825 when an authorization code is transmitted to the redirection 826 endpoint over an insecure channel, or when the redirection URI has 827 not been registered in full. 828 o Recovery from a compromised client by disabling the client or 829 changing its credentials, by preventing an attacker from abusing 830 stolen refresh tokens. Changing a single set of client 831 credentials is significantly faster than revoking an entire set of 832 refresh tokens. 833 o Implementing authentication management best practices which 834 require periodic credentials rotation. Rotation of an entire set 835 of refresh tokens can be challenging, while rotation of a single 836 set of client credentials is significantly easier. 838 The security ramifications of allowing unauthenticated access by 839 public clients to the token endpoint MUST be considered, as well as 840 the issuance of refresh tokens to public clients, their scope, and 841 lifetime. 843 4. Obtaining Authorization 845 To request an access token, the client obtains authorization from the 846 resource owner. The authorization is expressed in the form of an 847 authorization grant which the client uses to request the access 848 token. OAuth defines four grant types: authorization code, implicit, 849 resource owner password credentials, and client credentials. It also 850 provides an extension mechanism for defining additional grant types. 852 4.1. Authorization Code 854 The authorization code grant type is used to obtain both access 855 tokens and refresh tokens and is optimized for private clients. As a 856 redirection-based flow, the client must be capable of interacting 857 with the resource owner's user-agent (typically a web browser) and 858 capable of receiving incoming requests (via redirection) from the 859 authorization server. 861 +----------+ 862 | resource | 863 | owner | 864 | | 865 +----------+ 866 ^ 867 | 868 (B) 869 +----|-----+ Client Identifier +---------------+ 870 | -+----(A)-- & Redirection URI ---->| | 871 | User- | | Authorization | 872 | Agent -+----(B)-- User authenticates --->| Server | 873 | | | | 874 | -+----(C)-- Authorization Code ---<| | 875 +-|----|---+ +---------------+ 876 | | ^ v 877 (A) (C) | | 878 | | | | 879 ^ v | | 880 +---------+ | | 881 | |>---(D)-- Authorization Code ---------' | 882 | Client | & Redirection URI | 883 | | | 884 | |<---(E)----- Access Token -------------------' 885 +---------+ (w/ Optional Refresh Token) 887 Figure 3: Authorization Code Flow 889 The flow illustrated in Figure 3 includes the following steps: 891 (A) The client initiates the flow by directing the resource owner's 892 user-agent to the authorization endpoint. The client includes 893 its client identifier, requested scope, local state, and a 894 redirection URI to which the authorization server will send the 895 user-agent back once access is granted (or denied). 896 (B) The authorization server authenticates the resource owner (via 897 the user-agent) and establishes whether the resource owner 898 grants or denies the client's access request. 899 (C) Assuming the resource owner grants access, the authorization 900 server redirects the user-agent back to the client using the 901 redirection URI provided earlier. The redirection URI includes 902 an authorization code and any local state provided by the client 903 earlier. 904 (D) The client requests an access token from the authorization 905 server's token endpoint by including the authorization code 906 received in the previous step. When making the request, the 907 client authenticates with the authorization server. The client 908 includes the redirection URI used to obtain the authorization 909 code for verification. 910 (E) The authorization server authenticates the client, validates the 911 authorization code, and ensures the redirection URI received 912 matches the URI used to redirect the client in step (C). If 913 valid, responds back with an access token. 915 4.1.1. Authorization Request 917 The client constructs the request URI by adding the following 918 parameters to the query component of the authorization endpoint URI 919 using the "application/x-www-form-urlencoded" format as defined by 920 [W3C.REC-html401-19991224]: 922 response_type 923 REQUIRED. Value MUST be set to "code". 924 client_id 925 REQUIRED. The client identifier as described in Section 2.3. 926 redirect_uri 927 OPTIONAL, as described in Section 3.1.2. 928 scope 929 OPTIONAL. The scope of the access request expressed as a list 930 of space-delimited, case sensitive strings. The value is 931 defined by the authorization server. If the value contains 932 multiple space-delimited strings, their order does not matter, 933 and each string adds an additional access range to the 934 requested scope. 936 state 937 OPTIONAL. An opaque value used by the client to maintain state 938 between the request and callback. The authorization server 939 includes this value when redirecting the user-agent back to the 940 client. 942 The client directs the resource owner to the constructed URI using an 943 HTTP redirection response, or by other means available to it via the 944 user-agent. 946 For example, the client directs the user-agent to make the following 947 HTTP request using transport-layer security (extra line breaks are 948 for display purposes only): 950 GET /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz 951 &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 952 Host: server.example.com 954 The authorization server validates the request to ensure all required 955 parameters are present and valid. If the request is valid, the 956 authorization server authenticates the resource owner and obtains an 957 authorization decision (by asking the resource owner or by 958 establishing approval via other means). 960 When a decision is established, the authorization server directs the 961 user-agent to the provided client redirection URI using an HTTP 962 redirection response, or by other means available to it via the user- 963 agent. 965 4.1.2. Authorization Response 967 If the resource owner grants the access request, the authorization 968 server issues an authorization code and delivers it to the client by 969 adding the following parameters to the query component of the 970 redirection URI using the "application/x-www-form-urlencoded" format: 972 code 973 REQUIRED. The authorization code generated by the 974 authorization server. The authorization code MUST expire 975 shortly after it is issued to mitigate the risk of leaks. A 976 maximum authorization code lifetime of 10 minutes is 977 RECOMMENDED. The client MUST NOT reuse the authorization code. 978 If an authorization code is used more than once, the 979 authorization server SHOULD attempt to revoke all tokens 980 previously issued based on that authorization code. The 981 authorization code is bound to the client identifier and 982 redirection URI. 983 state 984 REQUIRED if the "state" parameter was present in the client 985 authorization request. Set to the exact value received from 986 the client. 988 For example, the authorization server redirects the user-agent by 989 sending the following HTTP response: 991 HTTP/1.1 302 Found 992 Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA 993 &state=xyz 995 The client SHOULD ignore unrecognized response parameters. The 996 authorization code string size is left undefined by this 997 specification. The client should avoid making assumptions about code 998 value sizes. The authorization server should document the size of 999 any value it issues. 1001 4.1.2.1. Error Response 1003 If the request fails due to a missing, invalid, or mismatching 1004 redirection URI, or if the client identifier provided is invalid, the 1005 authorization server SHOULD inform the resource owner of the error, 1006 and MUST NOT automatically redirect the user-agent to the invalid 1007 redirection URI. 1009 If the resource owner denies the access request or if the request 1010 fails for reasons other than a missing or invalid redirection URI, 1011 the authorization server informs the client by adding the following 1012 parameters to the query component of the redirection URI using the 1013 "application/x-www-form-urlencoded" format: 1015 error 1016 REQUIRED. A single error code from the following: 1017 invalid_request 1018 The request is missing a required parameter, includes an 1019 unsupported parameter or parameter value, or is otherwise 1020 malformed. 1021 unauthorized_client 1022 The client is not authorized to request an authorization 1023 code using this method. 1025 access_denied 1026 The resource owner or authorization server denied the 1027 request. 1028 unsupported_response_type 1029 The authorization server does not support obtaining an 1030 authorization code using this method. 1031 invalid_scope 1032 The requested scope is invalid, unknown, or malformed. 1033 server_error 1034 The authorization server encountered an unexpected 1035 condition which prevented it from fulfilling the request. 1036 temporarily_unavailable 1037 The authorization server is currently unable to handle 1038 the request due to a temporary overloading or maintenance 1039 of the server. 1040 error_description 1041 OPTIONAL. A human-readable UTF-8 encoded text providing 1042 additional information, used to assist the client developer in 1043 understanding the error that occurred. 1044 error_uri 1045 OPTIONAL. A URI identifying a human-readable web page with 1046 information about the error, used to provide the client 1047 developer with additional information about the error. 1048 state 1049 REQUIRED if a valid "state" parameter was present in the client 1050 authorization request. Set to the exact value received from 1051 the client. 1053 For example, the authorization server redirects the user-agent by 1054 sending the following HTTP response: 1056 HTTP/1.1 302 Found 1057 Location: https://client.example.com/cb?error=access_denied&state=xyz 1059 4.1.3. Access Token Request 1061 The client makes a request to the token endpoint by adding the 1062 following parameters using the "application/x-www-form-urlencoded" 1063 format in the HTTP request entity-body: 1065 grant_type 1066 REQUIRED. Value MUST be set to "authorization_code". 1068 code 1069 REQUIRED. The authorization code received from the 1070 authorization server. 1071 redirect_uri 1072 REQUIRED, if the "redirect_uri" parameter was included in the 1073 authorization request described in Section 4.1.1, and their 1074 values MUST be identical. 1076 If the client type is private or was issued client credentials (or 1077 assigned other authentication requirements), the client MUST 1078 authenticate with the authorization server as described in 1079 Section 3.2.1. 1081 For example, the client makes the following HTTP using transport- 1082 layer security (extra line breaks are for display purposes only): 1084 POST /token HTTP/1.1 1085 Host: server.example.com 1086 Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW 1087 Content-Type: application/x-www-form-urlencoded;charset=UTF-8 1089 grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA 1090 &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb 1092 The authorization server MUST: 1094 o require client authentication for private clients or for any 1095 client issued client credentials (or with other authentication 1096 requirements), 1097 o authenticate the client if client authentication is included and 1098 ensure the authorization code was issued to the authenticated 1099 client, 1100 o verify that the authorization code is valid, and 1101 o ensure that the "redirect_uri" parameter is present if the 1102 "redirect_uri" parameter was included in the initial authorization 1103 request described in Section 4.1.1, and that their values are 1104 identical. 1106 4.1.4. Access Token Response 1108 If the access token request is valid and authorized, the 1109 authorization server issues an access token and optional refresh 1110 token as described in Section 5.1. If the request client 1111 authentication failed or is invalid, the authorization server returns 1112 an error response as described in Section 5.2. 1114 An example successful response: 1116 HTTP/1.1 200 OK 1117 Content-Type: application/json;charset=UTF-8 1118 Cache-Control: no-store 1119 Pragma: no-cache 1121 { 1122 "access_token":"2YotnFZFEjr1zCsicMWpAA", 1123 "token_type":"example", 1124 "expires_in":3600, 1125 "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", 1126 "example_parameter":"example_value" 1127 } 1129 4.2. Implicit Grant 1131 The implicit grant type is used to obtain access tokens (it does not 1132 support the issuance of refresh tokens) and is optimized for public 1133 clients known to operate a particular redirection URI. These clients 1134 are typically implemented in a browser using a scripting language 1135 such as JavaScript. 1137 As a redirection-based flow, the client must be capable of 1138 interacting with the resource owner's user-agent (typically a web 1139 browser) and capable of receiving incoming requests (via redirection) 1140 from the authorization server. 1142 Unlike the authorization code grant type in which the client makes 1143 separate requests for authorization and access token, the client 1144 receives the access token as the result of the authorization request. 1146 The implicit grant type does not include client authentication, and 1147 relies on the presence of the resource owner and the registration of 1148 the redirection URI. Because the access token is encoded into the 1149 redirection URI, it may be exposed to the resource owner and other 1150 applications residing on its device. 1152 +----------+ 1153 | Resource | 1154 | Owner | 1155 | | 1156 +----------+ 1157 ^ 1158 | 1159 (B) 1160 +----|-----+ Client Identifier +---------------+ 1161 | -+----(A)-- & Redirection URI --->| | 1162 | User- | | Authorization | 1163 | Agent -|----(B)-- User authenticates -->| Server | 1164 | | | | 1165 | |<---(C)--- Redirection URI ----<| | 1166 | | with Access Token +---------------+ 1167 | | in Fragment 1168 | | +---------------+ 1169 | |----(D)--- Redirection URI ---->| Web-Hosted | 1170 | | without Fragment | Client | 1171 | | | Resource | 1172 | (F) |<---(E)------- Script ---------<| | 1173 | | +---------------+ 1174 +-|--------+ 1175 | | 1176 (A) (G) Access Token 1177 | | 1178 ^ v 1179 +---------+ 1180 | | 1181 | Client | 1182 | | 1183 +---------+ 1185 Figure 4: Implicit Grant Flow 1187 The flow illustrated in Figure 4 includes the following steps: 1189 (A) The client initiates the flow by directing the resource owner's 1190 user-agent to the authorization endpoint. The client includes 1191 its client identifier, requested scope, local state, and a 1192 redirection URI to which the authorization server will send the 1193 user-agent back once access is granted (or denied). 1194 (B) The authorization server authenticates the resource owner (via 1195 the user-agent) and establishes whether the resource owner 1196 grants or denies the client's access request. 1198 (C) Assuming the resource owner grants access, the authorization 1199 server redirects the user-agent back to the client using the 1200 redirection URI provided earlier. The redirection URI includes 1201 the access token in the URI fragment. 1202 (D) The user-agent follows the redirection instructions by making a 1203 request to the web-hosted client resource (which does not 1204 include the fragment). The user-agent retains the fragment 1205 information locally. 1206 (E) The web-hosted client resource returns a web page (typically an 1207 HTML document with an embedded script) capable of accessing the 1208 full redirection URI including the fragment retained by the 1209 user-agent, and extracting the access token (and other 1210 parameters) contained in the fragment. 1211 (F) The user-agent executes the script provided by the web-hosted 1212 client resource locally, which extracts the access token and 1213 passes it to the client. 1215 4.2.1. Authorization Request 1217 The client constructs the request URI by adding the following 1218 parameters to the query component of the authorization endpoint URI 1219 using the "application/x-www-form-urlencoded" format: 1221 response_type 1222 REQUIRED. Value MUST be set to "token". 1223 client_id 1224 REQUIRED. The client identifier as described in Section 2.3. 1225 redirect_uri 1226 OPTIONAL, as described in Section 3.1.2. 1227 scope 1228 OPTIONAL. The scope of the access request expressed as a list 1229 of space-delimited, case sensitive strings. The value is 1230 defined by the authorization server. If the value contains 1231 multiple space-delimited strings, their order does not matter, 1232 and each string adds an additional access range to the 1233 requested scope. 1234 state 1235 OPTIONAL. An opaque value used by the client to maintain state 1236 between the request and callback. The authorization server 1237 includes this value when redirecting the user-agent back to the 1238 client. 1240 The client directs the resource owner to the constructed URI using an 1241 HTTP redirection response, or by other means available to it via the 1242 user-agent. 1244 For example, the client directs the user-agent to make the following 1245 HTTP request using transport-layer security (extra line breaks are 1246 for display purposes only): 1248 GET /authorize?response_type=token&client_id=s6BhdRkqt3&state=xyz 1249 &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 1250 Host: server.example.com 1252 The authorization server validates the request to ensure all required 1253 parameters are present and valid. The authorization server MUST 1254 verify that the redirection URI to which it will redirect the access 1255 token matches a redirection URI registered by the client as described 1256 in Section 3.1.2. 1258 If the request is valid, the authorization server authenticates the 1259 resource owner and obtains an authorization decision (by asking the 1260 resource owner or by establishing approval via other means). 1262 When a decision is established, the authorization server directs the 1263 user-agent to the provided client redirection URI using an HTTP 1264 redirection response, or by other means available to it via the user- 1265 agent. 1267 4.2.2. Access Token Response 1269 If the resource owner grants the access request, the authorization 1270 server issues an access token and delivers it to the client by adding 1271 the following parameters to the fragment component of the redirection 1272 URI using the "application/x-www-form-urlencoded" format: 1274 access_token 1275 REQUIRED. The access token issued by the authorization server. 1276 token_type 1277 REQUIRED. The type of the token issued as described in 1278 Section 7.1. Value is case insensitive. 1279 expires_in 1280 OPTIONAL. The lifetime in seconds of the access token. For 1281 example, the value "3600" denotes that the access token will 1282 expire in one hour from the time the response was generated. 1283 scope 1284 OPTIONAL. The scope of the access token expressed as a list of 1285 space-delimited, case sensitive strings. The value is defined 1286 by the authorization server. If the value contains multiple 1287 space-delimited strings, their order does not matter, and each 1288 string adds an additional access range to the requested scope. 1289 The authorization server SHOULD include the parameter if the 1290 access token scope is different from the one requested by the 1291 client. 1292 state 1293 REQUIRED if the "state" parameter was present in the client 1294 authorization request. Set to the exact value received from 1295 the client. 1297 For example, the authorization server redirects the user-agent by 1298 sending the following HTTP response (URI extra line breaks are for 1299 display purposes only): 1301 HTTP/1.1 302 Found 1302 Location: http://example.com/rd#access_token=2YotnFZFEjr1zCsicMWpAA 1303 &state=xyz&token_type=example&expires_in=3600 1305 Developers should note that some HTTP client implementations do not 1306 support the inclusion of a fragment component in the HTTP "Location" 1307 response header field. Such client will require using other methods 1308 for redirecting the client than a 3xx redirection response. For 1309 example, returning an HTML page which includes a 'continue' button 1310 with an action linked to the redirection URI. 1312 The client SHOULD ignore unrecognized response parameters. The 1313 access token string size is left undefined by this specification. 1314 The client should avoid making assumptions about value sizes. The 1315 authorization server should document the size of any value it issues. 1317 4.2.2.1. Error Response 1319 If the request fails due to a missing, invalid, or mismatching 1320 redirection URI, or if the client identifier provided is invalid, the 1321 authorization server SHOULD inform the resource owner of the error, 1322 and MUST NOT automatically redirect the user-agent to the invalid 1323 redirection URI. 1325 If the resource owner denies the access request or if the request 1326 fails for reasons other than a missing or invalid redirection URI, 1327 the authorization server informs the client by adding the following 1328 parameters to the fragment component of the redirection URI using the 1329 "application/x-www-form-urlencoded" format: 1331 error 1332 REQUIRED. A single error code from the following: 1334 invalid_request 1335 The request is missing a required parameter, includes an 1336 unsupported parameter or parameter value, or is otherwise 1337 malformed. 1338 unauthorized_client 1339 The client is not authorized to request an access token 1340 using this method. 1341 access_denied 1342 The resource owner or authorization server denied the 1343 request. 1344 unsupported_response_type 1345 The authorization server does not support obtaining an 1346 access token using this method. 1347 invalid_scope 1348 The requested scope is invalid, unknown, or malformed. 1349 server_error 1350 The authorization server encountered an unexpected 1351 condition which prevented it from fulfilling the request. 1352 temporarily_unavailable 1353 The authorization server is currently unable to handle 1354 the request due to a temporary overloading or maintenance 1355 of the server. 1356 error_description 1357 OPTIONAL. A human-readable UTF-8 encoded text providing 1358 additional information, used to assist the client developer in 1359 understanding the error that occurred. 1360 error_uri 1361 OPTIONAL. A URI identifying a human-readable web page with 1362 information about the error, used to provide the client 1363 developer with additional information about the error. 1364 state 1365 REQUIRED if a valid "state" parameter was present in the client 1366 authorization request. Set to the exact value received from 1367 the client. 1369 For example, the authorization server redirects the user-agent by 1370 sending the following HTTP response: 1372 HTTP/1.1 302 Found 1373 Location: https://client.example.com/cb#error=access_denied&state=xyz 1375 4.3. Resource Owner Password Credentials 1377 The resource owner password credentials grant type is suitable in 1378 cases where the resource owner has a trust relationship with the 1379 client, such as its device operating system or a highly privileged 1380 application. The authorization server should take special care when 1381 enabling the grant type, and only when other flows are not viable. 1383 The grant type is suitable for clients capable of obtaining the 1384 resource owner credentials (username and password, typically using an 1385 interactive form). It is also used to migrate existing clients using 1386 direct authentication schemes such as HTTP Basic or Digest 1387 authentication to OAuth by converting the stored credentials to an 1388 access token. 1390 +----------+ 1391 | Resource | 1392 | Owner | 1393 | | 1394 +----------+ 1395 v 1396 | Resource Owner 1397 (A) Password Credentials 1398 | 1399 v 1400 +---------+ +---------------+ 1401 | |>--(B)---- Resource Owner ------->| | 1402 | | Password Credentials | Authorization | 1403 | Client | | Server | 1404 | |<--(C)---- Access Token ---------<| | 1405 | | (w/ Optional Refresh Token) | | 1406 +---------+ +---------------+ 1408 Figure 5: Resource Owner Password Credentials Flow 1410 The flow illustrated in Figure 5 includes the following steps: 1412 (A) The resource owner provides the client with its username and 1413 password. 1414 (B) The client requests an access token from the authorization 1415 server's token endpoint by including the credentials received 1416 from the resource owner. When making the request, the client 1417 authenticates with the authorization server. 1418 (C) The authorization server authenticates the client and validates 1419 the resource owner credentials, and if valid issues an access 1420 token. 1422 4.3.1. Authorization Request and Response 1424 The method through which the client obtains the resource owner 1425 credentials is beyond the scope of this specification. The client 1426 MUST discard the credentials once an access token has been obtained. 1428 4.3.2. Access Token Request 1430 The client makes a request to the token endpoint by adding the 1431 following parameters using the "application/x-www-form-urlencoded" 1432 format in the HTTP request entity-body: 1434 grant_type 1435 REQUIRED. Value MUST be set to "password". 1436 username 1437 REQUIRED. The resource owner username, encoded as UTF-8. 1438 password 1439 REQUIRED. The resource owner password, encoded as UTF-8. 1440 scope 1441 OPTIONAL. The scope of the access request expressed as a list 1442 of space-delimited, case sensitive strings. The value is 1443 defined by the authorization server. If the value contains 1444 multiple space-delimited strings, their order does not matter, 1445 and each string adds an additional access range to the 1446 requested scope. 1448 If the client type is private or was issued client credentials (or 1449 assigned other authentication requirements), the client MUST 1450 authenticate with the authorization server as described in 1451 Section 3.2.1. 1453 For example, the client makes the following HTTP request using 1454 transport-layer security (extra line breaks are for display purposes 1455 only): 1457 POST /token HTTP/1.1 1458 Host: server.example.com 1459 Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW 1460 Content-Type: application/x-www-form-urlencoded;charset=UTF-8 1462 grant_type=password&username=johndoe&password=A3ddj3w 1464 The authorization server MUST: 1466 o require client authentication for private clients or for any 1467 client issued client credentials (or with other authentication 1468 requirements), 1469 o authenticate the client if client authentication is included, and 1470 o validate the resource owner password credentials. 1472 Since this access token request utilizes the resource owner's 1473 password, the authorization server MUST protect the endpoint against 1474 brute force attacks. 1476 4.3.3. Access Token Response 1478 If the access token request is valid and authorized, the 1479 authorization server issues an access token and optional refresh 1480 token as described in Section 5.1. If the request failed client 1481 authentication or is invalid, the authorization server returns an 1482 error response as described in Section 5.2. 1484 An example successful response: 1486 HTTP/1.1 200 OK 1487 Content-Type: application/json;charset=UTF-8 1488 Cache-Control: no-store 1489 Pragma: no-cache 1491 { 1492 "access_token":"2YotnFZFEjr1zCsicMWpAA", 1493 "token_type":"example", 1494 "expires_in":3600, 1495 "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", 1496 "example_parameter":"example_value" 1497 } 1499 4.4. Client Credentials 1501 The client can request an access token using only its client 1502 credentials (or other supported means of authentication) when the 1503 client is requesting access to the protected resources under its 1504 control, or those of another resource owner which has been previously 1505 arranged with the authorization server (the method of which is beyond 1506 the scope of this specification). 1508 The client credentials grant type MUST only be used by private 1509 clients. 1511 +---------+ +---------------+ 1512 | | | | 1513 | |>--(A)- Client Authentication --->| Authorization | 1514 | Client | | Server | 1515 | |<--(B)---- Access Token ---------<| | 1516 | | | | 1517 +---------+ +---------------+ 1519 Figure 6: Client Credentials Flow 1521 The flow illustrated in Figure 6 includes the following steps: 1523 (A) The client authenticates with the authorization server and 1524 requests an access token from the token endpoint. 1525 (B) The authorization server authenticates the client, and if valid 1526 issues an access token. 1528 4.4.1. Authorization Request and Response 1530 Since the client authentication is used as the authorization grant, 1531 no additional authorization request is needed. 1533 4.4.2. Access Token Request 1535 The client makes a request to the token endpoint by adding the 1536 following parameters using the "application/x-www-form-urlencoded" 1537 format in the HTTP request entity-body: 1539 grant_type 1540 REQUIRED. Value MUST be set to "client_credentials". 1541 scope 1542 OPTIONAL. The scope of the access request expressed as a list 1543 of space-delimited, case sensitive strings. The value is 1544 defined by the authorization server. If the value contains 1545 multiple space-delimited strings, their order does not matter, 1546 and each string adds an additional access range to the 1547 requested scope. 1549 The client MUST authenticate with the authorization server as 1550 described in Section 3.2.1. 1552 For example, the client makes the following HTTP request using 1553 transport-layer security (extra line breaks are for display purposes 1554 only): 1556 POST /token HTTP/1.1 1557 Host: server.example.com 1558 Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW 1559 Content-Type: application/x-www-form-urlencoded;charset=UTF-8 1561 grant_type=client_credentials 1563 The authorization server MUST authenticate the client. 1565 4.4.3. Access Token Response 1567 If the access token request is valid and authorized, the 1568 authorization server issues an access token as described in 1569 Section 5.1. A refresh token SHOULD NOT be included. If the request 1570 failed client authentication or is invalid, the authorization server 1571 returns an error response as described in Section 5.2. 1573 An example successful response: 1575 HTTP/1.1 200 OK 1576 Content-Type: application/json;charset=UTF-8 1577 Cache-Control: no-store 1578 Pragma: no-cache 1580 { 1581 "access_token":"2YotnFZFEjr1zCsicMWpAA", 1582 "token_type":"example", 1583 "expires_in":3600, 1584 "example_parameter":"example_value" 1585 } 1587 4.5. Extensions 1589 The client uses an extension grant type by specifying the grant type 1590 using an absolute URI (defined by the authorization server) as the 1591 value of the "grant_type" parameter of the token endpoint, and by 1592 adding any additional parameters necessary. 1594 For example, to request an access token using a SAML 2.0 assertion 1595 grant type as defined by [I-D.ietf-oauth-saml2-bearer], the client 1596 makes the following HTTP request using transport-layer security (line 1597 breaks are for display purposes only): 1599 POST /token HTTP/1.1 1600 Host: server.example.com 1601 Content-Type: application/x-www-form-urlencoded;charset=UTF-8 1603 grant_type=http%3A%2F%2Foauth.net%2Fgrant_type%2Fassertion%2F 1604 saml%2F2.0%2Fbearer&assertion=PEFzc2VydGlvbiBJc3N1ZUluc3RhbnQ 1605 [...omitted for brevity...]V0aG5TdGF0ZW1lbnQ-PC9Bc3NlcnRpb24- 1607 If the access token request is valid and authorized, the 1608 authorization server issues an access token and optional refresh 1609 token as described in Section 5.1. If the request failed client 1610 authentication or is invalid, the authorization server returns an 1611 error response as described in Section 5.2. 1613 5. Issuing an Access Token 1615 If the access token request is valid and authorized, the 1616 authorization server issues an access token and optional refresh 1617 token as described in Section 5.1. If the request failed client 1618 authentication or is invalid, the authorization server returns an 1619 error response as described in Section 5.2. 1621 5.1. Successful Response 1623 The authorization server issues an access token and optional refresh 1624 token, and constructs the response by adding the following parameters 1625 to the entity body of the HTTP response with a 200 (OK) status code: 1627 access_token 1628 REQUIRED. The access token issued by the authorization server. 1629 token_type 1630 REQUIRED. The type of the token issued as described in 1631 Section 7.1. Value is case insensitive. 1632 expires_in 1633 OPTIONAL. The lifetime in seconds of the access token. For 1634 example, the value "3600" denotes that the access token will 1635 expire in one hour from the time the response was generated. 1637 refresh_token 1638 OPTIONAL. The refresh token which can be used to obtain new 1639 access tokens using the same authorization grant as described 1640 in Section 6. 1641 scope 1642 OPTIONAL. The scope of the access token expressed as a list of 1643 space-delimited, case sensitive strings. The value is defined 1644 by the authorization server. If the value contains multiple 1645 space-delimited strings, their order does not matter, and each 1646 string adds an additional access range to the requested scope. 1647 The authorization server SHOULD include the parameter if the 1648 access token scope is different from the one requested by the 1649 client. 1651 The parameters are included in the entity body of the HTTP response 1652 using the "application/json" media type as defined by [RFC4627]. The 1653 parameters are serialized into a JSON structure by adding each 1654 parameter at the highest structure level. Parameter names and string 1655 values are included as JSON strings. Numerical values are included 1656 as JSON numbers. 1658 The authorization server MUST include the HTTP "Cache-Control" 1659 response header field [RFC2616] with a value of "no-store" in any 1660 response containing tokens, credentials, or other sensitive 1661 information, as well as the "Pragma" response header field [RFC2616] 1662 with a value of "no-cache". 1664 For example: 1666 HTTP/1.1 200 OK 1667 Content-Type: application/json;charset=UTF-8 1668 Cache-Control: no-store 1669 Pragma: no-cache 1671 { 1672 "access_token":"2YotnFZFEjr1zCsicMWpAA", 1673 "token_type":"example", 1674 "expires_in":3600, 1675 "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", 1676 "example_parameter":"example_value" 1677 } 1679 The client SHOULD ignore unrecognized response parameters. The sizes 1680 of tokens and other values received from the authorization server are 1681 left undefined. The client should avoid making assumptions about 1682 value sizes. The authorization server should document the size of 1683 any value it issues. 1685 5.2. Error Response 1687 The authorization server responds with an HTTP 400 (Bad Request) 1688 status code and includes the following parameters with the response: 1690 error 1691 REQUIRED. A single error code from the following: 1692 invalid_request 1693 The request is missing a required parameter, includes an 1694 unsupported parameter or parameter value, repeats a 1695 parameter, includes multiple credentials, utilizes more 1696 than one mechanism for authenticating the client, or is 1697 otherwise malformed. 1698 invalid_client 1699 Client authentication failed (e.g. unknown client, no 1700 client authentication included, multiple client 1701 authentications included, or unsupported authentication 1702 method). The authorization server MAY return an HTTP 401 1703 (Unauthorized) status code to indicate which HTTP 1704 authentication schemes are supported. If the client 1705 attempted to authenticate via the "Authorization" request 1706 header field, the authorization server MUST respond with 1707 an HTTP 401 (Unauthorized) status code, and include the 1708 "WWW-Authenticate" response header field matching the 1709 authentication scheme used by the client. 1710 invalid_grant 1711 The provided authorization grant is invalid, expired, 1712 revoked, does not match the redirection URI used in the 1713 authorization request, or was issued to another client. 1714 unauthorized_client 1715 The authenticated client is not authorized to use this 1716 authorization grant type. 1717 unsupported_grant_type 1718 The authorization grant type is not supported by the 1719 authorization server. 1720 invalid_scope 1721 The requested scope is invalid, unknown, malformed, or 1722 exceeds the scope granted by the resource owner. 1723 error_description 1724 OPTIONAL. A human-readable UTF-8 encoded text providing 1725 additional information, used to assist the client developer in 1726 understanding the error that occurred. 1728 error_uri 1729 OPTIONAL. A URI identifying a human-readable web page with 1730 information about the error, used to provide the client 1731 developer with additional information about the error. 1733 The parameters are included in the entity body of the HTTP response 1734 using the "application/json" media type as defined by [RFC4627]. The 1735 parameters are serialized into a JSON structure by adding each 1736 parameter at the highest structure level. Parameter names and string 1737 values are included as JSON strings. Numerical values are included 1738 as JSON numbers. 1740 For example: 1742 HTTP/1.1 400 Bad Request 1743 Content-Type: application/json;charset=UTF-8 1744 Cache-Control: no-store 1745 Pragma: no-cache 1747 { 1748 "error":"invalid_request" 1749 } 1751 6. Refreshing an Access Token 1753 If the authorization server issued a refresh token to the client, the 1754 client makes a refresh request to the token endpoint by adding the 1755 following parameters using the "application/x-www-form-urlencoded" 1756 format in the HTTP request entity-body: 1758 grant_type 1759 REQUIRED. Value MUST be set to "refresh_token". 1760 refresh_token 1761 REQUIRED. The refresh token issued to the client. 1762 scope 1763 OPTIONAL. The scope of the access request expressed as a list 1764 of space-delimited, case sensitive strings. The value is 1765 defined by the authorization server. If the value contains 1766 multiple space-delimited strings, their order does not matter, 1767 and each string adds an additional access range to the 1768 requested scope. The requested scope MUST be equal or lesser 1769 than the scope originally granted by the resource owner, and if 1770 omitted is treated as equal to the scope originally granted by 1771 the resource owner. 1773 Because refresh tokens are typically long-lasting credentials used to 1774 request additional access tokens, the refresh token is bound to the 1775 client it was issued. If the client type is private or was issued 1776 client credentials (or assigned other authentication requirements), 1777 the client MUST authenticate with the authorization server as 1778 described in Section 3.2.1. 1780 For example, the client makes the following HTTP request using 1781 transport-layer security (extra line breaks are for display purposes 1782 only): 1784 POST /token HTTP/1.1 1785 Host: server.example.com 1786 Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW 1787 Content-Type: application/x-www-form-urlencoded;charset=UTF-8 1789 grant_type=refresh_token&refresh_token=tGzv3JOkF0XG5Qx2TlKWIA 1791 The authorization server MUST: 1793 o require client authentication for private clients or for any 1794 client issued client credentials (or with other authentication 1795 requirements), 1796 o authenticate the client if client authentication is included and 1797 ensure the refresh token was issued to the authenticated client, 1798 o validate the refresh token, and 1800 If valid and authorized, the authorization server issues an access 1801 token as described in Section 5.1. If the request failed 1802 verification or is invalid, the authorization server returns an error 1803 response as described in Section 5.2. 1805 The authorization server MAY issue a new refresh token, in which case 1806 the client MUST discard the old refresh token and replace it with the 1807 new refresh token. The authorization server MAY revoke the old 1808 refresh token after issuing a new refresh token to the client. If a 1809 new refresh token is issued, its scope MUST be identical to that of 1810 the refresh token included in the request. 1812 7. Accessing Protected Resources 1814 The client accesses protected resources by presenting the access 1815 token to the resource server. The resource server MUST validate the 1816 access token and ensure it has not expired and that its scope covers 1817 the requested resource. The methods used by the resource server to 1818 validate the access token (as well as any error responses) are beyond 1819 the scope of this specification, but generally involve an interaction 1820 or coordination between the resource server and the authorization 1821 server. 1823 The method in which the client utilized the access token to 1824 authenticate with the resource server depends on the type of access 1825 token issued by the authorization server. Typically, it involves 1826 using the HTTP "Authorization" request header field [RFC2617] with an 1827 authentication scheme defined by the access token type specification. 1829 7.1. Access Token Types 1831 The access token type provides the client with the information 1832 required to successfully utilize the access token to make a protected 1833 resource request (along with type-specific attributes). The client 1834 MUST NOT use an access token if it does not understand or does not 1835 trust the token type. 1837 For example, the "bearer" token type defined in 1838 [I-D.ietf-oauth-v2-bearer] is utilized by simply including the access 1839 token string in the request: 1841 GET /resource/1 HTTP/1.1 1842 Host: example.com 1843 Authorization: Bearer 7Fjfp0ZBr1KtDRbnfVdmIw 1845 while the "mac" token type defined in [I-D.ietf-oauth-v2-http-mac] is 1846 utilized by issuing a MAC key together with the access token which is 1847 used to sign certain components of the HTTP requests: 1849 GET /resource/1 HTTP/1.1 1850 Host: example.com 1851 Authorization: MAC id="h480djs93hd8", 1852 nonce="274312:dj83hs9s", 1853 mac="kDZvddkndxvhGRXZhvuDjEWhGeE=" 1855 The above examples are provided for illustration purposes only. 1856 Developers are advised to consult the [I-D.ietf-oauth-v2-bearer] and 1857 [I-D.ietf-oauth-v2-http-mac] specifications before use. 1859 Each access token type definition specifies the additional attributes 1860 (if any) sent to the client together with the "access_token" response 1861 parameter. It also defines the HTTP authentication method used to 1862 include the access token when making a protected resource request. 1864 8. Extensibility 1866 8.1. Defining Access Token Types 1868 Access token types can be defined in one of two ways: registered in 1869 the access token type registry (following the procedures in 1870 Section 11.1), or use a unique absolute URI as its name. 1872 Types utilizing a URI name SHOULD be limited to vendor-specific 1873 implementations that are not commonly applicable, and are specific to 1874 the implementation details of the resource server where they are 1875 used. 1877 All other types MUST be registered. Type names MUST conform to the 1878 type-name ABNF. If the type definition includes a new HTTP 1879 authentication scheme, the type name SHOULD be identical to the HTTP 1880 authentication scheme name (as defined by [RFC2617]). 1882 type-name = 1*name-char 1883 name-char = "-" / "." / "_" / DIGIT / ALPHA 1885 8.2. Defining New Endpoint Parameters 1887 New request or response parameters for use with the authorization 1888 endpoint or the token endpoint are defined and registered in the 1889 parameters registry following the procedure in Section 11.2. 1891 Parameter names MUST conform to the param-name ABNF and parameter 1892 values syntax MUST be well-defined (e.g., using ABNF, or a reference 1893 to the syntax of an existing parameter). 1895 param-name = 1*name-char 1896 name-char = "-" / "." / "_" / DIGIT / ALPHA 1898 Unregistered vendor-specific parameter extensions that are not 1899 commonly applicable, and are specific to the implementation details 1900 of the authorization server where they are used SHOULD utilize a 1901 vendor-specific prefix that is not likely to conflict with other 1902 registered values (e.g. begin with 'companyname_'). 1904 8.3. Defining New Authorization Grant Types 1906 New authorization grant types can be defined by assigning them a 1907 unique absolute URI for use with the "grant_type" parameter. If the 1908 extension grant type requires additional token endpoint parameters, 1909 they MUST be registered in the OAuth parameters registry as described 1910 by Section 11.2. 1912 8.4. Defining New Authorization Endpoint Response Types 1914 New response types for use with the authorization endpoint are 1915 defined and registered in the authorization endpoint response type 1916 registry following the procedure in Section 11.3. Response type 1917 names MUST conform to the response-type ABNF. 1919 response-type = response-name *( SP response-name ) 1920 response-name = 1*response-char 1921 response-char = "_" / DIGIT / ALPHA 1923 If a response type contains one of more space characters (%x20), it 1924 is compared as a space-delimited list of values in which the order of 1925 values does not matter. Only one order of values can be registered, 1926 which covers all other arrangements of the same set of values. 1928 For example, the response type "token code" is left undefined by this 1929 specification. However, an extension can define and register the 1930 "token code" response type. Once registered, the same combination 1931 cannot be registered as "code token", but both values can be used to 1932 denote the same response type. 1934 8.5. Defining Additional Error Codes 1936 In cases where protocol extensions (i.e. access token types, 1937 extension parameters, or extension grant types) require additional 1938 error codes to be used with the authorization code grant error 1939 response (Section 4.1.2.1), the implicit grant error response 1940 (Section 4.2.2.1), or the token error response (Section 5.2), such 1941 error codes MAY be defined. 1943 Extension error codes MUST be registered (following the procedures in 1944 Section 11.4) if the extension they are used in conjunction with is a 1945 registered access token type, a registered endpoint parameter, or an 1946 extension grant type. Error codes used with unregistered extensions 1947 MAY be registered. 1949 Error codes MUST conform to the error-code ABNF, and SHOULD be 1950 prefixed by an identifying name when possible. For example, an error 1951 identifying an invalid value set to the extension parameter "example" 1952 should be named "example_invalid". 1954 error-code = ALPHA *error-char 1955 error-char = "-" / "." / "_" / DIGIT / ALPHA 1957 9. Native Applications 1959 Native applications are clients installed and executed on the 1960 resource owner's device (i.e. desktop application, native mobile 1961 application). Native applications may require special consideration 1962 related to security, platform capabilities, and overall end-user 1963 experience. 1965 The authorization endpoint requires interaction between the client 1966 and the resource owner's user-agent. Native applications can invoke 1967 an external user-agent or embed a user-agent within the application. 1968 For example: 1970 o External user-agent - the native application can capture the 1971 response from the authorization server using a redirection URI 1972 with an scheme registered with the operating system to invoke the 1973 client as the handler, manual copy-and-paste of the credentials, 1974 running a local web server, installing a user-agent extension, or 1975 by providing a redirection URI identifying a server-hosted 1976 resource under the client's control, which in turn makes the 1977 response available to the native application. 1978 o Embedded user-agent - the native application obtains the response 1979 by directly communicating with the embedded user-agent by 1980 monitoring state changes emitted during the resource load, or 1981 accessing the user-agent's cookies storage. 1983 When choosing between an external or embedded user-agent, developers 1984 should consider: 1986 o External user-agents may improve completion rate as the resource 1987 owner may already have an active session with the authorization 1988 server removing the need to re-authenticate. It provides a 1989 familiar end-user experience and functionality. The resource 1990 owner may also rely on user-agent features or extensions to assist 1991 with authentication (e.g. password manager, 2-factor device 1992 reader). 1994 o Embedded user-agents may offer an improved usability, as they 1995 remove the need to switch context and open new windows. 1996 o Embedded user-agents pose a security challenge because resource 1997 owners are authenticating in an unidentified window without access 1998 to the visual protections found in most external user-agents. 1999 Embedded user-agents educate end-user to trust unidentified 2000 requests for authentication (making phishing attacks easier to 2001 execute). 2003 When choosing between the implicit grant type and the authorization 2004 code grant type, the following should be considered: 2006 o Native applications that use the authorization code grant type 2007 SHOULD do so without using client credentials, due to the native 2008 application's inability to keep credentials confidential. 2009 o When using the implicit grant type flow a refresh token is not 2010 returned. 2012 10. Security Considerations 2014 As a flexible and extensible framework, OAuth's security 2015 considerations depend on many factors. The following sections 2016 provide implementers with security guidelines focused on the three 2017 client profiles described in Section 2.1: web application, user- 2018 agent-based application, and native application. 2020 A comprehensive OAuth security model and analysis, as well as 2021 background for the protocol design is provided by 2022 [I-D.ietf-oauth-v2-threatmodel]. 2024 10.1. Client Authentication 2026 The authorization server establishes client credentials with web 2027 application clients for the purpose of client authentication. The 2028 authorization server is encouraged to consider stronger client 2029 authentication means than a client password. Web application clients 2030 MUST ensure confidentiality of client passwords and other client 2031 credentials. 2033 The authorization server MUST NOT issue client passwords or other 2034 client credentials to native application or user-agent-based 2035 application clients for the purpose of client authentication. The 2036 authorization server MAY issue a client password or other credentials 2037 for a specific installation of a native application client on a 2038 specific device. 2040 When client authentication is not possible, the authorization server 2041 SHOULD employ other means to validate the client's identity. For 2042 example, by requiring the registration of the client redirection URI 2043 or enlisting the resource owner to confirm identity. The 2044 authorization server must consider the security implications of 2045 interacting with unauthenticated clients and take measures to limit 2046 the potential exposure of other credentials (e.g. refresh tokens) 2047 issued to such clients. 2049 10.2. Client Impersonation 2051 A malicious client can impersonate another client and obtain access 2052 to protected resources, if the impersonated client fails to, or is 2053 unable to, keep is client credentials confidential. 2055 The authorization server MUST authenticate the client whenever 2056 possible. If the authorization server cannot authenticate the client 2057 due to the client nature, the authorization server MUST require the 2058 registration of any redirection URI used for receiving authorization, 2059 and SHOULD utilize other means to protect resource owners from such 2060 malicious clients. For example, engage the resource owner to assist 2061 in identifying the client and its origin. 2063 The authorization server SHOULD enforce explicit resource owner 2064 authentication and provide the resource owner with information about 2065 the client and the requested authorization scope and lifetime. It is 2066 up to the resource owner to review the information in the context of 2067 the current client, and authorize the request. 2069 The authorization server SHOULD NOT process repeated authorization 2070 requests automatically (without active resource owner interaction) 2071 without authenticating the client or relying on other measures to 2072 ensure the repeated request comes from the original client and not an 2073 impersonator. 2075 10.3. Access Tokens 2077 Access token (as well as any access token type-specific attributes) 2078 MUST be kept confidential in transit and storage, and only shared 2079 among the authorization server, the resource servers the access token 2080 is valid for, and the client to whom the access token is issued. 2082 When using the implicit grant type, the access token is transmitted 2083 in the URI fragment, which can expose it to unauthorized parties. 2085 The authorization server MUST ensure that access tokens cannot be 2086 generated, modified, or guessed to produce valid access tokens. 2088 The client SHOULD request access tokens with the minimal scope and 2089 lifetime necessary. The authorization server SHOULD take the client 2090 identity into account when choosing how to honor the requested scope 2091 and lifetime, and MAY issue an access token with a less rights than 2092 requested. 2094 10.4. Refresh Tokens 2096 Authorization servers MAY issue refresh tokens to web application 2097 clients and native application clients. 2099 Refresh tokens MUST be kept confidential in transit and storage, and 2100 shared only among the authorization server and the client to whom the 2101 refresh tokens were issued. The authorization server MUST maintain 2102 the binding between a refresh token and the client to whom it was 2103 issued. 2105 The authorization server MUST verify the binding between the refresh 2106 token and client identity whenever the client identity can be 2107 authenticated. When client authentication is not possible, the 2108 authorization server SHOULD deploy other means to detect refresh 2109 token abuse. 2111 For example, the authorization server could employ refresh tokens 2112 rotation in which a new refresh token is issued with every access 2113 token refresh response. The previous refresh token is invalidated 2114 but retained by the authorization server. If a refresh token is 2115 compromised and subsequently used by both the attacker and the 2116 legitimate client, one of them will present an invalidated refresh 2117 token which will inform the authorization server of the breach. 2119 The authorization server MUST ensure that refresh tokens cannot be 2120 generated, modified, or guessed to produce valid refresh tokens. 2122 10.5. Authorization Codes 2124 The transmission of authorization codes SHOULD be made over a secure 2125 channel, and the client SHOULD implement TLS for use with its 2126 redirection URI if the URI identifies a network resource. Effort 2127 should be made to keep authorization codes confidential. Since 2128 authorization codes are transmitted via user-agent redirections, they 2129 could potentially be disclosed through user-agent history and HTTP 2130 referrer headers. 2132 Authorization codes operate as plaintext bearer credentials, used to 2133 verify that the resource owner who granted authorization at the 2134 authorization server, is the same resource owner returning to the 2135 client to complete the process. Therefore, if the client relies on 2136 the authorization code for its own resource owner authentication, the 2137 client redirection endpoint MUST require TLS. 2139 Authorization codes MUST be short lived and single use. If the 2140 authorization server observes multiple attempts to exchange an 2141 authorization code for an access token, the authorization server 2142 SHOULD attempt to revoke all access tokens already granted based on 2143 the compromised authorization code. 2145 If the client can be authenticated, the authorization servers MUST 2146 authenticate the client and ensure that the authorization code was 2147 issued to the same client. 2149 10.6. Authorization Code Leakage 2151 An attacker can leverage the authorization code grant type by 2152 tricking a resource owner to authorize access to a legitimate client, 2153 but using a client account under the control of the attacker. The 2154 only difference between a valid request and the attack request is in 2155 how the victim reached the authorization server to grant access. 2157 Once at the authorization server, the victim is prompted with a 2158 normal, valid request on behalf of a legitimate and familiar client. 2159 The attacker then uses the victim's authorization to gain access to 2160 the information authorized by the victim (via the client). 2162 In order to prevent such an attack, authorization servers MUST ensure 2163 that the redirection URI used to obtain the authorization code, is 2164 the same as the redirection URI provided when exchanging the 2165 authorization code for an access token. The authorization server 2166 SHOULD require the client to register their redirection URI and if 2167 provided, MUST validate the redirection URI received in the 2168 authorization request against the registered value. 2170 10.7. Resource Owner Password Credentials 2172 The resource owner password credentials grant type is often used for 2173 legacy or migration reasons. It reduces the overall risk of storing 2174 username and password by the client, but does not eliminate the need 2175 to expose highly privileged credentials to the client. 2177 This grant type carries a higher risk than other grant types because 2178 it maintains the password anti-pattern this protocol seeks to avoid. 2179 The client could abuse the password or the password could 2180 unintentionally be disclosed to an attacker (e.g. via log files or 2181 other records kept by the client). 2183 Additionally, because the resource owner does not have control over 2184 the authorization process (the resource owner involvement ends when 2185 it hands over its credentials to the client), the client can obtain 2186 access tokens with a broader scope and longer lifetime than desired 2187 by the resource owner. The authorization server SHOULD restrict the 2188 scope and lifetime of access tokens issued via this grant type. 2190 The authorization server and client SHOULD minimize use of this grant 2191 type and utilize other grant types whenever possible. 2193 10.8. Request Confidentiality 2195 Access tokens, refresh tokens, resource owner passwords, and client 2196 credentials MUST NOT be transmitted in the clear. Authorization 2197 codes SHOULD NOT be transmitted in the clear. 2199 10.9. Endpoints Authenticity 2201 In order to prevent man-in-the-middle and phishing attacks, the 2202 authorization server MUST implement and require TLS with server 2203 authentication as defined by [RFC2818] for any request sent to the 2204 authorization and token endpoints. The client MUST validate the 2205 authorization server's TLS certificate in accordance with its 2206 requirements for server identity authentication. 2208 10.10. Credentials Guessing Attacks 2210 The authorization server MUST prevent attackers from guessing access 2211 tokens, authorization codes, refresh tokens, resource owner 2212 passwords, and client credentials. 2214 When generating tokens and other credentials not intended for 2215 handling by end-users, the authorization server MUST use a reasonable 2216 level of entropy in order to mitigate the risk of guessing attacks. 2217 The authorization server MUST utilize other means to protect 2218 credentials intended for end-user usage. 2220 10.11. Phishing Attacks 2222 Wide deployment of this and similar protocols may cause end-users to 2223 become inured to the practice of being redirected to websites where 2224 they are asked to enter their passwords. If end-users are not 2225 careful to verify the authenticity of these websites before entering 2226 their credentials, it will be possible for attackers to exploit this 2227 practice to steal resource owners' passwords. 2229 Service providers should attempt to educate end-users about the risks 2230 phishing attacks pose, and should provide mechanisms that make it 2231 easy for end-users to confirm the authenticity of their sites. 2232 Client developers should consider the security implications of how 2233 they interact with the user-agent (e.g., external, embedded), and the 2234 ability of the end-user to verify the authenticity of the 2235 authorization server. 2237 To reduce the risk of phishing attacks, the authorization servers 2238 MUST utilize TLS on every endpoint used for end-user interaction. 2240 10.12. Cross-Site Request Forgery 2242 Cross-site request forgery (CSRF) is a web-based attack whereby HTTP 2243 requests are transmitted from the user-agent of an end-user the 2244 server trusts or has authenticated. CSRF attacks on the 2245 authorization endpoint can allow an attacker to obtain authorization 2246 without the consent of the resource owner. 2248 The "state" request parameter SHOULD be used to mitigate against CSRF 2249 attacks, particularly for login CSRF attacks. CSRF attacks against 2250 the client's redirection URI allow an attacker to inject their own 2251 authorization code or access token, which can result in the client 2252 using an access token associated with the attacker's account rather 2253 than the victim's. Depending on the nature of the client and the 2254 protected resources, this can have undesirable and damaging effects. 2256 It is strongly RECOMMENDED that the client includes the "state" 2257 request parameter with authorization requests to the authorization 2258 server. The "state" request parameter MUST contain a non-guessable 2259 value, and the client MUST keep it in a location accessible only by 2260 the client or the user-agent (i.e., protected by same-origin policy). 2262 For example, using a DOM variable (protected by JavaScript or other 2263 DOM-binding language's enforcement of SOP [[ add reference ]]), HTTP 2264 cookie, or HTML5 client-side storage. The authorization server 2265 includes the value of the "state" parameter when redirecting the 2266 user-agent back to the client which MUST then ensure the received 2267 value matches the stored value. 2269 10.13. Clickjacking 2271 [[ Rework to use specification terminology ]] 2273 Clickjacking is the process of tricking end-users into revealing 2274 confidential information or taking control of their device while 2275 clicking on seemingly innocuous web pages. In more detail, a 2276 malicious site loads the target site in a transparent iframe overlaid 2277 on top of a set of dummy buttons which are carefully constructed to 2278 be placed directly under important buttons on the target site. When 2279 a user clicks a visible button, they are actually clicking a button 2280 (such as an "Authorize" button) on the hidden page. 2282 To prevent clickjacking (and phishing attacks), native applications 2283 SHOULD use external browsers instead of embedding browsers in an 2284 iframe when requesting end-user authorization. For newer browsers, 2285 avoidance of iframes can be enforced by the authorization server 2286 using the "x-frame-options" header [[ Add reference ]]. This header 2287 can have two values, "deny" and "sameorigin", which will block any 2288 framing or framing by sites with a different origin, respectively. 2289 For older browsers, javascript framebusting techniques can be used 2290 but may not be effective in all browsers. 2292 10.14. Code Injection and Input Validation 2294 A code injection attack occurs when an input or otherwise external 2295 variable is used by an application in which that input can cause 2296 modification of the application logic when used unsanitized. This 2297 may allow an attacker to gain access to the application device or its 2298 data, cause denial of service, or a wide range of malicious side- 2299 effects. 2301 The Authorization server and client MUST validate and sanitize any 2302 value received, and in particular, the value of the "state" and 2303 "redirect_uri" parameters. 2305 11. IANA Considerations 2307 11.1. The OAuth Access Token Type Registry 2309 This specification establishes the OAuth access token type registry. 2311 Access token types are registered on the advice of one or more 2312 Designated Experts (appointed by the IESG or their delegate), with a 2313 Specification Required (using terminology from [RFC5226]). However, 2314 to allow for the allocation of values prior to publication, the 2315 Designated Expert(s) may approve registration once they are satisfied 2316 that such a specification will be published. 2318 Registration requests should be sent to the [TBD]@ietf.org mailing 2319 list for review and comment, with an appropriate subject (e.g., 2320 "Request for access toke type: example"). [[ Note to RFC-EDITOR: The 2321 name of the mailing list should be determined in consultation with 2322 the IESG and IANA. Suggested name: oauth-ext-review. ]] 2324 Within at most 14 days of the request, the Designated Expert(s) will 2325 either approve or deny the registration request, communicating this 2326 decision to the review list and IANA. Denials should include an 2327 explanation and, if applicable, suggestions as to how to make the 2328 request successful. 2330 Decisions (or lack thereof) made by the Designated Expert can be 2331 first appealed to Application Area Directors (contactable using 2332 app-ads@tools.ietf.org email address or directly by looking up their 2333 email addresses on http://www.iesg.org/ website) and, if the 2334 appellant is not satisfied with the response, to the full IESG (using 2335 the iesg@iesg.org mailing list). 2337 IANA should only accept registry updates from the Designated 2338 Expert(s), and should direct all requests for registration to the 2339 review mailing list. 2341 11.1.1. Registration Template 2343 Type name: 2344 The name requested (e.g., "example"). 2345 Additional Token Endpoint Response Parameters: 2346 Additional response parameters returned together with the 2347 "access_token" parameter. New parameters MUST be separately 2348 registered in the OAuth parameters registry as described by 2349 Section 11.2. 2350 HTTP Authentication Scheme(s): 2351 The HTTP authentication scheme name(s), if any, used to 2352 authenticate protected resources requests using access token of 2353 this type. 2354 Change controller: 2355 For standards-track RFCs, state "IETF". For others, give the name 2356 of the responsible party. Other details (e.g., postal address, 2357 e-mail address, home page URI) may also be included. 2358 Specification document(s): 2359 Reference to document that specifies the parameter, preferably 2360 including a URI that can be used to retrieve a copy of the 2361 document. An indication of the relevant sections may also be 2362 included, but is not required. 2364 11.2. The OAuth Parameters Registry 2366 This specification establishes the OAuth parameters registry. 2368 Additional parameters for inclusion in the authorization endpoint 2369 request, the authorization endpoint response, the token endpoint 2370 request, or the token endpoint response, are registered on the advice 2371 of one or more Designated Experts (appointed by the IESG or their 2372 delegate), with a Specification Required (using terminology from 2373 [RFC5226]). However, to allow for the allocation of values prior to 2374 publication, the Designated Expert(s) may approve registration once 2375 they are satisfied that such a specification will be published. 2377 Registration requests should be sent to the [TBD]@ietf.org mailing 2378 list for review and comment, with an appropriate subject (e.g., 2379 "Request for parameter: example"). [[ Note to RFC-EDITOR: The name of 2380 the mailing list should be determined in consultation with the IESG 2381 and IANA. Suggested name: oauth-ext-review. ]] 2383 Within at most 14 days of the request, the Designated Expert(s) will 2384 either approve or deny the registration request, communicating this 2385 decision to the review list and IANA. Denials should include an 2386 explanation and, if applicable, suggestions as to how to make the 2387 request successful. 2389 Decisions (or lack thereof) made by the Designated Expert can be 2390 first appealed to Application Area Directors (contactable using 2391 app-ads@tools.ietf.org email address or directly by looking up their 2392 email addresses on http://www.iesg.org/ website) and, if the 2393 appellant is not satisfied with the response, to the full IESG (using 2394 the iesg@iesg.org mailing list). 2396 IANA should only accept registry updates from the Designated 2397 Expert(s), and should direct all requests for registration to the 2398 review mailing list. 2400 11.2.1. Registration Template 2402 Parameter name: 2403 The name requested (e.g., "example"). 2404 Parameter usage location: 2405 The location(s) where parameter can be used. The possible 2406 locations are: authorization request, authorization response, 2407 token request, or token response. 2408 Change controller: 2409 For standards-track RFCs, state "IETF". For others, give the name 2410 of the responsible party. Other details (e.g., postal address, 2411 e-mail address, home page URI) may also be included. 2412 Specification document(s): 2413 Reference to document that specifies the parameter, preferably 2414 including a URI that can be used to retrieve a copy of the 2415 document. An indication of the relevant sections may also be 2416 included, but is not required. 2418 11.2.2. Initial Registry Contents 2420 The OAuth Parameters Registry's initial contents are: 2422 o Parameter name: client_id 2423 o Parameter usage location: authorization request, token request 2424 o Change controller: IETF 2425 o Specification document(s): [[ this document ]] 2427 o Parameter name: client_secret 2428 o Parameter usage location: token request 2429 o Change controller: IETF 2430 o Specification document(s): [[ this document ]] 2432 o Parameter name: response_type 2433 o Parameter usage location: authorization request 2434 o Change controller: IETF 2435 o Specification document(s): [[ this document ]] 2437 o Parameter name: redirect_uri 2438 o Parameter usage location: authorization request, token request 2439 o Change controller: IETF 2440 o Specification document(s): [[ this document ]] 2442 o Parameter name: scope 2443 o Parameter usage location: authorization request, authorization 2444 response, token request, token response 2445 o Change controller: IETF 2446 o Specification document(s): [[ this document ]] 2448 o Parameter name: state 2449 o Parameter usage location: authorization request, authorization 2450 response 2451 o Change controller: IETF 2452 o Specification document(s): [[ this document ]] 2454 o Parameter name: code 2455 o Parameter usage location: authorization response, token request 2456 o Change controller: IETF 2457 o Specification document(s): [[ this document ]] 2459 o Parameter name: error_description 2460 o Parameter usage location: authorization response, token response 2461 o Change controller: IETF 2462 o Specification document(s): [[ this document ]] 2464 o Parameter name: error_uri 2465 o Parameter usage location: authorization response, token response 2466 o Change controller: IETF 2467 o Specification document(s): [[ this document ]] 2469 o Parameter name: grant_type 2470 o Parameter usage location: token request 2471 o Change controller: IETF 2472 o Specification document(s): [[ this document ]] 2474 o Parameter name: access_token 2475 o Parameter usage location: authorization response, token response 2476 o Change controller: IETF 2477 o Specification document(s): [[ this document ]] 2479 o Parameter name: token_type 2480 o Parameter usage location: authorization response, token response 2481 o Change controller: IETF 2482 o Specification document(s): [[ this document ]] 2484 o Parameter name: expires_in 2485 o Parameter usage location: authorization response, token response 2486 o Change controller: IETF 2487 o Specification document(s): [[ this document ]] 2489 o Parameter name: username 2490 o Parameter usage location: token request 2491 o Change controller: IETF 2492 o Specification document(s): [[ this document ]] 2494 o Parameter name: password 2495 o Parameter usage location: token request 2496 o Change controller: IETF 2497 o Specification document(s): [[ this document ]] 2499 o Parameter name: refresh_token 2500 o Parameter usage location: token request, token response 2501 o Change controller: IETF 2502 o Specification document(s): [[ this document ]] 2504 11.3. The OAuth Authorization Endpoint Response Type Registry 2506 This specification establishes the OAuth authorization endpoint 2507 response type registry. 2509 Additional response type for use with the authorization endpoint are 2510 registered on the advice of one or more Designated Experts (appointed 2511 by the IESG or their delegate), with a Specification Required (using 2512 terminology from [RFC5226]). However, to allow for the allocation of 2513 values prior to publication, the Designated Expert(s) may approve 2514 registration once they are satisfied that such a specification will 2515 be published. 2517 Registration requests should be sent to the [TBD]@ietf.org mailing 2518 list for review and comment, with an appropriate subject (e.g., 2519 "Request for response type: example"). [[ Note to RFC-EDITOR: The 2520 name of the mailing list should be determined in consultation with 2521 the IESG and IANA. Suggested name: oauth-ext-review. ]] 2523 Within at most 14 days of the request, the Designated Expert(s) will 2524 either approve or deny the registration request, communicating this 2525 decision to the review list and IANA. Denials should include an 2526 explanation and, if applicable, suggestions as to how to make the 2527 request successful. 2529 Decisions (or lack thereof) made by the Designated Expert can be 2530 first appealed to Application Area Directors (contactable using 2531 app-ads@tools.ietf.org email address or directly by looking up their 2532 email addresses on http://www.iesg.org/ website) and, if the 2533 appellant is not satisfied with the response, to the full IESG (using 2534 the iesg@iesg.org mailing list). 2536 IANA should only accept registry updates from the Designated 2537 Expert(s), and should direct all requests for registration to the 2538 review mailing list. 2540 11.3.1. Registration Template 2542 Response type name: 2543 The name requested (e.g., "example"). 2544 Change controller: 2545 For standards-track RFCs, state "IETF". For others, give the name 2546 of the responsible party. Other details (e.g., postal address, 2547 e-mail address, home page URI) may also be included. 2548 Specification document(s): 2549 Reference to document that specifies the type, preferably 2550 including a URI that can be used to retrieve a copy of the 2551 document. An indication of the relevant sections may also be 2552 included, but is not required. 2554 11.3.2. Initial Registry Contents 2556 The OAuth Authorization Endpoint Response Type Registry's initial 2557 contents are: 2559 o Response type name: code 2560 o Change controller: IETF 2561 o Specification document(s): [[ this document ]] 2563 o Response type name: token 2564 o Change controller: IETF 2565 o Specification document(s): [[ this document ]] 2567 11.4. The OAuth Extensions Error Registry 2569 This specification establishes the OAuth extensions error registry. 2571 Additional error codes used together with other protocol extensions 2572 (i.e. extension grant types, access token types, or extension 2573 parameters) are registered on the advice of one or more Designated 2574 Experts (appointed by the IESG or their delegate), with a 2575 Specification Required (using terminology from [RFC5226]). However, 2576 to allow for the allocation of values prior to publication, the 2577 Designated Expert(s) may approve registration once they are satisfied 2578 that such a specification will be published. 2580 Registration requests should be sent to the [TBD]@ietf.org mailing 2581 list for review and comment, with an appropriate subject (e.g., 2582 "Request for error code: example"). [[ Note to RFC-EDITOR: The name 2583 of the mailing list should be determined in consultation with the 2584 IESG and IANA. Suggested name: oauth-ext-review. ]] 2586 Within at most 14 days of the request, the Designated Expert(s) will 2587 either approve or deny the registration request, communicating this 2588 decision to the review list and IANA. Denials should include an 2589 explanation and, if applicable, suggestions as to how to make the 2590 request successful. 2592 Decisions (or lack thereof) made by the Designated Expert can be 2593 first appealed to Application Area Directors (contactable using 2594 app-ads@tools.ietf.org email address or directly by looking up their 2595 email addresses on http://www.iesg.org/ website) and, if the 2596 appellant is not satisfied with the response, to the full IESG (using 2597 the iesg@iesg.org mailing list). 2599 IANA should only accept registry updates from the Designated 2600 Expert(s), and should direct all requests for registration to the 2601 review mailing list. 2603 11.4.1. Registration Template 2605 Error name: 2606 The name requested (e.g., "example"). 2607 Error usage location: 2608 The location(s) where the error can be used. The possible 2609 locations are: authorization code grant error response 2610 (Section 4.1.2.1), implicit grant error response 2611 (Section 4.2.2.1), or token error response (Section 5.2). 2613 Related protocol extension: 2614 The name of the extension grant type, access token type, or 2615 extension parameter, the error code is used in conjunction with. 2616 Change controller: 2617 For standards-track RFCs, state "IETF". For others, give the name 2618 of the responsible party. Other details (e.g., postal address, 2619 e-mail address, home page URI) may also be included. 2620 Specification document(s): 2621 Reference to document that specifies the error code, preferably 2622 including a URI that can be used to retrieve a copy of the 2623 document. An indication of the relevant sections may also be 2624 included, but is not required. 2626 12. Acknowledgements 2628 The initial OAuth 2.0 protocol specification was edited by David 2629 Recordon, based on two previous publications: the OAuth 1.0 community 2630 specification [RFC5849], and OAuth WRAP (OAuth Web Resource 2631 Authorization Profiles) [I-D.draft-hardt-oauth-01]. The Security 2632 Considerations section was drafted by Torsten Lodderstedt, Mark 2633 McGloin, Phil Hunt, and Anthony Nadalin. 2635 The OAuth 1.0 community specification was edited by Eran Hammer-Lahav 2636 and authored by Mark Atwood, Dirk Balfanz, Darren Bounds, Richard M. 2637 Conlan, Blaine Cook, Leah Culver, Breno de Medeiros, Brian Eaton, 2638 Kellan Elliott-McCrea, Larry Halff, Eran Hammer-Lahav, Ben Laurie, 2639 Chris Messina, John Panzer, Sam Quigley, David Recordon, Eran 2640 Sandler, Jonathan Sergent, Todd Sieling, Brian Slesinsky, and Andy 2641 Smith. 2643 The OAuth WRAP specification was edited by Dick Hardt and authored by 2644 Brian Eaton, Yaron Goland, Dick Hardt, and Allen Tom. 2646 This specification is the work of the OAuth Working Group which 2647 includes dozens of active and dedicated participants. In particular, 2648 the following individuals contributed ideas, feedback, and wording 2649 which shaped and formed the final specification: 2651 Michael Adams, Andrew Arnott, Dirk Balfanz, Aiden Bell, Scott Cantor, 2652 Marcos Caceres, Blaine Cook, Brian Campbell, Brian Eaton, Leah 2653 Culver, Bill de hOra, Brian Eaton, Brian Ellin, Igor Faynberg, George 2654 Fletcher, Tim Freeman, Evan Gilbert, Yaron Goland, Brent Goldman, 2655 Kristoffer Gronowski, Justin Hart, Dick Hardt, Craig Heath, Phil 2656 Hunt, Michael B. Jones, John Kemp, Mark Kent, Raffi Krikorian, Chasen 2657 Le Hara, Rasmus Lerdorf, Torsten Lodderstedt, Hui-Lan Lu, Paul 2658 Madsen, Alastair Mair, Eve Maler, James Manger, Mark McGloin, 2659 Laurence Miao, Chuck Mortimore, Anthony Nadalin, Justin Richer, Peter 2660 Saint-Andre, Nat Sakimura, Rob Sayre, Marius Scurtescu, Naitik Shah, 2661 Luke Shepard, Vlad Skvortsov, Justin Smith, Jeremy Suriel, Christian 2662 Stuebner, Paul Tarjan, Allen Tom, Franklin Tse, Nick Walker, Shane 2663 Weeden, and Skylar Woodward. 2665 Appendix A. Editor's Notes 2667 While many people contributed to this specification throughout its 2668 long journey, the editor would like to acknowledge and thank a few 2669 individuals for their outstanding and invaluable efforts leading up 2670 to the publication of this specification. It is these individuals 2671 without whom this work would not have existed or reached its 2672 successful conclusion. 2674 David Recordon for continuously being one of OAuth's most valuable 2675 assets, bringing pragmatism and urgency to the work, and helping 2676 shape it from its very beginning, as well as being one of the best 2677 collaborators I had the pleasure of working with. 2679 Mark Nottingham for introducing OAuth to the IETF and setting the 2680 community on this course. Lisa Dusseault for her support and 2681 guidance as the Application area director. Blaine Cook, Peter Saint- 2682 Andre, and Hannes Tschofenig for their work as working group chairs. 2684 James Manger for his creative ideas and always insightful feedback. 2685 Brian Campbell, Torsten Lodderstedt, Chuck Mortimore, Justin Richer, 2686 Marius Scurtescu, and Luke Shepard for their continued participation 2687 and valuable feedback. 2689 Special thanks goes to Mike Curtis and Yahoo! for their unconditional 2690 support of this work for over three years. 2692 13. References 2694 13.1. Normative References 2696 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2697 Requirement Levels", BCP 14, RFC 2119, March 1997. 2699 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 2700 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 2701 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 2703 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 2704 Leach, P., Luotonen, A., and L. Stewart, "HTTP 2705 Authentication: Basic and Digest Access Authentication", 2706 RFC 2617, June 1999. 2708 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 2710 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2711 Resource Identifier (URI): Generic Syntax", STD 66, 2712 RFC 3986, January 2005. 2714 [RFC4627] Crockford, D., "The application/json Media Type for 2715 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 2717 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2718 RFC 4949, August 2007. 2720 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2721 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2722 May 2008. 2724 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 2725 Specifications: ABNF", STD 68, RFC 5234, January 2008. 2727 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 2728 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 2730 [W3C.REC-html401-19991224] 2731 Hors, A., Raggett, D., and I. Jacobs, "HTML 4.01 2732 Specification", World Wide Web Consortium 2733 Recommendation REC-html401-19991224, December 1999, 2734 . 2736 13.2. Informative References 2738 [I-D.draft-hardt-oauth-01] 2739 Hardt, D., Ed., Tom, A., Eaton, B., and Y. Goland, "OAuth 2740 Web Resource Authorization Profiles", January 2010. 2742 [I-D.ietf-oauth-saml2-bearer] 2743 Campbell, B. and C. Mortimore, "SAML 2.0 Bearer Assertion 2744 Grant Type Profile for OAuth 2.0", 2745 draft-ietf-oauth-saml2-bearer-03 (work in progress), 2746 February 2011. 2748 [I-D.ietf-oauth-v2-bearer] 2749 Jones, M., Hardt, D., and D. Recordon, "The OAuth 2.0 2750 Protocol: Bearer Tokens", draft-ietf-oauth-v2-bearer-04 2751 (work in progress), March 2011. 2753 [I-D.ietf-oauth-v2-http-mac] 2754 Hammer-Lahav, E., Barth, A., and B. Adida, "HTTP 2755 Authentication: MAC Access Authentication", 2756 draft-ietf-oauth-v2-http-mac-00 (work in progress), 2757 May 2011. 2759 [I-D.ietf-oauth-v2-threatmodel] 2760 Lodderstedt, T., McGloin, M., and P. Hunt, "OAuth 2.0 2761 Threat Model and Security Considerations", 2762 draft-ietf-oauth-v2-threatmodel-00 (work in progress), 2763 July 2011. 2765 [OASIS.saml-core-2.0-os] 2766 Cantor, S., Kemp, J., Philpott, R., and E. Maler, 2767 "Assertions and Protocol for the OASIS Security Assertion 2768 Markup Language (SAML) V2.0", OASIS Standard saml-core- 2769 2.0-os, March 2005. 2771 [RFC5849] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, 2772 April 2010. 2774 Authors' Addresses 2776 Eran Hammer-Lahav (editor) 2777 Yahoo! 2779 Email: eran@hueniverse.com 2780 URI: http://hueniverse.com 2782 David Recordon 2783 Facebook 2785 Email: dr@fb.com 2786 URI: http://www.davidrecordon.com/ 2788 Dick Hardt 2789 Microsoft 2791 Email: dick.hardt@gmail.com 2792 URI: http://dickhardt.org/