Qortora · Search · Indexed page

www.rfc-editor.orgFetched 2026-08-17T15:29:53Z

RFC 6749 - The OAuth 2.0 Authorization Framework

The OAuth 2.0 Authorization Framework (RFC 6749, )

Open original source · Full cached text

RFC 6749 - The OAuth 2.0 Authorization Framework Light Dark Auto RFC 6749 Proposed Standard Title The OAuth 2.0 Authorization Framework Document Document type RFC - Proposed Standard October 2012 View errata Report errata IPR Updated by RFC 8252, RFC 8996, RFC 9700 Obsoletes RFC 5849 Was draft-ietf-oauth-v2 (oauth WG) Select version 23 24 25 26 27 28 29 30 31 RFC 6749 Compare versions RFC 6749 draft-ietf-oauth-v2-31 draft-ietf-oauth-v2-30 draft-ietf-oauth-v2-29 draft-ietf-oauth-v2-28 draft-ietf-oauth-v2-27 draft-ietf-oauth-v2-26 draft-ietf-oauth-v2-25 draft-ietf-oauth-v2-24 draft-ietf-oauth-v2-23 draft-ietf-oauth-v2-22 draft-ietf-oauth-v2-21 draft-ietf-oauth-v2-20 draft-ietf-oauth-v2-19 draft-ietf-oauth-v2-18 draft-ietf-oauth-v2-17 draft-ietf-oauth-v2-16 draft-ietf-oauth-v2-15 draft-ietf-oauth-v2-14 draft-ietf-oauth-v2-13 draft-ietf-oauth-v2-12 draft-ietf-oauth-v2-11 draft-ietf-oauth-v2-10 draft-ietf-oauth-v2-09 draft-ietf-oauth-v2-08 draft-ietf-oauth-v2-07 draft-ietf-oauth-v2-06 draft-ietf-oauth-v2-05 draft-ietf-oauth-v2-04 draft-ietf-oauth-v2-03 draft-ietf-oauth-v2-02 draft-ietf-oauth-v2-01 draft-ietf-oauth-v2-00 RFC 6749 draft-ietf-oauth-v2-31 draft-ietf-oauth-v2-30 draft-ietf-oauth-v2-29 draft-ietf-oauth-v2-28 draft-ietf-oauth-v2-27 draft-ietf-oauth-v2-26 draft-ietf-oauth-v2-25 draft-ietf-oauth-v2-24 draft-ietf-oauth-v2-23 draft-ietf-oauth-v2-22 draft-ietf-oauth-v2-21 draft-ietf-oauth-v2-20 draft-ietf-oauth-v2-19 draft-ietf-oauth-v2-18 draft-ietf-oauth-v2-17 draft-ietf-oauth-v2-16 draft-ietf-oauth-v2-15 draft-ietf-oauth-v2-14 draft-ietf-oauth-v2-13 draft-ietf-oauth-v2-12 draft-ietf-oauth-v2-11 draft-ietf-oauth-v2-10 draft-ietf-oauth-v2-09 draft-ietf-oauth-v2-08 draft-ietf-oauth-v2-07 draft-ietf-oauth-v2-06 draft-ietf-oauth-v2-05 draft-ietf-oauth-v2-04 draft-ietf-oauth-v2-03 draft-ietf-oauth-v2-02 draft-ietf-oauth-v2-01 draft-ietf-oauth-v2-00 Side-by-side Inline Author D. Hardt Email authors RFC stream Other formats txt html w/errata bibtex Additional resources Mailing list discussion Report a bug Internet Engineering Task Force (IETF) D. Hardt, Ed. Request for Comments: 6749 Microsoft Obsoletes: 5849 October 2012 Category: Standards Track ISSN: 2070-1721 The OAuth 2.0 Authorization Framework Abstract The OAuth 2.0 authorization framework enables a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf. This specification replaces and obsoletes the OAuth 1.0 protocol described in RFC 5849. Status of This Memo This is an Internet Standards Track document. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741. Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6749. Copyright Notice Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Hardt Standards Track [Page 1] RFC 6749 OAuth 2.0 October 2012 Table of Contents 1. Introduction ....................................................4 1.1. Roles ......................................................6 1.2. Protocol Flow ..............................................7 1.3. Authorization Grant ........................................8 1.3.1. Authorization Code ..................................8 1.3.2. Implicit ............................................8 1.3.3. Resource Owner Password Credentials .................9 1.3.4. Client Credentials ..................................9 1.4. Access Token ..............................................10 1.5. Refresh Token .............................................10 1.6. TLS Version ...............................................12 1.7. HTTP Redirections .........................................12 1.8. Interoperability ..........................................12 1.9. Notational Conventions ....................................13 2. Client Registration ............................................13 2.1. Client Types ..............................................14 2.2. Client Identifier .........................................15 2.3. Client Authentication .....................................16 2.3.1. Client Password ....................................16 2.3.2. Other Authentication Methods .......................17 2.4. Unregistered Clients ......................................17 3. Protocol Endpoints .............................................18 3.1. Authorization Endpoint ....................................18 3.1.1. Response Type ......................................19 3.1.2. Redirection Endpoint ...............................19 3.2. Token Endpoint ............................................21 3.2.1. Client Authentication ..............................22 3.3. Access Token Scope ........................................23 4. Obtaining Authorization ........................................23 4.1. Authorization Code Grant ..................................24 4.1.1. Authorization Request ..............................25 4.1.2. Authorization Response .............................26 4.1.3. Access Token Request ...............................29 4.1.4. Access Token Response ..............................30 4.2. Implicit Grant ............................................31 4.2.1. Authorization Request ..............................33 4.2.2. Access Token Response ..............................35 4.3. Resource Owner Password Credentials Grant .................37 4.3.1. Authorization Request and Response .................39 4.3.2. Access Token Request ...............................39 4.3.3. Access Token Response ..............................40 4.4. Client Credentials Grant ..................................40 4.4.1. Authorization Request and Response .................41 4.4.2. Access Token Request ...............................41 4.4.3. Access Token Response ..............................42 4.5. Extension Grants ..........................................42 Hardt Standards Track [Page 2] RFC 6749 OAuth 2.0 October 2012 5. Issuing an Access Token ........................................43 5.1. Successful Response .......................................43 5.2. Error Response ............................................45 6. Refreshing an Access Token .....................................47 7. Accessing Protected Resources ..................................48 7.1. Access Token Types ........................................49 7.2. Error Response ............................................49 8. Extensibility ..................................................50 8.1. Defining Access Token Types ...............................50 8.2. Defining New Endpoint Parameters ..........................50 8.3. Defining New Authorization Grant Types ....................51 8.4. Defining New Authorization Endpoint Response Types ........51 8.5. Defining Additional Error Codes ...........................51 9. Native Applications ............................................52 10. Security Considerations .......................................53 10.1. Client Authentication ....................................53 10.2. Client Impersonation .....................................54 10.3. Access Tokens ............................................55 10.4. Refresh Tokens ...........................................55 10.5. Authorization Codes ......................................56 10.6. Authorization Code Redirection URI Manipulation ..........56 10.7. Resource Owner Password Credentials ......................57 10.8. Request Confidentiality ..................................58 10.9. Ensuring Endpoint Authenticity ...........................58 10.10. Credentials-Guessing Attacks ............................58 10.11. Phishing Attacks ........................................58 10.12. Cross-Site Request Forgery ..............................59 10.13. Clickjacking ............................................60 10.14. Code Injection and Input Validation .....................60 10.15. Open Redirectors ........................................60 10.16. Misuse of Access Token to Impersonate Resource Owner in Implicit Flow ..................................61 11. IANA Considerations ...........................................62 11.1. OAuth Access Token Types Registry ........................62 11.1.1. Registration Template .............................62 11.2. OAuth Parameters Registry ................................63 11.2.1. Registration Template .............................63 11.2.2. Initial Registry Contents .........................64 11.3. OAuth Authorization Endpoint Response Types Registry .....66 11.3.1. Registration Template .............................66 11.3.2. Initial Registry Contents .........................67 11.4. OAuth Extensions Error Registry ..........................67 11.4.1. Registration Template .............................68 12. References ....................................................68 12.1. Normative References .....................................68 12.2. Informative References ...................................70 Hardt Standards Track [Page 3] RFC 6749 OAuth 2.0 October 2012 Appendix A. Augmented Backus-Naur Form (ABNF) Syntax ..............71 A.1. "client_id" Syntax ........................................71 A.2. "client_secret" Syntax ....................................71 A.3. "response_type" Syntax ....................................71 A.4. "scope" Syntax ............................................72 A.5. "state" Syntax ............................................72 A.6. "redirect_uri" Syntax .....................................72 A.7. "error" Syntax ............................................72 A.8. "error_description" Syntax ................................72 A.9. "error_uri" Syntax ........................................72 A.10. "grant_type" Syntax .......................................73 A.11. "code" Syntax .............................................73 A.12. "access_token" Syntax .....................................73 A.13. "token_type" Syntax .......................................73 A.14. "expires_in" Syntax .......................................73 A.15. "username" Syntax .........................................73 A.16. "password" Syntax .........................................73 A.17. "refresh_token" Syntax ....................................74 A.18. Endpoint Parameter Syntax .................................74 Appendix B. Use of application/x-www-form-urlencoded Media Type ...74 Appendix C. Acknowledgements ......................................75 1. Introduction In the traditional client-server authentication model, the client requests an access-restricted resource (protected resource) on the server by authenticating with the server using the resource owner's credentials. In order to provide third-party applications access to restricted resources, the resource owner shares its credentials with the third party. This creates several problems and limitations: o Third-party applications are required to st…