idnits 2.17.1 draft-ietf-oauth-v2-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (May 9, 2010) is 5098 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) == Unused Reference: 'NIST FIPS-180-3' is defined on line 2107, but no explicit reference was found in the text == Unused Reference: 'RFC3447' is defined on line 2133, but no explicit reference was found in the text == Unused Reference: 'RFC3629' is defined on line 2137, but no explicit reference was found in the text == Unused Reference: 'I-D.hammer-oauth' is defined on line 2155, but no explicit reference was found in the text == Unused Reference: 'I-D.hardt-oauth' is defined on line 2159, but no explicit reference was found in the text == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p1-messaging-09 -- Possible downref: Non-RFC (?) normative reference: ref. 'NIST FIPS-180-3' ** Downref: Normative reference to an Informational RFC: RFC 2104 ** 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 3447 (Obsoleted by RFC 8017) ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) Summary: 6 errors (**), 0 flaws (~~), 8 warnings (==), 2 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 Intended status: Standards Track D. Recordon 5 Expires: November 10, 2010 Facebook 6 D. Hardt 7 May 9, 2010 9 The OAuth 2.0 Protocol 10 draft-ietf-oauth-v2-04 12 Abstract 14 This specification describes the OAuth 2.0 protocol. OAuth provides 15 a method for making authenticated HTTP requests using a token - an 16 identifier used to denote an access grant with specific scope, 17 duration, and other attributes. Tokens are issued to third-party 18 clients by an authorization server with the approval of the resource 19 owner. OAuth defines multiple flows for obtaining a token to support 20 a wide range of client types and user experience. 22 Status of this Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on November 10, 2010. 39 Copyright Notice 41 Copyright (c) 2010 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 57 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 58 2.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 59 2.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 6 60 2.3. Example . . . . . . . . . . . . . . . . . . . . . . . . . 8 61 2.4. Notational Conventions . . . . . . . . . . . . . . . . . . 8 62 2.5. Conformance . . . . . . . . . . . . . . . . . . . . . . . 8 63 3. Obtaining an Access Token . . . . . . . . . . . . . . . . . . 9 64 3.1. Authorization Endpoint . . . . . . . . . . . . . . . . . . 9 65 3.2. Token Endpoint . . . . . . . . . . . . . . . . . . . . . . 10 66 3.2.1. Response Format . . . . . . . . . . . . . . . . . . . 10 67 3.3. Flow Parameters . . . . . . . . . . . . . . . . . . . . . 12 68 3.4. Client Credentials . . . . . . . . . . . . . . . . . . . . 12 69 3.5. User-Agent Flow . . . . . . . . . . . . . . . . . . . . . 12 70 3.5.1. Client Requests Authorization . . . . . . . . . . . . 14 71 3.5.2. Client Extracts Access Token . . . . . . . . . . . . . 17 72 3.6. Web Server Flow . . . . . . . . . . . . . . . . . . . . . 17 73 3.6.1. Client Requests Authorization . . . . . . . . . . . . 19 74 3.6.2. Client Requests Access Token . . . . . . . . . . . . . 21 75 3.7. Device Flow . . . . . . . . . . . . . . . . . . . . . . . 23 76 3.7.1. Client Requests Authorization . . . . . . . . . . . . 25 77 3.7.2. Client Requests Access Token . . . . . . . . . . . . . 27 78 3.8. Username and Password Flow . . . . . . . . . . . . . . . . 29 79 3.8.1. Client Requests Access Token . . . . . . . . . . . . . 30 80 3.9. Client Credentials Flow . . . . . . . . . . . . . . . . . 32 81 3.9.1. Client Requests Access Token . . . . . . . . . . . . . 32 82 3.10. Assertion Flow . . . . . . . . . . . . . . . . . . . . . . 34 83 3.10.1. Client Requests Access Token . . . . . . . . . . . . . 35 84 4. Refreshing an Access Token . . . . . . . . . . . . . . . . . . 36 85 5. Accessing a Protected Resource . . . . . . . . . . . . . . . . 38 86 5.1. The Authorization Request Header . . . . . . . . . . . . . 39 87 5.2. Bearer Token Requests . . . . . . . . . . . . . . . . . . 40 88 5.2.1. URI Query Parameter . . . . . . . . . . . . . . . . . 41 89 5.2.2. Form-Encoded Body Parameter . . . . . . . . . . . . . 41 90 5.3. Cryptographic Tokens Requests . . . . . . . . . . . . . . 42 91 5.3.1. The 'hmac-sha256' Algorithm . . . . . . . . . . . . . 43 92 6. Identifying a Protected Resource . . . . . . . . . . . . . . . 46 93 6.1. The WWW-Authenticate Response Header . . . . . . . . . . . 46 94 6.1.1. The 'realm' Attribute . . . . . . . . . . . . . . . . 47 95 6.1.2. The 'authorization-uri' Attribute . . . . . . . . . . 47 96 6.1.3. The 'algorithms' Attribute . . . . . . . . . . . . . . 47 97 6.1.4. The 'error' Attribute . . . . . . . . . . . . . . . . 47 98 7. Security Considerations . . . . . . . . . . . . . . . . . . . 47 99 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 100 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 47 101 Appendix A. Differences from OAuth 1.0a . . . . . . . . . . . . . 47 102 Appendix B. Document History . . . . . . . . . . . . . . . . . . 48 103 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 49 104 10.1. Normative References . . . . . . . . . . . . . . . . . . . 49 105 10.2. Informative References . . . . . . . . . . . . . . . . . . 50 106 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 50 108 1. Authors 110 This specification was authored with the participation and based on 111 the work of Allen Tom (Yahoo!), Brian Eaton (Google), Brent Goldman 112 (Facebook), Luke Shepard (Facebook), Raffi Krikorian (Twitter), and 113 Yaron Goland (Microsoft). 115 2. Introduction 117 With the increasing use of distributed web services and cloud 118 computing, third-party applications require access to server-hosted 119 resources. These resources are usually protected and require 120 authentication using the resource owner's credentials (typically a 121 username and password). In the traditional client-server 122 authentication model, a client accessing a protected resource on a 123 server presents the resource owner's credentials in order to 124 authenticate and gain access. 126 Resource owners should not be required to share their credentials 127 when granting third-party applications access to their protected 128 resources. They should also have the ability to restrict access to a 129 limited subset of the resources they control, to limit access 130 duration, or to limit access to the HTTP methods supported by these 131 resources. 133 OAuth provides a method for making authenticated HTTP requests using 134 a token - an identifier used to denote an access grant with specific 135 scope, duration, and other attributes. Tokens are issued to third- 136 party clients by an authorization server with the approval of the 137 resource owner. Instead of sharing their credentials with the 138 client, resource owners grant access by authenticating directly with 139 the authorization server which in turn issues a token to the client. 140 The client uses the token (and optional secret) to authenticate with 141 the resource server and gain access. 143 For example, a web user (resource owner) can grant a printing service 144 (client) access to her protected photos stored at a photo sharing 145 service (resource server), without sharing her username and password 146 with the printing service. Instead, she authenticates directly with 147 the photo sharing service (authorization server) which issues the 148 printing service delegation-specific credentials (token). 150 This specification defines the use of OAuth over HTTP [RFC2616] (or 151 HTTP over TLS 1.0 as defined by [RFC2818]. Other specifications may 152 extend it for use with other transport protocols. 154 2.1. Terminology 156 resource server 157 An HTTP [RFC2616] server capable of accepting authenticated 158 resource requests using the OAuth protocol. 160 protected resource 161 An access-restricted resource which can be obtained from a 162 resource server using an OAuth-authenticated request. 164 client 165 An HTTP client capable of making authenticated requests for 166 protected resources using the OAuth protocol. 168 resource owner 169 An entity capable of granting access to a protected resource. 171 end-user 172 A human resource owner. 174 access token 175 A unique identifier used by the client to make authenticated 176 requests on behalf of the resource owner. Access tokens may 177 have a matching secret. 179 bearer token An access token without a matching secret, used to 180 obtain access to a protected resource by simply presenting the 181 access token as-is to the resource server. 183 authorization server 184 An HTTP server capable of issuing tokens after successfully 185 authenticating the resource owner and obtaining authorization. 186 The authorization server may be the same server as the resource 187 server, or a separate entity. 189 authorization endpoint 190 The authorization server's HTTP endpoint capable of 191 authenticating the resource owner and obtaining authorization. 193 token endpoint 194 The authorization server's HTTP endpoint capable of issuing 195 tokens and refreshing expired tokens. 197 client identifier 198 An unique identifier issued to the client to identify itself to 199 the authorization server. Client identifiers may have a 200 matching secret. 202 refresh token 203 A unique identifier used by the client to replace an expired 204 access token with a new access token without having to involve 205 the resource owner. A refresh token is used when the access 206 token is valid for a shorter time period than the duration of 207 the access grant approved by the resource owner. 209 2.2. Overview 211 Clients interact with a protected resource, first by requesting 212 access (which is granted in the form of an access token) from the 213 authorization server, and then by authenticating with the resource 214 server by presenting the access token. Figure 1 demonstrates the 215 flow between the client and authorization server (A, B), and the flow 216 between the client and resource server (C, D), when the client is 217 acting autonomously (the client is also the resource owner). 219 +--------+ +---------------+ 220 | |--(A)------ Credentials --------->| Authorization | 221 | | | Server | 222 | |<-(B)------ Access Token ---------| | 223 | | (w/ Optional Refresh Token) +---------------+ 224 | Client | 225 | | HTTP Request +---------------+ 226 | |--(C)--- with Access Token ------>| Resource | 227 | | | Server | 228 | |<-(D)------ HTTP Response --------| | 229 +--------+ +---------------+ 231 Figure 1 233 Access token strings can use any internal structure agreed upon 234 between the authorization server and the resource server, but their 235 structure is opaque to the client. Since the access token provides 236 the client access to the protected resource for the life of the 237 access token (or until revoked), the authorization server should 238 issue access tokens which expire within an appropriate time, usually 239 much shorter than the duration of the access grant. 241 When an access token expires, the client can request a new access 242 token from the authorization server by presenting its credentials 243 again (Figure 1), or by using the refresh token (if issued with the 244 access token) as shown in Figure 2. Once an expired access token has 245 been replaced with a new access token (A, B), the client uses the new 246 access token as before (C, D). 248 +--------+ +---------------+ 249 | |--(A)------ Refresh Token ------->| Authorization | 250 | | | Server | 251 | |<-(B)------ Access Token ---------| | 252 | | (with Optional Secret) +---------------+ 253 | Client | 254 | | HTTP Request +---------------+ 255 | |--(C)--- with Access Token ------>| Resource | 256 | | | Server | 257 | |<-(D)----- HTTP Response ---------| | 258 +--------+ +---------------+ 260 Figure 2 262 This specification defines a number of authorization flows to support 263 different client types and scenarios. These authorization flows can 264 be separated into three groups: user delegation flows, direct 265 credentials flows, and autonomous flows. 267 Additional authorization flows may be defined by other specifications 268 to cover different scenarios and client types. 270 User delegation flows are used to grant client access to protected 271 resources by the end-user without sharing the end-user credentials 272 (e.g. a username and password) with the client. Instead, the end- 273 user authenticates directly with the authorization server, and grants 274 client access to its protected resources. The user delegation flows 275 defined by this specifications are: 277 o User-Agent Flow - This flow is designed for clients running inside 278 a user-agent (typically a web browser). This flow is described in 279 Section 3.5. 281 o Web Server Flow - This flow is optimized for clients that are part 282 of a web server application, accessible via HTTP requests. This 283 flow is described in Section 3.6. 285 o Device Flow - This flow is suitable for clients executing on 286 limited devices, but where the end-user has separate access to a 287 user-agent on another computer or device. This flow is described 288 in Section 3.7. 290 Direct credentials flows enable clients to obtain an access token 291 with a single request using the client credentials or end-user 292 credentials without seeking additional resource owner authorization. 293 The direct credentials flows defined by this specification are: 295 o Username and Password Flow - This flow is used in cases where the 296 end-user trusts the client to handle its credentials but it is 297 still undesirable for the client to store the end-user's username 298 and password. This flow is only suitable when there is a high 299 degree of trust between the end-user and the client. This flow is 300 described in Section 3.8. 302 o Client Credentials Flow - The client uses its credentials to 303 obtain an access token. This flow is described in Section 3.9. 305 Autonomous flows enable clients to use utilize existing trust 306 relationships or different authorization constructs to obtain an 307 access token. They provide a bridge between OAuth and other trust 308 frameworks. The autonomous authorization flow defined by this 309 specifications is: 311 o Assertion Flow - The client presents an assertion such as a SAML 312 [OASIS.saml-core-2.0-os] assertion to the authorization server in 313 exchange for an access token. This flow is described in 314 Section 3.10. 316 2.3. Example 318 [[ Todo ]] 320 2.4. Notational Conventions 322 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 323 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this 324 document are to be interpreted as described in [RFC2119]. 326 This document uses the Augmented Backus-Naur Form (ABNF) notation of 327 [I-D.ietf-httpbis-p1-messaging]. Additionally, the realm and auth- 328 param rules are included from [RFC2617], and the URI-Reference rule 329 from [RFC3986]. 331 2.5. Conformance 333 An implementation is not compliant if it fails to satisfy one or more 334 of the MUST or REQUIRED level requirements for the flows it 335 implements. An implementation that satisfies all the MUST or 336 REQUIRED level and all the SHOULD level requirements for its flows is 337 said to be "unconditionally compliant"; one that satisfies all the 338 MUST level requirements but not all the SHOULD level requirements for 339 its flows is said to be "conditionally compliant." 341 3. Obtaining an Access Token 343 The client obtains an access token by using one of the authorization 344 flows supported by the authorization server. The authorization flows 345 all use the same authorization and token endpoints, each with a 346 different set of request parameters and values. 348 Access tokens have a scope, duration, and other access attributes 349 granted by the resource owner. These attributes MUST be enforced by 350 the resource server when receiving a protected resource request, and 351 by the authorization server when receiving a token refresh request. 353 In many cases it is desirable to issue access tokens with a shorter 354 lifetime than the duration of the authorization grant. However, it 355 may be undesirable to require the resource owner to authorize the 356 request again. Instead, the authorization server issues a refresh 357 token in addition to the access token. When the access token 358 expires, the client can request a new access token without involving 359 the resource owner as long as the authorization grant is still valid. 360 The token refresh method is described in Section 4. 362 3.1. Authorization Endpoint 364 Clients direct the resource owner to the authorization endpoint to 365 approve their access request. Before granting access, the resource 366 owner first authenticates with the authorization server. The way in 367 which the authorization server authenticates the end-user (e.g. 368 username and password login, OpenID, session cookies) and in which 369 the authorization server obtains the end-user's authorization, 370 including whether it uses a secure channel such as TLS/SSL, is beyond 371 the scope of this specification. However, the authorization server 372 MUST first verify the identity of the end-user. 374 The URI of the authorization endpoint can be found in the service 375 documentation, or can be obtained by the client by making an 376 unauthorized protected resource request (from the "WWW-Authenticate" 377 response header auth-uri (Section 6.1.2) attribute). 379 The authorization endpoint advertised by the resource server MAY 380 include a query component as defined by [RFC3986] section 3. 382 Since requests to the authorization endpoint result in user 383 authentication and the transmission of sensitive values, the 384 authorization server SHOULD require the use of a transport-layer 385 mechanism such as TLS/SSL (or a secure channel with equivalent 386 protections) when sending requests to the authorization endpoints. 388 3.2. Token Endpoint 390 After obtaining authorization from the resource owner, clients 391 request an access token from the authorization server's token 392 endpoint. 394 The URI of the token endpoint can be found in the service 395 documentation, or can be obtained by the client by making an 396 unauthorized protected resource request (from the "WWW-Authenticate" 397 response header token-uri (Section 6.1.2) attribute). 399 The token endpoint advertised by the resource server MAY include a 400 query component as defined by [RFC3986] section 3. 402 Since requests to the token endpoint result in the transmission of 403 plain text credentials in the HTTP request and response, the 404 authorization server MUST require the use of a transport-layer 405 mechanism such as TLS/SSL (or a secure channel with equivalent 406 protections) when sending requests to the token endpoints. 408 3.2.1. Response Format 410 Authorization servers respond to client requests by including a set 411 of response parameters in the entity body of the HTTP response. The 412 response uses the "application/json" media type as defined by 413 [RFC4627]. 415 The parameters are serialized into a JSON structure by adding each 416 parameter at the highest structure level. Parameter names and string 417 values are included as JSON strings. Numerical number are included 418 as JSON numbers. 420 The authorization server MUST include the HTTP "Cache-Control" 421 response header field with a value of "no-store" in any response 422 containing tokens, secrets, or other sensitive information. 424 3.2.1.1. Access Token Response 426 After receiving and verifying a valid and authorized access token 427 request from the client (as described in each of the flows below), 428 the authorization server constructs a JSON-formatted response which 429 includes the common parameters set as well as additional flow- 430 specific parameters. The formatted parameters are sent to the client 431 in the entity body of the HTTP response with a 200 status code (OK). 433 The token response contains the following common parameters: 435 access_token 436 REQUIRED. The access token issued by the authorization server. 438 expires_in 439 OPTIONAL. The duration in seconds of the access token 440 lifetime. 442 refresh_token 443 OPTIONAL. The refresh token used to obtain new access tokens 444 using the same end-user access grant as described in Section 4. 446 access_token_secret 447 REQUIRED if requested by the client. The corresponding access 448 token secret as requested by the client. 450 scope 451 OPTIONAL. The scope of the access token as a list of space- 452 delimited strings. The value of the "scope" parameter is 453 defined by the authorization server. If the value contains 454 multiple space-delimited strings, their order does not matter, 455 and each string adds an additional access range to the 456 requested scope. 458 For example (line breaks are for display purposes only): 460 HTTP/1.1 200 OK 461 Content-Type: application/json 462 Cache-Control: no-store 464 {"access_token":"SlAV32hkKG","expires_in":3600, 465 "refresh_token":"8xLOxBtZp8"} 467 3.2.1.2. Error Response 469 If the token request is invalid or unauthorized, the authorization 470 server constructs a JSON-formatted response which includes the common 471 parameters set as well as additional flow-specific parameters. The 472 formatted parameters are sent to the client in the entity body of the 473 HTTP response with a 400 status code (Bad Request). 475 The response contains the following common parameter: 477 error 478 REQUIRED. The parameter value MUST be set to one of the values 479 specified by each flow. 481 For example: 483 HTTP/1.1 400 Bad Request 484 Content-Type: application/json 485 Cache-Control: no-store 487 {"error":"incorrect_client_credentials"} 489 3.3. Flow Parameters 491 The sizes of tokens and other values received from the authorization 492 server, are left undefined by this specification. Clients should 493 avoid making assumptions about value sizes. Servers should document 494 the expected size of any value they issue. 496 Unless otherwise noted, all the protocol parameter names and values 497 are case sensitive. 499 3.4. Client Credentials 501 When requesting access from the authorization server, the client 502 identifies itself using a set of client credentials. The client 503 credentials include a client identifier and an OPTIONAL symmetric 504 shared secret. The means through which the client obtains these 505 credentials are beyond the scope of this specification, but usually 506 involve registration with the authorization server. 508 The client identifier is used by the authorization server to 509 establish the identity of the client for the purpose of presenting 510 information to the resource owner prior to granting access, as well 511 as for providing different service levels to different clients. They 512 can also be used to block unauthorized clients from requesting 513 access. 515 Due to the nature of some clients, authorization servers SHOULD NOT 516 make assumptions about the confidentiality of client credentials 517 without establishing trust with the client operator. Authorization 518 servers SHOULD NOT issue client secrets to clients incapable of 519 keeping their secrets confidential. 521 3.5. User-Agent Flow 523 The user-agent flow is a user delegation flow suitable for client 524 applications residing in a user-agent, typically implemented in a 525 browser using a scripting language such as JavaScript. These clients 526 cannot keep client secrets confidential and the authentication of the 527 client is based on the user-agent's same-origin policy. 529 Unlike other flows in which the client makes separate authorization 530 and access token requests, the client received the access token as a 531 result of the authorization request in the form of an HTTP 532 redirection. The client requests the authorization server to 533 redirect the user-agent to another web server or local resource 534 accessible to the browser which is capable of extracting the access 535 token from the response and passing it to the client. 537 This user-agent flow does not utilize the client secret since the 538 client executables reside on the end-user's computer or device which 539 makes the client secret accessible and exploitable. Because the 540 access token is encoded into the redirection URI, it may be exposed 541 to the end-user and other applications residing on the computer or 542 device. 544 +----------+ Client Identifier +----------------+ 545 | |>---(A)-- & Redirection URI --->| | 546 | | | | 547 End <--+ - - - +----(B)-- User authenticates -->| Authorization | 548 User | | | Server | 549 | |<---(C)-- Redirect URI --------<| | 550 | Client | with Access Token | | 551 | in | (w/ Optional Refresh Token) +----------------+ 552 | Browser | in Fragment 553 | | +----------------+ 554 | |>---(D)-- Redirect URI -------->| | 555 | | without Fragment | Web Server | 556 | | | with Client | 557 | (F) |<---(E)-- Web Page with -------<| Resource | 558 | Access | Script | | 559 | Token | +----------------+ 560 +----------+ 562 Figure 3 564 The user-agent flow illustrated in Figure 3 includes the following 565 steps: 567 (A) The client sends the user-agent to the authorization server and 568 includes its client identifier and redirection URI in the 569 request. 571 (B) The authorization server authenticates the end-user (via the 572 user-agent) and establishes whether the end-user grants or 573 denies the client's access request. 575 (C) Assuming the end-user granted access, the authorization server 576 redirects the user-agent to the redirection URI provided 577 earlier. The redirection URI includes the access token in the 578 URI fragment. 580 (D) The user-agent follows the redirection instructions by making a 581 request to the web server which does not include the fragment. 582 The user-agent retains the fragment information locally. 584 (E) The web server returns a web page containing a script capable of 585 extracting the access token from the URI fragment retained by 586 the user-agent. 588 (F) The user-agent executes the script provided by the web server 589 which extracts the access token and passes it to the client. 591 3.5.1. Client Requests Authorization 593 In order for the end-user to grant the client access, the client 594 sends the end-user to the authorization server. The client 595 constructs the request URI by adding the following URI query 596 parameters to the user authorization endpoint URI: 598 type 599 REQUIRED. The parameter value MUST be set to "user_agent". 601 client_id 602 REQUIRED. The client identifier as described in Section 3.4. 604 redirect_uri 605 REQUIRED unless a redirection URI has been established between 606 the client and authorization server via other means. An 607 absolute URI to which the authorization server will redirect 608 the user-agent to when the end-user authorization step is 609 completed. The authorization server SHOULD require the client 610 to pre-register their redirection URI. Authorization servers 611 MAY restrict the redirection URI to not include a query 612 component as defined by [RFC3986] section 3. 614 state 615 OPTIONAL. An opaque value used by the client to maintain state 616 between the request and callback. The authorization server 617 includes this value when redirecting the user-agent back to the 618 client. 620 scope 621 OPTIONAL. The scope of the access request expressed as a list 622 of space-delimited strings. The value of the "scope" parameter 623 is defined by the authorization server. If the value contains 624 multiple space-delimited strings, their order does not matter, 625 and each string adds an additional access range to the 626 requested scope. 628 immediate 629 OPTIONAL. The parameter value must be set to "true" or 630 "false". If set to "true", the authorization server MUST NOT 631 prompt the end-user to authenticate or approve access. 632 Instead, the authorization server attempts to establish the 633 end-user's identity via other means (e.g. browser cookies) and 634 checks if the end-user has previously approved an identical 635 access request by the same client and if that access grant is 636 still active. If the authorization server does not support an 637 immediate check or if it is unable to establish the end-user's 638 identity or approval status, it MUST deny the request without 639 prompting the end-user. Defaults to "false" if omitted. 641 secret_type 642 OPTIONAL. The access token secret type as described by 643 Section 5.3. If omitted, the authorization server will issue a 644 bearer token (an access token without a matching secret) as 645 described by Section 5.2. 647 The client directs the end-user to the constructed URI using an HTTP 648 redirection response, or by other means available to it via the end- 649 user's user-agent. The request MUST use the HTTP "GET" method. 651 For example, the client directs the end-user's user-agent to make the 652 following HTTPS request (line breaks are for display purposes only): 654 GET /authorize?type=user_agent&client_id=s6BhdRkqt3& 655 redirect_uri=https%3A%2F%2FEexample%2Ecom%2Frd HTTP/1.1 656 Host: server.example.com 658 If the client has previously registered a redirection URI with the 659 authorization server, the authorization server MUST verify that the 660 redirection URI received matches the registered URI associated with 661 the client identifier. 663 The authorization server authenticates the end-user and obtains an 664 authorization decision (by asking the end-user or establishing 665 approval via other means). The authorization server sends the end- 666 user's user-agent to the provided client redirection URI using an 667 HTTP redirection response. 669 3.5.1.1. End-user Grants Authorization 671 If the end-user authorizes the access request, the authorization 672 server issues an access token and delivers it to the client by adding 673 the following parameters, using the 674 "application/x-www-form-urlencoded" format as defined by 675 [W3C.REC-html40-19980424], to the redirection URI fragment: 677 access_token 678 REQUIRED. The access token. 680 expires_in 681 OPTIONAL. The duration in seconds of the access token 682 lifetime. 684 refresh_token 685 OPTIONAL. The refresh token. 687 state 688 REQUIRED if the "state" parameter was present in the client 689 authorization request. Set to the exact value received from 690 the client. 692 access_token_secret 693 REQUIRED if requested by the client. The corresponding access 694 token secret as requested by the client. 696 For example, the authorization server redirects the end-user's user- 697 agent by sending the following HTTP response: 699 HTTP/1.1 302 Found 700 Location: http://example.com/rd#access_token=FJQbwq9&expires_in=3600 702 3.5.1.2. End-user Denies Authorization 704 If the end-user denied the access request, the authorization server 705 responds to the client by adding the following parameters, using the 706 "application/x-www-form-urlencoded" format as defined by 707 [W3C.REC-html40-19980424], to the redirection URI fragment: 709 error 710 REQUIRED. The parameter value MUST be set to "user_denied". 712 state 713 REQUIRED if the "state" parameter was present in the client 714 authorization request. Set to the exact value received from 715 the client. 717 For example, the authorization server responds with the following: 719 HTTP/1.1 302 Found 720 Location: http://example.com/rd#error=user_denied 722 The authorization flow concludes unsuccessfully. To extract the 723 error message, the client follows the steps described in 724 Section 3.5.2. 726 3.5.2. Client Extracts Access Token 728 The user-agent follows the authorization server redirection response 729 by making an HTTP "GET" request to the URI received in the "Location" 730 HTTP response header. The user-agent SHALL NOT include the fragment 731 component with the request. 733 For example, the user-agent makes the following HTTP "GET" request in 734 response to the redirection directive received from the authorization 735 server: 737 GET /rd HTTP/1.1 738 Host: example.com 740 The HTTP response to the redirection request returns a web page 741 (typically an HTML page with an embedded script) capable of accessing 742 the full redirection URI including the fragment retained by the user- 743 agent, and extracting the access token (and other parameters) 744 contained in the fragment. 746 3.6. Web Server Flow 748 The web server flow is a user delegation flow suitable for clients 749 capable of interacting with the end-user's user-agent (typically a 750 web browser) and capable of receiving incoming requests from the 751 authorization server (capable of acting as an HTTP server). 753 +----------+ Client Identifier +---------------+ 754 | -+----(A)-- & Redirect URI ------->| | 755 | End-user | | Authorization | 756 | at |<---(B)-- User authenticates --->| Server | 757 | Browser | | | 758 | -+----(C)-- Verification Code ----<| | 759 +-|----|---+ +---------------+ 760 | | ^ v 761 (A) (C) | | 762 | | | | 763 ^ v | | 764 +---------+ | | 765 | |>---(D)-- Client Credentials, --------' | 766 | Web | Verification Code, | 767 | Client | & Redirect URI | 768 | | | 769 | |<---(E)------- Access Token -----------------' 770 +---------+ (w/ Optional Refresh Token) 772 Figure 4 774 The web server flow illustrated in Figure 4 includes the following 775 steps: 777 (A) The web client initiates the flow by redirecting the end-user's 778 user-agent to the authorization endpoint with its client 779 identifier and a redirect URI to which the authorization server 780 will send the end-user back once authorization is received (or 781 denied). 783 (B) The authorization server authenticates the end-user (via the 784 user-agent) and establishes whether the end-user grants or 785 denies the client's access request. 787 (C) Assuming the end-user granted access, the authorization server 788 redirects the user-agent back to the client to the redirection 789 URI provided earlier. The authorization includes a verification 790 code for the client to use to obtain an access token. 792 (D) The client requests an access token from the authorization 793 server by including its client credentials (identifier and 794 secret), as well as the verification code received in the 795 previous step. 797 (E) The authorization server validates the client credentials and 798 the verification code and responds back with the access token. 800 3.6.1. Client Requests Authorization 802 In order for the end-user to grant the client access, the client 803 sends the end-user to the authorization server. The client 804 constructs the request URI by adding the following URI query 805 parameters to the user authorization endpoint URI: 807 type 808 REQUIRED. The parameter value MUST be set to "web_server". 810 client_id 811 REQUIRED. The client identifier as described in Section 3.4. 813 redirect_uri 814 REQUIRED unless a redirection URI has been established between 815 the client and authorization server via other means. An 816 absolute URI to which the authorization server will redirect 817 the user-agent to when the end-user authorization step is 818 completed. The authorization server MAY require the client to 819 pre-register their redirection URI. Authorization servers MAY 820 restrict the redirection URI to not include a query component 821 as defined by [RFC3986] section 3. 823 state 824 OPTIONAL. An opaque value used by the client to maintain state 825 between the request and callback. The authorization server 826 includes this value when redirecting the user-agent back to the 827 client. 829 scope 830 OPTIONAL. The scope of the access request expressed as a list 831 of space-delimited strings. The value of the "scope" parameter 832 is defined by the authorization server. If the value contains 833 multiple space-delimited strings, their order does not matter, 834 and each string adds an additional access range to the 835 requested scope. 837 immediate 838 OPTIONAL. The parameter value must be set to "true" or 839 "false". If set to "true", the authorization server MUST NOT 840 prompt the end-user to authenticate or approve access. 841 Instead, the authorization server attempts to establish the 842 end-user's identity via other means (e.g. browser cookies) and 843 checks if the end-user has previously approved an identical 844 access request by the same client and if that access grant is 845 still active. If the authorization server does not support an 846 immediate check or if it is unable to establish the end-user's 847 identity or approval status, it MUST deny the request without 848 prompting the end-user. Defaults to "false" if omitted. 850 The client directs the end-user to the constructed URI using an HTTP 851 redirection response, or by other means available to it via the end- 852 user's user-agent. The request MUST use the HTTP "GET" method. 854 For example, the client directs the end-user's user-agent to make the 855 following HTTPS requests (line breaks are for display purposes only): 857 GET /authorize?type=web_server&client_id=s6BhdRkqt3&redirect_uri= 858 https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 859 Host: server.example.com 861 If the client has previously registered a redirection URI with the 862 authorization server, the authorization server MUST verify that the 863 redirection URI received matches the registered URI associated with 864 the client identifier. 866 The authorization server authenticates the end-user and obtains an 867 authorization decision (by asking the end-user or establishing 868 approval via other means). The authorization server sends the end- 869 user's user-agent to the provided client redirection URI using an 870 HTTP redirection response, or by other means available to it via the 871 end-user's user-agent. 873 3.6.1.1. End-user Grants Authorization 875 If the end-user authorizes the access request, the authorization 876 server generates a verification code and associates it with the 877 client identifier and redirection URI. The authorization server 878 constructs the request URI by adding the following parameters to the 879 query component of redirection URI provided by the client: 881 code 882 REQUIRED. The verification code generated by the authorization 883 server. 885 state 886 REQUIRED if the "state" parameter was present in the client 887 authorization request. Set to the exact value received from 888 the client. 890 The verification code should expire shortly after it is issued and 891 allowed for a single use. 893 For example, the authorization server redirects the end-user's user- 894 agent by sending the following HTTP response: 896 HTTP/1.1 302 Found 897 Location: https://client.example.com/cb?code=i1WsRn1uB1 899 In turn, the end-user's user-agent makes the following HTTPS "GET" 900 request: 902 GET /cb?code=i1WsRn1uB1 HTTP/1.1 903 Host: client.example.com 905 3.6.1.2. End-user Denies Authorization 907 If the end-user denied the access request, the authorization server 908 constructs the request URI by adding the following parameters to the 909 query component of the redirection URI provided by the client: 911 error 912 REQUIRED. The parameter value MUST be set to "user_denied". 914 state 915 REQUIRED if the "state" parameter was present in the client 916 authorization request. Set to the exact value received from 917 the client. 919 For example, the authorization server directs the client to make the 920 following HTTP request: 922 GET /cb?error=user_denied HTTP/1.1 923 Host: client.example.com 925 The authorization flow concludes unsuccessfully. 927 3.6.2. Client Requests Access Token 929 The client obtains an access token from the authorization server by 930 making an HTTP "POST" request to the token endpoint. The client 931 constructs a request URI by adding the following parameters to the 932 request: 934 type 935 REQUIRED. The parameter value MUST be set to "web_server". 937 client_id 938 REQUIRED. The client identifier as described in Section 3.4. 940 client_secret 941 REQUIRED if the client identifier has a matching secret. The 942 client secret as described in Section 3.4. 944 code 945 REQUIRED. The verification code received from the 946 authorization server. 948 redirect_uri 949 REQUIRED. The redirection URI used in the initial request. 951 secret_type 952 OPTIONAL. The access token secret type as described by 953 Section 5.3. If omitted, the authorization server will issue a 954 bearer token (an access token without a matching secret) as 955 described by Section 5.2. 957 For example, the client makes the following HTTPS request (line 958 breaks are for display purposes only): 960 POST /token HTTP/1.1 961 Host: server.example.com 962 Content-Type: application/x-www-form-urlencoded 964 type=web_server&client_id=s6BhdRkqt3& 965 client_secret=gX1fBat3bV&code=i1WsRn1uB1& 966 redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb 968 The authorization server MUST verify that the verification code, 969 client identity, client secret, and redirection URI are all valid and 970 match its stored association. If the request is valid, the 971 authorization server issues a successful response as described in 972 Section 3.2.1.1. 974 For example (line breaks are for display purposes only): 976 HTTP/1.1 200 OK 977 Content-Type: application/json 978 Cache-Control: no-store 980 {"access_token":"SlAV32hkKG","expires_in":3600, 981 "refresh_token":"8xLOxBtZp8"} 983 If the request is invalid, the authorization server returns an error 984 response as described in Section 3.2.1.2 with one of the following 985 error codes: 987 o "redirect_uri_mismatch" 989 o "bad_verification_code" 991 o "incorrect_client_credentials" 993 For example: 995 HTTP/1.1 400 Bad Request 996 Content-Type: application/json 997 Cache-Control: no-store 999 {"error":"incorrect_client_credentials"} 1001 3.7. Device Flow 1003 The device flow is a user delegation flow suitable for clients 1004 executing on devices which do not have an easy data-entry method 1005 (e.g. game consoles or media hub), but where the end-user has 1006 separate access to a user-agent on another computer or device (e.g. 1007 home computer, a laptop, or a smart phone). The client is incapable 1008 of receiving incoming requests from the authorization server 1009 (incapable of acting as an HTTP server). 1011 Instead of interacting with the end-user's user-agent, the client 1012 instructs the end-user to use another computer or device and connect 1013 to the authorization server to approve the access request. Since the 1014 client cannot receive incoming requests, it polls the authorization 1015 server repeatedly until the end-user completes the approval process. 1017 This device flow does not utilize the client secret since the client 1018 executables reside on a local device which makes the client secret 1019 accessible and exploitable. 1021 +----------+ +----------------+ 1022 | |>---(A)-- Client Identifier --->| | 1023 | | | | 1024 | |<---(B)-- Verification Code, --<| | 1025 | | User Code, | | 1026 | | & Verification URI | | 1027 | Device | | | 1028 | Client | Client Identifier & | | 1029 | |>---(E)-- Verification Code --->| | 1030 | | ... | | 1031 | |>---(E)---> | | 1032 | | | Authorization | 1033 | |<---(F)-- Access Token --------<| Server | 1034 +----------+ (w/ Optional Refresh Token) | | 1035 v | | 1036 : | | 1037 (C) User Code & Verification URI | | 1038 : | | 1039 v | | 1040 +----------+ | | 1041 | End-user | | | 1042 | at |<---(D)-- User authenticates -->| | 1043 | Browser | | | 1044 +----------+ +----------------+ 1046 Figure 5 1048 The device flow illustrated in Figure 5 includes the following steps: 1050 (A) The client requests access from the authorization server and 1051 includes its client identifier in the request. 1053 (B) The authorization server issues a verification code, a user 1054 code, and provides the end-user authorization URI. 1056 (C) The client instructs the end-user to use its user-agent 1057 (elsewhere) and visit the provided authorization URI. The 1058 client provides the user with the user code to enter in order to 1059 grant access. 1061 (D) The authorization server authenticates the end-user (via the 1062 user-agent) and prompts the end-user to grant the client's 1063 access request. If the end-user agrees to the client's access 1064 request, the end-user enters the user code provided by the 1065 client. 1067 (E) While the end-user authorizes (or denies) the client's request 1068 (D), the client repeatedly polls the authorization server to 1069 find out if the end-user completed the user authorization step. 1070 The client includes the verification code and its client 1071 identifier. 1073 (F) Assuming the end-user granted access, the authorization server 1074 validates the verification code provided by the client and 1075 responds back with the access token. 1077 3.7.1. Client Requests Authorization 1079 The client initiates the flow by requesting a set of verification 1080 codes from the authorization server by making an HTTP "POST" request 1081 to the token endpoint. The client constructs a request URI by adding 1082 the following parameters to the request: 1084 type 1085 REQUIRED. The parameter value MUST be set to "device_code". 1087 client_id 1088 REQUIRED. The client identifier as described in Section 3.4. 1090 scope 1091 OPTIONAL. The scope of the access request expressed as a list 1092 of space-delimited strings. The value of the "scope" parameter 1093 is defined by the authorization server. If the value contains 1094 multiple space-delimited strings, their order does not matter, 1095 and each string adds an additional access range to the 1096 requested scope. 1098 For example, the client makes the following HTTPS request (line 1099 breaks are for display purposes only): 1101 POST /token?type=device_code&client_id=s6BhdRkqt3 1102 HTTP/1.1 1103 Host: server.example.com 1105 In response, the authorization server generates a verification code 1106 and a user code and includes them in the HTTP response body using the 1107 "application/json" format as described by Section 3.2.1 with a 200 1108 status code (OK). The response contains the following parameters: 1110 code 1111 REQUIRED. The verification code. 1113 user_code 1114 REQUIRED. The user code. 1116 user_uri 1117 REQUIRED. The user authorization URI on the authorization 1118 server. The URI should be short and easy to remember as end- 1119 users will be asked to manually type it into their user-agent. 1121 expires_in 1122 OPTIONAL. The duration in seconds of the verification code 1123 lifetime. 1125 interval 1126 OPTIONAL. The minimum amount of time in seconds that the 1127 client SHOULD wait between polling requests to the token 1128 endpoint. 1130 For example (line breaks are for display purposes only): 1132 HTTP/1.1 200 OK 1133 Content-Type: application/json 1134 Cache-Control: no-store 1136 {"code":"74tq5miHKB","user_code":"94248","user_uri":"http%3A%2F%2 1137 Fwww%2Eexample%2Ecom%2Fdevice","interval"=5} 1139 The client displays the user code and the user authorization URI to 1140 the end-user, and instructs the end-user to visit the URI using a 1141 user-agent and enter the user code. 1143 The end-user manually types the provided URI and authenticates with 1144 the authorization server. The authorization server prompts the end- 1145 user to authorize the client's request by entering the user code 1146 provided by the client. Once the end-user approves or denies the 1147 request, the authorization server informs the end-user to return to 1148 the device for further instructions. 1150 3.7.2. Client Requests Access Token 1152 Since the client is unable to receive incoming requests from the 1153 authorization server, it polls the authorization server repeatedly 1154 until the end-user grants or denies the request, or the verification 1155 code expires. 1157 The client makes the following request at an arbitrary but reasonable 1158 interval which MUST NOT exceed the minimum interval rate provided by 1159 the authorization server (if present via the "interval" parameter). 1160 Alternatively, the client MAY provide a user interface for the end- 1161 user to manually inform it when authorization was granted. 1163 The client requests an access token by making an HTTP "POST" request 1164 to the token endpoint. The client constructs a request URI by adding 1165 the following parameters to the request: 1167 type 1168 REQUIRED. The parameter value MUST be set to "device_token". 1170 client_id 1171 REQUIRED. The client identifier as described in Section 3.4. 1173 code 1174 The verification code received from the authorization server. 1176 secret_type 1177 OPTIONAL. The access token secret type as described by 1178 Section 5.3. If omitted, the authorization server will issue a 1179 bearer token (an access token without a matching secret) as 1180 described by Section 5.2. 1182 For example, the client makes the following HTTPS request (line 1183 breaks are for display purposes only): 1185 POST /token?type=device_token&client_id=s6BhdRkqt3 1186 &code=J2vC42OifV HTTP/1.1 1187 Host: server.example.com 1189 If the end-user authorized the request, the authorization server 1190 issues an access token response as described in Section 3.2.1.1. 1192 For example (line breaks are for display purposes only): 1194 HTTP/1.1 200 OK 1195 Content-Type: application/json 1196 Cache-Control: no-store 1198 {"access_token":"SlAV32hkKG","expires_in":3600, 1199 "refresh_token":"8xLOxBtZp8"} 1201 If the request is invalid, the authorization server returns an error 1202 response as described in Section 3.2.1.2 with one of the following 1203 error codes: 1205 o "authorization_declined" 1207 o "bad_verification_code" 1209 For example: 1211 HTTP/1.1 400 Bad Request 1212 Content-Type: application/json 1213 Cache-Control: no-store 1215 {"error":"authorization_declined"} 1217 If the end-user authorization is pending or expired without receiving 1218 any response from the end-user, or the client is exceeding the 1219 allowed polling interval, the authorization server returns an error 1220 response as described in Section 3.2.1.2 with one of the following 1221 error codes: 1223 o "'authorization_pending" 1225 o "slow_down" 1227 o "code_expired" 1228 For example: 1230 HTTP/1.1 400 Bad Request 1231 Content-Type: application/json 1232 Cache-Control: no-store 1234 {"error":"authorization_pending"} 1236 3.8. Username and Password Flow 1238 The username and password flow is suitable for clients capable of 1239 asking end-users for their usernames and passwords. It is also used 1240 to migrate existing clients using direct authentication schemes such 1241 as HTTP Basic or Digest authentication to OAuth by converting the 1242 end-user credentials stored with tokens. 1244 However, unlike the HTTP Basic authentication scheme defined in 1245 [RFC2617], the end-user's credentials are used in a single request 1246 and are exchanged for an access token and refresh token which 1247 eliminates the client need to store them for future use. 1249 The methods through which the client prompts end users for their 1250 usernames and passwords is beyond the scope of this specification. 1251 The client MUST discard the usernames and passwords once an access 1252 token has been obtained. 1254 This flow is suitable in cases where the end-user already has a trust 1255 relationship with the client, such as its computer operating system 1256 or highly privileged applications. Authorization servers should take 1257 special care when enabling the username and password flow, and only 1258 when other delegation flows are not viable. 1260 End-user 1261 v 1262 : 1263 (A) 1264 : 1265 v 1266 +--------+ +---------------+ 1267 | | Client Credentials | | 1268 | |>--(B)--- & User Credentials ---->| Authorization | 1269 | Client | | Server | 1270 | |<--(C)---- Access Token ---------<| | 1271 | | (w/ Optional Refresh Token) | | 1272 +--------+ +---------------+ 1273 Figure 6 1275 The username and password flow illustrated in Figure 6 includes the 1276 following steps: 1278 (A) The end-user provides the client with its username and password. 1280 (B) The client sends an access token request to the authorization 1281 server and includes its client identifier and client secret, and 1282 the end-user's username and password. 1284 (C) The authorization server validates the end-user credentials and 1285 the client credentials and issues an access token. 1287 3.8.1. Client Requests Access Token 1289 The client requests an access token by making an HTTP "POST" request 1290 to the token endpoint. The client constructs a request URI by adding 1291 the following parameters to the request: 1293 type 1294 REQUIRED. The parameter value MUST be set to "username". 1296 client_id 1297 REQUIRED. The client identifier as described in Section 3.4. 1299 client_secret 1300 REQUIRED. The client secret as described in Section 3.4. 1301 OPTIONAL if no client secret was issued. 1303 username 1304 REQUIRED. The end-user's username. 1306 password 1307 REQUIRED. The end-user's password. 1309 scope 1310 OPTIONAL. The scope of the access request expressed as a list 1311 of space-delimited strings. The value of the "scope" parameter 1312 is defined by the authorization server. If the value contains 1313 multiple space-delimited strings, their order does not matter, 1314 and each string adds an additional access range to the 1315 requested scope. 1317 secret_type 1318 OPTIONAL. The access token secret type as described by 1319 Section 5.3. If omitted, the authorization server will issue a 1320 bearer token (an access token without a matching secret) as 1321 described by Section 5.2. 1323 For example, the client makes the following HTTPS request (line 1324 breaks are for display purposes only): 1326 POST /token HTTP/1.1 1327 Host: server.example.com 1329 type=username&client_id=s6BhdRkqt3&client_secret= 1330 47HDu8s&username=johndoe&password=A3ddj3w 1332 The authorization server MUST validate the client credentials and 1333 end-user credentials and if valid issues an access token response as 1334 described in Section 3.2.1.1. 1336 For example (line breaks are for display purposes only): 1338 HTTP/1.1 200 OK 1339 Content-Type: application/json 1340 Cache-Control: no-store 1342 {"access_token":"SlAV32hkKG","expires_in":3600, 1343 "refresh_token":"8xLOxBtZp8"} 1345 If the request is invalid, the authorization server returns an error 1346 response as described in Section 3.2.1.2 with one of the following 1347 error codes: 1349 o "incorrect_client_credentials" 1351 o "unauthorized_client'" - The client is not permitted to use this 1352 flow. 1354 For example: 1356 HTTP/1.1 400 Bad Request 1357 Content-Type: application/json 1358 Cache-Control: no-store 1360 {"error":"incorrect_client_credentials"} 1362 3.9. Client Credentials Flow 1364 The client credentials flow is used when the client acts on behalf of 1365 itself (the client is the resource owner), or when the client 1366 credentials are used to obtain an access token representing a 1367 previously established access authorization. The client secret is 1368 assumed to be high-entropy since it is not designed to be memorized 1369 by an end-user. 1371 +--------+ +---------------+ 1372 | | | | 1373 | |>--(A)--- Client Credentials ---->| Authorization | 1374 | Client | | Server | 1375 | |<--(B)---- Access Token ---------<| | 1376 | | (w/ Optional Refresh Token) | | 1377 +--------+ +---------------+ 1379 Figure 7 1381 The client credential flow illustrated in Figure 7 includes the 1382 following steps: 1384 (A) The client sends an access token request to the authorization 1385 server and includes its client identifier and client secret. 1387 (B) The authorization server validates the client credentials and 1388 issues an access token. 1390 3.9.1. Client Requests Access Token 1392 The client requests an access token by making an HTTP "POST" request 1393 to the token endpoint. The client constructs a request URI by adding 1394 the following parameters to the request: 1396 type 1397 REQUIRED. The parameter value MUST be set to 1398 "client_credentials". 1400 client_id 1401 REQUIRED. The client identifier as described in Section 3.4. 1403 client_secret 1404 REQUIRED. The client secret as described in Section 3.4. 1406 scope 1407 OPTIONAL. The scope of the access request expressed as a list 1408 of space-delimited strings. The value of the "scope" parameter 1409 is defined by the authorization server. If the value contains 1410 multiple space-delimited strings, their order does not matter, 1411 and each string adds an additional access range to the 1412 requested scope. 1414 secret_type 1415 OPTIONAL. The access token secret type as described by 1416 Section 5.3. If omitted, the authorization server will issue a 1417 bearer token (an access token without a matching secret) as 1418 described by Section 5.2. 1420 For example, the client makes the following HTTPS request (line 1421 breaks are for display purposes only): 1423 POST /token HTTP/1.1 1424 Host: server.example.com 1426 type=client_credentials&client_id=s6BhdRkqt3&client_secret=47HDu8s 1428 The authorization server MUST validate the client credentials and if 1429 valid issues an access token response as described in 1430 Section 3.2.1.1. 1432 For example (line breaks are for display purposes only): 1434 HTTP/1.1 200 OK 1435 Content-Type: application/json 1436 Cache-Control: no-store 1438 {"access_token":"SlAV32hkKG","expires_in":3600, 1439 "refresh_token":"8xLOxBtZp8"} 1441 If the request is invalid, the authorization server returns an error 1442 response as described in Section 3.2.1.2 with one of the following 1443 error codes: 1445 o "incorrect_client_credentials" 1446 For example: 1448 HTTP/1.1 400 Bad Request 1449 Content-Type: application/json 1450 Cache-Control: no-store 1452 {"error":"incorrect_client_credentials"} 1454 3.10. Assertion Flow 1456 The assertion flow is used when a client wishes to exchange an 1457 existing security token or assertion for an access token. This flow 1458 is suitable when the client is the resource owner or is acting on 1459 behalf of the resource owner (based on the content of the assertion 1460 used). 1462 The assertion flow requires the client to obtain a assertion (such as 1463 a SAML [OASIS.saml-core-2.0-os] assertion) from an assertion issuer 1464 or to self-issue an assertion prior to initiating the flow. The 1465 assertion format, the process by which the assertion is obtained, and 1466 the method of validating the assertion are defined by the assertion 1467 issuer and the authorization server, and are beyond the scope of this 1468 specification. 1470 +--------+ +---------------+ 1471 | | | | 1472 | |>--(A)------ Assertion ---------->| Authorization | 1473 | Client | | Server | 1474 | |<--(B)---- Access Token ---------<| | 1475 | | | | 1476 +--------+ +---------------+ 1478 Figure 8 1480 The assertion flow illustrated in Figure 8 includes the following 1481 steps: 1483 (A) The client sends an access token request to the authorization 1484 server and includes an assertion. 1486 (B) The authorization server validates the assertion and issues an 1487 access token. 1489 3.10.1. Client Requests Access Token 1491 The client requests an access token by making an HTTP "POST" request 1492 to the token endpoint. The client constructs a request URI by adding 1493 the following parameters to the request: 1495 type 1496 REQUIRED. The parameter value MUST be set to "assertion". 1498 format 1499 REQUIRED. The format of the assertion as defined by the 1500 authorization server. The value MUST be an absolute URI. 1502 assertion 1503 REQUIRED. The assertion. 1505 scope 1506 OPTIONAL. The scope of the access request expressed as a list 1507 of space-delimited strings. The value of the "scope" parameter 1508 is defined by the authorization server. If the value contains 1509 multiple space-delimited strings, their order does not matter, 1510 and each string adds an additional access range to the 1511 requested scope. 1513 secret_type 1514 OPTIONAL. The access token secret type as described by 1515 Section 5.3. If omitted, the authorization server will issue a 1516 bearer token (an access token without a matching secret) as 1517 described by Section 5.2. 1519 For example, the client makes the following HTTPS request (line 1520 breaks are for display purposes only): 1522 POST /token HTTP/1.1 1523 Host: server.example.com 1525 type=assertion&format=_______&assertion=_______ 1527 The authorization server MUST validate the assertion and if valid 1528 issues an access token response as described in Section 3.2.1.1. The 1529 authorization server SHOULD NOT issue a refresh token. 1531 For example (line breaks are for display purposes only): 1533 HTTP/1.1 200 OK 1534 Content-Type: application/json 1535 Cache-Control: no-store 1537 {"access_token":"SlAV32hkKG","expires_in":3600} 1539 If the request is invalid, the authorization server returns an error 1540 response as described in Section 3.2.1.2 with one of the following 1541 error codes: 1543 o "invalid_assertion" 1545 o "unknown_format" 1547 For example: 1549 HTTP/1.1 400 Bad Request 1550 Content-Type: application/json 1551 Cache-Control: no-store 1553 {"error":"invalid_assertion"} 1555 Authorization servers SHOULD issue access tokens with a limited 1556 lifetime and require clients to refresh them by requesting a new 1557 access token using the same assertion if it is still valid. 1558 Otherwise the client MUST obtain a new valid assertion. 1560 4. Refreshing an Access Token 1562 Token refresh is used when the lifetime of an access token is shorter 1563 than the lifetime of the authorization grant. It allows clients to 1564 obtain a new access token without having to go through the 1565 authorization flow again or involve the resource owner. It is also 1566 used to obtain a new token with different security properties (e.g. 1567 bearer token, token with shared symmetric secret). 1569 +--------+ Client Credentials, +---------------+ 1570 | | Refresh Token, | | 1571 | |>--(A)----- & Secret Type ------->| Authorization | 1572 | Client | | Server | 1573 | |<--(B)----- Access Token --------<| | 1574 | | & Optional Secret | | 1575 +--------+ +---------------+ 1577 Figure 9 1579 To refresh a token, the client constructs an HTTP "POST" request to 1580 the token endpoint and includes the following parameters in the HTTP 1581 request body using the "application/x-www-form-urlencoded" content 1582 type as defined by [W3C.REC-html40-19980424]: 1584 type 1585 REQUIRED. The parameter value MUST be set to "refresh". 1587 client_id 1588 REQUIRED. The client identifier as described in Section 3.4. 1590 client_secret 1591 REQUIRED if the client was issued a secret. The client secret. 1593 refresh_token 1594 REQUIRED. The refresh token associated with the access token 1595 to be refreshed. 1597 secret_type 1598 OPTIONAL. The access token secret type as described by 1599 Section 5.3. If omitted, the authorization server will issue a 1600 bearer token (an access token without a matching secret) as 1601 described by Section 5.2. 1603 For example, the client makes the following HTTPS request (line break 1604 are for display purposes only): 1606 POST /token HTTP/1.1 1607 Host: server.example.com 1608 Content-Type: application/x-www-form-urlencoded 1610 type=refresh_token&client_id=s6BhdRkqt3&client_secret=8eSEIpnqmM 1611 &refresh_token=n4E9O119d&secret_type=hmac-sha256 1613 verify the client credential, the validity of the refresh token, and 1614 that the resource owner's authorization is still valid. If the 1615 request is valid, the authorization server issues an access token 1616 response as described in Section 3.2.1.1. The authorization server 1617 MAY issue a new refresh token in which case the client MUST NOT use 1618 the previous refresh token and replace it with the newly issued 1619 refresh token. 1621 For example (line breaks are for display purposes only): 1623 HTTP/1.1 200 OK 1624 Content-Type: application/json 1625 Cache-Control: no-store 1627 {"access_token":"SlAV32hkKG","expires_in":3600} 1629 If the request is invalid, the authorization server returns an error 1630 response as described in Section 3.2.1.2 with one of the following 1631 error codes: 1633 o "incorrect_client_credentials" 1635 o "authorization_expired" 1637 o "unsupported_secret_type" 1639 For example: 1641 HTTP/1.1 400 Bad Request 1642 Content-Type: application/json 1643 Cache-Control: no-store 1645 {"error":"incorrect_client_credentials"} 1647 5. Accessing a Protected Resource 1649 Clients access protected resources by presenting an access token to 1650 the resource server. The methods used by the resource server to 1651 validate the access token are beyond the scope of this specification, 1652 but generally involve an interaction or coordination between the 1653 resource server and authorization server. 1655 The method in which a client uses an access token depends on the 1656 security properties of the access tokens. By default, access tokens 1657 are issued without a matching secret. Clients MAY request an access 1658 token with a matching secret by specifying the desired secret type 1659 using the "secret_type" token request parameter. 1661 When an access token does not include a matching secret, the access 1662 token acts as a bearer token, where the token string is a shared 1663 symmetric secret. This requires treating the access token with the 1664 same care as other secrets (e.g. user passwords). Access tokens 1665 SHOULD NOT be sent in the clear over an insecure channel. 1667 However, when it is necessary to transmit bearer tokens in the clear 1668 without a secure channel, authorization servers SHOULD issue access 1669 tokens with limited scope and lifetime to reduce the potential risk 1670 from a compromised access token. Clients SHOULD request and utilize 1671 an access token with a matching secret when making protected resource 1672 requests over an insecure channel (e.g. an HTTP request without using 1673 TLS/SSL). 1675 When an access token includes a matching secret, the secret is not 1676 included directly in the request but is used instead to generate a 1677 cryptographic signature of the request. The signature can only be 1678 generated and verified by entities with access to the secret. 1680 Clients SHOULD NOT make authenticated requests with an access token 1681 to unfamiliar resource servers, especially when using bearer tokens, 1682 regardless of the presence of a secure channel. 1684 5.1. The Authorization Request Header 1686 The "Authorization" request header field is used by clients to make 1687 both bearer token and cryptographic token requests. When making 1688 bearer token requests, the client uses the "token" attribute to 1689 include the access token in the request without any of the other 1690 attributes. Additional methods for making bearer token requests are 1691 described in Section 5.2. 1693 For example: 1695 GET /resource HTTP/1.1 1696 Host: server.example.com 1697 Authorization: Token token="vF9dft4qmT" 1699 When making a cryptographic token request (using an access token with 1700 a matching secret) the client uses the "token" attribute to include 1701 the access token in the request, and uses the "nonce", "timestamp", 1702 "algorithm", and "signature" attributes to apply the matching secret. 1704 For example: 1706 GET /resource HTTP/1.1 1707 Host: server.example.com 1708 Authorization: Token token="vF9dft4qmT", 1709 nonce="s8djwd", 1710 timestamp="137131200", 1711 algorithm="hmac-sha256", 1712 signature="wOJIO9A2W5mFwDgiDvZbTSMK/PY=" 1714 The "Authorization" header field uses the framework defined by 1715 [RFC2617] as follows: 1717 credentials = "Token" RWS token-response 1719 token-response = token-id 1720 [ CS nonce ] 1721 [ CS timestamp ] 1722 [ CS algorithm ] 1723 [ CS signature ] 1725 token-id = "token" "=" <"> token <"> 1726 timestamp = "timestamp" "=" <"> 1*DIGIT <"> 1727 nonce = "nonce" "=" <"> token <"> 1729 algorithm = "algorithm" "=" algorithm-name 1730 algorithm-name = "hmac-sha256" / 1731 token 1733 signature = "signature" "=" <"> token <"> 1735 5.2. Bearer Token Requests 1737 Clients make bearer token requests by including the access token 1738 using the HTTP "Authorization" request header with the "Token" 1739 authentication scheme as described in Section 5.1. The access token 1740 is included using the "token" parameter. 1742 For example, the client makes the following HTTPS request: 1744 GET /resource HTTP/1.1 1745 Host: server.example.com 1746 Authorization: Token token="vF9dft4qmT" 1748 The resource server MUST validate the access token and ensure it has 1749 not expired and that its scope covers the requested resource. If the 1750 token expired or is invalid, the resource server MUST reply with an 1751 HTTP 401 status code (Unauthorized) and include the HTTP 1752 "WWW-Authenticate" response header as described in Section 6.1. 1754 For example: 1756 HTTP/1.1 401 Unauthorized 1757 WWW-Authenticate: Token realm='Service', error='token_expired' 1759 Alternatively, the client MAY include the access token using the HTTP 1760 request URI in the query component as described in Section 5.2.1, or 1761 in the HTTP body when using the "application/x-www-form-urlencoded" 1762 content type as described in Section 5.2.2. Clients SHOULD only use 1763 the request URI or body when the "Authorization" request header is 1764 not available, and MUST NOT use more than one method in each request. 1766 5.2.1. URI Query Parameter 1768 When including the access token in the HTTP request URI, the client 1769 adds the access token to the request URI query component as defined 1770 by [RFC3986] using the "oauth_token" parameter. 1772 For example, the client makes the following HTTPS request: 1774 GET /resource?oauth_token=vF9dft4qmT HTTP/1.1 1775 Host: server.example.com 1777 The HTTP request URI query can include other request-specific 1778 parameters, in which case, the "oauth_token" parameters SHOULD be 1779 appended following the request-specific parameters, properly 1780 separated by an "&" character (ASCII code 38). 1782 The resource server MUST validate the access token and ensure it has 1783 not expired and its scope includes the requested resource. If the 1784 resource expired or is not valid, the resource server MUST reply with 1785 an HTTP 401 status code (Unauthorized) and include the HTTP 1786 "WWW-Authenticate" response header as described in Section 6.1. 1788 5.2.2. Form-Encoded Body Parameter 1790 When including the access token in the HTTP request entity-body, the 1791 client adds the access token to the request body using the 1792 "oauth_token" parameter. The client can use this method only if the 1793 following REQUIRED conditions are met: 1795 o The entity-body is single-part. 1797 o The entity-body follows the encoding requirements of the 1798 "application/x-www-form-urlencoded" content-type as defined by 1799 [W3C.REC-html40-19980424]. 1801 o The HTTP request entity-header includes the "Content-Type" header 1802 field set to "application/x-www-form-urlencoded". 1804 o The HTTP request method is "POST", "PUT", or "DELETE". 1806 The entity-body can include other request-specific parameters, in 1807 which case, the "oauth_token" parameters SHOULD be appended following 1808 the request-specific parameters, properly separated by an "&" 1809 character (ASCII code 38). 1811 For example, the client makes the following HTTPS request: 1813 POST /resource HTTP/1.1 1814 Host: server.example.com 1815 Content-Type: application/x-www-form-urlencoded 1817 oauth_token=vF9dft4qmT 1819 The resource server MUST validate the access token and ensure it has 1820 not expired and its scope includes the requested resource. If the 1821 resource expired or is not valid, the resource server MUST reply with 1822 an HTTP 401 status code (Unauthorized) and include the HTTP 1823 "WWW-Authenticate" response header as described in Section 6.1. 1825 5.3. Cryptographic Tokens Requests 1827 Clients make authenticated protected resource requests using an 1828 access token with a matching secret by calculating a set of values 1829 and including them in the request using the "Authorization" header 1830 field. The way clients calculate these values depends on the access 1831 token secret type as issued by the authorization server. 1833 This specification defines the "hmac-sha256" algorithm, and 1834 establishes a registry for providing additional algorithms. Clients 1835 obtain an access token with a matching "hmac-sha256" secret by using 1836 the "secret_type" parameter when requesting an access token. 1838 5.3.1. The 'hmac-sha256' Algorithm 1840 The "hmac-sha256" algorithm uses the HMAC method as defined in 1841 [RFC2104] together with the SHA-256 hash function defined in [NIST 1842 FIPS-180-3] to apply the access token secret to the request and 1843 generate a signature value that is included in the request instead of 1844 transmitting the secret in the clear. 1846 To use the "hmac-sha256" algorithm, clients: 1848 1. Calculate the request timestamp and generate a request nonce as 1849 described in Section 5.3.1.1. 1851 2. Construct the normalized request string as described in 1852 Section 5.3.1.2. 1854 3. Calculate the request signature as described in Section 5.3.1.3. 1856 4. Include the timestamp, nonce, algorithm name, and calculated 1857 signature in the request using the "Authorization" header field. 1859 For example: 1861 GET /resource HTTP/1.1 1862 Host: server.example.com 1863 Authorization: Token token="vF9dft4qmT", 1864 nonce="s8djwd", 1865 timestamp="137131200", 1866 algorithm="hmac-sha256", 1867 signature="wOJIO9A2W5mFwDgiDvZbTSMK/PY=" 1869 The resource server MUST validate the access token and ensure it has 1870 not expired and that its scope covers the requested resource. The 1871 resource server MUST also recalculate the request signature using the 1872 attributes provided by the client and compare it to the signature 1873 provided. If the token expired or is invalid, or if the signature is 1874 incorrect, the resource server MUST reply with an HTTP 401 status 1875 code (Unauthorized) and include the HTTP "WWW-Authenticate" response 1876 header as described in Section 6.1. 1878 For example: 1880 HTTP/1.1 401 Unauthorized 1881 Date: Tue, 15 Nov 2010 08:12:31 GMT 1882 WWW-Authenticate: Token realm='Service', 1883 algorithms='hmac-sha256', 1884 error='invalid_signature' 1886 [[ Errors list ]] 1888 5.3.1.1. Nonce and Timestamp 1890 A timestamp in combination with unique nonce values is used to 1891 protect against replay attacks when transmitted over an insecure 1892 channel. 1894 The nonce is a random string, uniquely generated by the client to 1895 allow the resource server to verify that a request has never been 1896 made before and helps prevent replay attacks when requests are made 1897 over a non-secure channel. The nonce value MUST be unique across all 1898 requests with the same timestamp and token combinations. 1900 The timestamp value is the current time expressed in the number of 1901 seconds since January 1, 1970 00:00:00 GMT, and MUST be a positive 1902 integer. 1904 To avoid the need to retain an infinite number of nonce values for 1905 future checks, resource servers MAY choose to restrict the time 1906 period after which a request with an old timestamp is rejected. When 1907 resource servers apply such a restriction, clients SHOULD synchronize 1908 their clocks by using the resource server's time as indicated by the 1909 HTTP "Date" response header field as defined in [RFC2616]. 1911 5.3.1.2. Normalized String Construction 1913 The normalized request string is a consistent, reproducible 1914 concatenation of several of the HTTP request elements into a single 1915 string. The string is used as an input to the selected cryptographic 1916 method and includes the HTTP request method (e.g. "GET", "POST", 1917 etc.), the authority as declared by the HTTP "Host" request header, 1918 and the request resource URI. 1920 The normalized request string does not cover the entire HTTP request. 1921 Most notably, it does not include the entity-body or most HTTP 1922 entity-headers. It is important to note that the resource server 1923 cannot verify the authenticity of the excluded request elements 1924 without using additional protections such as TLS/SSL. 1926 The normalized request string is constructed by concatenating 1927 together, in order, the following HTTP request elements, separated by 1928 the "," character (ASCII code 44): 1930 1. The request timestamp as described in Section 5.3.1.1. 1932 2. The request nonce as described in Section 5.3.1.1. 1934 3. The cryptographic algorithm used. 1936 4. The HTTP request method in uppercase. For example: "HEAD", 1937 "GET", "POST", etc. 1939 5. The hostname, colon-separated (ASCII code 58) from the TCP port 1940 used to make the request as included in the HTTP request "Host" 1941 header field. The port MUST be included even if it is not 1942 included in the "Host" header field (i.e. the default port for 1943 the scheme). 1945 6. The request resource URI. 1947 For example, the normalized request string for the "GET" request URI 1948 "http://example.com/resource", request timestamp "137131200", request 1949 nonce "s8djwd", and "hmac-sha256" algorithm (line breaks are for 1950 display purposes only): 1952 137131200,s8djwd,hmac-sha256,GET,example.com:80, 1953 http://example.com/resource 1955 5.3.1.3. Signature Calculation 1957 Clients calculate the request signature using the HMAC-SHA256 1958 function: 1960 digest = HMAC-SHA256 (key, text) 1962 by setting the function variables are follows: 1964 text 1965 is set to the value of the normalize request string as 1966 described in Section 5.3.1.2. 1968 key 1969 is set to the access token secret. 1971 The request signature is the calculated value of the "digest" 1972 variable after the result octet string is base64-encoded per 1973 [RFC2045] section 6.8. 1975 6. Identifying a Protected Resource 1977 Clients access protected resources after locating the appropriate 1978 authorization and token endpoints and obtaining an access token. In 1979 many cases, interacting with a protected resource requires prior 1980 knowledge of the protected resource properties and methods, as well 1981 as its authentication requirements (i.e. establishing client 1982 identity, locating the authorization and token endpoints). 1984 However, there are cases in which clients are unfamiliar with the 1985 protected resource, including whether the resource requires 1986 authentication. When clients attempt to access an unfamiliar 1987 protected resource without an access token, the resource server 1988 denies the request and informs the client of the required credentials 1989 using an HTTP authentication challenge. 1991 In addition, when receiving an invalid authenticated request, the 1992 resource server issues an authentication challenge including the 1993 error type and message. 1995 6.1. The WWW-Authenticate Response Header 1997 A resource server receiving a request for a protected resource 1998 without a valid access token MUST respond with a 401 HTTP status code 1999 (Unauthorized), and includes at least one "Token" "WWW-Authenticate" 2000 response header field challenge. 2002 The "WWW-Authenticate" header field uses the framework defined by 2003 [RFC2617] as follows: 2005 challenge = "Token" RWS token-challenge 2007 token-challenge = realm 2008 [ CS authz-uri ] 2009 [ CS token-uri ] 2010 [ CS algorithms ] 2011 [ CS error ] 2013 authz-uri = "auth-uri" "=" URI-Reference 2014 token-uri = "token-uri" "=" URI-Reference 2015 algorithms = "algorithms" "=" <"> 1#algorithm-name <"> 2016 error = "error" "=" <"> token <"> 2018 CS = OWS "," OWS 2020 6.1.1. The 'realm' Attribute 2022 The "realm" attribute is used to provide the protected resources 2023 partition as defined by [RFC2617]. 2025 6.1.2. The 'authorization-uri' Attribute 2027 6.1.3. The 'algorithms' Attribute 2029 6.1.4. The 'error' Attribute 2031 7. Security Considerations 2033 [[ Todo ]] 2035 8. IANA Considerations 2037 [[ Not Yet ]] 2039 9. Acknowledgements 2041 [[ Add OAuth 1.0a authors + WG contributors ]] 2043 Appendix A. Differences from OAuth 1.0a 2045 [[ Todo ]] 2047 Appendix B. Document History 2049 [[ to be removed by RFC editor before publication as an RFC ]] 2051 -04 2053 o Changed all token endpoints to use "POST" 2055 o Clarified the authorization server's ability to issue a new 2056 refresh token when refreshing a token. 2058 o Changed the flow categories to clarify the autonomous group. 2060 o Changed client credentials language not to always be server- 2061 issued. 2063 o Added a "scope" response parameter. 2065 o Fixed typos. 2067 o Fixed broken document structure. 2069 -03 2071 o Fixed typo in JSON error examples. 2073 o Fixed general typos. 2075 o Moved all flows sections up one level. 2077 -02 2079 o Removed restriction on "redirect_uri" including a query. 2081 o Added "scope" parameter. 2083 o Initial proposal for a JSON-based token response format. 2085 -01 2087 o Editorial changes based on feedback from Brian Eaton, Bill Keenan, 2088 and Chuck Mortimore. 2090 o Changed device flow "type" parameter values and switch to use only 2091 the token endpoint. 2093 -00 2094 o Initial draft based on a combination of WRAP and OAuth 1.0a. 2096 10. References 2098 10.1. Normative References 2100 [I-D.ietf-httpbis-p1-messaging] 2101 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 2102 Masinter, L., Leach, P., Berners-Lee, T., and J. Reschke, 2103 "HTTP/1.1, part 1: URIs, Connections, and Message 2104 Parsing", draft-ietf-httpbis-p1-messaging-09 (work in 2105 progress), March 2010. 2107 [NIST FIPS-180-3] 2108 National Institute of Standards and Technology, "Secure 2109 Hash Standard (SHS). FIPS PUB 180-3, October 2008". 2111 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2112 Extensions (MIME) Part One: Format of Internet Message 2113 Bodies", RFC 2045, November 1996. 2115 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 2116 Hashing for Message Authentication", RFC 2104, 2117 February 1997. 2119 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2120 Requirement Levels", BCP 14, RFC 2119, March 1997. 2122 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 2123 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 2124 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 2126 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 2127 Leach, P., Luotonen, A., and L. Stewart, "HTTP 2128 Authentication: Basic and Digest Access Authentication", 2129 RFC 2617, June 1999. 2131 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 2133 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 2134 Standards (PKCS) #1: RSA Cryptography Specifications 2135 Version 2.1", RFC 3447, February 2003. 2137 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2138 10646", STD 63, RFC 3629, November 2003. 2140 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2141 Resource Identifier (URI): Generic Syntax", STD 66, 2142 RFC 3986, January 2005. 2144 [RFC4627] Crockford, D., "The application/json Media Type for 2145 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 2147 [W3C.REC-html40-19980424] 2148 Hors, A., Raggett, D., and I. Jacobs, "HTML 4.0 2149 Specification", World Wide Web Consortium 2150 Recommendation REC-html40-19980424, April 1998, 2151 . 2153 10.2. Informative References 2155 [I-D.hammer-oauth] 2156 Hammer-Lahav, E., "The OAuth 1.0 Protocol", 2157 draft-hammer-oauth-10 (work in progress), February 2010. 2159 [I-D.hardt-oauth] 2160 Hardt, D., Tom, A., Eaton, B., and Y. Goland, "OAuth Web 2161 Resource Authorization Profiles", draft-hardt-oauth-01 2162 (work in progress), January 2010. 2164 [OASIS.saml-core-2.0-os] 2165 Cantor, S., Kemp, J., Philpott, R., and E. Maler, 2166 "Assertions and Protocol for the OASIS Security Assertion 2167 Markup Language (SAML) V2.0", OASIS Standard saml-core- 2168 2.0-os, March 2005. 2170 Authors' Addresses 2172 Eran Hammer-Lahav (editor) 2173 Yahoo! 2175 Email: eran@hueniverse.com 2176 URI: http://hueniverse.com 2178 David Recordon 2179 Facebook 2181 Email: davidrecordon@facebook.com 2182 URI: http://www.davidrecordon.com/ 2183 Dick Hardt 2185 Email: dick.hardt@gmail.com 2186 URI: http://dickhardt.org/