| < draft-ietf-oauth-v2-1-03.txt | draft-ietf-oauth-v2-1-04.txt > | |||
|---|---|---|---|---|
| OAuth Working Group D. Hardt | OAuth Working Group D. Hardt | |||
| Internet-Draft SignIn.Org | Internet-Draft Hellō | |||
| Intended status: Standards Track A. Parecki | Intended status: Standards Track A. Parecki | |||
| Expires: 12 March 2022 Okta | Expires: 8 April 2022 Okta | |||
| T. Lodderstedt | T. Lodderstedt | |||
| yes.com | yes.com | |||
| 8 September 2021 | 5 October 2021 | |||
| The OAuth 2.1 Authorization Framework | The OAuth 2.1 Authorization Framework | |||
| draft-ietf-oauth-v2-1-03 | draft-ietf-oauth-v2-1-04 | |||
| Abstract | Abstract | |||
| The OAuth 2.1 authorization framework enables a third-party | The OAuth 2.1 authorization framework enables a third-party | |||
| application to obtain limited access to an HTTP service, either on | application to obtain limited access to an HTTP service, either on | |||
| behalf of a resource owner by orchestrating an approval interaction | behalf of a resource owner by orchestrating an approval interaction | |||
| between the resource owner and an authorization service, or by | between the resource owner and an authorization service, or by | |||
| allowing the third-party application to obtain access on its own | allowing the third-party application to obtain access on its own | |||
| behalf. This specification replaces and obsoletes the OAuth 2.0 | behalf. This specification replaces and obsoletes the OAuth 2.0 | |||
| Authorization Framework described in RFC 6749. | Authorization Framework described in RFC 6749. | |||
| skipping to change at page 1, line 39 ¶ | skipping to change at page 1, line 39 ¶ | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on 12 March 2022. | This Internet-Draft will expire on 8 April 2022. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2021 IETF Trust and the persons identified as the | Copyright (c) 2021 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents (https://trustee.ietf.org/ | Provisions Relating to IETF Documents (https://trustee.ietf.org/ | |||
| license-info) in effect on the date of publication of this document. | license-info) in effect on the date of publication of this document. | |||
| Please review these documents carefully, as they describe your rights | Please review these documents carefully, as they describe your rights | |||
| skipping to change at page 2, line 28 ¶ | skipping to change at page 2, line 28 ¶ | |||
| 1.4. Access Token . . . . . . . . . . . . . . . . . . . . . . 11 | 1.4. Access Token . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| 1.5. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 12 | 1.5. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 12 | |||
| 1.6. HTTP Redirections . . . . . . . . . . . . . . . . . . . . 12 | 1.6. HTTP Redirections . . . . . . . . . . . . . . . . . . . . 12 | |||
| 1.7. Interoperability . . . . . . . . . . . . . . . . . . . . 12 | 1.7. Interoperability . . . . . . . . . . . . . . . . . . . . 12 | |||
| 1.8. Compatibility with OAuth 2.0 . . . . . . . . . . . . . . 13 | 1.8. Compatibility with OAuth 2.0 . . . . . . . . . . . . . . 13 | |||
| 1.9. Notational Conventions . . . . . . . . . . . . . . . . . 13 | 1.9. Notational Conventions . . . . . . . . . . . . . . . . . 13 | |||
| 2. Client Registration . . . . . . . . . . . . . . . . . . . . . 14 | 2. Client Registration . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 2.1. Client Types . . . . . . . . . . . . . . . . . . . . . . 14 | 2.1. Client Types . . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 2.2. Client Identifier . . . . . . . . . . . . . . . . . . . . 16 | 2.2. Client Identifier . . . . . . . . . . . . . . . . . . . . 16 | |||
| 2.3. Client Redirection Endpoint . . . . . . . . . . . . . . . 16 | 2.3. Client Redirection Endpoint . . . . . . . . . . . . . . . 16 | |||
| 2.3.1. Endpoint Request Confidentiality . . . . . . . . . . 16 | 2.3.1. Endpoint Request Confidentiality . . . . . . . . . . 17 | |||
| 2.3.2. Registration Requirements . . . . . . . . . . . . . . 17 | 2.3.2. Registration Requirements . . . . . . . . . . . . . . 17 | |||
| 2.3.3. Multiple Redirect URIs . . . . . . . . . . . . . . . 17 | 2.3.3. Multiple Redirect URIs . . . . . . . . . . . . . . . 17 | |||
| 2.3.4. Invalid Endpoint . . . . . . . . . . . . . . . . . . 17 | 2.3.4. Invalid Endpoint . . . . . . . . . . . . . . . . . . 17 | |||
| 2.3.5. Endpoint Content . . . . . . . . . . . . . . . . . . 17 | 2.3.5. Endpoint Content . . . . . . . . . . . . . . . . . . 18 | |||
| 2.4. Client Authentication . . . . . . . . . . . . . . . . . . 18 | 2.4. Client Authentication . . . . . . . . . . . . . . . . . . 18 | |||
| 2.4.1. Client Secret . . . . . . . . . . . . . . . . . . . . 19 | 2.4.1. Client Secret . . . . . . . . . . . . . . . . . . . . 19 | |||
| 2.4.2. Other Authentication Methods . . . . . . . . . . . . 20 | 2.4.2. Other Authentication Methods . . . . . . . . . . . . 20 | |||
| 2.5. Unregistered Clients . . . . . . . . . . . . . . . . . . 20 | 2.5. Unregistered Clients . . . . . . . . . . . . . . . . . . 20 | |||
| 3. Protocol Endpoints . . . . . . . . . . . . . . . . . . . . . 20 | 3. Protocol Endpoints . . . . . . . . . . . . . . . . . . . . . 20 | |||
| 3.1. Authorization Endpoint . . . . . . . . . . . . . . . . . 21 | 3.1. Authorization Endpoint . . . . . . . . . . . . . . . . . 21 | |||
| 3.2. Token Endpoint . . . . . . . . . . . . . . . . . . . . . 21 | 3.2. Token Endpoint . . . . . . . . . . . . . . . . . . . . . 21 | |||
| 3.2.1. Client Authentication . . . . . . . . . . . . . . . . 22 | 3.2.1. Client Authentication . . . . . . . . . . . . . . . . 22 | |||
| 3.2.2. Token Request . . . . . . . . . . . . . . . . . . . . 22 | 3.2.2. Token Request . . . . . . . . . . . . . . . . . . . . 22 | |||
| 3.2.3. Token Response . . . . . . . . . . . . . . . . . . . 24 | 3.2.3. Token Response . . . . . . . . . . . . . . . . . . . 24 | |||
| 4. Grant Types . . . . . . . . . . . . . . . . . . . . . . . . . 27 | 4. Grant Types . . . . . . . . . . . . . . . . . . . . . . . . . 27 | |||
| 4.1. Authorization Code Grant . . . . . . . . . . . . . . . . 28 | 4.1. Authorization Code Grant . . . . . . . . . . . . . . . . 28 | |||
| 4.1.1. Authorization Request . . . . . . . . . . . . . . . . 29 | 4.1.1. Authorization Request . . . . . . . . . . . . . . . . 29 | |||
| 4.1.2. Authorization Response . . . . . . . . . . . . . . . 32 | 4.1.2. Authorization Response . . . . . . . . . . . . . . . 32 | |||
| 4.1.3. Token Endpoint Extension . . . . . . . . . . . . . . 35 | 4.1.3. Token Endpoint Extension . . . . . . . . . . . . . . 35 | |||
| 4.2. Client Credentials Grant . . . . . . . . . . . . . . . . 36 | 4.2. Client Credentials Grant . . . . . . . . . . . . . . . . 36 | |||
| 4.2.1. Token Endpoint Extension . . . . . . . . . . . . . . 37 | 4.2.1. Token Endpoint Extension . . . . . . . . . . . . . . 37 | |||
| 4.3. Refresh Token Grant . . . . . . . . . . . . . . . . . . . 38 | 4.3. Refresh Token Grant . . . . . . . . . . . . . . . . . . . 37 | |||
| 4.3.1. Token Endpoint Extension . . . . . . . . . . . . . . 38 | 4.3.1. Token Endpoint Extension . . . . . . . . . . . . . . 37 | |||
| 4.3.2. Refresh Token Response . . . . . . . . . . . . . . . 39 | 4.3.2. Refresh Token Response . . . . . . . . . . . . . . . 39 | |||
| 4.4. Extension Grants . . . . . . . . . . . . . . . . . . . . 40 | 4.4. Extension Grants . . . . . . . . . . . . . . . . . . . . 39 | |||
| 5. Accessing Protected Resources . . . . . . . . . . . . . . . . 41 | 5. Accessing Protected Resources . . . . . . . . . . . . . . . . 40 | |||
| 5.1. Access Token Types . . . . . . . . . . . . . . . . . . . 41 | 5.1. Access Token Types . . . . . . . . . . . . . . . . . . . 40 | |||
| 5.2. Bearer Tokens . . . . . . . . . . . . . . . . . . . . . . 42 | 5.2. Bearer Tokens . . . . . . . . . . . . . . . . . . . . . . 41 | |||
| 5.2.1. Authenticated Requests . . . . . . . . . . . . . . . 42 | 5.2.1. Authenticated Requests . . . . . . . . . . . . . . . 41 | |||
| 5.2.2. The WWW-Authenticate Response Header Field . . . . . 44 | 5.2.2. The WWW-Authenticate Response Header Field . . . . . 43 | |||
| 5.2.3. Error Codes . . . . . . . . . . . . . . . . . . . . . 45 | 5.2.3. Error Codes . . . . . . . . . . . . . . . . . . . . . 44 | |||
| 5.3. Error Response . . . . . . . . . . . . . . . . . . . . . 46 | 5.3. Error Response . . . . . . . . . . . . . . . . . . . . . 45 | |||
| 5.3.1. Extension Token Types . . . . . . . . . . . . . . . . 46 | 5.3.1. Extension Token Types . . . . . . . . . . . . . . . . 45 | |||
| 6. Extensibility . . . . . . . . . . . . . . . . . . . . . . . . 46 | 6. Extensibility . . . . . . . . . . . . . . . . . . . . . . . . 46 | |||
| 6.1. Defining Access Token Types . . . . . . . . . . . . . . . 47 | 6.1. Defining Access Token Types . . . . . . . . . . . . . . . 46 | |||
| 6.2. Defining New Endpoint Parameters . . . . . . . . . . . . 47 | 6.2. Defining New Endpoint Parameters . . . . . . . . . . . . 46 | |||
| 6.3. Defining New Authorization Grant Types . . . . . . . . . 47 | 6.3. Defining New Authorization Grant Types . . . . . . . . . 47 | |||
| 6.4. Defining New Authorization Endpoint Response Types . . . 48 | 6.4. Defining New Authorization Endpoint Response Types . . . 47 | |||
| 6.5. Defining Additional Error Codes . . . . . . . . . . . . . 48 | 6.5. Defining Additional Error Codes . . . . . . . . . . . . . 47 | |||
| 7. Security Considerations . . . . . . . . . . . . . . . . . . . 49 | 7. Security Considerations . . . . . . . . . . . . . . . . . . . 48 | |||
| 7.1. Access Token Security Considerations . . . . . . . . . . 49 | 7.1. Access Token Security Considerations . . . . . . . . . . 48 | |||
| 7.1.1. Security Threats . . . . . . . . . . . . . . . . . . 49 | 7.1.1. Security Threats . . . . . . . . . . . . . . . . . . 48 | |||
| 7.1.2. Threat Mitigation . . . . . . . . . . . . . . . . . . 50 | 7.1.2. Threat Mitigation . . . . . . . . . . . . . . . . . . 49 | |||
| 7.1.3. Summary of Recommendations . . . . . . . . . . . . . 52 | 7.1.3. Summary of Recommendations . . . . . . . . . . . . . 51 | |||
| 7.1.4. Token Replay Prevention . . . . . . . . . . . . . . . 53 | 7.1.4. Token Replay Prevention . . . . . . . . . . . . . . . 52 | |||
| 7.1.5. Access Token Privilege Restriction . . . . . . . . . 54 | 7.1.5. Access Token Privilege Restriction . . . . . . . . . 52 | |||
| 7.2. Client Authentication . . . . . . . . . . . . . . . . . . 54 | 7.2. Client Authentication . . . . . . . . . . . . . . . . . . 53 | |||
| 7.2.1. Client Authentication of Native Apps . . . . . . . . 55 | 7.2.1. Client Authentication of Native Apps . . . . . . . . 54 | |||
| 7.3. Registration of Native App Clients . . . . . . . . . . . 55 | 7.3. Registration of Native App Clients . . . . . . . . . . . 54 | |||
| 7.4. Client Impersonation . . . . . . . . . . . . . . . . . . 56 | 7.4. Client Impersonation . . . . . . . . . . . . . . . . . . 54 | |||
| 7.4.1. Impersonation of Native Apps . . . . . . . . . . . . 56 | 7.4.1. Impersonation of Native Apps . . . . . . . . . . . . 55 | |||
| 7.4.2. Access Token Privilege Restriction . . . . . . . . . 57 | 7.4.2. Access Token Privilege Restriction . . . . . . . . . 55 | |||
| 7.4.3. Access Token Replay Prevention . . . . . . . . . . . 57 | 7.4.3. Access Token Replay Prevention . . . . . . . . . . . 56 | |||
| 7.5. Refresh Tokens . . . . . . . . . . . . . . . . . . . . . 58 | 7.5. Refresh Tokens . . . . . . . . . . . . . . . . . . . . . 56 | |||
| 7.6. Client Impersonating Resource Owner . . . . . . . . . . . 58 | 7.6. Client Impersonating Resource Owner . . . . . . . . . . . 57 | |||
| 7.7. Protecting the Authorization Code Flow . . . . . . . . . 59 | 7.7. Protecting the Authorization Code Flow . . . . . . . . . 57 | |||
| 7.7.1. Loopback Redirect Considerations in Native Apps . . . 59 | 7.7.1. Loopback Redirect Considerations in Native Apps . . . 58 | |||
| 7.7.2. HTTP 307 Redirect . . . . . . . . . . . . . . . . . . 60 | 7.7.2. HTTP 307 Redirect . . . . . . . . . . . . . . . . . . 58 | |||
| 7.8. Authorization Codes . . . . . . . . . . . . . . . . . . . 61 | 7.8. Authorization Codes . . . . . . . . . . . . . . . . . . . 59 | |||
| 7.9. Request Confidentiality . . . . . . . . . . . . . . . . . 62 | 7.9. Request Confidentiality . . . . . . . . . . . . . . . . . 60 | |||
| 7.10. Ensuring Endpoint Authenticity . . . . . . . . . . . . . 62 | 7.10. Ensuring Endpoint Authenticity . . . . . . . . . . . . . 61 | |||
| 7.11. Credentials-Guessing Attacks . . . . . . . . . . . . . . 62 | 7.11. Credentials-Guessing Attacks . . . . . . . . . . . . . . 61 | |||
| 7.12. Phishing Attacks . . . . . . . . . . . . . . . . . . . . 63 | 7.12. Phishing Attacks . . . . . . . . . . . . . . . . . . . . 61 | |||
| 7.13. Fake External User-Agents in Native Apps . . . . . . . . 63 | 7.13. Fake External User-Agents in Native Apps . . . . . . . . 62 | |||
| 7.14. Malicious External User-Agents in Native Apps . . . . . . 64 | 7.14. Malicious External User-Agents in Native Apps . . . . . . 62 | |||
| 7.15. Cross-Site Request Forgery . . . . . . . . . . . . . . . 64 | 7.15. Cross-Site Request Forgery . . . . . . . . . . . . . . . 62 | |||
| 7.16. Clickjacking . . . . . . . . . . . . . . . . . . . . . . 65 | 7.16. Clickjacking . . . . . . . . . . . . . . . . . . . . . . 63 | |||
| 7.17. Code Injection and Input Validation . . . . . . . . . . . 66 | 7.17. Code Injection and Input Validation . . . . . . . . . . . 64 | |||
| 7.18. Open Redirectors . . . . . . . . . . . . . . . . . . . . 66 | 7.18. Open Redirectors . . . . . . . . . . . . . . . . . . . . 64 | |||
| 7.18.1. Client as Open Redirector . . . . . . . . . . . . . 66 | 7.18.1. Client as Open Redirector . . . . . . . . . . . . . 64 | |||
| 7.18.2. Authorization Server as Open Redirector . . . . . . 66 | 7.18.2. Authorization Server as Open Redirector . . . . . . 65 | |||
| 7.19. Authorization Server Mix-Up Mitigation in Native Apps . . 67 | 7.19. Authorization Server Mix-Up Mitigation in Native Apps . . 65 | |||
| 7.20. Embedded User Agents in Native Apps . . . . . . . . . . . 67 | 7.20. Embedded User Agents in Native Apps . . . . . . . . . . . 66 | |||
| 7.21. Other Recommendations . . . . . . . . . . . . . . . . . . 68 | 7.21. Other Recommendations . . . . . . . . . . . . . . . . . . 66 | |||
| 8. Native Applications . . . . . . . . . . . . . . . . . . . . . 68 | 8. Native Applications . . . . . . . . . . . . . . . . . . . . . 67 | |||
| 8.1. Using Inter-App URI Communication for OAuth in Native | 8.1. Using Inter-App URI Communication for OAuth in Native | |||
| Apps . . . . . . . . . . . . . . . . . . . . . . . . . . 69 | Apps . . . . . . . . . . . . . . . . . . . . . . . . . . 68 | |||
| 8.2. Initiating the Authorization Request from a Native App . 70 | 8.2. Initiating the Authorization Request from a Native App . 68 | |||
| 8.3. Receiving the Authorization Response in a Native App . . 70 | 8.3. Receiving the Authorization Response in a Native App . . 69 | |||
| 8.3.1. Private-Use URI Scheme Redirection . . . . . . . . . 71 | 8.3.1. Private-Use URI Scheme Redirection . . . . . . . . . 69 | |||
| 8.3.2. Claimed "https" Scheme URI Redirection . . . . . . . 72 | 8.3.2. Claimed "https" Scheme URI Redirection . . . . . . . 70 | |||
| 8.3.3. Loopback Interface Redirection . . . . . . . . . . . 72 | 8.3.3. Loopback Interface Redirection . . . . . . . . . . . 71 | |||
| 9. Browser-Based Apps . . . . . . . . . . . . . . . . . . . . . 73 | 9. Browser-Based Apps . . . . . . . . . . . . . . . . . . . . . 72 | |||
| 10. Differences from OAuth 2.0 . . . . . . . . . . . . . . . . . 73 | 10. Differences from OAuth 2.0 . . . . . . . . . . . . . . . . . 72 | |||
| 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 74 | 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 73 | |||
| 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 74 | 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 73 | |||
| 12.1. Normative References . . . . . . . . . . . . . . . . . . 74 | 12.1. Normative References . . . . . . . . . . . . . . . . . . 73 | |||
| 12.2. Informative References . . . . . . . . . . . . . . . . . 77 | 12.2. Informative References . . . . . . . . . . . . . . . . . 75 | |||
| Appendix A. Augmented Backus-Naur Form (ABNF) Syntax . . . . . . 80 | Appendix A. Augmented Backus-Naur Form (ABNF) Syntax . . . . . . 79 | |||
| A.1. "client_id" Syntax . . . . . . . . . . . . . . . . . . . 80 | A.1. "client_id" Syntax . . . . . . . . . . . . . . . . . . . 79 | |||
| A.2. "client_secret" Syntax . . . . . . . . . . . . . . . . . 80 | A.2. "client_secret" Syntax . . . . . . . . . . . . . . . . . 79 | |||
| A.3. "response_type" Syntax . . . . . . . . . . . . . . . . . 80 | A.3. "response_type" Syntax . . . . . . . . . . . . . . . . . 79 | |||
| A.4. "scope" Syntax . . . . . . . . . . . . . . . . . . . . . 81 | A.4. "scope" Syntax . . . . . . . . . . . . . . . . . . . . . 79 | |||
| A.5. "state" Syntax . . . . . . . . . . . . . . . . . . . . . 81 | A.5. "state" Syntax . . . . . . . . . . . . . . . . . . . . . 80 | |||
| A.6. "redirect_uri" Syntax . . . . . . . . . . . . . . . . . . 81 | A.6. "redirect_uri" Syntax . . . . . . . . . . . . . . . . . . 80 | |||
| A.7. "error" Syntax . . . . . . . . . . . . . . . . . . . . . 81 | A.7. "error" Syntax . . . . . . . . . . . . . . . . . . . . . 80 | |||
| A.8. "error_description" Syntax . . . . . . . . . . . . . . . 81 | A.8. "error_description" Syntax . . . . . . . . . . . . . . . 80 | |||
| A.9. "error_uri" Syntax . . . . . . . . . . . . . . . . . . . 81 | A.9. "error_uri" Syntax . . . . . . . . . . . . . . . . . . . 80 | |||
| A.10. "grant_type" Syntax . . . . . . . . . . . . . . . . . . . 81 | A.10. "grant_type" Syntax . . . . . . . . . . . . . . . . . . . 80 | |||
| A.11. "code" Syntax . . . . . . . . . . . . . . . . . . . . . . 82 | A.11. "code" Syntax . . . . . . . . . . . . . . . . . . . . . . 81 | |||
| A.12. "access_token" Syntax . . . . . . . . . . . . . . . . . . 82 | A.12. "access_token" Syntax . . . . . . . . . . . . . . . . . . 81 | |||
| A.13. "token_type" Syntax . . . . . . . . . . . . . . . . . . . 82 | A.13. "token_type" Syntax . . . . . . . . . . . . . . . . . . . 81 | |||
| A.14. "expires_in" Syntax . . . . . . . . . . . . . . . . . . . 82 | A.14. "expires_in" Syntax . . . . . . . . . . . . . . . . . . . 81 | |||
| A.15. "refresh_token" Syntax . . . . . . . . . . . . . . . . . 82 | A.15. "refresh_token" Syntax . . . . . . . . . . . . . . . . . 81 | |||
| A.16. Endpoint Parameter Syntax . . . . . . . . . . . . . . . . 82 | A.16. Endpoint Parameter Syntax . . . . . . . . . . . . . . . . 81 | |||
| A.17. "code_verifier" Syntax . . . . . . . . . . . . . . . . . 83 | A.17. "code_verifier" Syntax . . . . . . . . . . . . . . . . . 81 | |||
| A.18. "code_challenge" Syntax . . . . . . . . . . . . . . . . . 83 | A.18. "code_challenge" Syntax . . . . . . . . . . . . . . . . . 82 | |||
| Appendix B. Use of application/x-www-form-urlencoded Media | Appendix B. Use of application/x-www-form-urlencoded Media | |||
| Type . . . . . . . . . . . . . . . . . . . . . . . . . . 83 | Type . . . . . . . . . . . . . . . . . . . . . . . . . . 82 | |||
| Appendix C. Extensions . . . . . . . . . . . . . . . . . . . . . 84 | Appendix C. Extensions . . . . . . . . . . . . . . . . . . . . . 82 | |||
| Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 85 | Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 84 | |||
| Appendix E. Document History . . . . . . . . . . . . . . . . . . 85 | Appendix E. Document History . . . . . . . . . . . . . . . . . . 84 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 86 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 85 | |||
| 1. Introduction | 1. Introduction | |||
| In the traditional client-server authentication model, the client | In the traditional client-server authentication model, the client | |||
| requests an access-restricted resource (protected resource) on the | requests an access-restricted resource (protected resource) on the | |||
| server by authenticating with the server using the resource owner's | server by authenticating with the server using the resource owner's | |||
| credentials. In order to provide third-party applications access to | credentials. In order to provide third-party applications access to | |||
| restricted resources, the resource owner shares its credentials with | restricted resources, the resource owner shares its credentials with | |||
| the third party. This creates several problems and limitations: | the third party. This creates several problems and limitations: | |||
| skipping to change at page 10, line 37 ¶ | skipping to change at page 10, line 37 ¶ | |||
| credentials. The client authentication requirements are based on | credentials. The client authentication requirements are based on | |||
| the client type and on the authorization server policies. | the client type and on the authorization server policies. | |||
| 8. The authorization server authenticates the client and validates | 8. The authorization server authenticates the client and validates | |||
| the refresh token, and if valid, issues a new access token (and, | the refresh token, and if valid, issues a new access token (and, | |||
| optionally, a new refresh token). | optionally, a new refresh token). | |||
| 1.3.3. Client Credentials | 1.3.3. Client Credentials | |||
| The client credentials or other forms of client authentication (e.g. | The client credentials or other forms of client authentication (e.g. | |||
| a "client_secret" or a private key used to sign a JWT) can be used as | a client_secret or a private key used to sign a JWT) can be used as | |||
| an authorization grant when the authorization scope is limited to the | an authorization grant when the authorization scope is limited to the | |||
| protected resources under the control of the client, or to protected | protected resources under the control of the client, or to protected | |||
| resources previously arranged with the authorization server. Client | resources previously arranged with the authorization server. Client | |||
| credentials are used as an authorization grant typically when the | credentials are used as an authorization grant typically when the | |||
| client is acting on its own behalf (the client is also the resource | client is acting on its own behalf (the client is also the resource | |||
| owner) or is requesting access to protected resources based on an | owner) or is requesting access to protected resources based on an | |||
| authorization previously arranged with the authorization server. | authorization previously arranged with the authorization server. | |||
| 1.4. Access Token | 1.4. Access Token | |||
| skipping to change at page 14, line 49 ¶ | skipping to change at page 14, line 49 ¶ | |||
| Dynamic Client Registration ([RFC7591]) defines a common general data | Dynamic Client Registration ([RFC7591]) defines a common general data | |||
| model for clients that may be used even with manual client | model for clients that may be used even with manual client | |||
| registration. | registration. | |||
| 2.1. Client Types | 2.1. Client Types | |||
| OAuth 2.1 defines three client types based on their ability to | OAuth 2.1 defines three client types based on their ability to | |||
| authenticate securely with the authorization server as well as the | authenticate securely with the authorization server as well as the | |||
| authorization server's assurance of the client's identity. | authorization server's assurance of the client's identity. | |||
| "confidential": Clients that have credentials and their identity has | "confidential": Clients that have credentials and have a prior | |||
| been confirmed by the AS are designated as "confidential clients" | relationship with the AS are designated as "confidential clients" | |||
| "credentialed": Clients that have credentials and their identity has | "credentialed": Clients that have credentials but no prior | |||
| been not been confirmed by the AS are designated as "credentialed | relationship with the AS are designated as "credentialed clients" | |||
| clients" | ||||
| "public": Clients without credentials are called "public clients" | "public": Clients without credentials are called "public clients" | |||
| Any clients with credentials MUST take precautions to prevent leakage | Any clients with credentials MUST take precautions to prevent leakage | |||
| and abuse of their credentials. | and abuse of their credentials. | |||
| Authorization servers SHOULD consider the level of confidence in a | Authorization servers SHOULD consider the level of confidence in a | |||
| client's identity when deciding whether they allow such a client | client's identity when deciding whether they allow such a client | |||
| access to more critical functions, such as the Client Credentials | access to more critical functions, such as the Client Credentials | |||
| grant type. | grant type. | |||
| A single "client_id" MUST NOT be treated as more than one type of | A single client_id MUST NOT be treated as more than one type of | |||
| client. | client. | |||
| For example, a client that has been registered at the authorization | ||||
| server by a registered application developer, where the client is | ||||
| expected to be run as server-side code, would be considered a | ||||
| confidential client. A client that runs on an end-user's device, and | ||||
| uses Dynamic Client Registration ([RFC7591]) to establish credentials | ||||
| the first time the app runs, would be considered a credentialed | ||||
| client. An application deployed as a single-page app on a static web | ||||
| host would be considered a public client. | ||||
| This specification has been designed around the following client | This specification has been designed around the following client | |||
| profiles: | profiles: | |||
| "web application": A web application is a confidential client | "web application": A web application is a confidential client | |||
| running on a web server. Resource owners access the client via an | running on a web server. Resource owners access the client via an | |||
| HTML user interface rendered in a user agent on the device used by | HTML user interface rendered in a user agent on the device used by | |||
| the resource owner. The client credentials as well as any access | the resource owner. The client credentials as well as any access | |||
| tokens issued to the client are stored on the web server and are | tokens issued to the client are stored on the web server and are | |||
| not exposed to or accessible by the resource owner. | not exposed to or accessible by the resource owner. | |||
| skipping to change at page 16, line 20 ¶ | skipping to change at page 16, line 26 ¶ | |||
| secret; it is exposed to the resource owner and MUST NOT be used | secret; it is exposed to the resource owner and MUST NOT be used | |||
| alone for client authentication. The client identifier is unique to | alone for client authentication. The client identifier is unique to | |||
| the authorization server. | the authorization server. | |||
| The client identifier string size is left undefined by this | The client identifier string size is left undefined by this | |||
| specification. The client should avoid making assumptions about the | specification. The client should avoid making assumptions about the | |||
| identifier size. The authorization server SHOULD document the size | identifier size. The authorization server SHOULD document the size | |||
| of any identifier it issues. | of any identifier it issues. | |||
| Authorization servers SHOULD NOT allow clients to choose or influence | Authorization servers SHOULD NOT allow clients to choose or influence | |||
| their "client_id" value. See Section 7.6 for details. | their client_id value. See Section 7.6 for details. | |||
| 2.3. Client Redirection Endpoint | 2.3. Client Redirection Endpoint | |||
| The client redirection endpoint (also referred to as "redirect | The client redirection endpoint (also referred to as "redirect | |||
| endpoint") is the URI of the client that the authorization server | endpoint") is the URI of the client that the authorization server | |||
| redirects the user agent back to after completing its interaction | redirects the user agent back to after completing its interaction | |||
| with the resource owner. | with the resource owner. | |||
| The authorization server redirects the user agent to one of the | The authorization server redirects the user agent to one of the | |||
| client's redirection endpoints previously established with the | client's redirection endpoints previously established with the | |||
| skipping to change at page 16, line 43 ¶ | skipping to change at page 17, line 8 ¶ | |||
| The redirect URI MUST be an absolute URI as defined by [RFC3986] | The redirect URI MUST be an absolute URI as defined by [RFC3986] | |||
| Section 4.3. The endpoint URI MAY include an "application/x-www- | Section 4.3. The endpoint URI MAY include an "application/x-www- | |||
| form-urlencoded" formatted (per Appendix B) query component | form-urlencoded" formatted (per Appendix B) query component | |||
| ([RFC3986] Section 3.4), which MUST be retained when adding | ([RFC3986] Section 3.4), which MUST be retained when adding | |||
| additional query parameters. The endpoint URI MUST NOT include a | additional query parameters. The endpoint URI MUST NOT include a | |||
| fragment component. | fragment component. | |||
| 2.3.1. Endpoint Request Confidentiality | 2.3.1. Endpoint Request Confidentiality | |||
| The redirection endpoint SHOULD require the use of TLS as described | The redirection endpoint SHOULD require the use of TLS as described | |||
| in Section 1.5 when the requested response type is "code", or when | in Section 1.5 when the requested response type is code, or when the | |||
| the redirection request will result in the transmission of sensitive | redirection request will result in the transmission of sensitive | |||
| credentials over an open network. If TLS is not available, the | credentials over an open network. If TLS is not available, the | |||
| authorization server SHOULD warn the resource owner about the | authorization server SHOULD warn the resource owner about the | |||
| insecure endpoint prior to redirection (e.g., display a message | insecure endpoint prior to redirection (e.g., display a message | |||
| during the authorization request). | during the authorization request). | |||
| 2.3.2. Registration Requirements | 2.3.2. Registration Requirements | |||
| Authorization servers MUST require clients to register their complete | Authorization servers MUST require clients to register their complete | |||
| redirect URI (including the path component) and reject authorization | redirect URI (including the path component) and reject authorization | |||
| requests that specify a redirect URI that doesn't exactly match one | requests that specify a redirect URI that doesn't exactly match one | |||
| that was registered; the exception is loopback redirects, where an | that was registered; the exception is loopback redirects, where an | |||
| exact match is required except for the port URI component. | exact match is required except for the port URI component. | |||
| For private-use URI scheme-based redirect URIs, authorization servers | For private-use URI scheme-based redirect URIs, authorization servers | |||
| SHOULD enforce the requirement in Section 8.3.1 that clients use | SHOULD enforce the requirement in Section 8.3.1 that clients use | |||
| schemes that are reverse domain name based. At a minimum, any | schemes that are reverse domain name based. At a minimum, any | |||
| private-use URI scheme that doesn't contain a period character (".") | private-use URI scheme that doesn't contain a period character (.) | |||
| SHOULD be rejected. | SHOULD be rejected. | |||
| The client MAY use the "state" request parameter to achieve per- | The client MAY use the state request parameter to achieve per-request | |||
| request customization if needed rather than varying the redirect URI | customization if needed rather than varying the redirect URI per | |||
| per request. | request. | |||
| The authorization server MAY allow the client to register multiple | The authorization server MAY allow the client to register multiple | |||
| redirect URIs. | redirect URIs. | |||
| Without requiring registration of redirect URIs, attackers can use | Without requiring registration of redirect URIs, attackers can use | |||
| the authorization endpoint as an open redirector as described in | the authorization endpoint as an open redirector as described in | |||
| Section 7.18. | Section 7.18. | |||
| 2.3.3. Multiple Redirect URIs | 2.3.3. Multiple Redirect URIs | |||
| If multiple redirect URIs have been registered, the client MUST | If multiple redirect URIs have been registered, the client MUST | |||
| include a redirect URI with the authorization request using the | include a redirect URI with the authorization request using the | |||
| "redirect_uri" request parameter. | redirect_uri request parameter. | |||
| 2.3.4. Invalid Endpoint | 2.3.4. Invalid Endpoint | |||
| If an authorization request fails validation due to a missing, | If an authorization request fails validation due to a missing, | |||
| invalid, or mismatching redirect URI, the authorization server SHOULD | invalid, or mismatching redirect URI, the authorization server SHOULD | |||
| inform the resource owner of the error and MUST NOT automatically | inform the resource owner of the error and MUST NOT automatically | |||
| redirect the user agent to the invalid redirect URI. | redirect the user agent to the invalid redirect URI. | |||
| 2.3.5. Endpoint Content | 2.3.5. Endpoint Content | |||
| skipping to change at page 18, line 16 ¶ | skipping to change at page 18, line 27 ¶ | |||
| party analytics, social plug-ins, ad networks) in the redirection | party analytics, social plug-ins, ad networks) in the redirection | |||
| endpoint response. Instead, it SHOULD extract the credentials from | endpoint response. Instead, it SHOULD extract the credentials from | |||
| the URI and redirect the user agent again to another endpoint without | the URI and redirect the user agent again to another endpoint without | |||
| exposing the credentials (in the URI or elsewhere). If third-party | exposing the credentials (in the URI or elsewhere). If third-party | |||
| scripts are included, the client MUST ensure that its own scripts | scripts are included, the client MUST ensure that its own scripts | |||
| (used to extract and remove the credentials from the URI) will | (used to extract and remove the credentials from the URI) will | |||
| execute first. | execute first. | |||
| 2.4. Client Authentication | 2.4. Client Authentication | |||
| Confidential and credentialed clients establish a client | If the client is confidential or credentialed, the authorization | |||
| authentication method with the authorization server suitable for the | ||||
| security requirements of the authorization server. The authorization | ||||
| server MAY accept any form of client authentication meeting its | server MAY accept any form of client authentication meeting its | |||
| security requirements. | security requirements (e.g., password, public/private key pair). | |||
| Confidential and credentialed clients are typically issued (or | ||||
| establish) a set of client credentials used for authenticating with | ||||
| the authorization server (e.g., password, public/private key pair). | ||||
| The authorization server MUST authenticate the client whenever | The authorization server MUST authenticate the client whenever | |||
| possible. If the authorization server cannot authenticate the client | possible. If the authorization server cannot authenticate the client | |||
| due to the client's nature, the authorization server SHOULD utilize | due to the client's nature, the authorization server SHOULD utilize | |||
| other means to protect resource owners from such potentially | other means to protect resource owners from such potentially | |||
| malicious clients. For example, the authorization server can engage | malicious clients. For example, the authorization server can engage | |||
| the resource owner to assist in identifying the client and its | the resource owner to assist in identifying the client and its | |||
| origin. | origin. | |||
| It is RECOMMENDED to use asymmetric (public-key based) methods for | It is RECOMMENDED to use asymmetric (public-key based) methods for | |||
| skipping to change at page 18, line 46 ¶ | skipping to change at page 18, line 51 ¶ | |||
| [OpenID]. When asymmetric methods for client authentication are | [OpenID]. When asymmetric methods for client authentication are | |||
| used, authorization servers do not need to store sensitive symmetric | used, authorization servers do not need to store sensitive symmetric | |||
| keys, making these methods more robust against a number of attacks. | keys, making these methods more robust against a number of attacks. | |||
| The authorization server MAY establish a client authentication method | The authorization server MAY establish a client authentication method | |||
| with public clients, which converts them to credentialed clients. | with public clients, which converts them to credentialed clients. | |||
| However, the authorization server MUST NOT rely on credentialed | However, the authorization server MUST NOT rely on credentialed | |||
| client authentication for the purpose of identifying the client. | client authentication for the purpose of identifying the client. | |||
| The client MUST NOT use more than one authentication method in each | The client MUST NOT use more than one authentication method in each | |||
| request. | request to prevent a conflict of which authentication mechanism is | |||
| authoritative for the request. | ||||
| 2.4.1. Client Secret | 2.4.1. Client Secret | |||
| Clients in possession of a client secret, sometimes known as a client | Clients in possession of a client secret, sometimes known as a client | |||
| password, MAY use the HTTP Basic authentication scheme as defined in | password, MAY use the HTTP Basic authentication scheme as defined in | |||
| [RFC7235] to authenticate with the authorization server. The client | [RFC7235] to authenticate with the authorization server. The client | |||
| identifier is encoded using the "application/x-www-form-urlencoded" | identifier is encoded using the application/x-www-form-urlencoded | |||
| encoding algorithm per Appendix B, and the encoded value is used as | encoding algorithm per Appendix B, and the encoded value is used as | |||
| the username; the client secret is encoded using the same algorithm | the username; the client secret is encoded using the same algorithm | |||
| and used as the password. The authorization server MUST support the | and used as the password. The authorization server MUST support the | |||
| HTTP Basic authentication scheme for authenticating clients that were | HTTP Basic authentication scheme for authenticating clients that were | |||
| issued a client secret. | issued a client secret. | |||
| For example (with extra line breaks for display purposes only): | For example (with extra line breaks for display purposes only): | |||
| Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3 | Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3 | |||
| skipping to change at page 21, line 30 ¶ | skipping to change at page 21, line 30 ¶ | |||
| formatted (per Appendix B) query component ([RFC3986] Section 3.4), | formatted (per Appendix B) query component ([RFC3986] Section 3.4), | |||
| which MUST be retained when adding additional query parameters. The | which MUST be retained when adding additional query parameters. The | |||
| endpoint URI MUST NOT include a fragment component. | endpoint URI MUST NOT include a fragment component. | |||
| Since requests to the authorization endpoint result in user | Since requests to the authorization endpoint result in user | |||
| authentication and the transmission of clear-text credentials (in the | authentication and the transmission of clear-text credentials (in the | |||
| HTTP response), the authorization server MUST require the use of TLS | HTTP response), the authorization server MUST require the use of TLS | |||
| as described in Section 1.5 when sending requests to the | as described in Section 1.5 when sending requests to the | |||
| authorization endpoint. | authorization endpoint. | |||
| The authorization server MUST support the use of the HTTP "GET" | The authorization server MUST support the use of the HTTP GET method | |||
| method [RFC7231] for the authorization endpoint and MAY support the | [RFC7231] for the authorization endpoint and MAY support the use of | |||
| use of the "POST" method as well. | the POST method as well. | |||
| The authorization server MUST ignore unrecognized request parameters. | The authorization server MUST ignore unrecognized request parameters. | |||
| Request and response parameters defined by this specification MUST | Request and response parameters defined by this specification MUST | |||
| NOT be included more than once. Parameters sent without a value MUST | NOT be included more than once. Parameters sent without a value MUST | |||
| be treated as if they were omitted from the request. | be treated as if they were omitted from the request. | |||
| 3.2. Token Endpoint | 3.2. Token Endpoint | |||
| The token endpoint is used by the client to obtain an access token | The token endpoint is used by the client to obtain an access token | |||
| using a grant such as those described in Section 4 and Section 4.3. | using a grant such as those described in Section 4 and Section 4.3. | |||
| The means through which the client obtains the location of the token | The means through which the client obtains the location of the token | |||
| endpoint are beyond the scope of this specification, but the location | endpoint are beyond the scope of this specification, but the location | |||
| is typically provided in the service documentation and configured | is typically provided in the service documentation and configured | |||
| during development of the client, or provided in the authorization | during development of the client, or provided in the authorization | |||
| server's metadata document ([RFC8414]) and fetched programmatically | server's metadata document ([RFC8414]) and fetched programmatically | |||
| at runtime. | at runtime. | |||
| The endpoint URI MAY include an "application/x-www-form-urlencoded" | The endpoint URI MAY include an application/x-www-form-urlencoded | |||
| formatted (per Appendix B) query component ([RFC3986] Section 3.4) | formatted (per Appendix B) query component ([RFC3986] Section 3.4) | |||
| and MUST NOT include a fragment component. | and MUST NOT include a fragment component. | |||
| Since requests to the token endpoint result in the transmission of | Since requests to the token endpoint result in the transmission of | |||
| clear-text credentials (in the HTTP request and response), the | clear-text credentials (in the HTTP request and response), the | |||
| authorization server MUST require the use of TLS as described in | authorization server MUST require the use of TLS as described in | |||
| Section 1.5 when sending requests to the token endpoint. | Section 1.5 when sending requests to the token endpoint. | |||
| The client MUST use the HTTP "POST" method when making access token | The client MUST use the HTTP POST method when making access token | |||
| requests. | requests. | |||
| The authorization server MUST ignore unrecognized request parameters. | The authorization server MUST ignore unrecognized request parameters. | |||
| Parameters sent without a value MUST be treated as if they were | Parameters sent without a value MUST be treated as if they were | |||
| omitted from the request. Request and response parameters defined by | omitted from the request. Request and response parameters defined by | |||
| this specification MUST NOT be included more than once. | this specification MUST NOT be included more than once. | |||
| 3.2.1. Client Authentication | 3.2.1. Client Authentication | |||
| skipping to change at page 22, line 50 ¶ | skipping to change at page 22, line 50 ¶ | |||
| refresh tokens. | refresh tokens. | |||
| * Implementing authentication management best practices, which | * Implementing authentication management best practices, which | |||
| require periodic credential rotation. Rotation of an entire set | require periodic credential rotation. Rotation of an entire set | |||
| of refresh tokens can be challenging, while rotation of a single | of refresh tokens can be challenging, while rotation of a single | |||
| set of client credentials is significantly easier. | set of client credentials is significantly easier. | |||
| 3.2.2. Token Request | 3.2.2. Token Request | |||
| The client makes a request to the token endpoint by sending the | The client makes a request to the token endpoint by sending the | |||
| following parameters using the "application/x-www-form-urlencoded" | following parameters using the application/x-www-form-urlencoded | |||
| format per Appendix B with a character encoding of UTF-8 in the HTTP | format per Appendix B with a character encoding of UTF-8 in the HTTP | |||
| request payload: | request payload: | |||
| "client_id": REQUIRED, if the client is not authenticating with the | "client_id": REQUIRED, if the client is not authenticating with the | |||
| authorization server as described in Section 3.2.1. | authorization server as described in Section 3.2.1. | |||
| "scope": OPTIONAL. The scope of the access request as described by | "scope": OPTIONAL. The scope of the access request as described by | |||
| Section 3.2.2.1. | Section 3.2.2.1. | |||
| "grant_type": REQUIRED. Identifier of the grant type the client | "grant_type": REQUIRED. Identifier of the grant type the client | |||
| uses with the particular token request. This specification | uses with the particular token request. This specification | |||
| defines the values "authorization_code", "refresh_token", and | defines the values authorization_code, refresh_token, and | |||
| "client_credentials". The grant type determines the further | client_credentials. The grant type determines the further | |||
| parameters required or supported by the token request. The | parameters required or supported by the token request. The | |||
| details of those grant types are defined below. | details of those grant types are defined below. | |||
| Confidential or credentialed clients MUST authenticate with the | Confidential or credentialed clients MUST authenticate with the | |||
| authorization server as described in Section 3.2.1. | authorization server as described in Section 3.2.1. | |||
| For example, the client makes the following HTTP request using TLS | For example, the client makes the following HTTP request using TLS | |||
| (with extra line breaks for display purposes only): | (with extra line breaks for display purposes only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| skipping to change at page 23, line 46 ¶ | skipping to change at page 23, line 46 ¶ | |||
| clients (or clients with other authentication requirements), | clients (or clients with other authentication requirements), | |||
| * authenticate the client if client authentication is included | * authenticate the client if client authentication is included | |||
| Further grant type specific processing rules apply and are specified | Further grant type specific processing rules apply and are specified | |||
| with the respective grant type. | with the respective grant type. | |||
| 3.2.2.1. Access Token Scope | 3.2.2.1. Access Token Scope | |||
| The authorization and token endpoints allow the client to specify the | The authorization and token endpoints allow the client to specify the | |||
| scope of the access request using the "scope" request parameter. In | scope of the access request using the scope request parameter. In | |||
| turn, the authorization server uses the "scope" response parameter to | turn, the authorization server uses the scope response parameter to | |||
| inform the client of the scope of the access token issued. | inform the client of the scope of the access token issued. | |||
| The value of the scope parameter is expressed as a list of space- | The value of the scope parameter is expressed as a list of space- | |||
| delimited, case-sensitive strings. The strings are defined by the | delimited, case-sensitive strings. The strings are defined by the | |||
| authorization server. If the value contains multiple space-delimited | authorization server. If the value contains multiple space-delimited | |||
| strings, their order does not matter, and each string adds an | strings, their order does not matter, and each string adds an | |||
| additional access range to the requested scope. | additional access range to the requested scope. | |||
| scope = scope-token *( SP scope-token ) | scope = scope-token *( SP scope-token ) | |||
| scope-token = 1*( %x21 / %x23-5B / %x5D-7E ) | scope-token = 1*( %x21 / %x23-5B / %x5D-7E ) | |||
| The authorization server MAY fully or partially ignore the scope | The authorization server MAY fully or partially ignore the scope | |||
| requested by the client, based on the authorization server policy or | requested by the client, based on the authorization server policy or | |||
| the resource owner's instructions. If the issued access token scope | the resource owner's instructions. If the issued access token scope | |||
| is different from the one requested by the client, the authorization | is different from the one requested by the client, the authorization | |||
| server MUST include the "scope" response parameter to inform the | server MUST include the scope response parameter to inform the client | |||
| client of the actual scope granted. | of the actual scope granted. | |||
| If the client omits the scope parameter when requesting | If the client omits the scope parameter when requesting | |||
| authorization, the authorization server MUST either process the | authorization, the authorization server MUST either process the | |||
| request using a pre-defined default value or fail the request | request using a pre-defined default value or fail the request | |||
| indicating an invalid scope. The authorization server SHOULD | indicating an invalid scope. The authorization server SHOULD | |||
| document its scope requirements and default value (if defined). | document its scope requirements and default value (if defined). | |||
| 3.2.3. Token Response | 3.2.3. Token Response | |||
| If the access token request is valid and authorized, the | If the access token request is valid and authorized, the | |||
| authorization server issues an access token and optional refresh | authorization server issues an access token and optional refresh | |||
| token. | token. | |||
| If the request client authentication failed or is invalid, the | If the request client authentication failed or is invalid, the | |||
| authorization server returns an error response as described in | authorization server returns an error response as described in | |||
| Section 3.2.3.1. | Section 3.2.3.1. | |||
| The authorization server issues an access token and optional refresh | The authorization server issues an access token and optional refresh | |||
| token by creating an HTTP response body using the "application/json" | token by creating an HTTP response body using the application/json | |||
| media type as defined by [RFC8259] with the following parameters and | media type as defined by [RFC8259] with the following parameters and | |||
| an HTTP 200 (OK) status code: | an HTTP 200 (OK) status code: | |||
| "access_token": REQUIRED. The access token issued by the | "access_token": REQUIRED. The access token issued by the | |||
| authorization server. | authorization server. | |||
| "token_type": REQUIRED. The type of the access token issued as | "token_type": REQUIRED. The type of the access token issued as | |||
| described in Section 5.1. Value is case insensitive. | described in Section 5.1. Value is case insensitive. | |||
| "expires_in": RECOMMENDED. The lifetime in seconds of the access | "expires_in": RECOMMENDED. The lifetime in seconds of the access | |||
| token. For example, the value "3600" denotes that the access | token. For example, the value 3600 denotes that the access token | |||
| token will expire in one hour from the time the response was | will expire in one hour from the time the response was generated. | |||
| generated. If omitted, the authorization server SHOULD provide | If omitted, the authorization server SHOULD provide the expiration | |||
| the expiration time via other means or document the default value. | time via other means or document the default value. | |||
| "scope": OPTIONAL, if identical to the scope requested by the | "scope": RECOMMENDED, if identical to the scope requested by the | |||
| client; otherwise, REQUIRED. The scope of the access token as | client; otherwise, REQUIRED. The scope of the access token as | |||
| described by Section 3.2.2.1. | described by Section 3.2.2.1. | |||
| "refresh_token": OPTIONAL. The refresh token, which can be used to | "refresh_token": OPTIONAL. The refresh token, which can be used to | |||
| obtain new access tokens based on the grant passed in the | obtain new access tokens based on the grant passed in the | |||
| corresponding token request. | corresponding token request. | |||
| Authorization servers SHOULD determine, based on a risk assessment | Authorization servers SHOULD determine, based on a risk assessment | |||
| and their own policies, whether to issue refresh tokens to a certain | and their own policies, whether to issue refresh tokens to a certain | |||
| client. If the authorization server decides not to issue refresh | client. If the authorization server decides not to issue refresh | |||
| skipping to change at page 25, line 32 ¶ | skipping to change at page 25, line 32 ¶ | |||
| the scope and resource servers as consented by the resource owner. | the scope and resource servers as consented by the resource owner. | |||
| This is to prevent privilege escalation by the legitimate client and | This is to prevent privilege escalation by the legitimate client and | |||
| reduce the impact of refresh token leakage. | reduce the impact of refresh token leakage. | |||
| The parameters are serialized into a JavaScript Object Notation | The parameters are serialized into a JavaScript Object Notation | |||
| (JSON) structure by adding each parameter at the highest structure | (JSON) structure by adding each parameter at the highest structure | |||
| level. Parameter names and string values are included as JSON | level. Parameter names and string values are included as JSON | |||
| strings. Numerical values are included as JSON numbers. The order | strings. Numerical values are included as JSON numbers. The order | |||
| of parameters does not matter and can vary. | of parameters does not matter and can vary. | |||
| The authorization server MUST include the HTTP "Cache-Control" | The authorization server MUST include the HTTP Cache-Control response | |||
| response header field [RFC7234] with a value of "no-store" in any | header field [RFC7234] with a value of no-store in any response | |||
| response containing tokens, credentials, or other sensitive | containing tokens, credentials, or other sensitive information. | |||
| information. | ||||
| For example: | For example: | |||
| 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":"2YotnFZFEjr1zCsicMWpAA", | "access_token":"2YotnFZFEjr1zCsicMWpAA", | |||
| "token_type":"Bearer", | "token_type":"Bearer", | |||
| skipping to change at page 26, line 23 ¶ | skipping to change at page 26, line 23 ¶ | |||
| status code (unless specified otherwise) and includes the following | status code (unless specified otherwise) and includes the following | |||
| parameters with the response: | parameters with the response: | |||
| "error": REQUIRED. A single ASCII [USASCII] error code from the | "error": REQUIRED. A single ASCII [USASCII] error code from the | |||
| following: | following: | |||
| "invalid_request": The request is missing a required parameter, | "invalid_request": The request is missing a required parameter, | |||
| includes an unsupported parameter value (other than grant | includes an unsupported parameter value (other than grant | |||
| type), repeats a parameter, includes multiple credentials, | type), repeats a parameter, includes multiple credentials, | |||
| utilizes more than one mechanism for authenticating the client, | utilizes more than one mechanism for authenticating the client, | |||
| contains a "code_verifier" although no "code_challenge" was | contains a code_verifier although no code_challenge was sent in | |||
| sent in the authorization request, or is otherwise malformed. | the authorization request, or is otherwise malformed. | |||
| "invalid_client": Client authentication failed (e.g., unknown | "invalid_client": Client authentication failed (e.g., unknown | |||
| client, no client authentication included, or unsupported | client, no client authentication included, or unsupported | |||
| authentication method). The authorization server MAY return an | authentication method). The authorization server MAY return an | |||
| HTTP 401 (Unauthorized) status code to indicate which HTTP | HTTP 401 (Unauthorized) status code to indicate which HTTP | |||
| authentication schemes are supported. If the client attempted | authentication schemes are supported. If the client attempted | |||
| to authenticate via the "Authorization" request header field, | to authenticate via the Authorization request header field, the | |||
| the authorization server MUST respond with an HTTP 401 | authorization server MUST respond with an HTTP 401 | |||
| (Unauthorized) status code and include the "WWW-Authenticate" | (Unauthorized) status code and include the WWW-Authenticate | |||
| response header field matching the authentication scheme used | response header field matching the authentication scheme used | |||
| by the client. | by the client. | |||
| "invalid_grant": The provided authorization grant (e.g., | "invalid_grant": The provided authorization grant (e.g., | |||
| authorization code, resource owner credentials) or refresh | authorization code, resource owner credentials) or refresh | |||
| token is invalid, expired, revoked, does not match the redirect | token is invalid, expired, revoked, does not match the redirect | |||
| URI used in the authorization request, or was issued to another | URI used in the authorization request, or was issued to another | |||
| client. | client. | |||
| "unauthorized_client": The authenticated client is not authorized | "unauthorized_client": The authenticated client is not authorized | |||
| to use this authorization grant type. | to use this authorization grant type. | |||
| "unsupported_grant_type": The authorization grant type is not | "unsupported_grant_type": The authorization grant type is not | |||
| supported by the authorization server. | supported by the authorization server. | |||
| "invalid_scope": The requested scope is invalid, unknown, | "invalid_scope": The requested scope is invalid, unknown, | |||
| malformed, or exceeds the scope granted by the resource owner. | malformed, or exceeds the scope granted by the resource owner. | |||
| Values for the "error" parameter MUST NOT include characters | Values for the error parameter MUST NOT include characters outside | |||
| outside the set %x20-21 / %x23-5B / %x5D-7E. | the set %x20-21 / %x23-5B / %x5D-7E. | |||
| "error_description": OPTIONAL. Human-readable ASCII [USASCII] text | "error_description": OPTIONAL. Human-readable ASCII [USASCII] text | |||
| providing additional information, used to assist the client | providing additional information, used to assist the client | |||
| developer in understanding the error that occurred. Values for | developer in understanding the error that occurred. Values for | |||
| the "error_description" parameter MUST NOT include characters | the error_description parameter MUST NOT include characters | |||
| outside the set %x20-21 / %x23-5B / %x5D-7E. | outside the set %x20-21 / %x23-5B / %x5D-7E. | |||
| "error_uri": OPTIONAL. A URI identifying a human-readable web page | "error_uri": OPTIONAL. A URI identifying a human-readable web page | |||
| with information about the error, used to provide the client | with information about the error, used to provide the client | |||
| developer with additional information about the error. Values for | developer with additional information about the error. Values for | |||
| the "error_uri" parameter MUST conform to the URI-reference syntax | the error_uri parameter MUST conform to the URI-reference syntax | |||
| and thus MUST NOT include characters outside the set %x21 / | and thus MUST NOT include characters outside the set %x21 / | |||
| %x23-5B / %x5D-7E. | %x23-5B / %x5D-7E. | |||
| The parameters are included in the payload of the HTTP response using | The parameters are included in the payload of the HTTP response using | |||
| the "application/json" media type as defined by [RFC7159]. The | the application/json media type as defined by [RFC7159]. The | |||
| parameters are serialized into a JSON structure by adding each | parameters are serialized into a JSON structure by adding each | |||
| parameter at the highest structure level. Parameter names and string | parameter at the highest structure level. Parameter names and string | |||
| values are included as JSON strings. Numerical values are included | values are included as JSON strings. Numerical values are included | |||
| as JSON numbers. The order of parameters does not matter and can | as JSON numbers. The order of parameters does not matter and can | |||
| vary. | vary. | |||
| For example: | For example: | |||
| HTTP/1.1 400 Bad Request | HTTP/1.1 400 Bad Request | |||
| Content-Type: application/json | Content-Type: application/json | |||
| skipping to change at page 29, line 50 ¶ | skipping to change at page 29, line 50 ¶ | |||
| redirect the user agent to this URI to initiate the request. | redirect the user agent to this URI to initiate the request. | |||
| Clients use a unique secret per authorization request to protect | Clients use a unique secret per authorization request to protect | |||
| against authorization code injection and CSRF attacks. The client | against authorization code injection and CSRF attacks. The client | |||
| first generates this secret, which it can use at the time of | first generates this secret, which it can use at the time of | |||
| redeeming the authorization code to prove that the client using the | redeeming the authorization code to prove that the client using the | |||
| authorization code is the same client that requested it. | authorization code is the same client that requested it. | |||
| The client constructs the request URI by adding the following | The client constructs the request URI by adding the following | |||
| parameters to the query component of the authorization endpoint URI | parameters to the query component of the authorization endpoint URI | |||
| using the "application/x-www-form-urlencoded" format, per Appendix B: | using the application/x-www-form-urlencoded format, per Appendix B: | |||
| "response_type": REQUIRED. The authorization endpoint supports | "response_type": REQUIRED. The authorization endpoint supports | |||
| different sets of request and response pameters. The client | different sets of request and response pameters. The client | |||
| determines the type of flow by using a certain "response_type" | determines the type of flow by using a certain response_type | |||
| value. This specification defines the value "code", which must be | value. This specification defines the value code, which must be | |||
| used to signal that the client wants to use the authorization code | used to signal that the client wants to use the authorization code | |||
| flow. | flow. | |||
| Extension response types MAY contain a space-delimited (%x20) list of | Extension response types MAY contain a space-delimited (%x20) list of | |||
| values, where the order of values does not matter (e.g., response | values, where the order of values does not matter (e.g., response | |||
| type "a b" is the same as "b a"). The meaning of such composite | type a b is the same as b a). The meaning of such composite response | |||
| response types is defined by their respective specifications. | types is defined by their respective specifications. | |||
| Some extension response types are defined by ([OpenID]). | Some extension response types are defined by ([OpenID]). | |||
| If an authorization request is missing the "response_type" parameter, | If an authorization request is missing the response_type parameter, | |||
| or if the response type is not understood, the authorization server | or if the response type is not understood, the authorization server | |||
| MUST return an error response as described in Section 4.1.2.1. | MUST return an error response as described in Section 4.1.2.1. | |||
| "client_id": REQUIRED. The client identifier as described in | "client_id": REQUIRED. The client identifier as described in | |||
| Section 2.2. | Section 2.2. | |||
| "code_challenge": REQUIRED or RECOMMENDED (see Section 7.8). Code | "code_challenge": REQUIRED or RECOMMENDED (see Section 7.8). Code | |||
| challenge. | challenge. | |||
| "code_challenge_method": OPTIONAL, defaults to "plain" if not | "code_challenge_method": OPTIONAL, defaults to plain if not present | |||
| present in the request. Code verifier transformation method is | in the request. Code verifier transformation method is S256 or | |||
| "S256" or "plain". | plain. | |||
| "redirect_uri": OPTIONAL. As described in Section 2.3. | "redirect_uri": OPTIONAL. As described in Section 2.3. | |||
| "scope": OPTIONAL. The scope of the access request as described by | "scope": OPTIONAL. The scope of the access request as described by | |||
| Section 3.2.2.1. | Section 3.2.2.1. | |||
| "state": 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 | state 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. | |||
| The "code_verifier" is a unique high-entropy cryptographically random | The code_verifier is a unique high-entropy cryptographically random | |||
| string generated for each authorization request, using the unreserved | string generated for each authorization request, using the unreserved | |||
| characters "[A-Z] / [a-z] / [0-9] / "-" / "." / "_" / "~"", with a | characters [A-Z] / [a-z] / [0-9] / "-" / "." / "_" / "~", with a | |||
| minimum length of 43 characters and a maximum length of 128 | minimum length of 43 characters and a maximum length of 128 | |||
| characters. | characters. | |||
| The client stores the "code_verifier" temporarily, and calculates the | The client stores the code_verifier temporarily, and calculates the | |||
| "code_challenge" which it uses in the authorization request. | code_challenge which it uses in the authorization request. | |||
| ABNF for "code_verifier" is as follows. | ABNF for code_verifier is as follows. | |||
| code-verifier = 43*128unreserved | code-verifier = 43*128unreserved | |||
| unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | |||
| ALPHA = %x41-5A / %x61-7A | ALPHA = %x41-5A / %x61-7A | |||
| DIGIT = %x30-39 | DIGIT = %x30-39 | |||
| NOTE: The code verifier SHOULD have enough entropy to make it | NOTE: The code verifier SHOULD have enough entropy to make it | |||
| impractical to guess the value. It is RECOMMENDED that the output of | impractical to guess the value. It is RECOMMENDED that the output of | |||
| a suitable random number generator be used to create a 32-octet | a suitable random number generator be used to create a 32-octet | |||
| sequence. The octet sequence is then base64url-encoded to produce a | sequence. The octet sequence is then base64url-encoded to produce a | |||
| 43-octet URL-safe string to use as the code verifier. | 43-octet URL-safe string to use as the code verifier. | |||
| The client then creates a "code_challenge" derived from the code | The client then creates a code_challenge derived from the code | |||
| verifier by using one of the following transformations on the code | verifier by using one of the following transformations on the code | |||
| verifier: | verifier: | |||
| S256 | S256 | |||
| code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier))) | code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier))) | |||
| plain | plain | |||
| code_challenge = code_verifier | code_challenge = code_verifier | |||
| If the client is capable of using "S256", it MUST use "S256", as | If the client is capable of using S256, it MUST use S256, as S256 is | |||
| "S256" is Mandatory To Implement (MTI) on the server. Clients are | Mandatory To Implement (MTI) on the server. Clients are permitted to | |||
| permitted to use "plain" only if they cannot support "S256" for some | use plain only if they cannot support S256 for some technical reason, | |||
| technical reason, for example constrained environments that do not | for example constrained environments that do not have a hashing | |||
| have a hashing function available, and know via out-of-band | function available, and know via out-of-band configuration or via | |||
| configuration or via Authorization Server Metadata ([RFC8414]) that | Authorization Server Metadata ([RFC8414]) that the server supports | |||
| the server supports "plain". | plain. | |||
| ABNF for "code_challenge" is as follows. | ABNF for code_challenge is as follows. | |||
| code-challenge = 43*128unreserved | code-challenge = 43*128unreserved | |||
| unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | |||
| ALPHA = %x41-5A / %x61-7A | ALPHA = %x41-5A / %x61-7A | |||
| DIGIT = %x30-39 | DIGIT = %x30-39 | |||
| The properties "code_challenge" and "code_verifier" are adopted from | The properties code_challenge and code_verifier are adopted from the | |||
| the OAuth 2.0 extension known as "Proof-Key for Code Exchange", or | OAuth 2.0 extension known as "Proof-Key for Code Exchange", or PKCE | |||
| PKCE ([RFC7636]) where this technique was originally developed. | ([RFC7636]) where this technique was originally developed. | |||
| Clients MUST use "code_challenge" and "code_verifier" and | Clients MUST use code_challenge and code_verifier and authorization | |||
| authorization servers MUST enforce their use except under the | servers MUST enforce their use except under the conditions described | |||
| conditions described in Section 7.8. In this case, using and | in Section 7.8. In this case, using and enforcing code_challenge and | |||
| enforcing "code_challenge" and "code_verifier" as described in the | code_verifier as described in the following is still RECOMMENDED. | |||
| following is still RECOMMENDED. | ||||
| The client directs the resource owner to the constructed URI using an | The client directs the resource owner to the constructed URI using an | |||
| HTTP redirection, or by other means available to it via the user | HTTP redirection, or by other means available to it via the user | |||
| agent. | agent. | |||
| For example, the client directs the user agent to make the following | For example, the client directs the user agent to make the following | |||
| HTTP request using TLS (with extra line breaks for display purposes | HTTP request using TLS (with extra line breaks for display purposes | |||
| only): | only): | |||
| GET /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz | GET /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz | |||
| &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb | &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb | |||
| &code_challenge=6fdkQaPm51l13DSukcAH3Mdx7_ntecHYd1vi3n0hMZY | &code_challenge=6fdkQaPm51l13DSukcAH3Mdx7_ntecHYd1vi3n0hMZY | |||
| &code_challenge_method=S256 HTTP/1.1 | &code_challenge_method=S256 HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| The authorization server validates the request to ensure that all | The authorization server validates the request to ensure that all | |||
| required parameters are present and valid. | required parameters are present and valid. | |||
| In particular, the authorization server MUST validate the | In particular, the authorization server MUST validate the | |||
| "redirect_uri" in the request if present, ensuring that it matches | redirect_uri in the request if present, ensuring that it matches one | |||
| one of the registered redirect URIs previously established during | of the registered redirect URIs previously established during client | |||
| client registration (Section 2). When comparing the two URIs the | registration (Section 2). When comparing the two URIs the | |||
| authorization server MUST using simple character-by-character string | authorization server MUST using simple character-by-character string | |||
| comparison as defined in [RFC3986], Section 6.2.1. | comparison as defined in [RFC3986], Section 6.2.1. | |||
| If the request is valid, the authorization server authenticates the | If the request is valid, the authorization server authenticates the | |||
| resource owner and obtains an authorization decision (by asking the | resource owner and obtains an authorization decision (by asking the | |||
| resource owner or by establishing approval via other means). | resource owner or by establishing approval via other means). | |||
| When a decision is established, the authorization server directs the | When a decision is established, the authorization server directs the | |||
| user agent to the provided client redirect URI using an HTTP | user agent to the provided client redirect URI using an HTTP | |||
| redirection response, or by other means available to it via the user | redirection response, or by other means available to it via the user | |||
| agent. | agent. | |||
| 4.1.2. Authorization Response | 4.1.2. Authorization Response | |||
| If the resource owner grants the access request, the authorization | If the resource owner grants the access request, the authorization | |||
| server issues an authorization code and delivers it to the client by | server issues an authorization code and delivers it to the client by | |||
| adding the following parameters to the query component of the | adding the following parameters to the query component of the | |||
| redirect URI using the "application/x-www-form-urlencoded" format, | redirect URI using the application/x-www-form-urlencoded format, per | |||
| per Appendix B: | Appendix B: | |||
| "code": REQUIRED. The authorization code generated by the | "code": REQUIRED. The authorization code generated by the | |||
| authorization server. The authorization code MUST expire shortly | authorization server and is opqaue to the client. The | |||
| after it is issued to mitigate the risk of leaks. A maximum | authorization code MUST expire shortly after it is issued to | |||
| authorization code lifetime of 10 minutes is RECOMMENDED. The | mitigate the risk of leaks. A maximum authorization code lifetime | |||
| client MUST NOT use the authorization code more than once. If an | of 10 minutes is RECOMMENDED. The client MUST NOT use the | |||
| authorization code is used more than once, the authorization | authorization code more than once. If an authorization code is | |||
| server MUST deny the request and SHOULD revoke (when possible) all | used more than once, the authorization server MUST deny the | |||
| access tokens and refresh tokens previously issued based on that | request and SHOULD revoke (when possible) all access tokens and | |||
| authorization code. The authorization code is bound to the client | refresh tokens previously issued based on that authorization code. | |||
| identifier and redirect URI. | The authorization code is bound to the client identifier, code | |||
| challenge and redirect URI. | ||||
| "state": REQUIRED if the "state" parameter was present in the client | "state": REQUIRED if the state parameter was present in the client | |||
| authorization request. The exact value received from the client. | authorization request. The exact value received from the client. | |||
| For example, the authorization server redirects the user agent by | For example, the authorization server redirects the user agent by | |||
| sending the following HTTP response: | sending the following HTTP response: | |||
| HTTP/1.1 302 Found | HTTP/1.1 302 Found | |||
| Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA | Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA | |||
| &state=xyz | &state=xyz | |||
| The client MUST ignore unrecognized response parameters. The | The client MUST ignore unrecognized response parameters. The | |||
| authorization code string size is left undefined by this | authorization code string size is left undefined by this | |||
| specification. The client should avoid making assumptions about code | specification. The client should avoid making assumptions about code | |||
| value sizes. The authorization server SHOULD document the size of | value sizes. The authorization server SHOULD document the size of | |||
| any value it issues. | any value it issues. | |||
| The authorization server MUST associate the "code_challenge" and | The authorization server MUST associate the code_challenge and | |||
| "code_challenge_method" values with the issued authorization code so | code_challenge_method values with the issued authorization code so | |||
| the code challenge can be verified later. | the code challenge can be verified later. | |||
| The exact method that the server uses to associate the | The exact method that the server uses to associate the code_challenge | |||
| "code_challenge" with the issued code is out of scope for this | with the issued code is out of scope for this specification. The | |||
| specification. The code challenge could be stored on the server and | code challenge could be stored on the server and associated with the | |||
| associated with the code there. The "code_challenge" and | code there. The code_challenge and code_challenge_method values may | |||
| "code_challenge_method" values may be stored in encrypted form in the | be stored in encrypted form in the code itself, but the server MUST | |||
| code itself, but the server MUST NOT include the "code_challenge" | NOT include the code_challenge value in a response parameter in a | |||
| value in a response parameter in a form that entities other than the | form that entities other than the AS can extract. | |||
| AS can extract. | ||||
| 4.1.2.1. Error Response | 4.1.2.1. Error Response | |||
| If the request fails due to a missing, invalid, or mismatching | If the request fails due to a missing, invalid, or mismatching | |||
| redirect URI, or if the client identifier is missing or invalid, the | redirect URI, or if the client identifier is missing or invalid, the | |||
| authorization server SHOULD inform the resource owner of the error | authorization server SHOULD inform the resource owner of the error | |||
| and MUST NOT automatically redirect the user agent to the invalid | and MUST NOT automatically redirect the user agent to the invalid | |||
| redirect URI. | redirect URI. | |||
| An AS MUST reject requests without a "code_challenge" from public | An AS MUST reject requests without a code_challenge from public | |||
| clients, and MUST reject such requests from other clients unless | clients, and MUST reject such requests from other clients unless | |||
| there is reasonable assurance that the client mitigates authorization | there is reasonable assurance that the client mitigates authorization | |||
| code injection in other ways. See Section 7.8 for details. | code injection in other ways. See Section 7.8 for details. | |||
| If the server does not support the requested "code_challenge_method" | If the server does not support the requested code_challenge_method | |||
| transformation, the authorization endpoint MUST return the | transformation, the authorization endpoint MUST return the | |||
| authorization error response with "error" value set to | authorization error response with error value set to invalid_request. | |||
| "invalid_request". The "error_description" or the response of | The error_description or the response of error_uri SHOULD explain the | |||
| "error_uri" SHOULD explain the nature of error, e.g., transform | nature of error, e.g., transform algorithm not supported. | |||
| algorithm not supported. | ||||
| If the resource owner denies the access request or if the request | If the resource owner denies the access request or if the request | |||
| fails for reasons other than a missing or invalid redirect URI, the | fails for reasons other than a missing or invalid redirect URI, the | |||
| authorization server informs the client by adding the following | authorization server informs the client by adding the following | |||
| parameters to the query component of the redirect URI using the | parameters to the query component of the redirect URI using the | |||
| "application/x-www-form-urlencoded" format, per Appendix B: | application/x-www-form-urlencoded format, per Appendix B: | |||
| "error": REQUIRED. A single ASCII [USASCII] error code from the | "error": REQUIRED. A single ASCII [USASCII] error code from the | |||
| following: | following: | |||
| "invalid_request": The request is missing a required parameter, | "invalid_request": The request is missing a required parameter, | |||
| includes an invalid parameter value, includes a parameter more | includes an invalid parameter value, includes a parameter more | |||
| than once, or is otherwise malformed. | than once, or is otherwise malformed. | |||
| "unauthorized_client": The client is not authorized to request an | "unauthorized_client": The client is not authorized to request an | |||
| authorization code using this method. | authorization code using this method. | |||
| skipping to change at page 34, line 49 ¶ | skipping to change at page 34, line 42 ¶ | |||
| request. (This error code is needed because a 500 Internal | request. (This error code is needed because a 500 Internal | |||
| Server Error HTTP status code cannot be returned to the client | Server Error HTTP status code cannot be returned to the client | |||
| via an HTTP redirect.) | via an HTTP redirect.) | |||
| "temporarily_unavailable": The authorization server is currently | "temporarily_unavailable": The authorization server is currently | |||
| unable to handle the request due to a temporary overloading or | unable to handle the request due to a temporary overloading or | |||
| maintenance of the server. (This error code is needed because | maintenance of the server. (This error code is needed because | |||
| a 503 Service Unavailable HTTP status code cannot be returned | a 503 Service Unavailable HTTP status code cannot be returned | |||
| to the client via an HTTP redirect.) | to the client via an HTTP redirect.) | |||
| Values for the "error" parameter MUST NOT include characters | Values for the error parameter MUST NOT include characters outside | |||
| outside the set %x20-21 / %x23-5B / %x5D-7E. | the set %x20-21 / %x23-5B / %x5D-7E. | |||
| "error_description": OPTIONAL. Human-readable ASCII [USASCII] text | "error_description": OPTIONAL. Human-readable ASCII [USASCII] text | |||
| providing additional information, used to assist the client | providing additional information, used to assist the client | |||
| developer in understanding the error that occurred. Values for | developer in understanding the error that occurred. Values for | |||
| the "error_description" parameter MUST NOT include characters | the error_description parameter MUST NOT include characters | |||
| outside the set %x20-21 / %x23-5B / %x5D-7E. | outside the set %x20-21 / %x23-5B / %x5D-7E. | |||
| "error_uri": OPTIONAL. A URI identifying a human-readable web page | "error_uri": OPTIONAL. A URI identifying a human-readable web page | |||
| with information about the error, used to provide the client | with information about the error, used to provide the client | |||
| developer with additional information about the error. Values for | developer with additional information about the error. Values for | |||
| the "error_uri" parameter MUST conform to the URI-reference syntax | the error_uri parameter MUST conform to the URI-reference syntax | |||
| and thus MUST NOT include characters outside the set %x21 / | and thus MUST NOT include characters outside the set %x21 / | |||
| %x23-5B / %x5D-7E. | %x23-5B / %x5D-7E. | |||
| "state": REQUIRED if a "state" parameter was present in the client | "state": REQUIRED if a state parameter was present in the client | |||
| authorization request. The exact value received from the client. | authorization request. The exact value received from the client. | |||
| For example, the authorization server redirects the user agent by | For example, the authorization server redirects the user agent by | |||
| sending the following HTTP response: | sending the following HTTP response: | |||
| HTTP/1.1 302 Found | HTTP/1.1 302 Found | |||
| Location: https://client.example.com/cb?error=access_denied&state=xyz | Location: https://client.example.com/cb?error=access_denied&state=xyz | |||
| 4.1.3. Token Endpoint Extension | 4.1.3. Token Endpoint Extension | |||
| The authorization grant type is identified at the token endpoint with | The authorization grant type is identified at the token endpoint with | |||
| the "grant_type" value of "authorization_code". | the grant_type value of authorization_code. | |||
| If this value is set, the following additional token request | If this value is set, the following additional token request | |||
| parameters beyond Section 3.2.2 are required: | parameters beyond Section 3.2.2 are required: | |||
| "code": REQUIRED. The authorization code received from the | "code": REQUIRED. The authorization code received from the | |||
| authorization server. | authorization server. | |||
| "redirect_uri": REQUIRED, if the "redirect_uri" parameter was | "redirect_uri": REQUIRED, if the redirect_uri parameter was included | |||
| included in the authorization request as described in | in the authorization request as described in Section 4.1.1, and | |||
| Section 4.1.1, and their values MUST be identical. | their values MUST be identical. | |||
| "code_verifier": REQUIRED, if the "code_challenge" parameter was | "code_verifier": REQUIRED, if the code_challenge parameter was | |||
| included in the authorization request. MUST NOT be used | included in the authorization request. MUST NOT be used | |||
| otherwise. The original code verifier string. | otherwise. The original code verifier string. | |||
| For example, the client makes the following HTTP request using TLS | For example, the client makes the following HTTP request using TLS | |||
| (with extra line breaks for display purposes only): | (with extra line breaks for display purposes only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW | Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW | |||
| Content-Type: application/x-www-form-urlencoded | Content-Type: application/x-www-form-urlencoded | |||
| grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA | grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA | |||
| &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb | &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb | |||
| &code_verifier=3641a2d12d66101249cdf7a79c000c1f8c05d2aafcf14bf146497bed | &code_verifier=3641a2d12d66101249cdf7a79c000c1f8c05d2aafcf14bf146497bed | |||
| In addition to the processing rules in Section 3.2.2, the | In addition to the processing rules in Section 3.2.2, the | |||
| authorization server MUST: | authorization server MUST: | |||
| * ensure that the authorization code was issued to the authenticated | * ensure that the authorization code was issued to the authenticated | |||
| confidential or credentialed client, or if the client is public, | confidential or credentialed client, or if the client is public, | |||
| ensure that the code was issued to "client_id" in the request, | ensure that the code was issued to client_id in the request, | |||
| * verify that the authorization code is valid, | * verify that the authorization code is valid, | |||
| * verify that the "code_verifier" parameter is present if and only | * verify that the code_verifier parameter is present if and only if | |||
| if a "code_challenge" parameter was present in the authorization | a code_challenge parameter was present in the authorization | |||
| request, | request, | |||
| * if a "code_verifier" is present, verify the "code_verifier" by | * if a code_verifier is present, verify the code_verifier by | |||
| calculating the code challenge from the received "code_verifier" | calculating the code challenge from the received code_verifier and | |||
| and comparing it with the previously associated "code_challenge", | comparing it with the previously associated code_challenge, after | |||
| after first transforming it according to the | first transforming it according to the code_challenge_method | |||
| "code_challenge_method" method specified by the client, and | method specified by the client, and | |||
| * ensure that the "redirect_uri" parameter is present if the | * ensure that the redirect_uri parameter is present if the | |||
| "redirect_uri" parameter was included in the initial authorization | redirect_uri parameter was included in the initial authorization | |||
| request as described in Section 4.1.1, and if included ensure that | request as described in Section 4.1.1, and if included ensure that | |||
| their values are identical. | their values are identical. | |||
| 4.2. Client Credentials Grant | 4.2. Client Credentials Grant | |||
| The client can request an access token using only its client | The client can request an access token using only its client | |||
| credentials (or other supported means of authentication) when the | credentials (or other supported means of authentication) when the | |||
| client is requesting access to the protected resources under its | client is requesting access to the protected resources under its | |||
| control, or those of another resource owner that have been previously | control, or those of another resource owner that have been previously | |||
| arranged with the authorization server (the method of which is beyond | arranged with the authorization server (the method of which is beyond | |||
| skipping to change at page 37, line 27 ¶ | skipping to change at page 37, line 11 ¶ | |||
| (1) The client authenticates with the authorization server and | (1) The client authenticates with the authorization server and | |||
| requests an access token from the token endpoint. | requests an access token from the token endpoint. | |||
| (2) The authorization server authenticates the client, and if valid, | (2) The authorization server authenticates the client, and if valid, | |||
| issues an access token. | issues an access token. | |||
| 4.2.1. Token Endpoint Extension | 4.2.1. Token Endpoint Extension | |||
| The authorization grant type is identified at the token endpoint with | The authorization grant type is identified at the token endpoint with | |||
| the "grant_type" value of "client_credentials". | the grant_type value of client_credentials. | |||
| If this value is set, no additional parameters beyond Section 3.2.2 | If this value is set, no additional parameters beyond Section 3.2.2 | |||
| are required/supported: | are required/supported: | |||
| For example, the client makes the following HTTP request using | For example, the client makes the following HTTP request using | |||
| transport-layer security (with extra line breaks for display purposes | transport-layer security (with extra line breaks for display purposes | |||
| only): | only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| skipping to change at page 38, line 18 ¶ | skipping to change at page 37, line 42 ¶ | |||
| to a client, which can be used to obtain new (fresh) access tokens | to a client, which can be used to obtain new (fresh) access tokens | |||
| based on an existing grant. The client uses this option either | based on an existing grant. The client uses this option either | |||
| because the previous access token has expired or the client | because the previous access token has expired or the client | |||
| previously obtained an access token with a scope more narrow than | previously obtained an access token with a scope more narrow than | |||
| approved by the respective grant and later requires an access token | approved by the respective grant and later requires an access token | |||
| with a different scope under the same grant. | with a different scope under the same grant. | |||
| 4.3.1. Token Endpoint Extension | 4.3.1. Token Endpoint Extension | |||
| The authorization grant type is identified at the token endpoint with | The authorization grant type is identified at the token endpoint with | |||
| the "grant_type" value of "refresh_token". | the grant_type value of refresh_token. | |||
| If this value is set, the following additional parameters beyond | If this value is set, the following additional parameters beyond | |||
| Section 3.2.2 are required/supported: | Section 3.2.2 are required/supported: | |||
| "refresh_token": REQUIRED. The refresh token issued to the client. | "refresh_token": REQUIRED. The refresh token issued to the client. | |||
| Because refresh tokens are typically long-lasting credentials used to | Because refresh tokens are typically long-lasting credentials used to | |||
| request additional access tokens, the refresh token is bound to the | request additional access tokens, the refresh token is bound to the | |||
| client to which it was issued. Confidential or credentialed clients | client to which it was issued. Confidential or credentialed clients | |||
| MUST authenticate with the authorization server as described in | MUST authenticate with the authorization server as described in | |||
| skipping to change at page 40, line 4 ¶ | skipping to change at page 39, line 32 ¶ | |||
| issuing a new refresh token to the client. If a new refresh token is | issuing a new refresh token to the client. If a new refresh token is | |||
| issued, the refresh token scope MUST be identical to that of the | issued, the refresh token scope MUST be identical to that of the | |||
| refresh token included by the client in the request. | refresh token included by the client in the request. | |||
| Authorization servers MAY revoke refresh tokens automatically in case | Authorization servers MAY revoke refresh tokens automatically in case | |||
| of a security event, such as: | of a security event, such as: | |||
| * password change | * password change | |||
| * logout at the authorization server | * logout at the authorization server | |||
| Refresh tokens SHOULD expire if the client has been inactive for some | Refresh tokens SHOULD expire if the client has been inactive for some | |||
| time, i.e., the refresh token has not been used to obtain new access | time, i.e., the refresh token has not been used to obtain new access | |||
| tokens for some time. The expiration time is at the discretion of | tokens for some time. The expiration time is at the discretion of | |||
| the authorization server. It might be a global value or determined | the authorization server. It might be a global value or determined | |||
| based on the client policy or the grant associated with the refresh | based on the client policy or the grant associated with the refresh | |||
| token (and its sensitivity). | token (and its sensitivity). | |||
| 4.4. Extension Grants | 4.4. Extension Grants | |||
| The client uses an extension grant type by specifying the grant type | The client uses an extension grant type by specifying the grant type | |||
| using an absolute URI (defined by the authorization server) as the | using an absolute URI (defined by the authorization server) as the | |||
| value of the "grant_type" parameter of the token endpoint, and by | value of the grant_type parameter of the token endpoint, and by | |||
| adding any additional parameters necessary. | adding any additional parameters necessary. | |||
| For example, to request an access token using the Device | For example, to request an access token using the Device | |||
| Authorization Grant as defined by [RFC8628] after the user has | Authorization Grant as defined by [RFC8628] after the user has | |||
| authorized the client on a separate device, the client makes the | authorized the client on a separate device, the client makes the | |||
| following HTTP request using TLS (with extra line breaks for display | following HTTP request using TLS (with extra line breaks for display | |||
| purposes only): | purposes only): | |||
| POST /token HTTP/1.1 | POST /token HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| skipping to change at page 41, line 24 ¶ | skipping to change at page 40, line 38 ¶ | |||
| authorization server. For example, when the resource server and | authorization server. For example, when the resource server and | |||
| authorization server are colocated or are part of the same system, | authorization server are colocated or are part of the same system, | |||
| they may share a database or other storage; when the two components | they may share a database or other storage; when the two components | |||
| are operated independently, they may use Token Introspection | are operated independently, they may use Token Introspection | |||
| [RFC7662] or a structured access token format such as a JWT | [RFC7662] or a structured access token format such as a JWT | |||
| [I-D.ietf-oauth-access-token-jwt]. | [I-D.ietf-oauth-access-token-jwt]. | |||
| The method in which the client utilizes the access token to access | The method in which the client utilizes the access token to access | |||
| protected resources at the resource server depends on the type of | protected resources at the resource server depends on the type of | |||
| access token issued by the authorization server. Typically, it | access token issued by the authorization server. Typically, it | |||
| involves using the HTTP "Authorization" request header field | involves using the HTTP Authorization request header field [RFC7235] | |||
| [RFC7235] with an authentication scheme defined by the specification | with an authentication scheme defined by the specification of the | |||
| of the access token type used, such as "Bearer", defined below. | access token type used, such as Bearer, defined below. | |||
| 5.1. Access Token Types | 5.1. Access Token Types | |||
| The access token type provides the client with the information | The access token type provides the client with the information | |||
| required to successfully utilize the access token to make a protected | required to successfully utilize the access token to make a protected | |||
| resource request (along with type-specific attributes). The client | resource request (along with type-specific attributes). The client | |||
| MUST NOT use an access token if it does not understand the token | MUST NOT use an access token if it does not understand the token | |||
| type. | type. | |||
| For example, the "Bearer" token type defined in this specification is | For example, the Bearer token type defined in this specification is | |||
| utilized by simply including the access token string in the request: | utilized by simply including the access token string in the request: | |||
| GET /resource/1 HTTP/1.1 | GET /resource/1 HTTP/1.1 | |||
| Host: example.com | Host: example.com | |||
| Authorization: Bearer mF_9.B5f-4.1JqM | Authorization: Bearer mF_9.B5f-4.1JqM | |||
| The above example is provided for illustration purposes only. | The above example is provided for illustration purposes only. | |||
| Each access token type definition specifies the additional attributes | Each access token type definition specifies the additional attributes | |||
| (if any) sent to the client together with the "access_token" response | (if any) sent to the client together with the access_token response | |||
| parameter. It also defines the HTTP authentication method used to | parameter. It also defines the HTTP authentication method used to | |||
| include the access token when making a protected resource request. | include the access token when making a protected resource request. | |||
| 5.2. Bearer Tokens | 5.2. Bearer Tokens | |||
| A Bearer Token is a security token with the property that any party | A Bearer Token is a security token with the property that any party | |||
| in possession of the token (a "bearer") can use the token in any way | in possession of the token (a "bearer") can use the token in any way | |||
| that any other party in possession of it can. Using a bearer token | that any other party in possession of it can. Using a bearer token | |||
| does not require a bearer to prove possession of cryptographic key | does not require a bearer to prove possession of cryptographic key | |||
| material (proof-of-possession). | material (proof-of-possession). | |||
| Bearer tokens may be extended to include proof-of-possession | Bearer tokens may be enhanced with proof-of-possession specifications | |||
| techniques by other specifications. | such as mTLS [RFC8705] to provide proof-of-possession | |||
| characteristics. | ||||
| 5.2.1. Authenticated Requests | 5.2.1. Authenticated Requests | |||
| This section defines two methods of sending Bearer tokens in resource | This section defines two methods of sending Bearer tokens in resource | |||
| requests to resource servers. Clients MUST NOT use more than one | requests to resource servers. Clients MUST use one of the two | |||
| method to transmit the token in each request. | methods defined below, and MUST NOT use more than one method to | |||
| transmit the token in each request. | ||||
| In particular, clients MUST NOT send the access token in a URI query | ||||
| parameter, and resource servers MUST ignore access tokens in a URI | ||||
| query parameter. | ||||
| 5.2.1.1. Authorization Request Header Field | 5.2.1.1. Authorization Request Header Field | |||
| When sending the access token in the "Authorization" request header | When sending the access token in the Authorization request header | |||
| field defined by HTTP/1.1 [RFC7235], the client uses the "Bearer" | field defined by HTTP/1.1 [RFC7235], the client uses the Bearer | |||
| authentication scheme to transmit the access token. | authentication scheme to transmit the access token. | |||
| For example: | For example: | |||
| GET /resource HTTP/1.1 | GET /resource HTTP/1.1 | |||
| Host: server.example.com | Host: server.example.com | |||
| Authorization: Bearer mF_9.B5f-4.1JqM | Authorization: Bearer mF_9.B5f-4.1JqM | |||
| The syntax of the "Authorization" header field for this scheme | The syntax of the Authorization header field for this scheme follows | |||
| follows the usage of the Basic scheme defined in Section 2 of | the usage of the Basic scheme defined in Section 2 of [RFC2617]. | |||
| [RFC2617]. Note that, as with Basic, it does not conform to the | Note that, as with Basic, it does not conform to the generic syntax | |||
| generic syntax defined in Section 1.2 of [RFC2617] but is compatible | defined in Section 1.2 of [RFC2617] but is compatible with the | |||
| with the general authentication framework in HTTP 1.1 Authentication | general authentication framework in HTTP 1.1 Authentication | |||
| [RFC7235], although it does not follow the preferred practice | [RFC7235], although it does not follow the preferred practice | |||
| outlined therein in order to reflect existing deployments. The | outlined therein in order to reflect existing deployments. The | |||
| syntax for Bearer credentials is as follows: | syntax for Bearer credentials is as follows: | |||
| b64token = 1*( ALPHA / DIGIT / | b64token = 1*( ALPHA / DIGIT / | |||
| "-" / "." / "_" / "~" / "+" / "/" ) *"=" | "-" / "." / "_" / "~" / "+" / "/" ) *"=" | |||
| credentials = "Bearer" 1*SP b64token | credentials = "Bearer" 1*SP b64token | |||
| Clients SHOULD make authenticated requests with a bearer token using | Clients SHOULD make authenticated requests with a bearer token using | |||
| the "Authorization" request header field with the "Bearer" HTTP | the Authorization request header field with the Bearer HTTP | |||
| authorization scheme. Resource servers MUST support this method. | authorization scheme. Resource servers MUST support this method. | |||
| 5.2.1.2. Form-Encoded Body Parameter | 5.2.1.2. Form-Encoded Body Parameter | |||
| When sending the access token in the HTTP request payload, the client | When sending the access token in the HTTP request payload, the client | |||
| adds the access token to the request-body using the "access_token" | adds the access token to the request-body using the access_token | |||
| parameter. The client MUST NOT use this method unless all of the | parameter. The client MUST NOT use this method unless all of the | |||
| following conditions are met: | following conditions are met: | |||
| * The HTTP request entity-header includes the "Content-Type" header | * The HTTP request entity-header includes the Content-Type header | |||
| field set to "application/x-www-form-urlencoded". | field set to application/x-www-form-urlencoded. | |||
| * The payload follows the encoding requirements of the "application/ | * The payload follows the encoding requirements of the application/ | |||
| x-www-form-urlencoded" content-type as defined by HTML 4.01 | x-www-form-urlencoded content-type as defined by HTML 4.01 | |||
| [W3C.REC-html401-19991224]. | [W3C.REC-html401-19991224]. | |||
| * The HTTP request payload is single-part. | * The HTTP request payload is single-part. | |||
| * The content to be encoded in the payload MUST consist entirely of | * The content to be encoded in the payload MUST consist entirely of | |||
| ASCII [USASCII] characters. | ASCII [USASCII] characters. | |||
| * The HTTP request method is one for which the request-body has | * The HTTP request method is one for which the request-body has | |||
| defined semantics. In particular, this means that the "GET" | defined semantics. In particular, this means that the GET method | |||
| method MUST NOT be used. | MUST NOT be used. | |||
| The payload MAY include other request-specific parameters, in which | The payload MAY include other request-specific parameters, in which | |||
| case the "access_token" parameter MUST be properly separated from the | case the access_token parameter MUST be properly separated from the | |||
| request-specific parameters using "&" character(s) (ASCII code 38). | request-specific parameters using & character(s) (ASCII code 38). | |||
| For example, the client makes the following HTTP request using | For example, the client makes the following HTTP request using | |||
| transport-layer security: | transport-layer security: | |||
| 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 | |||
| access_token=mF_9.B5f-4.1JqM | access_token=mF_9.B5f-4.1JqM | |||
| The "application/x-www-form-urlencoded" method SHOULD NOT be used | The application/x-www-form-urlencoded method SHOULD NOT be used | |||
| except in application contexts where participating clients do not | except in application contexts where participating clients do not | |||
| have access to the "Authorization" request header field. Resource | have access to the Authorization request header field. Resource | |||
| servers MAY support this method. | servers MAY support this method. | |||
| 5.2.2. The WWW-Authenticate Response Header Field | 5.2.2. The WWW-Authenticate Response Header Field | |||
| If the protected resource request does not include authentication | If the protected resource request does not include authentication | |||
| credentials or does not contain an access token that enables access | credentials or does not contain an access token that enables access | |||
| to the protected resource, the resource server MUST include the HTTP | to the protected resource, the resource server MUST include the HTTP | |||
| "WWW-Authenticate" response header field; it MAY include it in | WWW-Authenticate response header field; it MAY include it in response | |||
| response to other conditions as well. The "WWW-Authenticate" header | to other conditions as well. The WWW-Authenticate header field uses | |||
| field uses the framework defined by HTTP/1.1 [RFC7235]. | the framework defined by HTTP/1.1 [RFC7235]. | |||
| All challenges for this token type MUST use the auth-scheme value | All challenges for this token type MUST use the auth-scheme value | |||
| "Bearer". This scheme MUST be followed by one or more auth-param | Bearer. This scheme MUST be followed by one or more auth-param | |||
| values. The auth-param attributes used or defined by this | values. The auth-param attributes used or defined by this | |||
| specification for this token type are as follows. Other auth-param | specification for this token type are as follows. Other auth-param | |||
| attributes MAY be used as well. | attributes MAY be used as well. | |||
| A "realm" attribute MAY be included to indicate the scope of | A realm attribute MAY be included to indicate the scope of protection | |||
| protection in the manner described in HTTP/1.1 [RFC7235]. The | in the manner described in HTTP/1.1 [RFC7235]. The realm attribute | |||
| "realm" attribute MUST NOT appear more than once. | MUST NOT appear more than once. | |||
| The "scope" attribute is defined in Section 3.2.2.1. The "scope" | The scope attribute is defined in Section 3.2.2.1. The scope | |||
| attribute is a space-delimited list of case-sensitive scope values | attribute is a space-delimited list of case-sensitive scope values | |||
| indicating the required scope of the access token for accessing the | indicating the required scope of the access token for accessing the | |||
| requested resource. "scope" values are implementation defined; there | requested resource. scope values are implementation defined; there is | |||
| is no centralized registry for them; allowed values are defined by | no centralized registry for them; allowed values are defined by the | |||
| the authorization server. The order of "scope" values is not | authorization server. The order of scope values is not significant. | |||
| significant. In some cases, the "scope" value will be used when | In some cases, the scope value will be used when requesting a new | |||
| requesting a new access token with sufficient scope of access to | access token with sufficient scope of access to utilize the protected | |||
| utilize the protected resource. Use of the "scope" attribute is | resource. Use of the scope attribute is OPTIONAL. The scope | |||
| OPTIONAL. The "scope" attribute MUST NOT appear more than once. The | attribute MUST NOT appear more than once. The scope value is | |||
| "scope" value is intended for programmatic use and is not meant to be | intended for programmatic use and is not meant to be displayed to | |||
| displayed to end-users. | end-users. | |||
| Two example scope values follow; these are taken from the OpenID | Two example scope values follow; these are taken from the OpenID | |||
| Connect [OpenID.Messages] and the Open Authentication Technology | Connect [OpenID.Messages] and the Open Authentication Technology | |||
| Committee (OATC) Online Multimedia Authorization Protocol [OMAP] | Committee (OATC) Online Multimedia Authorization Protocol [OMAP] | |||
| OAuth 2.0 use cases, respectively: | OAuth 2.0 use cases, respectively: | |||
| scope="openid profile email" | scope="openid profile email" | |||
| scope="urn:example:channel=HBO&urn:example:rating=G,PG-13" | scope="urn:example:channel=HBO&urn:example:rating=G,PG-13" | |||
| If the protected resource request included an access token and failed | If the protected resource request included an access token and failed | |||
| authentication, the resource server SHOULD include the "error" | authentication, the resource server SHOULD include the error | |||
| attribute to provide the client with the reason why the access | attribute to provide the client with the reason why the access | |||
| request was declined. The parameter value is described in | request was declined. The parameter value is described in | |||
| Section 5.2.3. In addition, the resource server MAY include the | Section 5.2.3. In addition, the resource server MAY include the | |||
| "error_description" attribute to provide developers a human-readable | error_description attribute to provide developers a human-readable | |||
| explanation that is not meant to be displayed to end-users. It also | explanation that is not meant to be displayed to end-users. It also | |||
| MAY include the "error_uri" attribute with an absolute URI | MAY include the error_uri attribute with an absolute URI identifying | |||
| identifying a human-readable web page explaining the error. The | a human-readable web page explaining the error. The error, | |||
| "error", "error_description", and "error_uri" attributes MUST NOT | error_description, and error_uri attributes MUST NOT appear more than | |||
| appear more than once. | once. | |||
| Values for the "scope" attribute (specified in Appendix A.4) MUST NOT | Values for the scope attribute (specified in Appendix A.4) MUST NOT | |||
| include characters outside the set %x21 / %x23-5B / %x5D-7E for | include characters outside the set %x21 / %x23-5B / %x5D-7E for | |||
| representing scope values and %x20 for delimiters between scope | representing scope values and %x20 for delimiters between scope | |||
| values. Values for the "error" and "error_description" attributes | values. Values for the error and error_description attributes | |||
| (specified in Appendixes A.7 and A.8) MUST NOT include characters | (specified in Appendixes A.7 and A.8) MUST NOT include characters | |||
| outside the set %x20-21 / %x23-5B / %x5D-7E. Values for the | outside the set %x20-21 / %x23-5B / %x5D-7E. Values for the | |||
| "error_uri" attribute (specified in Appendix A.9 of) MUST conform to | error_uri attribute (specified in Appendix A.9 of) MUST conform to | |||
| the URI-reference syntax and thus MUST NOT include characters outside | the URI-reference syntax and thus MUST NOT include characters outside | |||
| the set %x21 / %x23-5B / %x5D-7E. | the set %x21 / %x23-5B / %x5D-7E. | |||
| For example, in response to a protected resource request without | For example, in response to a protected resource request without | |||
| authentication: | authentication: | |||
| HTTP/1.1 401 Unauthorized | HTTP/1.1 401 Unauthorized | |||
| WWW-Authenticate: Bearer realm="example" | WWW-Authenticate: Bearer realm="example" | |||
| And in response to a protected resource request with an | And in response to a protected resource request with an | |||
| skipping to change at page 45, line 50 ¶ | skipping to change at page 45, line 15 ¶ | |||
| same parameter, uses more than one method for including an access | same parameter, uses more than one method for including an access | |||
| token, or is otherwise malformed. The resource server SHOULD | token, or is otherwise malformed. The resource server SHOULD | |||
| respond with the HTTP 400 (Bad Request) status code. | respond with the HTTP 400 (Bad Request) status code. | |||
| "invalid_token": The access token provided is expired, revoked, | "invalid_token": The access token provided is expired, revoked, | |||
| malformed, or invalid for other reasons. The resource SHOULD | malformed, or invalid for other reasons. The resource SHOULD | |||
| respond with the HTTP 401 (Unauthorized) status code. The client | respond with the HTTP 401 (Unauthorized) status code. The client | |||
| MAY request a new access token and retry the protected resource | MAY request a new access token and retry the protected resource | |||
| request. | request. | |||
| "insufficient_scope": The request requires higher privileges than | "insufficient_scope": The request requires higher privileges | |||
| provided by the access token. The resource server SHOULD respond | (scopes) than provided by the scopes granted to the client and | |||
| with the HTTP 403 (Forbidden) status code and MAY include the | represented by the access token. | |||
| "scope" attribute with the scope necessary to access the protected | ||||
| resource. | The resource server SHOULD respond with the HTTP 403 (Forbidden) | |||
| status code and MAY include the scope attribute with the scope | ||||
| necessary to access the protected resource. | ||||
| If the request lacks any authentication information (e.g., the client | If the request lacks any authentication information (e.g., the client | |||
| was unaware that authentication is necessary or attempted using an | was unaware that authentication is necessary or attempted using an | |||
| unsupported authentication method), the resource server SHOULD NOT | unsupported authentication method), the resource server SHOULD NOT | |||
| include an error code or other error information. | include an error code or other error information. | |||
| For example: | For example: | |||
| HTTP/1.1 401 Unauthorized | HTTP/1.1 401 Unauthorized | |||
| WWW-Authenticate: Bearer realm="example" | WWW-Authenticate: Bearer realm="example" | |||
| skipping to change at page 46, line 39 ¶ | skipping to change at page 46, line 7 ¶ | |||
| (https://tools.ietf.org/html/rfc6749#section-11.4) for error values | (https://tools.ietf.org/html/rfc6749#section-11.4) for error values | |||
| to be shared among OAuth token authentication schemes. | to be shared among OAuth token authentication schemes. | |||
| New authentication schemes designed primarily for OAuth token | New authentication schemes designed primarily for OAuth token | |||
| authentication SHOULD define a mechanism for providing an error | authentication SHOULD define a mechanism for providing an error | |||
| status code to the client, in which the error values allowed are | status code to the client, in which the error values allowed are | |||
| registered in the error registry established by this specification. | registered in the error registry established by this specification. | |||
| Such schemes MAY limit the set of valid error codes to a subset of | Such schemes MAY limit the set of valid error codes to a subset of | |||
| the registered values. If the error code is returned using a named | the registered values. If the error code is returned using a named | |||
| parameter, the parameter name SHOULD be "error". | parameter, the parameter name SHOULD be error. | |||
| Other schemes capable of being used for OAuth token authentication, | Other schemes capable of being used for OAuth token authentication, | |||
| but not primarily designed for that purpose, MAY bind their error | but not primarily designed for that purpose, MAY bind their error | |||
| values to the registry in the same manner. | values to the registry in the same manner. | |||
| New authentication schemes MAY choose to also specify the use of the | New authentication schemes MAY choose to also specify the use of the | |||
| "error_description" and "error_uri" parameters to return error | error_description and error_uri parameters to return error | |||
| information in a manner parallel to their usage in this | information in a manner parallel to their usage in this | |||
| specification. | specification. | |||
| 6. Extensibility | 6. Extensibility | |||
| 6.1. Defining Access Token Types | 6.1. Defining Access Token Types | |||
| Access token types can be defined in one of two ways: registered in | Access token types can be defined in one of two ways: registered in | |||
| the Access Token Types registry (following the procedures in | the Access Token Types registry (following the procedures in | |||
| Section 11.1 of [RFC6749]), or by using a unique absolute URI as its | Section 11.1 of [RFC6749]), or by using a unique absolute URI as its | |||
| name. | name. | |||
| Types utilizing a URI name SHOULD be limited to vendor-specific | Types utilizing a URI name SHOULD be limited to vendor-specific | |||
| implementations that are not commonly applicable, and are specific to | implementations that are not commonly applicable, and are specific to | |||
| the implementation details of the resource server where they are | the implementation details of the resource server where they are | |||
| used. | used. | |||
| All other types MUST be registered. Type names MUST conform to the | All other types MUST be registered. Type names MUST conform to the | |||
| type-name ABNF. If the type definition includes a new HTTP | type-name ABNF. If the type definition includes a new HTTP | |||
| authentication scheme, the type name SHOULD be identical to the HTTP | authentication scheme, the type name SHOULD be identical to the HTTP | |||
| authentication scheme name (as defined by [RFC2617]). The token type | authentication scheme name (as defined by [RFC2617]). The token type | |||
| "example" is reserved for use in examples. | example is reserved for use in examples. | |||
| type-name = 1*name-char | type-name = 1*name-char | |||
| name-char = "-" / "." / "_" / DIGIT / ALPHA | name-char = "-" / "." / "_" / DIGIT / ALPHA | |||
| 6.2. Defining New Endpoint Parameters | 6.2. Defining New Endpoint Parameters | |||
| New request or response parameters for use with the authorization | New request or response parameters for use with the authorization | |||
| endpoint or the token endpoint are defined and registered in the | endpoint or the token endpoint are defined and registered in the | |||
| OAuth Parameters registry following the procedure in Section 11.2 of | OAuth Parameters registry following the procedure in Section 11.2 of | |||
| [RFC6749]. | [RFC6749]. | |||
| skipping to change at page 47, line 48 ¶ | skipping to change at page 47, line 17 ¶ | |||
| Unregistered vendor-specific parameter extensions that are not | Unregistered vendor-specific parameter extensions that are not | |||
| commonly applicable and that are specific to the implementation | commonly applicable and that are specific to the implementation | |||
| details of the authorization server where they are used SHOULD | details of the authorization server where they are used SHOULD | |||
| utilize a vendor-specific prefix that is not likely to conflict with | utilize a vendor-specific prefix that is not likely to conflict with | |||
| other registered values (e.g., begin with 'companyname_'). | other registered values (e.g., begin with 'companyname_'). | |||
| 6.3. Defining New Authorization Grant Types | 6.3. Defining New Authorization Grant Types | |||
| New authorization grant types can be defined by assigning them a | New authorization grant types can be defined by assigning them a | |||
| unique absolute URI for use with the "grant_type" parameter. If the | unique absolute URI for use with the grant_type parameter. If the | |||
| extension grant type requires additional token endpoint parameters, | extension grant type requires additional token endpoint parameters, | |||
| they MUST be registered in the OAuth Parameters registry as described | they MUST be registered in the OAuth Parameters registry as described | |||
| by Section 11.2 of [RFC6749]. | by Section 11.2 of [RFC6749]. | |||
| 6.4. Defining New Authorization Endpoint Response Types | 6.4. Defining New Authorization Endpoint Response Types | |||
| New response types for use with the authorization endpoint are | New response types for use with the authorization endpoint are | |||
| defined and registered in the Authorization Endpoint Response Types | defined and registered in the Authorization Endpoint Response Types | |||
| registry following the procedure in Section 11.3 of [RFC6749]. | registry following the procedure in Section 11.3 of [RFC6749]. | |||
| Response type names MUST conform to the response-type ABNF. | Response type names MUST conform to the response-type ABNF. | |||
| response-type = response-name *( SP response-name ) | response-type = response-name *( SP response-name ) | |||
| response-name = 1*response-char | response-name = 1*response-char | |||
| response-char = "_" / DIGIT / ALPHA | response-char = "_" / DIGIT / ALPHA | |||
| If a response type contains one or more space characters (%x20), it | If a response type contains one or more space characters (%x20), it | |||
| is compared as a space-delimited list of values in which the order of | is compared as a space-delimited list of values in which the order of | |||
| values does not matter. Only one order of values can be registered, | values does not matter. Only one order of values can be registered, | |||
| which covers all other arrangements of the same set of values. | which covers all other arrangements of the same set of values. | |||
| For example, an extension can define and register the "code | For example, an extension can define and register the code | |||
| other_token" response type. Once registered, the same combination | other_token response type. Once registered, the same combination | |||
| cannot be registered as "other_token code", but both values can be | cannot be registered as other_token code, but both values can be used | |||
| used to denote the same response type. | to denote the same response type. | |||
| 6.5. Defining Additional Error Codes | 6.5. Defining Additional Error Codes | |||
| In cases where protocol extensions (i.e., access token types, | In cases where protocol extensions (i.e., access token types, | |||
| extension parameters, or extension grant types) require additional | extension parameters, or extension grant types) require additional | |||
| error codes to be used with the authorization code grant error | error codes to be used with the authorization code grant error | |||
| response (Section 4.1.2.1), the token error response | response (Section 4.1.2.1), the token error response | |||
| (Section 3.2.3.1), or the resource access error response | (Section 3.2.3.1), or the resource access error response | |||
| (Section 5.3), such error codes MAY be defined. | (Section 5.3), such error codes MAY be defined. | |||
| Extension error codes MUST be registered (following the procedures in | Extension error codes MUST be registered (following the procedures in | |||
| Section 11.4 of [RFC6749]) if the extension they are used in | Section 11.4 of [RFC6749]) if the extension they are used in | |||
| conjunction with is a registered access token type, a registered | conjunction with is a registered access token type, a registered | |||
| endpoint parameter, or an extension grant type. Error codes used | endpoint parameter, or an extension grant type. Error codes used | |||
| with unregistered extensions MAY be registered. | with unregistered extensions MAY be registered. | |||
| Error codes MUST conform to the error ABNF and SHOULD be prefixed by | Error codes MUST conform to the error ABNF and SHOULD be prefixed by | |||
| an identifying name when possible. For example, an error identifying | an identifying name when possible. For example, an error identifying | |||
| an invalid value set to the extension parameter "example" SHOULD be | an invalid value set to the extension parameter example SHOULD be | |||
| named "example_invalid". | named example_invalid. | |||
| error = 1*error-char | error = 1*error-char | |||
| error-char = %x20-21 / %x23-5B / %x5D-7E | error-char = %x20-21 / %x23-5B / %x5D-7E | |||
| 7. Security Considerations | 7. Security Considerations | |||
| As a flexible and extensible framework, OAuth's security | As a flexible and extensible framework, OAuth's security | |||
| considerations depend on many factors. The following sections | considerations depend on many factors. The following sections | |||
| provide implementers with security guidelines focused on the three | provide implementers with security guidelines focused on the three | |||
| client profiles described in Section 2.1: web application, browser- | client profiles described in Section 2.1: web application, browser- | |||
| skipping to change at page 54, line 22 ¶ | skipping to change at page 52, line 50 ¶ | |||
| restrictions also help to reduce the impact of access token leakage. | restrictions also help to reduce the impact of access token leakage. | |||
| In particular, access tokens SHOULD be restricted to certain resource | In particular, access tokens SHOULD be restricted to certain resource | |||
| servers (audience restriction), preferably to a single resource | servers (audience restriction), preferably to a single resource | |||
| server. To put this into effect, the authorization server associates | server. To put this into effect, the authorization server associates | |||
| the access token with certain resource servers and every resource | the access token with certain resource servers and every resource | |||
| server is obliged to verify, for every request, whether the access | server is obliged to verify, for every request, whether the access | |||
| token sent with that request was meant to be used for that particular | token sent with that request was meant to be used for that particular | |||
| resource server. If not, the resource server MUST refuse to serve | resource server. If not, the resource server MUST refuse to serve | |||
| the respective request. Clients and authorization servers MAY | the respective request. Clients and authorization servers MAY | |||
| utilize the parameters "scope" or "resource" as specified in this | utilize the parameters scope or resource as specified in this | |||
| document and [RFC8707], respectively, to determine the resource | document and [RFC8707], respectively, to determine the resource | |||
| server they want to access. | server they want to access. | |||
| Additionally, access tokens SHOULD be restricted to certain resources | Additionally, access tokens SHOULD be restricted to certain resources | |||
| and actions on resource servers or resources. To put this into | and actions on resource servers or resources. To put this into | |||
| effect, the authorization server associates the access token with the | effect, the authorization server associates the access token with the | |||
| respective resource and actions and every resource server is obliged | respective resource and actions and every resource server is obliged | |||
| to verify, for every request, whether the access token sent with that | to verify, for every request, whether the access token sent with that | |||
| request was meant to be used for that particular action on the | request was meant to be used for that particular action on the | |||
| particular resource. If not, the resource server must refuse to | particular resource. If not, the resource server must refuse to | |||
| serve the respective request. Clients and authorization servers MAY | serve the respective request. Clients and authorization servers MAY | |||
| utilize the parameter "scope" and "authorization_details" as | utilize the parameter scope and authorization_details as specified in | |||
| specified in [I-D.ietf-oauth-rar] to determine those resources and/or | [I-D.ietf-oauth-rar] to determine those resources and/or actions. | |||
| actions. | ||||
| 7.2. Client Authentication | 7.2. Client Authentication | |||
| The authorization server MUST only rely on client authentication if | The authorization server MUST only rely on client authentication if | |||
| the process of issuance/registration and distribution of the | the process of issuance/registration and distribution of the | |||
| underlying credentials ensures their confidentiality. | underlying credentials ensures their confidentiality. | |||
| When client authentication is not possible, the authorization server | When client authentication is not possible, the authorization server | |||
| SHOULD employ other means to validate the client's identity - for | SHOULD employ other means to validate the client's identity - for | |||
| example, by requiring the registration of the client redirect URI or | example, by requiring the registration of the client redirect URI or | |||
| skipping to change at page 55, line 29 ¶ | skipping to change at page 54, line 13 ¶ | |||
| services or to use the client credentials grant type. | services or to use the client credentials grant type. | |||
| 7.2.1. Client Authentication of Native Apps | 7.2.1. Client Authentication of Native Apps | |||
| Secrets that are statically included as part of an app distributed to | Secrets that are statically included as part of an app distributed to | |||
| multiple users should not be treated as confidential secrets, as one | multiple users should not be treated as confidential secrets, as one | |||
| user may inspect their copy and learn the shared secret. For this | user may inspect their copy and learn the shared secret. For this | |||
| reason, it is NOT RECOMMENDED for authorization servers to require | reason, it is NOT RECOMMENDED for authorization servers to require | |||
| client authentication of public native apps clients using a shared | client authentication of public native apps clients using a shared | |||
| secret, as this serves little value beyond client identification | secret, as this serves little value beyond client identification | |||
| which is already provided by the "client_id" request parameter. | which is already provided by the client_id request parameter. | |||
| Authorization servers that still require a statically included shared | Authorization servers that still require a statically included shared | |||
| secret for native app clients MUST treat the client as a public | secret for native app clients MUST treat the client as a public | |||
| client (as defined in Section 2.1), and not accept the secret as | client (as defined in Section 2.1), and not accept the secret as | |||
| proof of the client's identity. Without additional measures, such | proof of the client's identity. Without additional measures, such | |||
| clients are subject to client impersonation (see Section 7.4.1). | clients are subject to client impersonation (see Section 7.4.1). | |||
| 7.3. Registration of Native App Clients | 7.3. Registration of Native App Clients | |||
| Except when using a mechanism like Dynamic Client Registration | Except when using a mechanism like Dynamic Client Registration | |||
| skipping to change at page 56, line 11 ¶ | skipping to change at page 54, line 41 ¶ | |||
| specific information, such as the app package or bundle name, or | specific information, such as the app package or bundle name, or | |||
| other information that may be useful for verifying the calling app's | other information that may be useful for verifying the calling app's | |||
| identity on operating systems that support such functions. | identity on operating systems that support such functions. | |||
| For private-use URI scheme-based redirect URIs, authorization servers | For private-use URI scheme-based redirect URIs, authorization servers | |||
| SHOULD require that the URI scheme be based on a domain name that is | SHOULD require that the URI scheme be based on a domain name that is | |||
| under the control of the app. In addition to the collision-resistant | under the control of the app. In addition to the collision-resistant | |||
| properties, this can help to prove ownership in the event of a | properties, this can help to prove ownership in the event of a | |||
| dispute where two apps claim the same private-use URI scheme (where | dispute where two apps claim the same private-use URI scheme (where | |||
| one app is acting maliciously). For example, if two apps claimed | one app is acting maliciously). For example, if two apps claimed | |||
| "com.example.app", the owner of "example.com" could petition the app | com.example.app, the owner of example.com could petition the app | |||
| store operator to remove the counterfeit app. Such a petition is | store operator to remove the counterfeit app. Such a petition is | |||
| harder to prove if a generic URI scheme was used. | harder to prove if a generic URI scheme was used. | |||
| 7.4. Client Impersonation | 7.4. Client Impersonation | |||
| A malicious client can impersonate another client and obtain access | A malicious client can impersonate another client and obtain access | |||
| to protected resources if the impersonated client fails to, or is | to protected resources if the impersonated client fails to, or is | |||
| unable to, keep its client credentials confidential. | unable to, keep its client credentials confidential. | |||
| The authorization server SHOULD enforce explicit resource owner | The authorization server SHOULD enforce explicit resource owner | |||
| skipping to change at page 56, line 43 ¶ | skipping to change at page 55, line 27 ¶ | |||
| 7.4.1. Impersonation of Native Apps | 7.4.1. Impersonation of Native Apps | |||
| As stated above, the authorization server SHOULD NOT process | As stated above, the authorization server SHOULD NOT process | |||
| authorization requests automatically without user consent or | authorization requests automatically without user consent or | |||
| interaction, except when the identity of the client can be assured. | interaction, except when the identity of the client can be assured. | |||
| This includes the case where the user has previously approved an | This includes the case where the user has previously approved an | |||
| authorization request for a given client ID - unless the identity of | authorization request for a given client ID - unless the identity of | |||
| the client can be proven, the request SHOULD be processed as if no | the client can be proven, the request SHOULD be processed as if no | |||
| previous request had been approved. | previous request had been approved. | |||
| Measures such as claimed "https" scheme redirects MAY be accepted by | Measures such as claimed https scheme redirects MAY be accepted by | |||
| authorization servers as identity proof. Some operating systems may | authorization servers as identity proof. Some operating systems may | |||
| offer alternative platform-specific identity features that MAY be | offer alternative platform-specific identity features that MAY be | |||
| accepted, as appropriate. | accepted, as appropriate. | |||
| 7.4.2. Access Token Privilege Restriction | 7.4.2. Access Token Privilege Restriction | |||
| The client SHOULD request access tokens with the minimal scope | The client SHOULD request access tokens with the minimal scope | |||
| necessary. The authorization server SHOULD take the client identity | necessary. The authorization server SHOULD take the client identity | |||
| into account when choosing how to honor the requested scope and MAY | into account when choosing how to honor the requested scope and MAY | |||
| issue an access token with less rights than requested. | issue an access token with less rights than requested. | |||
| skipping to change at page 57, line 27 ¶ | skipping to change at page 56, line 5 ¶ | |||
| restrictions also help to reduce the impact of access token leakage. | restrictions also help to reduce the impact of access token leakage. | |||
| In particular, access tokens SHOULD be restricted to certain resource | In particular, access tokens SHOULD be restricted to certain resource | |||
| servers (audience restriction), preferably to a single resource | servers (audience restriction), preferably to a single resource | |||
| server. To put this into effect, the authorization server associates | server. To put this into effect, the authorization server associates | |||
| the access token with certain resource servers and every resource | the access token with certain resource servers and every resource | |||
| server is obliged to verify, for every request, whether the access | server is obliged to verify, for every request, whether the access | |||
| token sent with that request was meant to be used for that particular | token sent with that request was meant to be used for that particular | |||
| resource server. If not, the resource server MUST refuse to serve | resource server. If not, the resource server MUST refuse to serve | |||
| the respective request. Clients and authorization servers MAY | the respective request. Clients and authorization servers MAY | |||
| utilize the parameters "scope" or "resource" as specified in | utilize the parameters scope or resource as specified in [RFC8707], | |||
| [RFC8707], respectively, to determine the resource server they want | respectively, to determine the resource server they want to access. | |||
| to access. | ||||
| 7.4.3. Access Token Replay Prevention | 7.4.3. Access Token Replay Prevention | |||
| Additionally, access tokens SHOULD be restricted to certain resources | Additionally, access tokens SHOULD be restricted to certain resources | |||
| and actions on resource servers or resources. To put this into | and actions on resource servers or resources. To put this into | |||
| effect, the authorization server associates the access token with the | effect, the authorization server associates the access token with the | |||
| respective resource and actions and every resource server is obliged | respective resource and actions and every resource server is obliged | |||
| to verify, for every request, whether the access token sent with that | to verify, for every request, whether the access token sent with that | |||
| request was meant to be used for that particular action on the | request was meant to be used for that particular action on the | |||
| particular resource. If not, the resource server must refuse to | particular resource. If not, the resource server must refuse to | |||
| serve the respective request. Clients and authorization servers MAY | serve the respective request. Clients and authorization servers MAY | |||
| utilize the parameter "scope" and "authorization_details" as | utilize the parameter scope and authorization_details as specified in | |||
| specified in [I-D.ietf-oauth-rar] to determine those resources and/or | [I-D.ietf-oauth-rar] to determine those resources and/or actions. | |||
| actions. | ||||
| Authorization and resource servers SHOULD use mechanisms for sender- | Authorization and resource servers SHOULD use mechanisms for sender- | |||
| constrained access tokens to prevent token replay as described in | constrained access tokens to prevent token replay as described in | |||
| (#pop_tokens). A sender-constrained access token scopes the | (#pop_tokens). A sender-constrained access token scopes the | |||
| applicability of an access token to a certain sender. This sender is | applicability of an access token to a certain sender. This sender is | |||
| obliged to demonstrate knowledge of a certain secret as prerequisite | obliged to demonstrate knowledge of a certain secret as prerequisite | |||
| for the acceptance of that access token at the recipient (e.g., a | for the acceptance of that access token at the recipient (e.g., a | |||
| resource server). The use of Mutual TLS for OAuth 2.0 [RFC8705] is | resource server). The use of Mutual TLS for OAuth 2.0 [RFC8705] is | |||
| RECOMMENDED. | RECOMMENDED. | |||
| skipping to change at page 58, line 31 ¶ | skipping to change at page 57, line 8 ¶ | |||
| or use refresh token rotation as described in (#refreshing-an-access- | or use refresh token rotation as described in (#refreshing-an-access- | |||
| token). | token). | |||
| The authorization server MUST ensure that refresh tokens cannot be | The authorization server MUST ensure that refresh tokens cannot be | |||
| generated, modified, or guessed to produce valid refresh tokens by | generated, modified, or guessed to produce valid refresh tokens by | |||
| unauthorized parties. | unauthorized parties. | |||
| 7.6. Client Impersonating Resource Owner | 7.6. Client Impersonating Resource Owner | |||
| Resource servers may make access control decisions based on the | Resource servers may make access control decisions based on the | |||
| identity of the resource owner as communicated in the "sub" claim | identity of the resource owner as communicated in the sub claim | |||
| returned by the authorization server in a token introspection | returned by the authorization server in a token introspection | |||
| response [RFC7662] or other mechanisms. If a client is able to | response [RFC7662] or other mechanisms. If a client is able to | |||
| choose its own "client_id" during registration with the authorization | choose its own client_id during registration with the authorization | |||
| server, then there is a risk that it can register with the same "sub" | server, then there is a risk that it can register with the same sub | |||
| value as a privileged user. A subsequent access token obtained under | value as a privileged user. A subsequent access token obtained under | |||
| the client credentials grant may be mistaken for an access token | the client credentials grant may be mistaken for an access token | |||
| authorized by the privileged user if the resource server does not | authorized by the privileged user if the resource server does not | |||
| perform additional checks. | perform additional checks. | |||
| Authorization servers SHOULD NOT allow clients to influence their | Authorization servers SHOULD NOT allow clients to influence their | |||
| "client_id" or "sub" value or any other claim if that can cause | client_id or sub value or any other claim if that can cause confusion | |||
| confusion with a genuine resource owner. Where this cannot be | with a genuine resource owner. Where this cannot be avoided, | |||
| avoided, authorization servers MUST provide other means for the | authorization servers MUST provide other means for the resource | |||
| resource server to distinguish between access tokens authorized by a | server to distinguish between access tokens authorized by a resource | |||
| resource owner from access tokens authorized by the client itself. | owner from access tokens authorized by the client itself. | |||
| 7.7. Protecting the Authorization Code Flow | 7.7. Protecting the Authorization Code Flow | |||
| When comparing client redirect URIs against pre-registered URIs, | When comparing client redirect URIs against pre-registered URIs, | |||
| authorization servers MUST utilize exact string matching. This | authorization servers MUST utilize exact string matching. This | |||
| measure contributes to the prevention of leakage of authorization | measure contributes to the prevention of leakage of authorization | |||
| codes and access tokens (see (#insufficient_uri_validation)). It can | codes and access tokens (see (#insufficient_uri_validation)). It can | |||
| also help to detect mix-up attacks (see (#mix_up)). | also help to detect mix-up attacks (see (#mix_up)). | |||
| Clients MUST NOT expose URLs that forward the user's browser to | Clients MUST NOT expose URLs that forward the user's browser to | |||
| arbitrary URIs obtained from a query parameter ("open redirector"). | arbitrary URIs obtained from a query parameter ("open redirector"). | |||
| Open redirectors can enable exfiltration of authorization codes and | Open redirectors can enable exfiltration of authorization codes and | |||
| access tokens, see (#open_redirector_on_client). | access tokens, see (#open_redirector_on_client). | |||
| Clients MUST prevent Cross-Site Request Forgery (CSRF). In this | Clients MUST prevent Cross-Site Request Forgery (CSRF). In this | |||
| context, CSRF refers to requests to the redirection endpoint that do | context, CSRF refers to requests to the redirection endpoint that do | |||
| not originate at the authorization server, but a malicious third | not originate at the authorization server, but a malicious third | |||
| party (see Section 4.4.1.8. of [RFC6819] for details). Clients that | party (see Section 4.4.1.8. of [RFC6819] for details). Clients that | |||
| have ensured that the authorization server supports the | have ensured that the authorization server supports the | |||
| "code_challenge" parameter MAY rely the CSRF protection provided by | code_challenge parameter MAY rely the CSRF protection provided by | |||
| that mechanism. In OpenID Connect flows, the "nonce" parameter | that mechanism. In OpenID Connect flows, the nonce parameter | |||
| provides CSRF protection. Otherwise, one-time use CSRF tokens | provides CSRF protection. Otherwise, one-time use CSRF tokens | |||
| carried in the "state" parameter that are securely bound to the user | carried in the state parameter that are securely bound to the user | |||
| agent MUST be used for CSRF protection (see (#csrf_countermeasures)). | agent MUST be used for CSRF protection (see (#csrf_countermeasures)). | |||
| In order to prevent mix-up attacks (see (#mix_up)), clients MUST only | In order to prevent mix-up attacks (see (#mix_up)), clients MUST only | |||
| process redirect responses of the authorization server they sent the | process redirect responses of the authorization server they sent the | |||
| respective request to and from the same user agent this authorization | respective request to and from the same user agent this authorization | |||
| request was initiated with. Clients MUST store the authorization | request was initiated with. Clients MUST store the authorization | |||
| server they sent an authorization request to and bind this | server they sent an authorization request to and bind this | |||
| information to the user agent and check that the authorization | information to the user agent and check that the authorization | |||
| response was received from the correct authorization server. Clients | response was received from the correct authorization server. Clients | |||
| MUST ensure that the subsequent access token request, if applicable, | MUST ensure that the subsequent access token request, if applicable, | |||
| is sent to the same authorization server. Clients SHOULD use | is sent to the same authorization server. Clients SHOULD use | |||
| distinct redirect URIs for each authorization server as a means to | distinct redirect URIs for each authorization server as a means to | |||
| identify the authorization server a particular response came from. | identify the authorization server a particular response came from. | |||
| An AS that redirects a request potentially containing user | An AS that redirects a request potentially containing user | |||
| credentials MUST avoid forwarding these user credentials accidentally | credentials MUST avoid forwarding these user credentials accidentally | |||
| (see Section 7.7.2 for details). | (see Section 7.7.2 for details). | |||
| 7.7.1. Loopback Redirect Considerations in Native Apps | 7.7.1. Loopback Redirect Considerations in Native Apps | |||
| Loopback interface redirect URIs use the "http" scheme (i.e., without | Loopback interface redirect URIs use the http scheme (i.e., without | |||
| Transport Layer Security (TLS)). This is acceptable for loopback | Transport Layer Security (TLS)). This is acceptable for loopback | |||
| interface redirect URIs as the HTTP request never leaves the device. | interface redirect URIs as the HTTP request never leaves the device. | |||
| Clients should open the network port only when starting the | Clients should open the network port only when starting the | |||
| authorization request and close it once the response is returned. | authorization request and close it once the response is returned. | |||
| Clients should listen on the loopback network interface only, in | Clients should listen on the loopback network interface only, in | |||
| order to avoid interference by other network actors. | order to avoid interference by other network actors. | |||
| While redirect URIs using localhost (i.e., | Clients should use loopback IP literals rather than the string | |||
| "http://localhost:{port}/{path}") function similarly to loopback IP | localhost as described in Section 8.3.3. | |||
| redirects described in Section 8.3.3, the use of "localhost" is NOT | ||||
| RECOMMENDED. Specifying a redirect URI with the loopback IP literal | ||||
| rather than "localhost" avoids inadvertently listening on network | ||||
| interfaces other than the loopback interface. It is also less | ||||
| susceptible to client-side firewalls and misconfigured host name | ||||
| resolution on the user's device. | ||||
| 7.7.2. HTTP 307 Redirect | 7.7.2. HTTP 307 Redirect | |||
| An AS which redirects a request that potentially contains user | An AS which redirects a request that potentially contains user | |||
| credentials MUST NOT use the HTTP 307 status code for redirection. | credentials MUST NOT use the HTTP 307 status code for redirection. | |||
| If an HTTP redirection (and not, for example, JavaScript) is used for | If an HTTP redirection (and not, for example, JavaScript) is used for | |||
| such a request, AS SHOULD use HTTP status code 303 "See Other". | such a request, AS SHOULD use HTTP status code 303 "See Other". | |||
| At the authorization endpoint, a typical protocol flow is that the AS | At the authorization endpoint, a typical protocol flow is that the AS | |||
| prompts the user to enter their credentials in a form that is then | prompts the user to enter their credentials in a form that is then | |||
| skipping to change at page 61, line 19 ¶ | skipping to change at page 59, line 33 ¶ | |||
| authorization code for an access token, the authorization server | authorization code for an access token, the authorization server | |||
| SHOULD attempt to revoke all refresh and access tokens already | SHOULD attempt to revoke all refresh and access tokens already | |||
| granted based on the compromised authorization code. | granted based on the compromised authorization code. | |||
| If the client can be authenticated, the authorization servers MUST | If the client can be authenticated, the authorization servers MUST | |||
| authenticate the client and ensure that the authorization code was | authenticate the client and ensure that the authorization code was | |||
| issued to the same client. | issued to the same client. | |||
| Clients MUST prevent injection (replay) of authorization codes into | Clients MUST prevent injection (replay) of authorization codes into | |||
| the authorization response by attackers. To this end, using | the authorization response by attackers. To this end, using | |||
| "code_challenge" and "code_verifier" is REQUIRED for clients and | code_challenge and code_verifier is REQUIRED for clients and | |||
| authorization servers MUST enforce their use, unless both of the | authorization servers MUST enforce their use, unless both of the | |||
| following criteria are met: | following criteria are met: | |||
| * The client is a confidential client. | * The client is a confidential client. | |||
| * In the specific deployment and the specific request, there is | * In the specific deployment and the specific request, there is | |||
| reasonable assurance for authorization server that the client | reasonable assurance for authorization server that the client | |||
| implements the OpenID Connect "nonce" mechanism properly. | implements the OpenID Connect nonce mechanism properly. | |||
| In this case, using and enforcing "code_challenge" and | In this case, using and enforcing code_challenge and code_verifier is | |||
| "code_verifier" is still RECOMMENDED. | still RECOMMENDED. | |||
| The "code_challenge" or OpenID Connect "nonce" value MUST be | The code_challenge or OpenID Connect nonce value MUST be transaction- | |||
| transaction-specific and securely bound to the client and the user | specific and securely bound to the client and the user agent in which | |||
| agent in which the transaction was started. If a transaction leads | the transaction was started. If a transaction leads to an error, | |||
| to an error, fresh values for "code_challenge" or "nonce" MUST be | fresh values for code_challenge or nonce MUST be chosen. | |||
| chosen. | ||||
| Historic note: Although PKCE [RFC7636] was originally designed as a | Historic note: Although PKCE [RFC7636] was originally designed as a | |||
| mechanism to protect native apps, this advice applies to all kinds of | mechanism to protect native apps, this advice applies to all kinds of | |||
| OAuth clients, including web applications and other confidential | OAuth clients, including web applications and other confidential | |||
| clients. | clients. | |||
| Clients SHOULD use code challenge methods that do not expose the | Clients SHOULD use code challenge methods that do not expose the | |||
| "code_verifier" in the authorization request. Otherwise, attackers | code_verifier in the authorization request. Otherwise, attackers | |||
| that can read the authorization request (cf. Attacker A4 in | that can read the authorization request (cf. Attacker A4 in | |||
| (#secmodel)) can break the security provided by this mechanism. | (#secmodel)) can break the security provided by this mechanism. | |||
| Currently, "S256" is the only such method. | Currently, S256 is the only such method. | |||
| When an authorization code arrives at the token endpoint, the | When an authorization code arrives at the token endpoint, the | |||
| authorization server MUST do the following check: | authorization server MUST do the following check: | |||
| 1. If there was a "code_challenge" in the authorization request for | 1. If there was a code_challenge in the authorization request for | |||
| which this code was issued, there must be a "code_verifier" in | which this code was issued, there must be a code_verifier in the | |||
| the token request, and it MUST be verified according to the steps | token request, and it MUST be verified according to the steps in | |||
| in Section 3.2.2. (This is no change from the current behavior | Section 3.2.2. (This is no change from the current behavior in | |||
| in [RFC7636].) | [RFC7636].) | |||
| 2. If there was no "code_challenge" in the authorization request, | 2. If there was no code_challenge in the authorization request, any | |||
| any request to the token endpoint containing a "code_verifier" | request to the token endpoint containing a code_verifier MUST be | |||
| MUST be rejected. | rejected. | |||
| Authorization servers MUST support the "code_challenge" and | Authorization servers MUST support the code_challenge and | |||
| "code_verifier" parameters. | code_verifier parameters. | |||
| Authorization servers MUST provide a way to detect their support for | Authorization servers MUST provide a way to detect their support for | |||
| the "code_challenge" mechanism. To this end, they MUST either (a) | the code_challenge mechanism. To this end, they MUST either (a) | |||
| publish the element "code_challenge_methods_supported" in their AS | publish the element code_challenge_methods_supported in their AS | |||
| metadata ([RFC8414]) containing the supported | metadata ([RFC8414]) containing the supported code_challenge_methods | |||
| "code_challenge_method"s (which can be used by the client to detect | (which can be used by the client to detect support) or (b) provide a | |||
| support) or (b) provide a deployment-specific way to ensure or | deployment-specific way to ensure or determine support by the AS. | |||
| determine support by the AS. | ||||
| 7.9. Request Confidentiality | 7.9. Request Confidentiality | |||
| Access tokens, refresh tokens, authorization codes, and client | Access tokens, refresh tokens, authorization codes, and client | |||
| credentials MUST NOT be transmitted in the clear. | credentials MUST NOT be transmitted in the clear. | |||
| The "state" and "scope" parameters SHOULD NOT include sensitive | The state and scope parameters SHOULD NOT include sensitive client or | |||
| client or resource owner information in plain text, as they can be | resource owner information in plain text, as they can be transmitted | |||
| transmitted over insecure channels or stored insecurely. | over insecure channels or stored insecurely. | |||
| 7.10. Ensuring Endpoint Authenticity | 7.10. Ensuring Endpoint Authenticity | |||
| In order to prevent man-in-the-middle attacks, the authorization | In order to prevent man-in-the-middle attacks, the authorization | |||
| server MUST require the use of TLS with server authentication as | server MUST require the use of TLS with server authentication as | |||
| defined by [RFC2818] for any request sent to the authorization and | defined by [RFC2818] for any request sent to the authorization and | |||
| token endpoints. The client MUST validate the authorization server's | token endpoints. The client MUST validate the authorization server's | |||
| TLS certificate as defined by [RFC6125] and in accordance with its | TLS certificate as defined by [RFC6125] and in accordance with its | |||
| requirements for server identity authentication. | requirements for server identity authentication. | |||
| skipping to change at page 64, line 14 ¶ | skipping to change at page 62, line 36 ¶ | |||
| Users who are particularly concerned about their security when using | Users who are particularly concerned about their security when using | |||
| in-app browser tabs may also take the additional step of opening the | in-app browser tabs may also take the additional step of opening the | |||
| request in the full browser from the in-app browser tab and complete | request in the full browser from the in-app browser tab and complete | |||
| the authorization there, as most implementations of the in-app | the authorization there, as most implementations of the in-app | |||
| browser tab pattern offer such functionality. | browser tab pattern offer such functionality. | |||
| 7.14. Malicious External User-Agents in Native Apps | 7.14. Malicious External User-Agents in Native Apps | |||
| If a malicious app is able to configure itself as the default handler | If a malicious app is able to configure itself as the default handler | |||
| for "https" scheme URIs in the operating system, it will be able to | for https scheme URIs in the operating system, it will be able to | |||
| intercept authorization requests that use the default browser and | intercept authorization requests that use the default browser and | |||
| abuse this position of trust for malicious ends such as phishing the | abuse this position of trust for malicious ends such as phishing the | |||
| user. | user. | |||
| This attack is not confined to OAuth; a malicious app configured in | This attack is not confined to OAuth; a malicious app configured in | |||
| this way would present a general and ongoing risk to the user beyond | this way would present a general and ongoing risk to the user beyond | |||
| OAuth usage by native apps. Many operating systems mitigate this | OAuth usage by native apps. Many operating systems mitigate this | |||
| issue by requiring an explicit user action to change the default | issue by requiring an explicit user action to change the default | |||
| handler for "http" and "https" scheme URIs. | handler for http and https scheme URIs. | |||
| 7.15. Cross-Site Request Forgery | 7.15. Cross-Site Request Forgery | |||
| An attacker might attempt to inject a request to the redirect URI of | An attacker might attempt to inject a request to the redirect URI of | |||
| the legitimate client on the victim's device, e.g., to cause the | the legitimate client on the victim's device, e.g., to cause the | |||
| client to access resources under the attacker's control. This is a | client to access resources under the attacker's control. This is a | |||
| variant of an attack known as Cross-Site Request Forgery (CSRF). | variant of an attack known as Cross-Site Request Forgery (CSRF). | |||
| The traditional countermeasure are CSRF tokens that are bound to the | The traditional countermeasure are CSRF tokens that are bound to the | |||
| user agent and passed in the "state" parameter to the authorization | user agent and passed in the state parameter to the authorization | |||
| server as described in [RFC6819]. The same protection is provided by | server as described in [RFC6819]. The same protection is provided by | |||
| the "code_verifier" parameter or the OpenID Connect "nonce" value. | the code_verifier parameter or the OpenID Connect nonce value. | |||
| When using "code_verifier" instead of "state" or "nonce" for CSRF | When using code_verifier instead of state or nonce for CSRF | |||
| protection, it is important to note that: | protection, it is important to note that: | |||
| * Clients MUST ensure that the AS supports the | * Clients MUST ensure that the AS supports the code_challenge_method | |||
| "code_challenge_method" intended to be used by the client. If an | intended to be used by the client. If an authorization server | |||
| authorization server does not support the requested method, | does not support the requested method, state or nonce MUST be used | |||
| "state" or "nonce" MUST be used for CSRF protection instead. | for CSRF protection instead. | |||
| * If "state" is used for carrying application state, and integrity | * If state is used for carrying application state, and integrity of | |||
| of its contents is a concern, clients MUST protect "state" against | its contents is a concern, clients MUST protect state against | |||
| tampering and swapping. This can be achieved by binding the | tampering and swapping. This can be achieved by binding the | |||
| contents of state to the browser session and/or signed/encrypted | contents of state to the browser session and/or signed/encrypted | |||
| state values [I-D.bradley-oauth-jwt-encoded-state]. | state values [I-D.bradley-oauth-jwt-encoded-state]. | |||
| AS therefore MUST provide a way to detect their supported code | AS therefore MUST provide a way to detect their supported code | |||
| challenge methods either via AS metadata according to [RFC8414] or | challenge methods either via AS metadata according to [RFC8414] or | |||
| provide a deployment-specific way to ensure or determine support. | provide a deployment-specific way to ensure or determine support. | |||
| 7.16. Clickjacking | 7.16. Clickjacking | |||
| skipping to change at page 65, line 37 ¶ | skipping to change at page 64, line 9 ¶ | |||
| origins in user agents that support CSP. The client MAY permit being | origins in user agents that support CSP. The client MAY permit being | |||
| framed by some other origin than the one used in its redirection | framed by some other origin than the one used in its redirection | |||
| endpoint. For this reason, authorization servers SHOULD allow | endpoint. For this reason, authorization servers SHOULD allow | |||
| administrators to configure allowed origins for particular clients | administrators to configure allowed origins for particular clients | |||
| and/or for clients to register these dynamically. | and/or for clients to register these dynamically. | |||
| Using CSP allows authorization servers to specify multiple origins in | Using CSP allows authorization servers to specify multiple origins in | |||
| a single response header field and to constrain these using flexible | a single response header field and to constrain these using flexible | |||
| patterns (see [CSP-2] for details). Level 2 of this standard | patterns (see [CSP-2] for details). Level 2 of this standard | |||
| provides a robust mechanism for protecting against clickjacking by | provides a robust mechanism for protecting against clickjacking by | |||
| using policies that restrict the origin of frames (using "frame- | using policies that restrict the origin of frames (using frame- | |||
| ancestors") together with those that restrict the sources of scripts | ancestors) together with those that restrict the sources of scripts | |||
| allowed to execute on an HTML page (by using "script-src"). A non- | allowed to execute on an HTML page (by using script-src). A non- | |||
| normative example of such a policy is shown in the following listing: | normative example of such a policy is shown in the following listing: | |||
| "HTTP/1.1 200 OK Content-Security-Policy: frame-ancestors | HTTP/1.1 200 OK Content-Security-Policy: frame-ancestors | |||
| https://ext.example.org:8000 Content-Security-Policy: script-src | https://ext.example.org:8000 Content-Security-Policy: script-src | |||
| 'self' X-Frame-Options: ALLOW-FROM https://ext.example.org:8000 ..." | 'self' X-Frame-Options: ALLOW-FROM https://ext.example.org:8000 ... | |||
| Because some user agents do not support [CSP-2], this technique | Because some user agents do not support [CSP-2], this technique | |||
| SHOULD be combined with others, including those described in | SHOULD be combined with others, including those described in | |||
| [RFC6819], unless such legacy user agents are explicitly unsupported | [RFC6819], unless such legacy user agents are explicitly unsupported | |||
| by the authorization server. Even in such cases, additional | by the authorization server. Even in such cases, additional | |||
| countermeasures SHOULD still be employed. | countermeasures SHOULD still be employed. | |||
| 7.17. Code Injection and Input Validation | 7.17. Code Injection and Input Validation | |||
| A code injection attack occurs when an input or otherwise external | A code injection attack occurs when an input or otherwise external | |||
| variable is used by an application unsanitized and causes | variable is used by an application unsanitized and causes | |||
| modification to the application logic. This may allow an attacker to | modification to the application logic. This may allow an attacker to | |||
| gain access to the application device or its data, cause denial of | gain access to the application device or its data, cause denial of | |||
| service, or introduce a wide range of malicious side-effects. | service, or introduce a wide range of malicious side-effects. | |||
| The authorization server and client MUST sanitize (and validate when | The authorization server and client MUST sanitize (and validate when | |||
| possible) any value received - in particular, the value of the | possible) any value received - in particular, the value of the state | |||
| "state" and "redirect_uri" parameters. | and redirect_uri parameters. | |||
| 7.18. Open Redirectors | 7.18. Open Redirectors | |||
| The following attacks can occur when an AS or client has an open | The following attacks can occur when an AS or client has an open | |||
| redirector. An open redirector is an endpoint that forwards a user's | redirector. An open redirector is an endpoint that forwards a user's | |||
| browser to an arbitrary URI obtained from a query parameter. | browser to an arbitrary URI obtained from a query parameter. | |||
| 7.18.1. Client as Open Redirector | 7.18.1. Client as Open Redirector | |||
| Clients MUST NOT expose open redirectors. Attackers may use open | Clients MUST NOT expose open redirectors. Attackers may use open | |||
| skipping to change at page 66, line 48 ¶ | skipping to change at page 65, line 20 ¶ | |||
| 7.18.2. Authorization Server as Open Redirector | 7.18.2. Authorization Server as Open Redirector | |||
| Just as with clients, attackers could try to utilize a user's trust | Just as with clients, attackers could try to utilize a user's trust | |||
| in the authorization server (and its URL in particular) for | in the authorization server (and its URL in particular) for | |||
| performing phishing attacks. OAuth authorization servers regularly | performing phishing attacks. OAuth authorization servers regularly | |||
| redirect users to other web sites (the clients), but must do so in a | redirect users to other web sites (the clients), but must do so in a | |||
| safe way. | safe way. | |||
| Section 4.1.2.1 already prevents open redirects by stating that the | Section 4.1.2.1 already prevents open redirects by stating that the | |||
| AS MUST NOT automatically redirect the user agent in case of an | AS MUST NOT automatically redirect the user agent in case of an | |||
| invalid combination of "client_id" and "redirect_uri". | invalid combination of client_id and redirect_uri. | |||
| However, an attacker could also utilize a correctly registered | However, an attacker could also utilize a correctly registered | |||
| redirect URI to perform phishing attacks. The attacker could, for | redirect URI to perform phishing attacks. The attacker could, for | |||
| example, register a client via dynamic client registration [RFC7591] | example, register a client via dynamic client registration [RFC7591] | |||
| and intentionally send an erroneous authorization request, e.g., by | and intentionally send an erroneous authorization request, e.g., by | |||
| using an invalid scope value, thus instructing the AS to redirect the | using an invalid scope value, thus instructing the AS to redirect the | |||
| user agent to its phishing site. | user agent to its phishing site. | |||
| The AS MUST take precautions to prevent this threat. Based on its | The AS MUST take precautions to prevent this threat. Based on its | |||
| risk assessment, the AS needs to decide whether it can trust the | risk assessment, the AS needs to decide whether it can trust the | |||
| skipping to change at page 67, line 28 ¶ | skipping to change at page 65, line 49 ¶ | |||
| To protect against a compromised or malicious authorization server | To protect against a compromised or malicious authorization server | |||
| attacking another authorization server used by the same app, it is | attacking another authorization server used by the same app, it is | |||
| REQUIRED that a unique redirect URI is used for each authorization | REQUIRED that a unique redirect URI is used for each authorization | |||
| server used by the app (for example, by varying the path component), | server used by the app (for example, by varying the path component), | |||
| and that authorization responses are rejected if the redirect URI | and that authorization responses are rejected if the redirect URI | |||
| they were received on doesn't match the redirect URI in an outgoing | they were received on doesn't match the redirect URI in an outgoing | |||
| authorization request. | authorization request. | |||
| The native app MUST store the redirect URI used in the authorization | The native app MUST store the redirect URI used in the authorization | |||
| request with the authorization session data (i.e., along with "state" | request with the authorization session data (i.e., along with state | |||
| and other related data) and MUST verify that the URI on which the | and other related data) and MUST verify that the URI on which the | |||
| authorization response was received exactly matches it. | authorization response was received exactly matches it. | |||
| The requirement of Section 7.3, specifically that authorization | The requirement of Section 7.3, specifically that authorization | |||
| servers reject requests with URIs that don't match what was | servers reject requests with URIs that don't match what was | |||
| registered, is also required to prevent such attacks. | registered, is also required to prevent such attacks. | |||
| 7.20. Embedded User Agents in Native Apps | 7.20. Embedded User Agents in Native Apps | |||
| Embedded user agents are a technically possible method for | Embedded user agents are a technically possible method for | |||
| skipping to change at page 68, line 25 ¶ | skipping to change at page 66, line 44 ¶ | |||
| site first. | site first. | |||
| Aside from the security concerns, embedded user agents do not share | Aside from the security concerns, embedded user agents do not share | |||
| the authentication state with other apps or the browser, requiring | the authentication state with other apps or the browser, requiring | |||
| the user to log in for every authorization request, which is often | the user to log in for every authorization request, which is often | |||
| considered an inferior user experience. | considered an inferior user experience. | |||
| 7.21. Other Recommendations | 7.21. Other Recommendations | |||
| Authorization servers SHOULD NOT allow clients to influence their | Authorization servers SHOULD NOT allow clients to influence their | |||
| "client_id" or "sub" value or any other claim if that can cause | client_id or sub value or any other claim if that can cause confusion | |||
| confusion with a genuine resource owner (see | with a genuine resource owner (see (#client_impersonating)). | |||
| (#client_impersonating)). | ||||
| 8. Native Applications | 8. Native Applications | |||
| Native applications are clients installed and executed on the device | Native applications are clients installed and executed on the device | |||
| used by the resource owner (i.e., desktop application, native mobile | used by the resource owner (i.e., desktop application, native mobile | |||
| application). Native applications require special consideration | application). Native applications require special consideration | |||
| related to security, platform capabilities, and overall end-user | related to security, platform capabilities, and overall end-user | |||
| experience. | experience. | |||
| The authorization endpoint requires interaction between the client | The authorization endpoint requires interaction between the client | |||
| skipping to change at page 70, line 24 ¶ | skipping to change at page 68, line 46 ¶ | |||
| client's server, the redirect URI used by a native app returns the | client's server, the redirect URI used by a native app returns the | |||
| response to the app. Several options for a redirect URI that will | response to the app. Several options for a redirect URI that will | |||
| return the authorization response to the native app in different | return the authorization response to the native app in different | |||
| platforms are documented in Section 8.3. Any redirect URI that | platforms are documented in Section 8.3. Any redirect URI that | |||
| allows the app to receive the URI and inspect its parameters is | allows the app to receive the URI and inspect its parameters is | |||
| viable. | viable. | |||
| After constructing the authorization request URI, the app uses | After constructing the authorization request URI, the app uses | |||
| platform-specific APIs to open the URI in an external user agent. | platform-specific APIs to open the URI in an external user agent. | |||
| Typically, the external user agent used is the default browser, that | Typically, the external user agent used is the default browser, that | |||
| is, the application configured for handling "http" and "https" scheme | is, the application configured for handling http and https scheme | |||
| URIs on the system; however, different browser selection criteria and | URIs on the system; however, different browser selection criteria and | |||
| other categories of external user agents MAY be used. | other categories of external user agents MAY be used. | |||
| This best practice focuses on the browser as the RECOMMENDED external | This best practice focuses on the browser as the RECOMMENDED external | |||
| user agent for native apps. An external user agent designed | user agent for native apps. An external user agent designed | |||
| specifically for user authorization and capable of processing | specifically for user authorization and capable of processing | |||
| authorization requests and responses like a browser MAY also be used. | authorization requests and responses like a browser MAY also be used. | |||
| Other external user agents, such as a native app provided by the | Other external user agents, such as a native app provided by the | |||
| authorization server may meet the criteria set out in this best | authorization server may meet the criteria set out in this best | |||
| practice, including using the same redirect URI properties, but their | practice, including using the same redirect URI properties, but their | |||
| skipping to change at page 71, line 16 ¶ | skipping to change at page 69, line 35 ¶ | |||
| least the three redirect URI options described in the following | least the three redirect URI options described in the following | |||
| subsections to native apps. Native apps MAY use whichever redirect | subsections to native apps. Native apps MAY use whichever redirect | |||
| option suits their needs best, taking into account platform-specific | option suits their needs best, taking into account platform-specific | |||
| implementation details. | implementation details. | |||
| 8.3.1. Private-Use URI Scheme Redirection | 8.3.1. Private-Use URI Scheme Redirection | |||
| Many mobile and desktop computing platforms support inter-app | Many mobile and desktop computing platforms support inter-app | |||
| communication via URIs by allowing apps to register private-use URI | communication via URIs by allowing apps to register private-use URI | |||
| schemes (sometimes colloquially referred to as "custom URL schemes") | schemes (sometimes colloquially referred to as "custom URL schemes") | |||
| like "com.example.app". When the browser or another app attempts to | like com.example.app. When the browser or another app attempts to | |||
| load a URI with a private-use URI scheme, the app that registered it | load a URI with a private-use URI scheme, the app that registered it | |||
| is launched to handle the request. | is launched to handle the request. | |||
| To perform an authorization request with a private-use URI scheme | To perform an authorization request with a private-use URI scheme | |||
| redirect, the native app launches the browser with a standard | redirect, the native app launches the browser with a standard | |||
| authorization request, but one where the redirect URI utilizes a | authorization request, but one where the redirect URI utilizes a | |||
| private-use URI scheme it registered with the operating system. | private-use URI scheme it registered with the operating system. | |||
| When choosing a URI scheme to associate with the app, apps MUST use a | When choosing a URI scheme to associate with the app, apps MUST use a | |||
| URI scheme based on a domain name under their control, expressed in | URI scheme based on a domain name under their control, expressed in | |||
| reverse order, as recommended by Section 3.8 of [RFC7595] for | reverse order, as recommended by Section 3.8 of [RFC7595] for | |||
| private-use URI schemes. | private-use URI schemes. | |||
| For example, an app that controls the domain name "app.example.com" | For example, an app that controls the domain name app.example.com can | |||
| can use "com.example.app" as their scheme. Some authorization | use com.example.app as their scheme. Some authorization servers | |||
| servers assign client identifiers based on domain names, for example, | assign client identifiers based on domain names, for example, | |||
| "client1234.usercontent.example.net", which can also be used as the | client1234.usercontent.example.net, which can also be used as the | |||
| domain name for the scheme when reversed in the same manner. A | domain name for the scheme when reversed in the same manner. A | |||
| scheme such as "myapp", however, would not meet this requirement, as | scheme such as myapp, however, would not meet this requirement, as it | |||
| it is not based on a domain name. | is not based on a domain name. | |||
| When there are multiple apps by the same publisher, care must be | When there are multiple apps by the same publisher, care must be | |||
| taken so that each scheme is unique within that group. On platforms | taken so that each scheme is unique within that group. On platforms | |||
| that use app identifiers based on reverse-order domain names, those | that use app identifiers based on reverse-order domain names, those | |||
| identifiers can be reused as the private-use URI scheme for the OAuth | identifiers can be reused as the private-use URI scheme for the OAuth | |||
| redirect to help avoid this problem. | redirect to help avoid this problem. | |||
| Following the requirements of Section 3.2 of [RFC3986], as there is | Following the requirements of Section 3.2 of [RFC3986], as there is | |||
| no naming authority for private-use URI scheme redirects, only a | no naming authority for private-use URI scheme redirects, only a | |||
| single slash ("/") appears after the scheme component. A complete | single slash (/) appears after the scheme component. A complete | |||
| example of a redirect URI utilizing a private-use URI scheme is: | example of a redirect URI utilizing a private-use URI scheme is: | |||
| com.example.app:/oauth2redirect/example-provider | com.example.app:/oauth2redirect/example-provider | |||
| When the authorization server completes the request, it redirects to | When the authorization server completes the request, it redirects to | |||
| the client's redirect URI as it would normally. As the redirect URI | the client's redirect URI as it would normally. As the redirect URI | |||
| uses a private-use URI scheme, it results in the operating system | uses a private-use URI scheme, it results in the operating system | |||
| launching the native app, passing in the URI as a launch parameter. | launching the native app, passing in the URI as a launch parameter. | |||
| Then, the native app uses normal processing for the authorization | Then, the native app uses normal processing for the authorization | |||
| response. | response. | |||
| 8.3.2. Claimed "https" Scheme URI Redirection | 8.3.2. Claimed "https" Scheme URI Redirection | |||
| Some operating systems allow apps to claim "https" scheme [RFC7230] | Some operating systems allow apps to claim https scheme [RFC7230] | |||
| URIs in the domains they control. When the browser encounters a | URIs in the domains they control. When the browser encounters a | |||
| claimed URI, instead of the page being loaded in the browser, the | claimed URI, instead of the page being loaded in the browser, the | |||
| native app is launched with the URI supplied as a launch parameter. | native app is launched with the URI supplied as a launch parameter. | |||
| Such URIs can be used as redirect URIs by native apps. They are | Such URIs can be used as redirect URIs by native apps. They are | |||
| indistinguishable to the authorization server from a regular web- | indistinguishable to the authorization server from a regular web- | |||
| based client redirect URI. An example is: | based client redirect URI. An example is: | |||
| https://app.example.com/oauth2redirect/example-provider | https://app.example.com/oauth2redirect/example-provider | |||
| As the redirect URI alone is not enough to distinguish public native | As the redirect URI alone is not enough to distinguish public native | |||
| app clients from confidential web clients, it is REQUIRED in | app clients from confidential web clients, it is REQUIRED in | |||
| Section 7.3 that the client type be recorded during client | Section 7.3 that the client type be recorded during client | |||
| registration to enable the server to determine the client type and | registration to enable the server to determine the client type and | |||
| act accordingly. | act accordingly. | |||
| App-claimed "https" scheme redirect URIs have some advantages | App-claimed https scheme redirect URIs have some advantages compared | |||
| compared to other native app redirect options in that the identity of | to other native app redirect options in that the identity of the | |||
| the destination app is guaranteed to the authorization server by the | destination app is guaranteed to the authorization server by the | |||
| operating system. For this reason, native apps SHOULD use them over | operating system. For this reason, native apps SHOULD use them over | |||
| the other options where possible. | the other options where possible. | |||
| 8.3.3. Loopback Interface Redirection | 8.3.3. Loopback Interface Redirection | |||
| Native apps that are able to open a port on the loopback network | Native apps that are able to open a port on the loopback network | |||
| interface without needing special permissions (typically, those on | interface without needing special permissions (typically, those on | |||
| desktop operating systems) can use the loopback interface to receive | desktop operating systems) can use the loopback interface to receive | |||
| the OAuth redirect. | the OAuth redirect. | |||
| Loopback redirect URIs use the "http" scheme and are constructed with | Loopback redirect URIs use the http scheme and are constructed with | |||
| the loopback IP literal and whatever port the client is listening on. | the loopback IP literal and whatever port the client is listening on. | |||
| That is, "http://127.0.0.1:{port}/{path}" for IPv4, and | That is, http://127.0.0.1:{port}/{path} for IPv4, and | |||
| "http://[::1]:{port}/{path}" for IPv6. An example redirect using the | http://[::1]:{port}/{path} for IPv6. An example redirect using the | |||
| IPv4 loopback interface with a randomly assigned port: | IPv4 loopback interface with a randomly assigned port: | |||
| http://127.0.0.1:51004/oauth2redirect/example-provider | http://127.0.0.1:51004/oauth2redirect/example-provider | |||
| An example redirect using the IPv6 loopback interface with a randomly | An example redirect using the IPv6 loopback interface with a randomly | |||
| assigned port: | assigned port: | |||
| http://[::1]:61023/oauth2redirect/example-provider | http://[::1]:61023/oauth2redirect/example-provider | |||
| While redirect URIs using the name localhost (i.e., | ||||
| http://localhost:{port}/{path}) function similarly to loopback IP | ||||
| redirects, the use of localhost is NOT RECOMMENDED. Specifying a | ||||
| redirect URI with the loopback IP literal rather than localhost | ||||
| avoids inadvertently listening on network interfaces other than the | ||||
| loopback interface. It is also less susceptible to client-side | ||||
| firewalls and misconfigured host name resolution on the user's | ||||
| device. | ||||
| The authorization server MUST allow any port to be specified at the | The authorization server MUST allow any port to be specified at the | |||
| time of the request for loopback IP redirect URIs, to accommodate | time of the request for loopback IP redirect URIs, to accommodate | |||
| clients that obtain an available ephemeral port from the operating | clients that obtain an available ephemeral port from the operating | |||
| system at the time of the request. | system at the time of the request. | |||
| Clients SHOULD NOT assume that the device supports a particular | Clients SHOULD NOT assume that the device supports a particular | |||
| version of the Internet Protocol. It is RECOMMENDED that clients | version of the Internet Protocol. It is RECOMMENDED that clients | |||
| attempt to bind to the loopback interface using both IPv4 and IPv6 | attempt to bind to the loopback interface using both IPv4 and IPv6 | |||
| and use whichever is available. | and use whichever is available. | |||
| skipping to change at page 74, line 5 ¶ | skipping to change at page 72, line 39 ¶ | |||
| A non-normative list of changes from OAuth 2.0 is listed below: | A non-normative list of changes from OAuth 2.0 is listed below: | |||
| * The authorization code grant is extended with the functionality | * The authorization code grant is extended with the functionality | |||
| from PKCE ([RFC7636]) such that the default method of using the | from PKCE ([RFC7636]) such that the default method of using the | |||
| authorization code grant according to this specification requires | authorization code grant according to this specification requires | |||
| the addition of the PKCE parameters | the addition of the PKCE parameters | |||
| * Redirect URIs must be compared using exact string matching as per | * Redirect URIs must be compared using exact string matching as per | |||
| Section 4.1.3 of [I-D.ietf-oauth-security-topics] | Section 4.1.3 of [I-D.ietf-oauth-security-topics] | |||
| * The Implicit grant ("response_type=token") is omitted from this | * The Implicit grant (response_type=token) is omitted from this | |||
| specification as per Section 2.1.2 of | specification as per Section 2.1.2 of | |||
| [I-D.ietf-oauth-security-topics] | [I-D.ietf-oauth-security-topics] | |||
| * The Resource Owner Password Credentials grant is omitted from this | * The Resource Owner Password Credentials grant is omitted from this | |||
| specification as per Section 2.4 of | specification as per Section 2.4 of | |||
| [I-D.ietf-oauth-security-topics] | [I-D.ietf-oauth-security-topics] | |||
| * Bearer token usage omits the use of bearer tokens in the query | * Bearer token usage omits the use of bearer tokens in the query | |||
| string of URIs as per Section 4.3.2 of | string of URIs as per Section 4.3.2 of | |||
| [I-D.ietf-oauth-security-topics] | [I-D.ietf-oauth-security-topics] | |||
| skipping to change at page 78, line 8 ¶ | skipping to change at page 76, line 48 ¶ | |||
| [I-D.ietf-oauth-par] | [I-D.ietf-oauth-par] | |||
| Lodderstedt, T., Campbell, B., Sakimura, N., Tonge, D., | Lodderstedt, T., Campbell, B., Sakimura, N., Tonge, D., | |||
| and F. Skokan, "OAuth 2.0 Pushed Authorization Requests", | and F. Skokan, "OAuth 2.0 Pushed Authorization Requests", | |||
| Work in Progress, Internet-Draft, draft-ietf-oauth-par-10, | Work in Progress, Internet-Draft, draft-ietf-oauth-par-10, | |||
| 29 July 2021, <https://www.ietf.org/archive/id/draft-ietf- | 29 July 2021, <https://www.ietf.org/archive/id/draft-ietf- | |||
| oauth-par-10.txt>. | oauth-par-10.txt>. | |||
| [I-D.ietf-oauth-rar] | [I-D.ietf-oauth-rar] | |||
| Lodderstedt, T., Richer, J., and B. Campbell, "OAuth 2.0 | Lodderstedt, T., Richer, J., and B. Campbell, "OAuth 2.0 | |||
| Rich Authorization Requests", Work in Progress, Internet- | Rich Authorization Requests", Work in Progress, Internet- | |||
| Draft, draft-ietf-oauth-rar-05, 15 May 2021, | Draft, draft-ietf-oauth-rar-07, 12 September 2021, | |||
| <https://www.ietf.org/archive/id/draft-ietf-oauth-rar- | <https://www.ietf.org/archive/id/draft-ietf-oauth-rar- | |||
| 05.txt>. | 07.txt>. | |||
| [I-D.ietf-oauth-token-binding] | [I-D.ietf-oauth-token-binding] | |||
| Jones, M. B., Campbell, B., Bradley, J., and W. Denniss, | Jones, M. B., Campbell, B., Bradley, J., and W. Denniss, | |||
| "OAuth 2.0 Token Binding", Work in Progress, Internet- | "OAuth 2.0 Token Binding", Work in Progress, Internet- | |||
| Draft, draft-ietf-oauth-token-binding-08, 19 October 2018, | Draft, draft-ietf-oauth-token-binding-08, 19 October 2018, | |||
| <https://www.ietf.org/archive/id/draft-ietf-oauth-token- | <https://www.ietf.org/archive/id/draft-ietf-oauth-token- | |||
| binding-08.txt>. | binding-08.txt>. | |||
| [NIST800-63] | [NIST800-63] | |||
| Burr, W., Dodson, D., Newton, E., Perlner, R., Polk, T., | Burr, W., Dodson, D., Newton, E., Perlner, R., Polk, T., | |||
| skipping to change at page 80, line 34 ¶ | skipping to change at page 79, line 30 ¶ | |||
| NQSCHAR = %x20-21 / %x23-5B / %x5D-7E | NQSCHAR = %x20-21 / %x23-5B / %x5D-7E | |||
| UNICODECHARNOCRLF = %x09 /%x20-7E / %x80-D7FF / | UNICODECHARNOCRLF = %x09 /%x20-7E / %x80-D7FF / | |||
| %xE000-FFFD / %x10000-10FFFF | %xE000-FFFD / %x10000-10FFFF | |||
| (The UNICODECHARNOCRLF definition is based upon the Char definition | (The UNICODECHARNOCRLF definition is based upon the Char definition | |||
| in Section 2.2 of [W3C.REC-xml-20081126], but omitting the Carriage | in Section 2.2 of [W3C.REC-xml-20081126], but omitting the Carriage | |||
| Return and Linefeed characters.) | Return and Linefeed characters.) | |||
| A.1. "client_id" Syntax | A.1. "client_id" Syntax | |||
| The "client_id" element is defined in Section 2.4.1: | The client_id element is defined in Section 2.4.1: | |||
| client-id = *VSCHAR | client-id = *VSCHAR | |||
| A.2. "client_secret" Syntax | A.2. "client_secret" Syntax | |||
| The "client_secret" element is defined in Section 2.4.1: | The client_secret element is defined in Section 2.4.1: | |||
| client-secret = *VSCHAR | client-secret = *VSCHAR | |||
| A.3. "response_type" Syntax | A.3. "response_type" Syntax | |||
| The "response_type" element is defined in Section 4.1.1 and | The response_type element is defined in Section 4.1.1 and | |||
| Section 6.4: | Section 6.4: | |||
| response-type = response-name *( SP response-name ) | response-type = response-name *( SP response-name ) | |||
| response-name = 1*response-char | response-name = 1*response-char | |||
| response-char = "_" / DIGIT / ALPHA | response-char = "_" / DIGIT / ALPHA | |||
| A.4. "scope" Syntax | A.4. "scope" Syntax | |||
| The "scope" element is defined in Section 3.2.2.1: | The scope element is defined in Section 3.2.2.1: | |||
| scope = scope-token *( SP scope-token ) | scope = scope-token *( SP scope-token ) | |||
| scope-token = 1*NQCHAR | scope-token = 1*NQCHAR | |||
| A.5. "state" Syntax | A.5. "state" Syntax | |||
| The "state" element is defined in Section 4.1.1, Section 4.1.2, and | The state element is defined in Section 4.1.1, Section 4.1.2, and | |||
| Section 4.1.2.1: | Section 4.1.2.1: | |||
| state = 1*VSCHAR | state = 1*VSCHAR | |||
| A.6. "redirect_uri" Syntax | A.6. "redirect_uri" Syntax | |||
| The "redirect_uri" element is defined in Section 4.1.1, and | The redirect_uri element is defined in Section 4.1.1, and | |||
| Section 4.1.3: | Section 4.1.3: | |||
| redirect-uri = URI-reference | redirect-uri = URI-reference | |||
| A.7. "error" Syntax | A.7. "error" Syntax | |||
| The "error" element is defined in Sections Section 4.1.2.1, | The error element is defined in Sections Section 4.1.2.1, | |||
| Section 3.2.3.1, 7.2, and 8.5: | Section 3.2.3.1, 7.2, and 8.5: | |||
| error = 1*NQSCHAR | error = 1*NQSCHAR | |||
| A.8. "error_description" Syntax | A.8. "error_description" Syntax | |||
| The "error_description" element is defined in Sections | The error_description element is defined in Sections Section 4.1.2.1, | |||
| Section 4.1.2.1, Section 3.2.3.1, and Section 5.3: | Section 3.2.3.1, and Section 5.3: | |||
| error-description = 1*NQSCHAR | error-description = 1*NQSCHAR | |||
| A.9. "error_uri" Syntax | A.9. "error_uri" Syntax | |||
| The "error_uri" element is defined in Sections Section 4.1.2.1, | The error_uri element is defined in Sections Section 4.1.2.1, | |||
| Section 3.2.3.1, and 7.2: | Section 3.2.3.1, and 7.2: | |||
| error-uri = URI-reference | error-uri = URI-reference | |||
| A.10. "grant_type" Syntax | A.10. "grant_type" Syntax | |||
| The "grant_type" element is defined in Section Section 3.2.2: | The grant_type element is defined in Section Section 3.2.2: | |||
| grant-type = grant-name / URI-reference | grant-type = grant-name / URI-reference | |||
| grant-name = 1*name-char | grant-name = 1*name-char | |||
| name-char = "-" / "." / "_" / DIGIT / ALPHA | name-char = "-" / "." / "_" / DIGIT / ALPHA | |||
| A.11. "code" Syntax | A.11. "code" Syntax | |||
| The "code" element is defined in Section 4.1.3: | The code element is defined in Section 4.1.3: | |||
| code = 1*VSCHAR | code = 1*VSCHAR | |||
| A.12. "access_token" Syntax | A.12. "access_token" Syntax | |||
| The "access_token" element is defined in Section 3.2.3: | The access_token element is defined in Section 3.2.3: | |||
| access-token = 1*VSCHAR | access-token = 1*VSCHAR | |||
| A.13. "token_type" Syntax | A.13. "token_type" Syntax | |||
| The "token_type" element is defined in Section 3.2.3, and | The token_type element is defined in Section 3.2.3, and Section 6.1: | |||
| Section 6.1: | ||||
| token-type = type-name / URI-reference | token-type = type-name / URI-reference | |||
| type-name = 1*name-char | type-name = 1*name-char | |||
| name-char = "-" / "." / "_" / DIGIT / ALPHA | name-char = "-" / "." / "_" / DIGIT / ALPHA | |||
| A.14. "expires_in" Syntax | A.14. "expires_in" Syntax | |||
| The "expires_in" element is defined in Section 3.2.3: | The expires_in element is defined in Section 3.2.3: | |||
| expires-in = 1*DIGIT | expires-in = 1*DIGIT | |||
| A.15. "refresh_token" Syntax | A.15. "refresh_token" Syntax | |||
| The "refresh_token" element is defined in Section 3.2.3 and | The refresh_token element is defined in Section 3.2.3 and | |||
| Section 4.3: | Section 4.3: | |||
| refresh-token = 1*VSCHAR | refresh-token = 1*VSCHAR | |||
| A.16. Endpoint Parameter Syntax | A.16. Endpoint Parameter Syntax | |||
| The syntax for new endpoint parameters is defined in Section 6.2: | The syntax for new endpoint parameters is defined in Section 6.2: | |||
| param-name = 1*name-char | param-name = 1*name-char | |||
| name-char = "-" / "." / "_" / DIGIT / ALPHA | name-char = "-" / "." / "_" / DIGIT / ALPHA | |||
| A.17. "code_verifier" Syntax | A.17. "code_verifier" Syntax | |||
| ABNF for "code_verifier" is as follows. | ABNF for code_verifier is as follows. | |||
| code-verifier = 43*128unreserved | code-verifier = 43*128unreserved | |||
| unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | |||
| ALPHA = %x41-5A / %x61-7A | ALPHA = %x41-5A / %x61-7A | |||
| DIGIT = %x30-39 | DIGIT = %x30-39 | |||
| A.18. "code_challenge" Syntax | A.18. "code_challenge" Syntax | |||
| ABNF for "code_challenge" is as follows. | ABNF for code_challenge is as follows. | |||
| code-challenge = 43*128unreserved | code-challenge = 43*128unreserved | |||
| unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | |||
| ALPHA = %x41-5A / %x61-7A | ALPHA = %x41-5A / %x61-7A | |||
| DIGIT = %x30-39 | DIGIT = %x30-39 | |||
| Appendix B. Use of application/x-www-form-urlencoded Media Type | Appendix B. Use of application/x-www-form-urlencoded Media Type | |||
| At the time of publication of this specification, the "application/x- | At the time of publication of this specification, the application/x- | |||
| www-form-urlencoded" media type was defined in Section 17.13.4 of | www-form-urlencoded media type was defined in Section 17.13.4 of | |||
| [W3C.REC-html401-19991224] but not registered in the IANA MIME Media | [W3C.REC-html401-19991224] but not registered in the IANA MIME Media | |||
| Types registry (http://www.iana.org/assignments/media-types | Types registry (http://www.iana.org/assignments/media-types | |||
| (http://www.iana.org/assignments/media-types)). Furthermore, that | (http://www.iana.org/assignments/media-types)). Furthermore, that | |||
| definition is incomplete, as it does not consider non-US-ASCII | definition is incomplete, as it does not consider non-US-ASCII | |||
| characters. | characters. | |||
| To address this shortcoming when generating payloads using this media | To address this shortcoming when generating payloads using this media | |||
| type, names and values MUST be encoded using the UTF-8 character | type, names and values MUST be encoded using the UTF-8 character | |||
| encoding scheme [RFC3629] first; the resulting octet sequence then | encoding scheme [RFC3629] first; the resulting octet sequence then | |||
| needs to be further encoded using the escaping rules defined in | needs to be further encoded using the escaping rules defined in | |||
| skipping to change at page 85, line 30 ¶ | skipping to change at page 84, line 21 ¶ | |||
| * [I-D.ietf-oauth-par]: Pushed Authorization Requests | * [I-D.ietf-oauth-par]: Pushed Authorization Requests | |||
| - The Pushed Authorization Requests extension describes a | - The Pushed Authorization Requests extension describes a | |||
| technique of initiating an OAuth flow from the back channel, | technique of initiating an OAuth flow from the back channel, | |||
| providing better security and more flexibility for building | providing better security and more flexibility for building | |||
| complex authorization requests. | complex authorization requests. | |||
| * [I-D.ietf-oauth-rar]: Rich Authorization Requests | * [I-D.ietf-oauth-rar]: Rich Authorization Requests | |||
| - Rich Authorization Requests specifies a new parameter | - Rich Authorization Requests specifies a new parameter | |||
| "authorization_details" that is used to carry fine-grained | authorization_details that is used to carry fine-grained | |||
| authorization data in the OAuth authorization request. | authorization data in the OAuth authorization request. | |||
| Appendix D. Acknowledgements | Appendix D. Acknowledgements | |||
| TBD | TBD | |||
| Appendix E. Document History | Appendix E. Document History | |||
| [[ To be removed from the final specification ]] | [[ To be removed from the final specification ]] | |||
| -04 | ||||
| * Added explicit mention of not sending access tokens in URI query strings | ||||
| * Clarifications on definition of client types | ||||
| * Consolidated text around loopback vs localhost | ||||
| * Editorial clarifications throughout the document | ||||
| -03 | -03 | |||
| * refactored structure | * refactoring to collect all the grant types under the same top-level header in section 4 | |||
| * Better split normative and security consideration text into the appropriate places, both moving text that was really security considerations out of the main part of the document, as well as pulling normative requirements from the security considerations sections into the appropriate part of the main document | ||||
| * Incorporated many of the published errata on RFC6749 | ||||
| * Updated references to various RFCs | ||||
| * Editorial clarifications throughout the document | ||||
| -02 | -02 | |||
| -01 | -01 | |||
| -00 | -00 | |||
| * initial revision | * initial revision | |||
| Authors' Addresses | Authors' Addresses | |||
| Dick Hardt | Dick Hardt | |||
| SignIn.Org | Hellō | |||
| Email: dick.hardt@gmail.com | Email: dick.hardt@gmail.com | |||
| Aaron Parecki | Aaron Parecki | |||
| Okta | Okta | |||
| Email: aaron@parecki.com | Email: aaron@parecki.com | |||
| URI: https://aaronparecki.com | URI: https://aaronparecki.com | |||
| Torsten Lodderstedt | Torsten Lodderstedt | |||
| End of changes. 195 change blocks. | ||||
| 436 lines changed or deleted | 454 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/ | ||||