| < draft-ietf-oauth-v2-03.txt | draft-ietf-oauth-v2-04.txt > | |||
|---|---|---|---|---|
| Network Working Group E. Hammer-Lahav, Ed. | Network Working Group E. Hammer-Lahav, Ed. | |||
| Internet-Draft Yahoo! | Internet-Draft Yahoo! | |||
| Intended status: Standards Track D. Recordon | Intended status: Standards Track D. Recordon | |||
| Expires: November 10, 2010 Facebook | Expires: November 10, 2010 Facebook | |||
| D. Hardt | D. Hardt | |||
| May 9, 2010 | May 9, 2010 | |||
| The OAuth 2.0 Protocol | The OAuth 2.0 Protocol | |||
| draft-ietf-oauth-v2-03 | draft-ietf-oauth-v2-04 | |||
| Abstract | Abstract | |||
| This specification describes the OAuth 2.0 protocol. OAuth provides | This specification describes the OAuth 2.0 protocol. OAuth provides | |||
| a method for making authenticated HTTP requests using a token - an | a method for making authenticated HTTP requests using a token - an | |||
| identifier used to denote an access grant with specific scope, | identifier used to denote an access grant with specific scope, | |||
| duration, and other attributes. Tokens are issued to third-party | duration, and other attributes. Tokens are issued to third-party | |||
| clients by an authorization server with the approval of the resource | clients by an authorization server with the approval of the resource | |||
| owner. OAuth defines multiple flows for obtaining a token to support | owner. OAuth defines multiple flows for obtaining a token to support | |||
| a wide range of client types and user experience. | a wide range of client types and user experience. | |||
| skipping to change at page 2, line 18 ¶ | skipping to change at page 2, line 18 ¶ | |||
| Table of Contents | Table of Contents | |||
| 1. Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 | 1. Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
| 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 | 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
| 2.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 | 2.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
| 2.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 6 | 2.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 6 | |||
| 2.3. Example . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 2.3. Example . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 2.4. Notational Conventions . . . . . . . . . . . . . . . . . . 8 | 2.4. Notational Conventions . . . . . . . . . . . . . . . . . . 8 | |||
| 2.5. Conformance . . . . . . . . . . . . . . . . . . . . . . . 8 | 2.5. Conformance . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 3. Obtaining an Access Token . . . . . . . . . . . . . . . . . . 8 | 3. Obtaining an Access Token . . . . . . . . . . . . . . . . . . 9 | |||
| 3.1. Authorization Endpoint . . . . . . . . . . . . . . . . . . 9 | 3.1. Authorization Endpoint . . . . . . . . . . . . . . . . . . 9 | |||
| 3.2. Token Endpoint . . . . . . . . . . . . . . . . . . . . . . 9 | 3.2. Token Endpoint . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 3.2.1. Response Format . . . . . . . . . . . . . . . . . . . 10 | 3.2.1. Response Format . . . . . . . . . . . . . . . . . . . 10 | |||
| 3.3. Flow Parameters . . . . . . . . . . . . . . . . . . . . . 11 | 3.3. Flow Parameters . . . . . . . . . . . . . . . . . . . . . 12 | |||
| 3.4. Client Credentials . . . . . . . . . . . . . . . . . . . . 12 | 3.4. Client Credentials . . . . . . . . . . . . . . . . . . . . 12 | |||
| 3.5. User-Agent Flow . . . . . . . . . . . . . . . . . . . . . 12 | 3.5. User-Agent Flow . . . . . . . . . . . . . . . . . . . . . 12 | |||
| 3.5.1. Client Requests Authorization . . . . . . . . . . . . 14 | 3.5.1. Client Requests Authorization . . . . . . . . . . . . 14 | |||
| 3.5.2. Client Extracts Access Token . . . . . . . . . . . . . 17 | 3.5.2. Client Extracts Access Token . . . . . . . . . . . . . 17 | |||
| 3.6. Web Server Flow . . . . . . . . . . . . . . . . . . . . . 17 | 3.6. Web Server Flow . . . . . . . . . . . . . . . . . . . . . 17 | |||
| 3.6.1. Client Requests Authorization . . . . . . . . . . . . 19 | 3.6.1. Client Requests Authorization . . . . . . . . . . . . 19 | |||
| 3.6.2. Client Requests Access Token . . . . . . . . . . . . . 21 | 3.6.2. Client Requests Access Token . . . . . . . . . . . . . 21 | |||
| 3.7. Device Flow . . . . . . . . . . . . . . . . . . . . . . . 23 | 3.7. Device Flow . . . . . . . . . . . . . . . . . . . . . . . 23 | |||
| 3.7.1. Client Requests Authorization . . . . . . . . . . . . 25 | 3.7.1. Client Requests Authorization . . . . . . . . . . . . 25 | |||
| 3.7.2. Client Requests Access Token . . . . . . . . . . . . . 26 | 3.7.2. Client Requests Access Token . . . . . . . . . . . . . 27 | |||
| 4. Username and Password Flow . . . . . . . . . . . . . . . . . . 28 | 3.8. Username and Password Flow . . . . . . . . . . . . . . . . 29 | |||
| 4.1. Client Requests Access Token . . . . . . . . . . . . . . . 30 | 3.8.1. Client Requests Access Token . . . . . . . . . . . . . 30 | |||
| 5. Client Credentials Flow . . . . . . . . . . . . . . . . . . . 31 | 3.9. Client Credentials Flow . . . . . . . . . . . . . . . . . 32 | |||
| 5.1. Client Requests Access Token . . . . . . . . . . . . . . . 32 | 3.9.1. Client Requests Access Token . . . . . . . . . . . . . 32 | |||
| 6. Assertion Flow . . . . . . . . . . . . . . . . . . . . . . . . 33 | 3.10. Assertion Flow . . . . . . . . . . . . . . . . . . . . . . 34 | |||
| 6.1. Client Requests Access Token . . . . . . . . . . . . . . . 34 | 3.10.1. Client Requests Access Token . . . . . . . . . . . . . 35 | |||
| 7. Refreshing an Access Token . . . . . . . . . . . . . . . . . . 36 | 4. Refreshing an Access Token . . . . . . . . . . . . . . . . . . 36 | |||
| 8. Accessing a Protected Resource . . . . . . . . . . . . . . . . 38 | 5. Accessing a Protected Resource . . . . . . . . . . . . . . . . 38 | |||
| 8.1. The Authorization Request Header . . . . . . . . . . . . . 39 | 5.1. The Authorization Request Header . . . . . . . . . . . . . 39 | |||
| 8.2. Bearer Token Requests . . . . . . . . . . . . . . . . . . 40 | 5.2. Bearer Token Requests . . . . . . . . . . . . . . . . . . 40 | |||
| 8.2.1. URI Query Parameter . . . . . . . . . . . . . . . . . 41 | 5.2.1. URI Query Parameter . . . . . . . . . . . . . . . . . 41 | |||
| 8.2.2. Form-Encoded Body Parameter . . . . . . . . . . . . . 41 | 5.2.2. Form-Encoded Body Parameter . . . . . . . . . . . . . 41 | |||
| 8.3. Cryptographic Tokens Requests . . . . . . . . . . . . . . 42 | 5.3. Cryptographic Tokens Requests . . . . . . . . . . . . . . 42 | |||
| 8.3.1. The 'hmac-sha256' Algorithm . . . . . . . . . . . . . 42 | 5.3.1. The 'hmac-sha256' Algorithm . . . . . . . . . . . . . 43 | |||
| 9. Identifying a Protected Resource . . . . . . . . . . . . . . . 45 | 6. Identifying a Protected Resource . . . . . . . . . . . . . . . 46 | |||
| 9.1. The WWW-Authenticate Response Header . . . . . . . . . . . 46 | 6.1. The WWW-Authenticate Response Header . . . . . . . . . . . 46 | |||
| 9.1.1. The 'realm' Attribute . . . . . . . . . . . . . . . . 46 | 6.1.1. The 'realm' Attribute . . . . . . . . . . . . . . . . 47 | |||
| 9.1.2. The 'authorization-uri' Attribute . . . . . . . . . . 46 | 6.1.2. The 'authorization-uri' Attribute . . . . . . . . . . 47 | |||
| 9.1.3. The 'algorithms' Attribute . . . . . . . . . . . . . . 46 | 6.1.3. The 'algorithms' Attribute . . . . . . . . . . . . . . 47 | |||
| 9.1.4. The 'error' Attribute . . . . . . . . . . . . . . . . 47 | 6.1.4. The 'error' Attribute . . . . . . . . . . . . . . . . 47 | |||
| 10. Security Considerations . . . . . . . . . . . . . . . . . . . 47 | 7. Security Considerations . . . . . . . . . . . . . . . . . . . 47 | |||
| 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 | 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 | |||
| 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 47 | 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 47 | |||
| Appendix A. Differences from OAuth 1.0a . . . . . . . . . . . . . 47 | Appendix A. Differences from OAuth 1.0a . . . . . . . . . . . . . 47 | |||
| Appendix B. Document History . . . . . . . . . . . . . . . . . . 47 | Appendix B. Document History . . . . . . . . . . . . . . . . . . 48 | |||
| 13. References . . . . . . . . . . . . . . . . . . . . . . . . . . 48 | 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 49 | |||
| 13.1. Normative References . . . . . . . . . . . . . . . . . . . 48 | 10.1. Normative References . . . . . . . . . . . . . . . . . . . 49 | |||
| 13.2. Informative References . . . . . . . . . . . . . . . . . . 49 | 10.2. Informative References . . . . . . . . . . . . . . . . . . 50 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 49 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 50 | |||
| 1. Authors | 1. Authors | |||
| This specification was authored with the participation and based on | This specification was authored with the participation and based on | |||
| the work of Allen Tom (Yahoo!), Brian Eaton (Google), Brent Goldman | the work of Allen Tom (Yahoo!), Brian Eaton (Google), Brent Goldman | |||
| (Facebook), Luke Shepard (Facebook), Raffi Krikorian (Twitter), and | (Facebook), Luke Shepard (Facebook), Raffi Krikorian (Twitter), and | |||
| Yaron Goland (Microsoft). | Yaron Goland (Microsoft). | |||
| 2. Introduction | 2. Introduction | |||
| skipping to change at page 4, line 49 ¶ | skipping to change at page 4, line 49 ¶ | |||
| For example, a web user (resource owner) can grant a printing service | For example, a web user (resource owner) can grant a printing service | |||
| (client) access to her protected photos stored at a photo sharing | (client) access to her protected photos stored at a photo sharing | |||
| service (resource server), without sharing her username and password | service (resource server), without sharing her username and password | |||
| with the printing service. Instead, she authenticates directly with | with the printing service. Instead, she authenticates directly with | |||
| the photo sharing service (authorization server) which issues the | the photo sharing service (authorization server) which issues the | |||
| printing service delegation-specific credentials (token). | printing service delegation-specific credentials (token). | |||
| This specification defines the use of OAuth over HTTP [RFC2616] (or | This specification defines the use of OAuth over HTTP [RFC2616] (or | |||
| HTTP over TLS 1.0 as defined by [RFC2818]. Other specifications may | HTTP over TLS 1.0 as defined by [RFC2818]. Other specifications may | |||
| extend it for use with other tranport protocols. | extend it for use with other transport protocols. | |||
| 2.1. Terminology | 2.1. Terminology | |||
| resource server | resource server | |||
| An HTTP [RFC2616] server capable of accepting authenticated | An HTTP [RFC2616] server capable of accepting authenticated | |||
| resource requests using the OAuth protocol. | resource requests using the OAuth protocol. | |||
| protected resource | protected resource | |||
| An access-restricted resource which can be obtained from a | An access-restricted resource which can be obtained from a | |||
| resource server using an OAuth-authenticated request. | resource server using an OAuth-authenticated request. | |||
| skipping to change at page 7, line 21 ¶ | skipping to change at page 7, line 21 ¶ | |||
| | | HTTP Request +---------------+ | | | HTTP Request +---------------+ | |||
| | |--(C)--- with Access Token ------>| Resource | | | |--(C)--- with Access Token ------>| Resource | | |||
| | | | Server | | | | | Server | | |||
| | |<-(D)----- HTTP Response ---------| | | | |<-(D)----- HTTP Response ---------| | | |||
| +--------+ +---------------+ | +--------+ +---------------+ | |||
| Figure 2 | Figure 2 | |||
| This specification defines a number of authorization flows to support | This specification defines a number of authorization flows to support | |||
| different client types and scenarios. These authorization flows can | different client types and scenarios. These authorization flows can | |||
| be separated into three groups: user delegation flows, end-user | be separated into three groups: user delegation flows, direct | |||
| credentials flows, and autonomous flows. | credentials flows, and autonomous flows. | |||
| Additional authorization flows may be defined by other specifications | Additional authorization flows may be defined by other specifications | |||
| to cover different scenarios and client types. | to cover different scenarios and client types. | |||
| User delegation flows are used to grant client access to protected | User delegation flows are used to grant client access to protected | |||
| resources by the end-user without sharing the end-user credentials | resources by the end-user without sharing the end-user credentials | |||
| (e.g. a username and password) with the client. Instead, the end- | (e.g. a username and password) with the client. Instead, the end- | |||
| user authenticates directly with the authorization server, and grants | user authenticates directly with the authorization server, and grants | |||
| client access to its protected resources. The user delegation flows | client access to its protected resources. The user delegation flows | |||
| skipping to change at page 7, line 47 ¶ | skipping to change at page 7, line 47 ¶ | |||
| o Web Server Flow - This flow is optimized for clients that are part | o Web Server Flow - This flow is optimized for clients that are part | |||
| of a web server application, accessible via HTTP requests. This | of a web server application, accessible via HTTP requests. This | |||
| flow is described in Section 3.6. | flow is described in Section 3.6. | |||
| o Device Flow - This flow is suitable for clients executing on | o Device Flow - This flow is suitable for clients executing on | |||
| limited devices, but where the end-user has separate access to a | limited devices, but where the end-user has separate access to a | |||
| user-agent on another computer or device. This flow is described | user-agent on another computer or device. This flow is described | |||
| in Section 3.7. | in Section 3.7. | |||
| End-user credentials flow enable clients with direct access to the | Direct credentials flows enable clients to obtain an access token | |||
| end-user's credentials to exchange them for an access token without | with a single request using the client credentials or end-user | |||
| seeking additional authorization. These flows are only suitable when | credentials without seeking additional resource owner authorization. | |||
| there is a high degree of trust between the end-user and the client. | The direct credentials flows defined by this specification are: | |||
| The end-user credentials flow defined by this specification is: | ||||
| o Username and Password Flow - This flow is used in cases where the | o Username and Password Flow - This flow is used in cases where the | |||
| end-user trusts the client to handle its credentials but it is | end-user trusts the client to handle its credentials but it is | |||
| still undesirable for the client to store the end-user's username | still undesirable for the client to store the end-user's username | |||
| and password. This flow is described in Section 4. | and password. This flow is only suitable when there is a high | |||
| degree of trust between the end-user and the client. This flow is | ||||
| Autonomous flows enable clients to act for their own behalf (the | described in Section 3.8. | |||
| client is also the resource owner). The autonomous authorization | ||||
| flows defined by this specifications are: | ||||
| o Client Credentials Flow - The client uses its credentials to | o Client Credentials Flow - The client uses its credentials to | |||
| obtain an access token. This flow is described in Section 5. | obtain an access token. This flow is described in Section 3.9. | |||
| Autonomous flows enable clients to use utilize existing trust | ||||
| relationships or different authorization constructs to obtain an | ||||
| access token. They provide a bridge between OAuth and other trust | ||||
| frameworks. The autonomous authorization flow defined by this | ||||
| specifications is: | ||||
| o Assertion Flow - The client presents an assertion such as a SAML | o Assertion Flow - The client presents an assertion such as a SAML | |||
| [OASIS.saml-core-2.0-os] assertion to the authorization server in | [OASIS.saml-core-2.0-os] assertion to the authorization server in | |||
| exchange for an access token. This flow is described in | exchange for an access token. This flow is described in | |||
| Section 6. | Section 3.10. | |||
| 2.3. Example | 2.3. Example | |||
| [[ Todo ]] | [[ Todo ]] | |||
| 2.4. Notational Conventions | 2.4. Notational Conventions | |||
| The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', | The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', | |||
| 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this | 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this | |||
| document are to be interpreted as described in [RFC2119]. | document are to be interpreted as described in [RFC2119]. | |||
| skipping to change at page 9, line 18 ¶ | skipping to change at page 9, line 24 ¶ | |||
| the resource server when receiving a protected resource request, and | the resource server when receiving a protected resource request, and | |||
| by the authorization server when receiving a token refresh request. | by the authorization server when receiving a token refresh request. | |||
| In many cases it is desirable to issue access tokens with a shorter | In many cases it is desirable to issue access tokens with a shorter | |||
| lifetime than the duration of the authorization grant. However, it | lifetime than the duration of the authorization grant. However, it | |||
| may be undesirable to require the resource owner to authorize the | may be undesirable to require the resource owner to authorize the | |||
| request again. Instead, the authorization server issues a refresh | request again. Instead, the authorization server issues a refresh | |||
| token in addition to the access token. When the access token | token in addition to the access token. When the access token | |||
| expires, the client can request a new access token without involving | expires, the client can request a new access token without involving | |||
| the resource owner as long as the authorization grant is still valid. | the resource owner as long as the authorization grant is still valid. | |||
| The token refresh method is described in Section 7. | The token refresh method is described in Section 4. | |||
| 3.1. Authorization Endpoint | 3.1. Authorization Endpoint | |||
| Clients direct the resource owner to the authorization endpoint to | Clients direct the resource owner to the authorization endpoint to | |||
| approve their access request. Before granting access, the resource | approve their access request. Before granting access, the resource | |||
| owner first authenticates with the authorization server. The way in | owner first authenticates with the authorization server. The way in | |||
| which the authorization server authenticates the end-user (e.g. | which the authorization server authenticates the end-user (e.g. | |||
| username and password login, OpenID, session cookies) and in which | username and password login, OpenID, session cookies) and in which | |||
| the authorization server obtains the end-user's authorization, | the authorization server obtains the end-user's authorization, | |||
| including whether it uses a secure channel such as TLS/SSL, is beyond | including whether it uses a secure channel such as TLS/SSL, is beyond | |||
| the scope of this specification. However, the authorization server | the scope of this specification. However, the authorization server | |||
| MUST first verify the identity of the end-user. | MUST first verify the identity of the end-user. | |||
| The URI of the authorization endpoint can be found in the service | The URI of the authorization endpoint can be found in the service | |||
| documentation, or can be obtained by the client by making an | documentation, or can be obtained by the client by making an | |||
| unauthorized protected resource request (from the "WWW-Authenticate" | unauthorized protected resource request (from the "WWW-Authenticate" | |||
| response header auth-uri (Section 9.1.2) attribute). | response header auth-uri (Section 6.1.2) attribute). | |||
| The authorization endpoint advertised by the resource server MAY | The authorization endpoint advertised by the resource server MAY | |||
| include a query component as defined by [RFC3986] section 3. | include a query component as defined by [RFC3986] section 3. | |||
| Since requests to the authorization endpoint result in user | Since requests to the authorization endpoint result in user | |||
| authentication and the transmission of sensitive values, the | authentication and the transmission of sensitive values, the | |||
| authorization server SHOULD require the use of a transport-layer | authorization server SHOULD require the use of a transport-layer | |||
| mechanism such as TLS/SSL (or a secure channel with equivalent | mechanism such as TLS/SSL (or a secure channel with equivalent | |||
| protections) when sending requests to the authorization endpoints. | protections) when sending requests to the authorization endpoints. | |||
| 3.2. Token Endpoint | 3.2. Token Endpoint | |||
| After obtaining authorization from the resource owner, clients | After obtaining authorization from the resource owner, clients | |||
| request an access token from the authorization server's token | request an access token from the authorization server's token | |||
| endpoint. | endpoint. | |||
| The URI of the token endpoint can be found in the service | The URI of the token endpoint can be found in the service | |||
| documentation, or can be obtained by the client by making an | documentation, or can be obtained by the client by making an | |||
| unauthorized protected resource request (from the "WWW-Authenticate" | unauthorized protected resource request (from the "WWW-Authenticate" | |||
| response header token-uri (Section 9.1.2) attribute). | response header token-uri (Section 6.1.2) attribute). | |||
| The token endpoint advertised by the resource server MAY include a | The token endpoint advertised by the resource server MAY include a | |||
| query component as defined by [RFC3986] section 3. | query component as defined by [RFC3986] section 3. | |||
| Since requests to the token endpoint result in the transmission of | Since requests to the token endpoint result in the transmission of | |||
| plain text credentials in the HTTP request and response, the | plain text credentials in the HTTP request and response, the | |||
| authorization server MUST require the use of a transport-layer | authorization server MUST require the use of a transport-layer | |||
| mechanism such as TLS/SSL (or a secure channel with equivalent | mechanism such as TLS/SSL (or a secure channel with equivalent | |||
| protections) when sending requests to the token endpoints. | protections) when sending requests to the token endpoints. | |||
| 3.2.1. Response Format | 3.2.1. Response Format | |||
| Authorization servers respond to client requests by including a set | Authorization servers respond to client requests by including a set | |||
| of response parameters in the entity body of the HTTP response. The | of response parameters in the entity body of the HTTP response. The | |||
| response uses the "application/json" media type as defined by | response uses the "application/json" media type as defined by | |||
| [RFC4627]. | [RFC4627]. | |||
| The parameters are serialized into a JSON structure by adding each | The parameters are serialized into a JSON structure by adding each | |||
| parameter at the highest strucutre level. Parameter names and string | parameter at the highest structure level. Parameter names and string | |||
| values are included as JSON strings. Numerical number are included | values are included as JSON strings. Numerical number are included | |||
| as JSON numbers. | as JSON numbers. | |||
| The authorization server MUST include the HTTP "Cache-Control" | The authorization server MUST include the HTTP "Cache-Control" | |||
| response header field with a value of "no-store" in any response | response header field with a value of "no-store" in any response | |||
| containing tokens, secrets, or other sensitive information. | containing tokens, secrets, or other sensitive information. | |||
| 3.2.1.1. Access Token Response | 3.2.1.1. Access Token Response | |||
| After recieving and verifying a valid and authorized access token | After receiving and verifying a valid and authorized access token | |||
| request from the client (as described in each of the flows below), | request from the client (as described in each of the flows below), | |||
| the authorization server constructs a JSON-formatted response which | the authorization server constructs a JSON-formatted response which | |||
| includes the common parameters set as well as additional flow- | includes the common parameters set as well as additional flow- | |||
| specific parameters. The formatted parameters are sent to the client | specific parameters. The formatted parameters are sent to the client | |||
| in the entity body of the HTTP response with a 200 status code (OK). | in the entity body of the HTTP response with a 200 status code (OK). | |||
| The token response contains the following common parameters: | The token response contains the following common parameters: | |||
| access_token | access_token | |||
| REQUIRED. The access token issued by the authorization server. | REQUIRED. The access token issued by the authorization server. | |||
| expires_in | expires_in | |||
| OPTIONAL. The duration in seconds of the access token | OPTIONAL. The duration in seconds of the access token | |||
| lifetime. | lifetime. | |||
| refresh_token | refresh_token | |||
| OPTIONAL. The refresh token used to obtain new access tokens | OPTIONAL. The refresh token used to obtain new access tokens | |||
| using the same end-user access grant as described in Section 7. | using the same end-user access grant as described in Section 4. | |||
| access_token_secret | access_token_secret | |||
| REQUIRED if requested by the client. The corresponding access | REQUIRED if requested by the client. The corresponding access | |||
| token secret as requested by the client. | token secret as requested by the client. | |||
| scope | ||||
| OPTIONAL. The scope of the access token as a list of space- | ||||
| delimited strings. The value of the "scope" parameter is | ||||
| defined by the authorization server. If the value contains | ||||
| multiple space-delimited strings, their order does not matter, | ||||
| and each string adds an additional access range to the | ||||
| requested scope. | ||||
| For example (line breaks are for display purposes only): | For example (line breaks are for display purposes only): | |||
| HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
| Content-Type: application/json | Content-Type: application/json | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"access_token":"SlAV32hkKG","expires_in":3600, | {"access_token":"SlAV32hkKG","expires_in":3600, | |||
| "refresh_token":"8xLOxBtZp8"} | "refresh_token":"8xLOxBtZp8"} | |||
| 3.2.1.2. Error Response | 3.2.1.2. Error Response | |||
| skipping to change at page 12, line 12 ¶ | skipping to change at page 12, line 26 ¶ | |||
| server, are left undefined by this specification. Clients should | server, are left undefined by this specification. Clients should | |||
| avoid making assumptions about value sizes. Servers should document | avoid making assumptions about value sizes. Servers should document | |||
| the expected size of any value they issue. | the expected size of any value they issue. | |||
| Unless otherwise noted, all the protocol parameter names and values | Unless otherwise noted, all the protocol parameter names and values | |||
| are case sensitive. | are case sensitive. | |||
| 3.4. Client Credentials | 3.4. Client Credentials | |||
| When requesting access from the authorization server, the client | When requesting access from the authorization server, the client | |||
| identifies itself using its authorization-server-issued client | identifies itself using a set of client credentials. The client | |||
| credentials. The client credentials include a client identifier and | credentials include a client identifier and an OPTIONAL symmetric | |||
| an OPTIONAL symmetric shared secret. The means through which the | shared secret. The means through which the client obtains these | |||
| client obtains these credentials are beyond the scope of this | credentials are beyond the scope of this specification, but usually | |||
| specification, but usually involve registration with the | involve registration with the authorization server. | |||
| authorization server. | ||||
| The client identifier is used by the authorization server to | The client identifier is used by the authorization server to | |||
| establish the identity of the client for the purpose of presenting | establish the identity of the client for the purpose of presenting | |||
| information to the resource owner prior to granting access, as well | information to the resource owner prior to granting access, as well | |||
| as for providing different service levels to different clients. They | as for providing different service levels to different clients. They | |||
| can also be used to block unauthorized clients from requesting | can also be used to block unauthorized clients from requesting | |||
| access. | access. | |||
| Due to the nature of some clients, authorization servers SHOULD NOT | Due to the nature of some clients, authorization servers SHOULD NOT | |||
| make assumptions about the confidentiality of client credentials | make assumptions about the confidentiality of client credentials | |||
| skipping to change at page 14, line 46 ¶ | skipping to change at page 15, line 10 ¶ | |||
| OPTIONAL. An opaque value used by the client to maintain state | OPTIONAL. An opaque value used by the client to maintain state | |||
| between the request and callback. The authorization server | between the request and callback. The authorization server | |||
| includes this value when redirecting the user-agent back to the | includes this value when redirecting the user-agent back to the | |||
| client. | client. | |||
| scope | scope | |||
| OPTIONAL. The scope of the access request expressed as a list | OPTIONAL. The scope of the access request expressed as a list | |||
| of space-delimited strings. The value of the "scope" parameter | of space-delimited strings. The value of the "scope" parameter | |||
| is defined by the authorization server. If the value contains | is defined by the authorization server. If the value contains | |||
| multiple space-delimited strings, their order does not matter, | multiple space-delimited strings, their order does not matter, | |||
| and each string adds additional access range to the requested | and each string adds an additional access range to the | |||
| scope. | requested scope. | |||
| immediate | immediate | |||
| OPTIONAL. The parameter value must be set to "true" or | OPTIONAL. The parameter value must be set to "true" or | |||
| "false". If set to "true", the authorization server MUST NOT | "false". If set to "true", the authorization server MUST NOT | |||
| prompt the end-user to authenticate or approve access. | prompt the end-user to authenticate or approve access. | |||
| Instead, the authorization server attempts to establish the | Instead, the authorization server attempts to establish the | |||
| end-user's identity via other means (e.g. browser cookies) and | end-user's identity via other means (e.g. browser cookies) and | |||
| checks if the end-user has previously approved an identical | checks if the end-user has previously approved an identical | |||
| access request by the same client and if that access grant is | access request by the same client and if that access grant is | |||
| still active. If the authorization server does not support an | still active. If the authorization server does not support an | |||
| immediate check or if it is unable to establish the end-user's | immediate check or if it is unable to establish the end-user's | |||
| identity or approval status, it MUST deny the request without | identity or approval status, it MUST deny the request without | |||
| prompting the end-user. Defaults to "false" if omitted. | prompting the end-user. Defaults to "false" if omitted. | |||
| secret_type | secret_type | |||
| OPTIONAL. The access token secret type as described by | OPTIONAL. The access token secret type as described by | |||
| Section 8.3. If omitted, the authorization server will issue a | Section 5.3. If omitted, the authorization server will issue a | |||
| bearer token (an access token without a matching secret) as | bearer token (an access token without a matching secret) as | |||
| described by Section 8.2. | described by Section 5.2. | |||
| The client directs the end-user to the constructed URI using an HTTP | The client directs the end-user to the constructed URI using an HTTP | |||
| redirection response, or by other means available to it via the end- | redirection response, or by other means available to it via the end- | |||
| user's user-agent. The request MUST use the HTTP "GET" method. | user's user-agent. The request MUST use the HTTP "GET" method. | |||
| For example, the client directs the end-user's user-agent to make the | For example, the client directs the end-user's user-agent to make the | |||
| following HTTPS request (line breaks are for display purposes only): | following HTTPS request (line breaks are for display purposes only): | |||
| GET /authorize?type=user_agent&client_id=s6BhdRkqt3& | GET /authorize?type=user_agent&client_id=s6BhdRkqt3& | |||
| redirect_uri=https%3A%2F%2FEexample%2Ecom%2Frd HTTP/1.1 | redirect_uri=https%3A%2F%2FEexample%2Ecom%2Frd HTTP/1.1 | |||
| skipping to change at page 19, line 42 ¶ | skipping to change at page 19, line 42 ¶ | |||
| OPTIONAL. An opaque value used by the client to maintain state | OPTIONAL. An opaque value used by the client to maintain state | |||
| between the request and callback. The authorization server | between the request and callback. The authorization server | |||
| includes this value when redirecting the user-agent back to the | includes this value when redirecting the user-agent back to the | |||
| client. | client. | |||
| scope | scope | |||
| OPTIONAL. The scope of the access request expressed as a list | OPTIONAL. The scope of the access request expressed as a list | |||
| of space-delimited strings. The value of the "scope" parameter | of space-delimited strings. The value of the "scope" parameter | |||
| is defined by the authorization server. If the value contains | is defined by the authorization server. If the value contains | |||
| multiple space-delimited strings, their order does not matter, | multiple space-delimited strings, their order does not matter, | |||
| and each string adds additional access range to the requested | and each string adds an additional access range to the | |||
| scope. | requested scope. | |||
| immediate | immediate | |||
| OPTIONAL. The parameter value must be set to "true" or | OPTIONAL. The parameter value must be set to "true" or | |||
| "false". If set to "true", the authorization server MUST NOT | "false". If set to "true", the authorization server MUST NOT | |||
| prompt the end-user to authenticate or approve access. | prompt the end-user to authenticate or approve access. | |||
| Instead, the authorization server attempts to establish the | Instead, the authorization server attempts to establish the | |||
| end-user's identity via other means (e.g. browser cookies) and | end-user's identity via other means (e.g. browser cookies) and | |||
| checks if the end-user has previously approved an identical | checks if the end-user has previously approved an identical | |||
| access request by the same client and if that access grant is | access request by the same client and if that access grant is | |||
| still active. If the authorization server does not support an | still active. If the authorization server does not support an | |||
| skipping to change at page 22, line 24 ¶ | skipping to change at page 22, line 24 ¶ | |||
| code | code | |||
| REQUIRED. The verification code received from the | REQUIRED. The verification code received from the | |||
| authorization server. | authorization server. | |||
| redirect_uri | redirect_uri | |||
| REQUIRED. The redirection URI used in the initial request. | REQUIRED. The redirection URI used in the initial request. | |||
| secret_type | secret_type | |||
| OPTIONAL. The access token secret type as described by | OPTIONAL. The access token secret type as described by | |||
| Section 8.3. If omitted, the authorization server will issue a | Section 5.3. If omitted, the authorization server will issue a | |||
| bearer token (an access token without a matching secret) as | bearer token (an access token without a matching secret) as | |||
| described by Section 8.2. | described by Section 5.2. | |||
| For example, the client makes the following HTTPS request (line | For example, the client makes the following HTTPS request (line | |||
| breaks are for display purposes only): | breaks are for display purposes only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Content-Type: application/x-www-form-urlencoded | Content-Type: application/x-www-form-urlencoded | |||
| type=web_server&client_id=s6BhdRkqt3& | type=web_server&client_id=s6BhdRkqt3& | |||
| client_secret=gX1fBat3bV&code=i1WsRn1uB1& | client_secret=gX1fBat3bV&code=i1WsRn1uB1& | |||
| skipping to change at page 23, line 38 ¶ | skipping to change at page 23, line 38 ¶ | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"error":"incorrect_client_credentials"} | {"error":"incorrect_client_credentials"} | |||
| 3.7. Device Flow | 3.7. Device Flow | |||
| The device flow is a user delegation flow suitable for clients | The device flow is a user delegation flow suitable for clients | |||
| executing on devices which do not have an easy data-entry method | executing on devices which do not have an easy data-entry method | |||
| (e.g. game consoles or media hub), but where the end-user has | (e.g. game consoles or media hub), but where the end-user has | |||
| separate access to a user-agent on another computer or device (e.g. | separate access to a user-agent on another computer or device (e.g. | |||
| home computer, a laptop, or a smartphone). The client is incapable | home computer, a laptop, or a smart phone). The client is incapable | |||
| of receiving incoming requests from the authorization server | of receiving incoming requests from the authorization server | |||
| (incapable of acting as an HTTP server). | (incapable of acting as an HTTP server). | |||
| Instead of interacting with the end-user's user-agent, the client | Instead of interacting with the end-user's user-agent, the client | |||
| instructs the end-user to use another computer or device and connect | instructs the end-user to use another computer or device and connect | |||
| to the authorization server to approve the access request. Since the | to the authorization server to approve the access request. Since the | |||
| client cannot receive incoming requests, it polls the authorization | client cannot receive incoming requests, it polls the authorization | |||
| server repeatedly until the end-user completes the approval process. | server repeatedly until the end-user completes the approval process. | |||
| This device flow does not utilize the client secret since the client | This device flow does not utilize the client secret since the client | |||
| skipping to change at page 25, line 7 ¶ | skipping to change at page 25, line 7 ¶ | |||
| (B) The authorization server issues a verification code, a user | (B) The authorization server issues a verification code, a user | |||
| code, and provides the end-user authorization URI. | code, and provides the end-user authorization URI. | |||
| (C) The client instructs the end-user to use its user-agent | (C) The client instructs the end-user to use its user-agent | |||
| (elsewhere) and visit the provided authorization URI. The | (elsewhere) and visit the provided authorization URI. The | |||
| client provides the user with the user code to enter in order to | client provides the user with the user code to enter in order to | |||
| grant access. | grant access. | |||
| (D) The authorization server authenticates the end-user (via the | (D) The authorization server authenticates the end-user (via the | |||
| user-agent) and prompts the end-user to grant the client's | user-agent) and prompts the end-user to grant the client's | |||
| access request by entering the user code provided by the client. | access request. If the end-user agrees to the client's access | |||
| request, the end-user enters the user code provided by the | ||||
| client. | ||||
| (E) While the end-user authorizes (or denies) the client's request | (E) While the end-user authorizes (or denies) the client's request | |||
| (D), the client repeatedly polls the authorization server to | (D), the client repeatedly polls the authorization server to | |||
| find out if the end-user completed the user authorization step. | find out if the end-user completed the user authorization step. | |||
| The client includes the verification code and its client | The client includes the verification code and its client | |||
| identifier. | identifier. | |||
| (F) Assuming the end-user granted access, the authorization server | (F) Assuming the end-user granted access, the authorization server | |||
| validates the verification code provided by the client and | validates the verification code provided by the client and | |||
| responds back with the access token. | responds back with the access token. | |||
| 3.7.1. Client Requests Authorization | 3.7.1. Client Requests Authorization | |||
| The client initiates the flow by requesting a set of verification | The client initiates the flow by requesting a set of verification | |||
| codes from the authorization server by making an HTTP "GET" request | codes from the authorization server by making an HTTP "POST" request | |||
| to the token endpoint. The client constructs a request URI by adding | to the token endpoint. The client constructs a request URI by adding | |||
| the following parameters to the request: | the following parameters to the request: | |||
| type | type | |||
| REQUIRED. The parameter value MUST be set to "device_code". | REQUIRED. The parameter value MUST be set to "device_code". | |||
| client_id | client_id | |||
| REQUIRED. The client identifier as described in Section 3.4. | REQUIRED. The client identifier as described in Section 3.4. | |||
| scope | scope | |||
| OPTIONAL. The scope of the access request expressed as a list | OPTIONAL. The scope of the access request expressed as a list | |||
| of space-delimited strings. The value of the "scope" parameter | of space-delimited strings. The value of the "scope" parameter | |||
| is defined by the authorization server. If the value contains | is defined by the authorization server. If the value contains | |||
| multiple space-delimited strings, their order does not matter, | multiple space-delimited strings, their order does not matter, | |||
| and each string adds additional access range to the requested | and each string adds an additional access range to the | |||
| scope. | requested scope. | |||
| For example, the client makes the following HTTPS request (line | For example, the client makes the following HTTPS request (line | |||
| breaks are for display purposes only): | breaks are for display purposes only): | |||
| GET /token?type=device_code&client_id=s6BhdRkqt3 | POST /token?type=device_code&client_id=s6BhdRkqt3 | |||
| HTTP/1.1 | HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| In response, the authorization server generates a verification code | In response, the authorization server generates a verification code | |||
| and a user code and includes them in the HTTP response body using the | and a user code and includes them in the HTTP response body using the | |||
| "application/json" format as desribed by Section 3.2.1 with a 200 | "application/json" format as described by Section 3.2.1 with a 200 | |||
| status code (OK). The response contains the following parameters: | status code (OK). The response contains the following parameters: | |||
| code | code | |||
| REQUIRED. The verification code. | REQUIRED. The verification code. | |||
| user_code | user_code | |||
| REQUIRED. The user code. | REQUIRED. The user code. | |||
| user_uri | user_uri | |||
| REQUIRED. The user authorization URI on the authorization | REQUIRED. The user authorization URI on the authorization | |||
| server. | server. The URI should be short and easy to remember as end- | |||
| users will be asked to manually type it into their user-agent. | ||||
| expires_in | expires_in | |||
| OPTIONAL. The duration in seconds of the verification code | OPTIONAL. The duration in seconds of the verification code | |||
| lifetime. | lifetime. | |||
| interval | interval | |||
| OPTIONAL. The minimum amount of time in seconds that the | OPTIONAL. The minimum amount of time in seconds that the | |||
| client SHOULD wait between polling requests to the token | client SHOULD wait between polling requests to the token | |||
| endpoint. | endpoint. | |||
| skipping to change at page 27, line 11 ¶ | skipping to change at page 27, line 18 ¶ | |||
| authorization server, it polls the authorization server repeatedly | authorization server, it polls the authorization server repeatedly | |||
| until the end-user grants or denies the request, or the verification | until the end-user grants or denies the request, or the verification | |||
| code expires. | code expires. | |||
| The client makes the following request at an arbitrary but reasonable | The client makes the following request at an arbitrary but reasonable | |||
| interval which MUST NOT exceed the minimum interval rate provided by | interval which MUST NOT exceed the minimum interval rate provided by | |||
| the authorization server (if present via the "interval" parameter). | the authorization server (if present via the "interval" parameter). | |||
| Alternatively, the client MAY provide a user interface for the end- | Alternatively, the client MAY provide a user interface for the end- | |||
| user to manually inform it when authorization was granted. | user to manually inform it when authorization was granted. | |||
| The client requests an access token by making an HTTP "GET" request | The client requests an access token by making an HTTP "POST" request | |||
| to the token endpoint. The client constructs a request URI by adding | to the token endpoint. The client constructs a request URI by adding | |||
| the following parameters to the request: | the following parameters to the request: | |||
| type | type | |||
| REQUIRED. The parameter value MUST be set to "device_token". | REQUIRED. The parameter value MUST be set to "device_token". | |||
| client_id | client_id | |||
| REQUIRED. The client identifier as described in Section 3.4. | REQUIRED. The client identifier as described in Section 3.4. | |||
| code | code | |||
| The verification code received from the authorization server. | The verification code received from the authorization server. | |||
| secret_type | secret_type | |||
| OPTIONAL. The access token secret type as described by | OPTIONAL. The access token secret type as described by | |||
| Section 8.3. If omitted, the authorization server will issue a | Section 5.3. If omitted, the authorization server will issue a | |||
| bearer token (an access token without a matching secret) as | bearer token (an access token without a matching secret) as | |||
| described by Section 8.2. | described by Section 5.2. | |||
| For example, the client makes the following HTTPS request (line | For example, the client makes the following HTTPS request (line | |||
| breaks are for display purposes only): | breaks are for display purposes only): | |||
| GET /token?type=device_token&client_id=s6BhdRkqt3 | POST /token?type=device_token&client_id=s6BhdRkqt3 | |||
| &code=J2vC42OifV HTTP/1.1 | &code=J2vC42OifV HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| If the end-user authorized the request, the authorization server | If the end-user authorized the request, the authorization server | |||
| issues an access token response as described in Section 3.2.1.1. | issues an access token response as described in Section 3.2.1.1. | |||
| For example (line breaks are for display purposes only): | For example (line breaks are for display purposes only): | |||
| HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
| Content-Type: application/json | Content-Type: application/json | |||
| skipping to change at page 28, line 32 ¶ | skipping to change at page 29, line 4 ¶ | |||
| any response from the end-user, or the client is exceeding the | any response from the end-user, or the client is exceeding the | |||
| allowed polling interval, the authorization server returns an error | allowed polling interval, the authorization server returns an error | |||
| response as described in Section 3.2.1.2 with one of the following | response as described in Section 3.2.1.2 with one of the following | |||
| error codes: | error codes: | |||
| o "'authorization_pending" | o "'authorization_pending" | |||
| o "slow_down" | o "slow_down" | |||
| o "code_expired" | o "code_expired" | |||
| For example: | For example: | |||
| HTTP/1.1 400 Bad Request | HTTP/1.1 400 Bad Request | |||
| Content-Type: application/json | Content-Type: application/json | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"error":"authorization_pending"} | {"error":"authorization_pending"} | |||
| 4. Username and Password Flow | 3.8. Username and Password Flow | |||
| The username and password flow is an end-user credentials flow | The username and password flow is suitable for clients capable of | |||
| suitable for clients capable of asking end users for their usernames | asking end-users for their usernames and passwords. It is also used | |||
| and passwords. It is also used to migrate existing clients using | to migrate existing clients using direct authentication schemes such | |||
| direct authentication schemes such as HTTP Basic or Digest | as HTTP Basic or Digest authentication to OAuth by converting the | |||
| authentication to OAuth by converting the end-user credentials stored | end-user credentials stored with tokens. | |||
| with tokens. | ||||
| However, unlike the HTTP Basic authentication scheme defined in | However, unlike the HTTP Basic authentication scheme defined in | |||
| [RFC2617], the end-user's credentials are used in a single request | [RFC2617], the end-user's credentials are used in a single request | |||
| and are exchanged for an access token and refresh token which | and are exchanged for an access token and refresh token which | |||
| eliminates the client need to store them for future use. | eliminates the client need to store them for future use. | |||
| The methods through which the client prompts end users for their | The methods through which the client prompts end users for their | |||
| usernames and passwords is beyond the scope of this specification. | usernames and passwords is beyond the scope of this specification. | |||
| The client MUST discard the usernames and passwords once an access | The client MUST discard the usernames and passwords once an access | |||
| token has been obtained. | token has been obtained. | |||
| skipping to change at page 29, line 35 ¶ | skipping to change at page 30, line 4 ¶ | |||
| (A) | (A) | |||
| : | : | |||
| v | v | |||
| +--------+ +---------------+ | +--------+ +---------------+ | |||
| | | Client Credentials | | | | | Client Credentials | | | |||
| | |>--(B)--- & User Credentials ---->| Authorization | | | |>--(B)--- & User Credentials ---->| Authorization | | |||
| | Client | | Server | | | Client | | Server | | |||
| | |<--(C)---- Access Token ---------<| | | | |<--(C)---- Access Token ---------<| | | |||
| | | (w/ Optional Refresh Token) | | | | | (w/ Optional Refresh Token) | | | |||
| +--------+ +---------------+ | +--------+ +---------------+ | |||
| Figure 6 | Figure 6 | |||
| The username and password flow illustrated in Figure 6 includes the | The username and password flow illustrated in Figure 6 includes the | |||
| following steps: | following steps: | |||
| (A) The end-user provides the client with its username and password. | (A) The end-user provides the client with its username and password. | |||
| (B) The client sends an access token request to the authorization | (B) The client sends an access token request to the authorization | |||
| server and includes its client identifier and client secret, and | server and includes its client identifier and client secret, and | |||
| the end-user's username and password. | the end-user's username and password. | |||
| (C) The authorization server validates the end-user credentials and | (C) The authorization server validates the end-user credentials and | |||
| the client credentials and issues an access token. | the client credentials and issues an access token. | |||
| 4.1. Client Requests Access Token | 3.8.1. Client Requests Access Token | |||
| The client requests an access token by making an HTTP "POST" request | The client requests an access token by making an HTTP "POST" request | |||
| to the token endpoint. The client constructs a request URI by adding | to the token endpoint. The client constructs a request URI by adding | |||
| the following parameters to the request: | the following parameters to the request: | |||
| type | type | |||
| REQUIRED. The parameter value MUST be set to "username". | REQUIRED. The parameter value MUST be set to "username". | |||
| client_id | client_id | |||
| REQUIRED. The client identifier as described in Section 3.4. | REQUIRED. The client identifier as described in Section 3.4. | |||
| skipping to change at page 30, line 35 ¶ | skipping to change at page 30, line 45 ¶ | |||
| REQUIRED. The end-user's username. | REQUIRED. The end-user's username. | |||
| password | password | |||
| REQUIRED. The end-user's password. | REQUIRED. The end-user's password. | |||
| scope | scope | |||
| OPTIONAL. The scope of the access request expressed as a list | OPTIONAL. The scope of the access request expressed as a list | |||
| of space-delimited strings. The value of the "scope" parameter | of space-delimited strings. The value of the "scope" parameter | |||
| is defined by the authorization server. If the value contains | is defined by the authorization server. If the value contains | |||
| multiple space-delimited strings, their order does not matter, | multiple space-delimited strings, their order does not matter, | |||
| and each string adds additional access range to the requested | and each string adds an additional access range to the | |||
| scope. | requested scope. | |||
| secret_type | secret_type | |||
| OPTIONAL. The access token secret type as described by | OPTIONAL. The access token secret type as described by | |||
| Section 8.3. If omitted, the authorization server will issue a | Section 5.3. If omitted, the authorization server will issue a | |||
| bearer token (an access token without a matching secret) as | bearer token (an access token without a matching secret) as | |||
| described by Section 8.2. | described by Section 5.2. | |||
| For example, the client makes the following HTTPS request (line | For example, the client makes the following HTTPS request (line | |||
| breaks are for display purposes only): | breaks are for display purposes only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| type=username&client_id=s6BhdRkqt3&client_secret= | type=username&client_id=s6BhdRkqt3&client_secret= | |||
| 47HDu8s&username=johndoe&password=A3ddj3w | 47HDu8s&username=johndoe&password=A3ddj3w | |||
| skipping to change at page 31, line 35 ¶ | skipping to change at page 32, line 5 ¶ | |||
| flow. | flow. | |||
| For example: | For example: | |||
| HTTP/1.1 400 Bad Request | HTTP/1.1 400 Bad Request | |||
| Content-Type: application/json | Content-Type: application/json | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"error":"incorrect_client_credentials"} | {"error":"incorrect_client_credentials"} | |||
| 5. Client Credentials Flow | 3.9. Client Credentials Flow | |||
| The client credentials flow is used when the client acts autonomously | The client credentials flow is used when the client acts on behalf of | |||
| without acting on behalf of a separate resource owner. The client | itself (the client is the resource owner), or when the client | |||
| secret is assumed to be high-entropy since it is not designed to be | credentials are used to obtain an access token representing a | |||
| memorized by an end-user. | previously established access authorization. The client secret is | |||
| assumed to be high-entropy since it is not designed to be memorized | ||||
| by an end-user. | ||||
| +--------+ +---------------+ | +--------+ +---------------+ | |||
| | | | | | | | | | | |||
| | |>--(A)--- Client Credentials ---->| Authorization | | | |>--(A)--- Client Credentials ---->| Authorization | | |||
| | Client | | Server | | | Client | | Server | | |||
| | |<--(B)---- Access Token ---------<| | | | |<--(B)---- Access Token ---------<| | | |||
| | | (w/ Optional Refresh Token) | | | | | (w/ Optional Refresh Token) | | | |||
| +--------+ +---------------+ | +--------+ +---------------+ | |||
| Figure 7 | Figure 7 | |||
| The client credential flow illustrated in Figure 7 includes the | The client credential flow illustrated in Figure 7 includes the | |||
| following steps: | following steps: | |||
| (A) The client sends an access token request to the authorization | (A) The client sends an access token request to the authorization | |||
| server and includes its client identifier and client secret. | server and includes its client identifier and client secret. | |||
| (B) The authorization server validates the client credentials and | (B) The authorization server validates the client credentials and | |||
| issues an access token. | issues an access token. | |||
| 5.1. Client Requests Access Token | 3.9.1. Client Requests Access Token | |||
| The client requests an access token by making an HTTP "POST" request | The client requests an access token by making an HTTP "POST" request | |||
| to the token endpoint. The client constructs a request URI by adding | to the token endpoint. The client constructs a request URI by adding | |||
| the following parameters to the request: | the following parameters to the request: | |||
| type | type | |||
| REQUIRED. The parameter value MUST be set to | REQUIRED. The parameter value MUST be set to | |||
| "client_credentials". | "client_credentials". | |||
| client_id | client_id | |||
| REQUIRED. The client identifier as described in Section 3.4. | REQUIRED. The client identifier as described in Section 3.4. | |||
| client_secret | client_secret | |||
| REQUIRED. The client secret as described in Section 3.4. | REQUIRED. The client secret as described in Section 3.4. | |||
| scope | scope | |||
| OPTIONAL. The scope of the access request expressed as a list | OPTIONAL. The scope of the access request expressed as a list | |||
| of space-delimited strings. The value of the "scope" parameter | of space-delimited strings. The value of the "scope" parameter | |||
| is defined by the authorization server. If the value contains | is defined by the authorization server. If the value contains | |||
| multiple space-delimited strings, their order does not matter, | multiple space-delimited strings, their order does not matter, | |||
| and each string adds additional access range to the requested | and each string adds an additional access range to the | |||
| scope. | requested scope. | |||
| secret_type | secret_type | |||
| OPTIONAL. The access token secret type as described by | OPTIONAL. The access token secret type as described by | |||
| Section 8.3. If omitted, the authorization server will issue a | Section 5.3. If omitted, the authorization server will issue a | |||
| bearer token (an access token without a matching secret) as | bearer token (an access token without a matching secret) as | |||
| described by Section 8.2. | described by Section 5.2. | |||
| For example, the client makes the following HTTPS request (line | For example, the client makes the following HTTPS request (line | |||
| breaks are for display purposes only): | breaks are for display purposes only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| type=client_credentials&client_id=s6BhdRkqt3&client_secret=47HDu8s | type=client_credentials&client_id=s6BhdRkqt3&client_secret=47HDu8s | |||
| The authorization server MUST validate the client credentials and if | The authorization server MUST validate the client credentials and if | |||
| skipping to change at page 33, line 32 ¶ | skipping to change at page 34, line 4 ¶ | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"access_token":"SlAV32hkKG","expires_in":3600, | {"access_token":"SlAV32hkKG","expires_in":3600, | |||
| "refresh_token":"8xLOxBtZp8"} | "refresh_token":"8xLOxBtZp8"} | |||
| If the request is invalid, the authorization server returns an error | If the request is invalid, the authorization server returns an error | |||
| response as described in Section 3.2.1.2 with one of the following | response as described in Section 3.2.1.2 with one of the following | |||
| error codes: | error codes: | |||
| o "incorrect_client_credentials" | o "incorrect_client_credentials" | |||
| For example: | For example: | |||
| HTTP/1.1 400 Bad Request | HTTP/1.1 400 Bad Request | |||
| Content-Type: application/json | Content-Type: application/json | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"error":"incorrect_client_credentials"} | {"error":"incorrect_client_credentials"} | |||
| 6. Assertion Flow | 3.10. Assertion Flow | |||
| The assertion flow is used when a client wishes to exchange an | The assertion flow is used when a client wishes to exchange an | |||
| existing security token or assertion for an access token. This flow | existing security token or assertion for an access token. This flow | |||
| is suitable when the client is acting autonomously or on behalf of | is suitable when the client is the resource owner or is acting on | |||
| the end-user (based on the content of the assertion used). | behalf of the resource owner (based on the content of the assertion | |||
| used). | ||||
| The assertion flow requires the client to obtain a assertion (such as | The assertion flow requires the client to obtain a assertion (such as | |||
| a SAML [OASIS.saml-core-2.0-os] assertion) from an assertion issuer | a SAML [OASIS.saml-core-2.0-os] assertion) from an assertion issuer | |||
| or to self-issue an assertion prior to initiating the flow. The | or to self-issue an assertion prior to initiating the flow. The | |||
| assertion format, the process by which the assertion is obtained, and | assertion format, the process by which the assertion is obtained, and | |||
| the method of validating the assertion are defined by the assertion | the method of validating the assertion are defined by the assertion | |||
| issuer and the authorization server, and are beyond the scope of this | issuer and the authorization server, and are beyond the scope of this | |||
| specification. | specification. | |||
| +--------+ +---------------+ | +--------+ +---------------+ | |||
| skipping to change at page 34, line 34 ¶ | skipping to change at page 35, line 5 ¶ | |||
| The assertion flow illustrated in Figure 8 includes the following | The assertion flow illustrated in Figure 8 includes the following | |||
| steps: | steps: | |||
| (A) The client sends an access token request to the authorization | (A) The client sends an access token request to the authorization | |||
| server and includes an assertion. | server and includes an assertion. | |||
| (B) The authorization server validates the assertion and issues an | (B) The authorization server validates the assertion and issues an | |||
| access token. | access token. | |||
| 6.1. Client Requests Access Token | 3.10.1. Client Requests Access Token | |||
| The client requests an access token by making an HTTP "POST" request | The client requests an access token by making an HTTP "POST" request | |||
| to the token endpoint. The client constructs a request URI by adding | to the token endpoint. The client constructs a request URI by adding | |||
| the following parameters to the request: | the following parameters to the request: | |||
| type | type | |||
| REQUIRED. The parameter value MUST be set to "assertion". | REQUIRED. The parameter value MUST be set to "assertion". | |||
| format | format | |||
| REQUIRED. The format of the assertion as defined by the | REQUIRED. The format of the assertion as defined by the | |||
| authorization server. The value MUST be an absolute URI. | authorization server. The value MUST be an absolute URI. | |||
| assertion | assertion | |||
| REQUIRED. The assertion. | REQUIRED. The assertion. | |||
| scope | scope | |||
| OPTIONAL. The scope of the access request expressed as a list | OPTIONAL. The scope of the access request expressed as a list | |||
| of space-delimited strings. The value of the "scope" parameter | of space-delimited strings. The value of the "scope" parameter | |||
| is defined by the authorization server. If the value contains | is defined by the authorization server. If the value contains | |||
| multiple space-delimited strings, their order does not matter, | multiple space-delimited strings, their order does not matter, | |||
| and each string adds additional access range to the requested | and each string adds an additional access range to the | |||
| scope. | requested scope. | |||
| secret_type | secret_type | |||
| OPTIONAL. The access token secret type as described by | OPTIONAL. The access token secret type as described by | |||
| Section 8.3. If omitted, the authorization server will issue a | Section 5.3. If omitted, the authorization server will issue a | |||
| bearer token (an access token without a matching secret) as | bearer token (an access token without a matching secret) as | |||
| described by Section 8.2. | described by Section 5.2. | |||
| For example, the client makes the following HTTPS request (line | For example, the client makes the following HTTPS request (line | |||
| breaks are for display purposes only): | breaks are for display purposes only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| type=assertion&format=_______&assertion=_______ | type=assertion&format=_______&assertion=_______ | |||
| The authorization server MUST validate the assertion and if valid | The authorization server MUST validate the assertion and if valid | |||
| skipping to change at page 36, line 4 ¶ | skipping to change at page 36, line 18 ¶ | |||
| Content-Type: application/json | Content-Type: application/json | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"access_token":"SlAV32hkKG","expires_in":3600} | {"access_token":"SlAV32hkKG","expires_in":3600} | |||
| If the request is invalid, the authorization server returns an error | If the request is invalid, the authorization server returns an error | |||
| response as described in Section 3.2.1.2 with one of the following | response as described in Section 3.2.1.2 with one of the following | |||
| error codes: | error codes: | |||
| o "invalid_assertion" | o "invalid_assertion" | |||
| o "unknown_format" | o "unknown_format" | |||
| For example: | For example: | |||
| HTTP/1.1 400 Bad Request | HTTP/1.1 400 Bad Request | |||
| Content-Type: application/json | Content-Type: application/json | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"error":"invalid_assertion"} | {"error":"invalid_assertion"} | |||
| Authorization servers SHOULD issue access tokens with a limited | Authorization servers SHOULD issue access tokens with a limited | |||
| lifetime and require clients to refresh them by requesting a new | lifetime and require clients to refresh them by requesting a new | |||
| access token using the same assertion if it is still valid. | access token using the same assertion if it is still valid. | |||
| Otherwise the client MUST obtain a new valid assertion. | Otherwise the client MUST obtain a new valid assertion. | |||
| 7. Refreshing an Access Token | 4. Refreshing an Access Token | |||
| Token refresh is used when the lifetime of an access token is shorter | Token refresh is used when the lifetime of an access token is shorter | |||
| than the lifetime of the authorization grant. It allows clients to | than the lifetime of the authorization grant. It allows clients to | |||
| obtain a new access token without having to go through the | obtain a new access token without having to go through the | |||
| authorization flow again or involve the resource owner. It is also | authorization flow again or involve the resource owner. It is also | |||
| used to obtain a new token with different security properties (e.g. | used to obtain a new token with different security properties (e.g. | |||
| bearer token, token with shared symmetric secret). | bearer token, token with shared symmetric secret). | |||
| +--------+ Client Credentials, +---------------+ | +--------+ Client Credentials, +---------------+ | |||
| | | Refresh Token, | | | | | Refresh Token, | | | |||
| skipping to change at page 37, line 17 ¶ | skipping to change at page 37, line 35 ¶ | |||
| client_secret | client_secret | |||
| REQUIRED if the client was issued a secret. The client secret. | REQUIRED if the client was issued a secret. The client secret. | |||
| refresh_token | refresh_token | |||
| REQUIRED. The refresh token associated with the access token | REQUIRED. The refresh token associated with the access token | |||
| to be refreshed. | to be refreshed. | |||
| secret_type | secret_type | |||
| OPTIONAL. The access token secret type as described by | OPTIONAL. The access token secret type as described by | |||
| Section 8.3. If omitted, the authorization server will issue a | Section 5.3. If omitted, the authorization server will issue a | |||
| bearer token (an access token without a matching secret) as | bearer token (an access token without a matching secret) as | |||
| described by Section 8.2. | described by Section 5.2. | |||
| For example, the client makes the following HTTPS request (line break | For example, the client makes the following HTTPS request (line break | |||
| are for display purposes only): | are for display purposes only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Content-Type: application/x-www-form-urlencoded | Content-Type: application/x-www-form-urlencoded | |||
| type=refresh_token&client_id=s6BhdRkqt3&client_secret=8eSEIpnqmM | type=refresh_token&client_id=s6BhdRkqt3&client_secret=8eSEIpnqmM | |||
| &refresh_token=n4E9O119d&secret_type=hmac-sha256 | &refresh_token=n4E9O119d&secret_type=hmac-sha256 | |||
| verify the client credential, the validity of the refresh token, and | verify the client credential, the validity of the refresh token, and | |||
| that the resource owner's authorization is still valid. If the | that the resource owner's authorization is still valid. If the | |||
| request is valid, the authorization server issues an access token | request is valid, the authorization server issues an access token | |||
| response as described in Section 3.2.1.1. The authorization server | response as described in Section 3.2.1.1. The authorization server | |||
| MAY issue a new token. | MAY issue a new refresh token in which case the client MUST NOT use | |||
| the previous refresh token and replace it with the newly issued | ||||
| refresh token. | ||||
| For example (line breaks are for display purposes only): | For example (line breaks are for display purposes only): | |||
| HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
| Content-Type: application/json | Content-Type: application/json | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"access_token":"SlAV32hkKG","expires_in":3600} | {"access_token":"SlAV32hkKG","expires_in":3600} | |||
| If the request is invalid, the authorization server returns an error | If the request is invalid, the authorization server returns an error | |||
| skipping to change at page 38, line 19 ¶ | skipping to change at page 38, line 37 ¶ | |||
| o "unsupported_secret_type" | o "unsupported_secret_type" | |||
| For example: | For example: | |||
| HTTP/1.1 400 Bad Request | HTTP/1.1 400 Bad Request | |||
| Content-Type: application/json | Content-Type: application/json | |||
| Cache-Control: no-store | Cache-Control: no-store | |||
| {"error":"incorrect_client_credentials"} | {"error":"incorrect_client_credentials"} | |||
| 8. Accessing a Protected Resource | 5. Accessing a Protected Resource | |||
| Clients access protected resources by presenting an access token to | Clients access protected resources by presenting an access token to | |||
| the resource server. The methods used by the resource server to | the resource server. The methods used by the resource server to | |||
| validate the access token are beyond the scope of this specification, | validate the access token are beyond the scope of this specification, | |||
| but generally involve an interaction or coordination between the | but generally involve an interaction or coordination between the | |||
| resource server and authorization server. | resource server and authorization server. | |||
| The method in which a client uses an access token depends on the | The method in which a client uses an access token depends on the | |||
| security properties of the access tokens. By default, access tokens | security properties of the access tokens. By default, access tokens | |||
| are issued without a matching secret. Clients MAY request an access | are issued without a matching secret. Clients MAY request an access | |||
| skipping to change at page 39, line 10 ¶ | skipping to change at page 39, line 31 ¶ | |||
| When an access token includes a matching secret, the secret is not | When an access token includes a matching secret, the secret is not | |||
| included directly in the request but is used instead to generate a | included directly in the request but is used instead to generate a | |||
| cryptographic signature of the request. The signature can only be | cryptographic signature of the request. The signature can only be | |||
| generated and verified by entities with access to the secret. | generated and verified by entities with access to the secret. | |||
| Clients SHOULD NOT make authenticated requests with an access token | Clients SHOULD NOT make authenticated requests with an access token | |||
| to unfamiliar resource servers, especially when using bearer tokens, | to unfamiliar resource servers, especially when using bearer tokens, | |||
| regardless of the presence of a secure channel. | regardless of the presence of a secure channel. | |||
| 8.1. The Authorization Request Header | 5.1. The Authorization Request Header | |||
| The "Authorization" request header field is used by clients to make | The "Authorization" request header field is used by clients to make | |||
| both bearer token and cryptographic token requests. When making | both bearer token and cryptographic token requests. When making | |||
| bearer token requests, the client uses the "token" attribute to | bearer token requests, the client uses the "token" attribute to | |||
| include the access token in the request without any of the other | include the access token in the request without any of the other | |||
| attributes. Additional methods for making bearer token requests are | attributes. Additional methods for making bearer token requests are | |||
| described in Section 8.2. | described in Section 5.2. | |||
| For example: | For example: | |||
| GET /resource HTTP/1.1 | GET /resource HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Authorization: Token token="vF9dft4qmT" | Authorization: Token token="vF9dft4qmT" | |||
| When making a cryptographic token request (using an access token with | When making a cryptographic token request (using an access token with | |||
| a matching secret) the client uses the "token" attribute to include | a matching secret) the client uses the "token" attribute to include | |||
| the access token in the request, and uses the "nonce", "timestamp", | the access token in the request, and uses the "nonce", "timestamp", | |||
| skipping to change at page 40, line 23 ¶ | skipping to change at page 40, line 36 ¶ | |||
| token-id = "token" "=" <"> token <"> | token-id = "token" "=" <"> token <"> | |||
| timestamp = "timestamp" "=" <"> 1*DIGIT <"> | timestamp = "timestamp" "=" <"> 1*DIGIT <"> | |||
| nonce = "nonce" "=" <"> token <"> | nonce = "nonce" "=" <"> token <"> | |||
| algorithm = "algorithm" "=" algorithm-name | algorithm = "algorithm" "=" algorithm-name | |||
| algorithm-name = "hmac-sha256" / | algorithm-name = "hmac-sha256" / | |||
| token | token | |||
| signature = "signature" "=" <"> token <"> | signature = "signature" "=" <"> token <"> | |||
| 8.2. Bearer Token Requests | 5.2. Bearer Token Requests | |||
| Clients make bearer token requests by including the access token | Clients make bearer token requests by including the access token | |||
| using the HTTP "Authorization" request header with the "Token" | using the HTTP "Authorization" request header with the "Token" | |||
| authentication scheme as described in Section 8.1. The access token | authentication scheme as described in Section 5.1. The access token | |||
| is included using the "token" parameter. | is included using the "token" parameter. | |||
| For example, the client makes the following HTTPS request: | For example, the client makes the following HTTPS request: | |||
| GET /resource HTTP/1.1 | GET /resource HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Authorization: Token token="vF9dft4qmT" | Authorization: Token token="vF9dft4qmT" | |||
| The resource server MUST validate the access token and ensure it has | The resource server MUST validate the access token and ensure it has | |||
| not expired and that its scope covers the requested resource. If the | not expired and that its scope covers the requested resource. If the | |||
| token expired or is invalid, the resource server MUST reply with an | token expired or is invalid, the resource server MUST reply with an | |||
| HTTP 401 status code (Unauthorized) and include the HTTP | HTTP 401 status code (Unauthorized) and include the HTTP | |||
| "WWW-Authenticate" response header as described in Section 9.1. | "WWW-Authenticate" response header as described in Section 6.1. | |||
| For example: | For example: | |||
| HTTP/1.1 401 Unauthorized | HTTP/1.1 401 Unauthorized | |||
| WWW-Authenticate: Token realm='Service', error='token_expired' | WWW-Authenticate: Token realm='Service', error='token_expired' | |||
| Alternatively, the client MAY include the access token using the HTTP | Alternatively, the client MAY include the access token using the HTTP | |||
| request URI in the query component as described in Section 8.2.1, or | request URI in the query component as described in Section 5.2.1, or | |||
| in the HTTP body when using the "application/x-www-form-urlencoded" | in the HTTP body when using the "application/x-www-form-urlencoded" | |||
| content type as described in Section 8.2.2. Clients SHOULD only use | content type as described in Section 5.2.2. Clients SHOULD only use | |||
| the request URI or body when the "Authorization" request header is | the request URI or body when the "Authorization" request header is | |||
| not available, and MUST NOT use more than one method in each request. | not available, and MUST NOT use more than one method in each request. | |||
| 8.2.1. URI Query Parameter | 5.2.1. URI Query Parameter | |||
| When including the access token in the HTTP request URI, the client | When including the access token in the HTTP request URI, the client | |||
| adds the access token to the request URI query component as defined | adds the access token to the request URI query component as defined | |||
| by [RFC3986] using the "oauth_token" parameter. | by [RFC3986] using the "oauth_token" parameter. | |||
| For example, the client makes the following HTTPS request: | For example, the client makes the following HTTPS request: | |||
| GET /resource?oauth_token=vF9dft4qmT HTTP/1.1 | GET /resource?oauth_token=vF9dft4qmT HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| The HTTP request URI query can include other request-specific | The HTTP request URI query can include other request-specific | |||
| parameters, in which case, the "oauth_token" parameters SHOULD be | parameters, in which case, the "oauth_token" parameters SHOULD be | |||
| appended following the request-specific parameters, properly | appended following the request-specific parameters, properly | |||
| separated by an "&" character (ASCII code 38). | separated by an "&" character (ASCII code 38). | |||
| The resource server MUST validate the access token and ensure it has | The resource server MUST validate the access token and ensure it has | |||
| not expired and its scope includes the requested resource. If the | not expired and its scope includes the requested resource. If the | |||
| resource expired or is not valid, the resource server MUST reply with | resource expired or is not valid, the resource server MUST reply with | |||
| an HTTP 401 status code (Unauthorized) and include the HTTP | an HTTP 401 status code (Unauthorized) and include the HTTP | |||
| "WWW-Authenticate" response header as described in Section 9.1. | "WWW-Authenticate" response header as described in Section 6.1. | |||
| 8.2.2. Form-Encoded Body Parameter | 5.2.2. Form-Encoded Body Parameter | |||
| When including the access token in the HTTP request entity-body, the | When including the access token in the HTTP request entity-body, the | |||
| client adds the access token to the request body using the | client adds the access token to the request body using the | |||
| "oauth_token" parameter. The client can use this method only if the | "oauth_token" parameter. The client can use this method only if the | |||
| following REQUIRED conditions are met: | following REQUIRED conditions are met: | |||
| o The entity-body is single-part. | o The entity-body is single-part. | |||
| o The entity-body follows the encoding requirements of the | o The entity-body follows the encoding requirements of the | |||
| "application/x-www-form-urlencoded" content-type as defined by | "application/x-www-form-urlencoded" content-type as defined by | |||
| skipping to change at page 42, line 22 ¶ | skipping to change at page 42, line 35 ¶ | |||
| POST /resource HTTP/1.1 | POST /resource HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Content-Type: application/x-www-form-urlencoded | Content-Type: application/x-www-form-urlencoded | |||
| oauth_token=vF9dft4qmT | oauth_token=vF9dft4qmT | |||
| The resource server MUST validate the access token and ensure it has | The resource server MUST validate the access token and ensure it has | |||
| not expired and its scope includes the requested resource. If the | not expired and its scope includes the requested resource. If the | |||
| resource expired or is not valid, the resource server MUST reply with | resource expired or is not valid, the resource server MUST reply with | |||
| an HTTP 401 status code (Unauthorized) and include the HTTP | an HTTP 401 status code (Unauthorized) and include the HTTP | |||
| "WWW-Authenticate" response header as described in Section 9.1. | "WWW-Authenticate" response header as described in Section 6.1. | |||
| 8.3. Cryptographic Tokens Requests | 5.3. Cryptographic Tokens Requests | |||
| Clients make authenticated protected resource requests using an | Clients make authenticated protected resource requests using an | |||
| access token with a matching secret by calculating a set of values | access token with a matching secret by calculating a set of values | |||
| and including them in the request using the "Authorization" header | and including them in the request using the "Authorization" header | |||
| field. The way clients calculate these values depends on the access | field. The way clients calculate these values depends on the access | |||
| token secret type as issued by the authorization server. | token secret type as issued by the authorization server. | |||
| This specification defines the "hmac-sha256" algorithm, and | This specification defines the "hmac-sha256" algorithm, and | |||
| establishes a registry for providing additional algorithms. Clients | establishes a registry for providing additional algorithms. Clients | |||
| obtain an access token with a matching "hmac-sha256" secret by using | obtain an access token with a matching "hmac-sha256" secret by using | |||
| the "secret_type" parameter when requesting an access token. | the "secret_type" parameter when requesting an access token. | |||
| 8.3.1. The 'hmac-sha256' Algorithm | 5.3.1. The 'hmac-sha256' Algorithm | |||
| The "hmac-sha256" algorithm uses the HMAC method as defined in | The "hmac-sha256" algorithm uses the HMAC method as defined in | |||
| [RFC2104] together with the SHA-256 hash function defined in [NIST | [RFC2104] together with the SHA-256 hash function defined in [NIST | |||
| FIPS-180-3] to apply the access token secret to the request and | FIPS-180-3] to apply the access token secret to the request and | |||
| generate a signature value that is included in the request instead of | generate a signature value that is included in the request instead of | |||
| transmitting the secret in the clear. | transmitting the secret in the clear. | |||
| To use the "hmac-sha256" algorithm, clients: | To use the "hmac-sha256" algorithm, clients: | |||
| 1. Calculate the request timestamp and generate a request nonce as | 1. Calculate the request timestamp and generate a request nonce as | |||
| described in Section 8.3.1.1. | described in Section 5.3.1.1. | |||
| 2. Construct the normalized request string as described in | 2. Construct the normalized request string as described in | |||
| Section 8.3.1.2. | Section 5.3.1.2. | |||
| 3. Calculate the request signature as described in Section 8.3.1.3. | 3. Calculate the request signature as described in Section 5.3.1.3. | |||
| 4. Include the timestamp, nonce, algorithm name, and calculated | 4. Include the timestamp, nonce, algorithm name, and calculated | |||
| signature in the request using the "Authorization" header field. | signature in the request using the "Authorization" header field. | |||
| For example: | For example: | |||
| GET /resource HTTP/1.1 | GET /resource HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Authorization: Token token="vF9dft4qmT", | Authorization: Token token="vF9dft4qmT", | |||
| nonce="s8djwd", | nonce="s8djwd", | |||
| skipping to change at page 43, line 30 ¶ | skipping to change at page 43, line 43 ¶ | |||
| algorithm="hmac-sha256", | algorithm="hmac-sha256", | |||
| signature="wOJIO9A2W5mFwDgiDvZbTSMK/PY=" | signature="wOJIO9A2W5mFwDgiDvZbTSMK/PY=" | |||
| The resource server MUST validate the access token and ensure it has | The resource server MUST validate the access token and ensure it has | |||
| not expired and that its scope covers the requested resource. The | not expired and that its scope covers the requested resource. The | |||
| resource server MUST also recalculate the request signature using the | resource server MUST also recalculate the request signature using the | |||
| attributes provided by the client and compare it to the signature | attributes provided by the client and compare it to the signature | |||
| provided. If the token expired or is invalid, or if the signature is | provided. If the token expired or is invalid, or if the signature is | |||
| incorrect, the resource server MUST reply with an HTTP 401 status | incorrect, the resource server MUST reply with an HTTP 401 status | |||
| code (Unauthorized) and include the HTTP "WWW-Authenticate" response | code (Unauthorized) and include the HTTP "WWW-Authenticate" response | |||
| header as described in Section 9.1. | header as described in Section 6.1. | |||
| For example: | For example: | |||
| HTTP/1.1 401 Unauthorized | HTTP/1.1 401 Unauthorized | |||
| Date: Tue, 15 Nov 2010 08:12:31 GMT | Date: Tue, 15 Nov 2010 08:12:31 GMT | |||
| WWW-Authenticate: Token realm='Service', | WWW-Authenticate: Token realm='Service', | |||
| algorithms='hmac-sha256', | algorithms='hmac-sha256', | |||
| error='invalid_signature' | error='invalid_signature' | |||
| [[ Errors list ]] | [[ Errors list ]] | |||
| 8.3.1.1. Nonce and Timestamp | 5.3.1.1. Nonce and Timestamp | |||
| A timestamp in combination with unique nonce values is used to | A timestamp in combination with unique nonce values is used to | |||
| protect against replay attacks when transmitted over an insecure | protect against replay attacks when transmitted over an insecure | |||
| channel. | channel. | |||
| The nonce is a random string, uniquely generated by the client to | The nonce is a random string, uniquely generated by the client to | |||
| allow the resource server to verify that a request has never been | allow the resource server to verify that a request has never been | |||
| made before and helps prevent replay attacks when requests are made | made before and helps prevent replay attacks when requests are made | |||
| over a non-secure channel. The nonce value MUST be unique across all | over a non-secure channel. The nonce value MUST be unique across all | |||
| requests with the same timestamp and token combinations. | requests with the same timestamp and token combinations. | |||
| skipping to change at page 44, line 20 ¶ | skipping to change at page 44, line 38 ¶ | |||
| seconds since January 1, 1970 00:00:00 GMT, and MUST be a positive | seconds since January 1, 1970 00:00:00 GMT, and MUST be a positive | |||
| integer. | integer. | |||
| To avoid the need to retain an infinite number of nonce values for | To avoid the need to retain an infinite number of nonce values for | |||
| future checks, resource servers MAY choose to restrict the time | future checks, resource servers MAY choose to restrict the time | |||
| period after which a request with an old timestamp is rejected. When | period after which a request with an old timestamp is rejected. When | |||
| resource servers apply such a restriction, clients SHOULD synchronize | resource servers apply such a restriction, clients SHOULD synchronize | |||
| their clocks by using the resource server's time as indicated by the | their clocks by using the resource server's time as indicated by the | |||
| HTTP "Date" response header field as defined in [RFC2616]. | HTTP "Date" response header field as defined in [RFC2616]. | |||
| 8.3.1.2. Normalized String Construction | 5.3.1.2. Normalized String Construction | |||
| The normalized request string is a consistent, reproducible | The normalized request string is a consistent, reproducible | |||
| concatenation of several of the HTTP request elements into a single | concatenation of several of the HTTP request elements into a single | |||
| string. The string is used as an input to the selected cryptographic | string. The string is used as an input to the selected cryptographic | |||
| method and includes the HTTP request method (e.g. "GET", "POST", | method and includes the HTTP request method (e.g. "GET", "POST", | |||
| etc.), the authority as declared by the HTTP "Host" request header, | etc.), the authority as declared by the HTTP "Host" request header, | |||
| and the request resource URI. | and the request resource URI. | |||
| The normalized request string does not cover the entire HTTP request. | The normalized request string does not cover the entire HTTP request. | |||
| Most notably, it does not include the entity-body or most HTTP | Most notably, it does not include the entity-body or most HTTP | |||
| entity-headers. It is important to note that the resource server | entity-headers. It is important to note that the resource server | |||
| cannot verify the authenticity of the excluded request elements | cannot verify the authenticity of the excluded request elements | |||
| without using additional protections such as TLS/SSL. | without using additional protections such as TLS/SSL. | |||
| The normalized request string is constructed by concatenating | The normalized request string is constructed by concatenating | |||
| together, in order, the following HTTP request elements, separated by | together, in order, the following HTTP request elements, separated by | |||
| the "," character (ASCII code 44): | the "," character (ASCII code 44): | |||
| 1. The request timestamp as described in Section 8.3.1.1. | 1. The request timestamp as described in Section 5.3.1.1. | |||
| 2. The request nonce as described in Section 8.3.1.1. | 2. The request nonce as described in Section 5.3.1.1. | |||
| 3. The cryptographic algorithm used. | 3. The cryptographic algorithm used. | |||
| 4. The HTTP request method in uppercase. For example: "HEAD", | 4. The HTTP request method in uppercase. For example: "HEAD", | |||
| "GET", "POST", etc. | "GET", "POST", etc. | |||
| 5. The hostname, colon-separated (ASCII code 58) from the TCP port | 5. The hostname, colon-separated (ASCII code 58) from the TCP port | |||
| used to make the request as included in the HTTP request "Host" | used to make the request as included in the HTTP request "Host" | |||
| header field. The port MUST be included even if it is not | header field. The port MUST be included even if it is not | |||
| included in the "Host" header field (i.e. the default port for | included in the "Host" header field (i.e. the default port for | |||
| skipping to change at page 45, line 16 ¶ | skipping to change at page 45, line 35 ¶ | |||
| 6. The request resource URI. | 6. The request resource URI. | |||
| For example, the normalized request string for the "GET" request URI | For example, the normalized request string for the "GET" request URI | |||
| "http://example.com/resource", request timestamp "137131200", request | "http://example.com/resource", request timestamp "137131200", request | |||
| nonce "s8djwd", and "hmac-sha256" algorithm (line breaks are for | nonce "s8djwd", and "hmac-sha256" algorithm (line breaks are for | |||
| display purposes only): | display purposes only): | |||
| 137131200,s8djwd,hmac-sha256,GET,example.com:80, | 137131200,s8djwd,hmac-sha256,GET,example.com:80, | |||
| http://example.com/resource | http://example.com/resource | |||
| 8.3.1.3. Signature Calculation | 5.3.1.3. Signature Calculation | |||
| Clients calculate the request signature using the HMAC-SHA256 | Clients calculate the request signature using the HMAC-SHA256 | |||
| function: | function: | |||
| digest = HMAC-SHA256 (key, text) | digest = HMAC-SHA256 (key, text) | |||
| by setting the function variables are follows: | by setting the function variables are follows: | |||
| text | text | |||
| is set to the value of the normalize request string as | is set to the value of the normalize request string as | |||
| described in Section 8.3.1.2. | described in Section 5.3.1.2. | |||
| key | key | |||
| is set to the access token secret. | is set to the access token secret. | |||
| The request signature is the calculated value of the "digest" | The request signature is the calculated value of the "digest" | |||
| variable after the result octet string is base64-encoded per | variable after the result octet string is base64-encoded per | |||
| [RFC2045] section 6.8. | [RFC2045] section 6.8. | |||
| 9. Identifying a Protected Resource | 6. Identifying a Protected Resource | |||
| Clients access protected resources after locating the appropriate | Clients access protected resources after locating the appropriate | |||
| authorization and token endpoints and obtaining an access token. In | authorization and token endpoints and obtaining an access token. In | |||
| many cases, interacting with a protected resource requires prior | many cases, interacting with a protected resource requires prior | |||
| knowledge of the protected resource properties and methods, as well | knowledge of the protected resource properties and methods, as well | |||
| as its authentication requirements (i.e. establishing client | as its authentication requirements (i.e. establishing client | |||
| identity, locating the authorization and token endpoints). | identity, locating the authorization and token endpoints). | |||
| However, there are cases in which clients are unfamiliar with the | However, there are cases in which clients are unfamiliar with the | |||
| protected resource, including whether the resource requires | protected resource, including whether the resource requires | |||
| authentication. When clients attempt to access an unfamiliar | authentication. When clients attempt to access an unfamiliar | |||
| protected resource without an access token, the resource server | protected resource without an access token, the resource server | |||
| denies the request and informs the client of the required credentials | denies the request and informs the client of the required credentials | |||
| using an HTTP authentication challenge. | using an HTTP authentication challenge. | |||
| In addition, when receiving an invalid authenticated request, the | In addition, when receiving an invalid authenticated request, the | |||
| resource server issues an authentication challenge including the | resource server issues an authentication challenge including the | |||
| error type and message. | error type and message. | |||
| 9.1. The WWW-Authenticate Response Header | 6.1. The WWW-Authenticate Response Header | |||
| A resource server receiving a request for a protected resource | A resource server receiving a request for a protected resource | |||
| without a valid access token MUST respond with a 401 HTTP status code | without a valid access token MUST respond with a 401 HTTP status code | |||
| (Unauthorized), and includes at least one "Token" "WWW-Authenticate" | (Unauthorized), and includes at least one "Token" "WWW-Authenticate" | |||
| response header field challenge. | response header field challenge. | |||
| The "WWW-Authenticate" header field uses the framework defined by | The "WWW-Authenticate" header field uses the framework defined by | |||
| [RFC2617] as follows: | [RFC2617] as follows: | |||
| challenge = "Token" RWS token-challenge | challenge = "Token" RWS token-challenge | |||
| skipping to change at page 46, line 38 ¶ | skipping to change at page 47, line 20 ¶ | |||
| [ CS algorithms ] | [ CS algorithms ] | |||
| [ CS error ] | [ CS error ] | |||
| authz-uri = "auth-uri" "=" URI-Reference | authz-uri = "auth-uri" "=" URI-Reference | |||
| token-uri = "token-uri" "=" URI-Reference | token-uri = "token-uri" "=" URI-Reference | |||
| algorithms = "algorithms" "=" <"> 1#algorithm-name <"> | algorithms = "algorithms" "=" <"> 1#algorithm-name <"> | |||
| error = "error" "=" <"> token <"> | error = "error" "=" <"> token <"> | |||
| CS = OWS "," OWS | CS = OWS "," OWS | |||
| 9.1.1. The 'realm' Attribute | 6.1.1. The 'realm' Attribute | |||
| The "realm" attribute is used to provide the protected resources | The "realm" attribute is used to provide the protected resources | |||
| partition as defined by [RFC2617]. | partition as defined by [RFC2617]. | |||
| 9.1.2. The 'authorization-uri' Attribute | 6.1.2. The 'authorization-uri' Attribute | |||
| 9.1.3. The 'algorithms' Attribute | 6.1.3. The 'algorithms' Attribute | |||
| 9.1.4. The 'error' Attribute | ||||
| 10. Security Considerations | 6.1.4. The 'error' Attribute | |||
| 7. Security Considerations | ||||
| [[ Todo ]] | [[ Todo ]] | |||
| 11. IANA Considerations | 8. IANA Considerations | |||
| [[ Not Yet ]] | [[ Not Yet ]] | |||
| 12. Acknowledgements | 9. Acknowledgements | |||
| [[ Add OAuth 1.0a authors + WG contributors ]] | [[ Add OAuth 1.0a authors + WG contributors ]] | |||
| Appendix A. Differences from OAuth 1.0a | Appendix A. Differences from OAuth 1.0a | |||
| [[ Todo ]] | [[ Todo ]] | |||
| Appendix B. Document History | Appendix B. Document History | |||
| [[ to be removed by RFC editor before publication as an RFC ]] | [[ to be removed by RFC editor before publication as an RFC ]] | |||
| -04 | ||||
| o Changed all token endpoints to use "POST" | ||||
| o Clarified the authorization server's ability to issue a new | ||||
| refresh token when refreshing a token. | ||||
| o Changed the flow categories to clarify the autonomous group. | ||||
| o Changed client credentials language not to always be server- | ||||
| issued. | ||||
| o Added a "scope" response parameter. | ||||
| o Fixed typos. | ||||
| o Fixed broken document structure. | ||||
| -03 | -03 | |||
| o Fixed typo in JSON error examples. | o Fixed typo in JSON error examples. | |||
| o Fixed general typos. | o Fixed general typos. | |||
| o Moved all flows sections up one level. | o Moved all flows sections up one level. | |||
| -02 | -02 | |||
| skipping to change at page 48, line 5 ¶ | skipping to change at page 48, line 48 ¶ | |||
| o Added "scope" parameter. | o Added "scope" parameter. | |||
| o Initial proposal for a JSON-based token response format. | o Initial proposal for a JSON-based token response format. | |||
| -01 | -01 | |||
| o Editorial changes based on feedback from Brian Eaton, Bill Keenan, | o Editorial changes based on feedback from Brian Eaton, Bill Keenan, | |||
| and Chuck Mortimore. | and Chuck Mortimore. | |||
| o Changed devide flow "type" parameter values and switch to use only | o Changed device flow "type" parameter values and switch to use only | |||
| the token endpoint. | the token endpoint. | |||
| -00 | -00 | |||
| o Initial draft based on a combination of WRAP and OAuth 1.0a. | o Initial draft based on a combination of WRAP and OAuth 1.0a. | |||
| 13. References | 10. References | |||
| 13.1. Normative References | 10.1. Normative References | |||
| [I-D.ietf-httpbis-p1-messaging] | [I-D.ietf-httpbis-p1-messaging] | |||
| Fielding, R., Gettys, J., Mogul, J., Nielsen, H., | Fielding, R., Gettys, J., Mogul, J., Nielsen, H., | |||
| Masinter, L., Leach, P., Berners-Lee, T., and J. Reschke, | Masinter, L., Leach, P., Berners-Lee, T., and J. Reschke, | |||
| "HTTP/1.1, part 1: URIs, Connections, and Message | "HTTP/1.1, part 1: URIs, Connections, and Message | |||
| Parsing", draft-ietf-httpbis-p1-messaging-09 (work in | Parsing", draft-ietf-httpbis-p1-messaging-09 (work in | |||
| progress), March 2010. | progress), March 2010. | |||
| [NIST FIPS-180-3] | [NIST FIPS-180-3] | |||
| National Institute of Standards and Technology, "Secure | National Institute of Standards and Technology, "Secure | |||
| skipping to change at page 49, line 21 ¶ | skipping to change at page 50, line 16 ¶ | |||
| [RFC4627] Crockford, D., "The application/json Media Type for | [RFC4627] Crockford, D., "The application/json Media Type for | |||
| JavaScript Object Notation (JSON)", RFC 4627, July 2006. | JavaScript Object Notation (JSON)", RFC 4627, July 2006. | |||
| [W3C.REC-html40-19980424] | [W3C.REC-html40-19980424] | |||
| Hors, A., Raggett, D., and I. Jacobs, "HTML 4.0 | Hors, A., Raggett, D., and I. Jacobs, "HTML 4.0 | |||
| Specification", World Wide Web Consortium | Specification", World Wide Web Consortium | |||
| Recommendation REC-html40-19980424, April 1998, | Recommendation REC-html40-19980424, April 1998, | |||
| <http://www.w3.org/TR/1998/REC-html40-19980424>. | <http://www.w3.org/TR/1998/REC-html40-19980424>. | |||
| 13.2. Informative References | 10.2. Informative References | |||
| [I-D.hammer-oauth] | [I-D.hammer-oauth] | |||
| Hammer-Lahav, E., "The OAuth 1.0 Protocol", | Hammer-Lahav, E., "The OAuth 1.0 Protocol", | |||
| draft-hammer-oauth-10 (work in progress), February 2010. | draft-hammer-oauth-10 (work in progress), February 2010. | |||
| [I-D.hardt-oauth] | [I-D.hardt-oauth] | |||
| Hardt, D., Tom, A., Eaton, B., and Y. Goland, "OAuth Web | Hardt, D., Tom, A., Eaton, B., and Y. Goland, "OAuth Web | |||
| Resource Authorization Profiles", draft-hardt-oauth-01 | Resource Authorization Profiles", draft-hardt-oauth-01 | |||
| (work in progress), January 2010. | (work in progress), January 2010. | |||
| End of changes. 102 change blocks. | ||||
| 155 lines changed or deleted | 187 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||