73
The OAuth 2.0 Authorization Protocol Abstract The OAuth 2.0 authorization protocol enables a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf. This specification replaces and obsoletes the OAuth 1.0 protocol described in RFC 5849. Authors: 1. Eran Hammer (editor) [email protected] 2. David Recordon, Facebook [email protected] 3. Dick Hardt, Microsoft [email protected]

The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

  • Upload
    lehanh

  • View
    224

  • Download
    4

Embed Size (px)

Citation preview

Page 1: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The OAuth 2.0 AuthorizationProtocolAbstractThe OAuth 2.0 authorization protocol enables a third-party application to obtainlimited access to an HTTP service, either on behalf of a resource owner byorchestrating an approval interaction between the resource owner and the HTTPservice, or by allowing the third-party application to obtain access on its own behalf.This specification replaces and obsoletes the OAuth 1.0 protocol described in RFC5849.

Authors:

1. Eran Hammer (editor) [email protected]. David Recordon, Facebook [email protected]. Dick Hardt, Microsoft [email protected]

www.princexml.com
Prince - Non-commercial License
This document was created with Prince, a great way of getting web content onto paper.
Page 2: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Introduction....................................................................................................................4▪ Roles .........................................................................................................................5▪ Protocol Flow ............................................................................................................6▪ Authorization Grant ...................................................................................................7▪ Access Token............................................................................................................8▪ Refresh Token ...........................................................................................................9▪ TLS Version .............................................................................................................11▪ Interoperability ........................................................................................................12▪ Notational Conventions...........................................................................................12Client Registration........................................................................................................13▪ Client Types ............................................................................................................13▪ Client Identifier ........................................................................................................15▪ Client Authentication...............................................................................................15▪ Unregistered Clients................................................................................................16Protocol Endpoints ......................................................................................................17▪ Authorization Endpoint............................................................................................17▪ Token Endpoint .......................................................................................................20▪ Access Token Scope ..............................................................................................22Obtaining Authorization................................................................................................23▪ Authorization Code Grant .......................................................................................23▪ Implicit Grant...........................................................................................................30▪ Resource Owner Password Credentials Grant .......................................................36▪ Client Credentials Grant..........................................................................................39▪ Extension Grants.....................................................................................................41Issuing an Access Token .............................................................................................43▪ Successful Response..............................................................................................43▪ Error Response .......................................................................................................44Refreshing an Access Token .......................................................................................47

Accessing Protected Resources..................................................................................49▪ Access Token Types ...............................................................................................49Extensibility ..................................................................................................................51▪ Defining Access Token Types.................................................................................51▪ Defining New Endpoint Parameters ........................................................................51▪ Defining New Authorization Grant Types ................................................................52

ii

Page 3: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

▪ Defining New Authorization Endpoint Response Types .........................................52▪ Defining Additional Error Codes..............................................................................52Native Applications ......................................................................................................54

Security Considerations ...............................................................................................56▪ Client Authentication...............................................................................................15▪ Client Impersonation ...............................................................................................56▪ Access Tokens........................................................................................................57▪ Refresh Tokens .......................................................................................................57▪ Authorization Codes................................................................................................58▪ Authorization Code Redirection URI Manipulation .................................................59▪ Resource Owner Password Credentials ...................................................................8▪ Request Confidentiality ...........................................................................................60▪ Endpoints Authenticity ............................................................................................60▪ Credentials Guessing Attacks.................................................................................60▪ Phishing Attacks .....................................................................................................61▪ Cross-Site Request Forgery....................................................................................61▪ Clickjacking .............................................................................................................62▪ Code Injection and Input Validation ........................................................................62▪ Open Redirectors ....................................................................................................63IANA Considerations....................................................................................................64▪ The OAuth Access Token Type Registry ................................................................64▪ The OAuth Parameters Registry .............................................................................65▪ The OAuth Authorization Endpoint Response Type Registry .................................69▪ The OAuth Extensions Error Registry......................................................................70Acknowledgements......................................................................................................72

Chapter 1: Abstract

iii

Page 4: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

2. IntroductionIn the traditional client-server authentication model, the client requests an accessrestricted resource (protected resource) on the server by authenticating with theserver using the resource owner's credentials. In order to provide third-partyapplications access to restricted resources, the resource owner shares its credentialswith the third-party. This creates several problems and limitations:

• Third-party applications are required to store the resource owner's credentials forfuture use, typically a password in clear-text.

• Servers are required to support password authentication, despite the securityweaknesses created by passwords.

• Third-party applications gain overly broad access to the resource owner'sprotected resources, leaving resource owners without any ability to restrictduration or access to a limited subset of resources.

• Resource owners cannot revoke access to an individual third-party withoutrevoking access to all third-parties, and must do so by changing their password.

• Compromise of any third-party application results in compromise of the end-user's password and all of the data protected by that password.

OAuth addresses these issues by introducing an authorization layer and separatingthe role of the client from that of the resource owner. In OAuth, the client requestsaccess to resources controlled by the resource owner and hosted by the resourceserver, and is issued a different set of credentials than those of the resource owner.

Instead of using the resource owner's credentials to access protected resources, theclient obtains an access token - a string denoting a specific scope, lifetime, and otheraccess attributes. Access tokens are issued to third-party clients by an authorizationserver with the approval of the resource owner. The client uses the access token toaccess the protected resources hosted by the resource server.

For example, an end-user (resource owner) can grant a printing service (client) accessto her protected photos stored at a photo sharing service (resource server), withoutsharing her username and password with the printing service. Instead, sheauthenticates directly with a server trusted by the photo sharing service (authorization

OAuth 2.0

4

Page 5: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

server) which issues the printing service delegation-specific credentials (accesstoken).

This specification is designed for use with HTTP RFC2616. The use of OAuth with anytransport protocol other than HTTP is undefined.

2.1. RolesOAuth defines four roles:

resource ownerAn entity capable of granting access to a protected resource. When the resourceowner is a person, it is refered to as an end-user.

resource serverThe server hosting the protected resources, capable of accepting and responding toprotected resource requests using access tokens.

clientAn application making protected resource requests on behalf of the resource ownerand with its authorization. The term client does not imply any particularimplementation characteristics (e.g. whether the application executes on a server, adesktop, or other devices).

authorization serverThe server issuing access tokens to the client after successfully authenticating theresource owner and obtaining authorization.

The interaction between the authorization server and resource server is beyond thescope of this specification. The authorization server may be the same server as theresource server or a separate entity. A single authorization server may issue accesstokens accepted by multiple resource servers.

Chapter 2: Introduction

5

Page 6: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

2.2. Protocol FlowAbstract Protocol Flow

+--------+ +---------------+| |--(A)- Authorization Request ->| Resource || | | Owner || |<-(B)-- Authorization Grant ---| || | +---------------+| || | +---------------+| |--(C)-- Authorization Grant -->| Authorization || Client | | Server || |<-(D)----- Access Token -------| || | +---------------+| || | +---------------+| |--(E)----- Access Token ------>| Resource || | | Server || |<-(F)--- Protected Resource ---| |+--------+ +---------------+

The abstract flow illustrated in Abstract Protocol Flow describes the interactionbetween the four roles and includes the following steps:

A. The client requests authorization from the resource owner. The authorizationrequest can be made directly to the resource owner (as shown), or preferablyindirectly via the authorization server as an intermediary.

B. The client receives an authorization grant which is a credential representing theresource owner's authorization, expressed using one of four grant types definedin this specification or using an extension grant type. The authorization grant typedepends on the method used by the client to request authorization and the typessupported by the authorization server.

C. The client requests an access token by authenticating with the authorizationserver and presenting the authorization grant.

D. The authorization server authenticates the client and validates the authorizationgrant, and if valid issues an access token.

OAuth 2.0

6

Page 7: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

E. The client requests the protected resource from the resource server andauthenticates by presenting the access token.

F. The resource server validates the access token, and if valid, serves the request.

2.3. Authorization GrantAn authorization grant is a credential representing the resource owner's authorization(to access its protected resources) used by the client to obtain an access token. Thisspecification defines four grant types: authorization code, implicit, resource ownerpassword credentials, and client credentials, as well as an extensibility mechanism fordefining additional types.

2.3.1. Authorization CodeThe authorization code is obtained by using an authorization server as anintermediary between the client and resource owner. Instead of requestingauthorization directly from the resource owner, the client directs the resource ownerto an authorization server (via its user-agent as defined in RFC2616), which in turndirects the resource owner back to the client with the authorization code.

Before directing the resource owner back to the client with the authorization code, theauthorization server authenticates the resource owner and obtains authorization.Because the resource owner only authenticates with the authorization server, theresource owner's credentials are never shared with the client.

The authorization code provides a few important security benefits such as the abilityto authenticate the client, and the transmission of the access token directly to theclient without passing it through the resource owner's user-agent, potentiallyexposing it to others, including the resource owner.

2.3.2. ImplicitThe implicit grant is a simplified authorization code flow optimized for clientsimplemented in a browser using a scripting language such as JavaScript. In theimplicit flow, instead of issuing the client an authorization code, the client is issued anaccess token directly (as the result of the resource owner authorization). The granttype is implicit as no intermediate credentials (such as an authorization code) areissued (and later used to obtain an access token).

When issuing an access token during the implicit grant flow, the authorization serverdoes not authenticate the client. In some cases, the client identity can be verified viathe redirection URI used to deliver the access token to the client. The access token

Chapter 2: Introduction

7

Page 8: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

may be exposed to the resource owner or other applications with access to theresource owner's user-agent.

Implicit grants improve the responsiveness and efficiency of some clients (such as aclient implemented as an in-browser application) since it reduces the number ofround trips required to obtain an access token. However, this convenience should beweighed against the security implications of using implicit grants, especially when theauthorization code grant type is available.

2.3.3. Resource Owner Password CredentialsThe resource owner password credentials (i.e. username and password) can be useddirectly as an authorization grant to obtain an access token. The credentials shouldonly be used when there is a high degree of trust between the resource owner andthe client (e.g. the client is part of the device operating system or a highly privilegedapplication), and when other authorization grant types are not available (such as anauthorization code).

Even though this grant type requires direct client access to the resource ownercredentials, the resource owner credentials are used for a single request and areexchanged for an access token. This grant type can eliminate the need for the clientto store the resource owner credentials for future use, by exchanging the credentialswith a long-lived access token or refresh token.

2.3.4. Client CredentialsThe client credentials (or other forms of client authentication) can be used as anauthorization grant when the authorization scope is limited to the protected resourcesunder the control of the client, or to protected resources previously arranged with theauthorization server. Client credentials are used as an authorization grant typicallywhen the client is acting on its own behalf (the client is also the resource owner), or isrequesting access to protected resources based on an authorization previouslyarranged with the authorization server.

2.4. Access TokenAccess tokens are credentials used to access protected resources. An access tokenis a string representing an authorization issued to the client. The string is usuallyopaque to the client. Tokens represent specific scopes and durations of access,granted by the resource owner, and enforced by the resource server andauthorization server.

OAuth 2.0

8

Page 9: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The token may denote an identifier used to retrieve the authorization information, orself-contain the authorization information in a verifiable manner (i.e. a token stringconsisting of some data and a signature). Additional authentication credentials, whichare beyond the scope of this specification, may be required in order for the client touse a token.

The access token provides an abstraction layer, replacing different authorizationconstructs (e.g. username and password) with a single token understood by theresource server. This abstraction enables issuing access tokens more restrictive thanthe authorization grant used to obtain them, as well as removing the resource server'sneed to understand a wide range of authentication methods.

Access tokens can have different formats, structures, and methods of utilization (e.g.cryptographic properties) based on the resource server security requirements. Accesstoken attributes and the methods used to access protected resources are beyond thescope of this specification and are defined by companion specifications.

2.5. Refresh TokenRefresh tokens are credentials used to obtain access tokens. Refresh tokens areissued to the client by the authorization server and are used to obtain a new accesstoken when the current access token becomes invalid or expires, or to obtainadditional access tokens with identical or narrower scope (access tokens may have ashorter lifetime and fewer permissions than authorized by the resource owner).Issuing a refresh token is optional at the discretion of the authorization server. If theauthorization server issues a refresh token, it is included when issuing an accesstoken.

A refresh token is a string representing the authorization granted to the client by theresource owner. The string is usually opaque to the client. The token denotes anidentifier used to retrieve the authorization information. Unlike access tokens, refreshtokens are intended for use only with authorization servers and are never sent toresource servers.

Chapter 2: Introduction

9

Page 10: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Refreshing an Expired Access Token

+--------++---------------+| |--(A)------- Authorization Grant--------->| || || || |<-(B)----------- Access Token-------------| || | & Refresh Token| || || || | +----------+| || |--(C)---- Access Token ---->| || || | | || || |<-(D)- Protected Resource --| Resource | |Authorization || Client | | Server | |Server || |--(E)---- Access Token ---->| || || | | || || |<-(F)- Invalid Token Error -| || || | +----------+| || || || |--(G)----------- Refresh Token----------->| || |

OAuth 2.0

10

Page 11: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

| || |<-(H)----------- Access Token-------------| |+--------+ & Optional Refresh Token+---------------+

The flow illustrated in Refreshing an Expired Access Token includes the followingsteps:

A. The client requests an access token by authenticating with the authorizationserver, and presenting an authorization grant.

B. The authorization server authenticates the client and validates the authorizationgrant, and if valid issues an access token and a refresh token.

C. The client makes a protected resource request to the resource server bypresenting the access token.

D. The resource server validates the access token, and if valid, serves the request.

E. Steps (C) and (D) repeat until the access token expires. If the client knows theaccess token expired, it skips to step (G), otherwise it makes another protectedresource request.

F. Since the access token is invalid, the resource server returns an invalid tokenerror.

G. The client requests a new access token by authenticating with the authorizationserver and presenting the refresh token. The client authentication requirementsare based on the client type and on the authorization server policies.

H. The authorization server authenticates the client and validates the refresh token,and if valid issues a new access token (and optionally, a new refresh token).

Steps C, D, E, and F are outside the scope of this specification as described inAccessing Protected Resources.

2.6. TLS VersionWhenever TLS is required by this specification, the appropriate version (or versions)of TLS will vary over time, based on the widespread deployment and known securityvulnerabilities. At the time of this writing, TLS version 1.2 RFC5246 is the most recent

Chapter 2: Introduction

11

Page 12: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

version, but has a very limited deployment base and might not be readily available forimplementation. TLS version 1.0 RFC2246 is the most widely deployed version, andwill provide the broadest interoperability.

Implementations MAY also support additional transport-layer mechanisms that meettheir security requirements.

2.7. InteroperabilityOAuth 2.0 provides a rich authorization framework with well-defined securityproperties. However, as a rich and highly extensible framework with many optionalcomponents, on its own, this specification is likely to produce a wide range of non-interoperable implementations. In addition, this specification leaves a few requiredcomponents partially or fully undefined (e.g. client registration, authorization servercapabilities, endpoint discovery).

This protocol was designed with the clear expectation that future work will defineprescriptive profiles and extensions necessary to achieve full web-scaleinteroperability.

2.8. Notational ConventionsThe key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT','SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in thisspecification are to be interpreted as described in RFC2119.

This specification uses the Augmented Backus-Naur Form (ABNF) notation ofRFC5234.

Certain security-related terms are to be understood in the sense defined in RFC4949.These terms include, but are not limited to, 'attack', 'authentication', 'authorization','certificate', 'confidentiality', 'credential', 'encryption', 'identity', 'sign', 'signature','trust', 'validate', and 'verify'.

Unless otherwise noted, all the protocol parameter names and values are casesensitive.

OAuth 2.0

12

Page 13: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

3. Client RegistrationBefore initiating the protocol, the client registers with the authorization server. Themeans through which the client registers with the authorization server are beyond thescope of this specification, but typically involve end-user interaction with an HTMLregistration form.

Client registration does not require a direct interaction between the client and theauthorization server. When supported by the authorization server, registration can relyon other means for establishing trust and obtaining the required client properties (e.g.redirection URI, client type). For example, registration can be accomplished using aself-issued or third-party-issued assertion, or by the authorization server performingclient discovery using a trusted channel.

When registering a client, the client developer:

• specifies the client type as described in Client Types,

• provides its client redirection URIs as described in Redirection Endpoint, and

• includes any other information required by the authorization server (e.g.application name, website, description, logo image, the acceptance of legalterms).

3.1. Client TypesOAuth defines two client types, based on their ability to authenticate securely with theauthorization server (i.e. ability to maintain the confidentiality of their clientcredentials):

confidentialClients capable of maintaining the confidentiality of their credentials (e.g. clientimplemented on a secure server with restricted access to the client credentials), orcapable of secure client authentication using other means.

publicClients incapable of maintaining the confidentiality of their credentials (e.g. clientsexecuting on the device used by the resource owner such as an installed nativeapplication or a web browser-based application), and incapable of secure clientauthentication via any other means.

Chapter 3: Client Registration

13

Page 14: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The client type designation is based on the authorization server's definition of secureauthentication and its acceptable exposure levels of client credentials.

The authorization server SHOULD NOT make assumptions about the client type, noraccept the type information provided by the client developer without first establishingtrust.

A client application consisting of multiple components, each with its own client type(e.g. a distributed client with both a confidential server-based component and apublic browser-based component), MUST register each component separately as adifferent client to ensure proper handling by the authorization server. Theauthorization server MAY provider tools to manage such complex clients through asingle administration interface.

This specification has been designed around the following client profiles:

web applicationA web application is a confidential client running on a web server. Resource ownersaccess the client via an HTML user interface rendered in a user-agent on the deviceused by the resource owner. The client credentials as well as any access tokenissued to the client are stored on the web server and are not exposed to oraccessible by the resource owner.

user-agent-based applicationA user-agent-based application is a public client in which the client code isdownloaded from a web server and executes within a user-agent (e.g. web browser)on the device used by the resource owner. Protocol data and credentials are easilyaccessible (and often visible) to the resource owner. Since such applications residewithin the user-agent, they can make seamless use of the user-agent capabilitieswhen requesting authorization.

native applicationA native application is a public client installed and executed on the device used bythe resource owner. Protocol data and credentials are accessible to the resourceowner. It is assumed that any client authentication credentials included in theapplication can be extracted. On the other hand, dynamically issued credentialssuch as access tokens or refresh tokens can receive an acceptable level ofprotection. At a minimum, these credentials are protected from hostile servers withwhich the application may interact with. On some platforms these credentials mightbe protected from other applications residing on the same device.

OAuth 2.0

14

Page 15: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

3.2. Client IdentifierThe authorization server issues the registered client a client identifier - a unique stringrepresenting the registration information provided by the client. The client identifier isnot a secret, it is exposed to the resource owner, and MUST NOT be used alone forclient authentication.

3.3. Client AuthenticationIf the client type is confidential, the client and authorization server establish a clientauthentication method suitable for the security requirements of the authorizationserver. The authorization server MAY accept any form of client authentication meetingits security requirements.

Confidential clients are typically issued (or establish) a set of client credentials usedfor authenticating with the authorization server (e.g. password, public/private keypair).

The authorization server MAY establish a client authentication method with publicclients. However, the authorization server MUST NOT rely on public clientauthentication for the purpose of identifying the client.

The client MUST NOT use more than one authentication method in each request.

3.3.1. Client PasswordClients in possession of a client password MAY use the HTTP Basic authenticationscheme as defined in RFC2617 to authenticate with the authorization server. Theclient identifier is used as the username, and the client password is used as thepassword. The authorization server MUST support the HTTP Basic authenticationscheme for authenticating clients which were issued a client password.

For example (extra line breaks are for display purposes only):

Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3

Alternatively, the authorization server MAY support including the client credentials inthe request body using the following parameters:

client_idREQUIRED. The client identifier issued to the client during the registration processdescribed by Client Identifier.

Chapter 3: Client Registration

15

Page 16: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

client_secretREQUIRED. The client secret. The client MAY omit the parameter if the client secretis an empty string.

Including the client credentials in the request body using the two parameters is NOTRECOMMENDED, and should be limited to clients unable to directly utilize the HTTPBasic authentication scheme (or other password-based HTTP authenticationschemes). The parameters can only be transmitted in the request body and MUSTNOT be included in the request URI.

For example, requesting to refresh an access token (Refreshing an Access Token)using the body parameters (extra line breaks are for display purposes only):

POST /token HTTP/1.1Host: server.example.comContent-Type: application/x-www-form-urlencoded;charset=UTF-8

grant_type=refresh_token&refresh_token=tGzv3JOkF0XG5Qx2TlKWIA&client_id=s6BhdRkqt3&client_secret=7Fjfp0ZBr1KtDRbnfVdmIw

The authorization server MUST require TLS as described in TLS Version whensending requests using password authentication.

Since this client authentication method involves a password, the authorization serverMUST protect any endpoint utilizing it against brute force attacks.

3.3.2. Other Authentication MethodsThe authorization server MAY support any suitable HTTP authentication schemematching its security requirements. When using other authentication methods, theauthorization server MUST define a mapping between the client identifier (registrationrecord) and authentication scheme.

3.4. Unregistered ClientsThis specification does not exclude the use of unregistered clients. However, the usewith such clients is beyond the scope of this specification, and requires additionalsecurity analysis and review of its interoperability impact.

OAuth 2.0

16

Page 17: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

4. Protocol EndpointsThe authorization process utilizes two authorization server endpoints (HTTPresources):

• Authorization endpoint - used by the client to obtain authorization from theresource owner via user-agent redirection.

• Token endpoint - used by the client to exchange an authorization grant for anaccess token, typically with client authentication.

As well as one client endpoint:

• Redirection endpoint - used by the authorization server to return authorizationcredentials responses to the client via the resource owner user-agent.

Not every authorization grant type utilizes both endpoints. Extension grant types MAYdefine additional endpoints as needed.

4.1. Authorization EndpointThe authorization endpoint is used to interact with the resource owner and obtain anauthorization grant. The authorization server MUST first verify the identity of theresource owner. The way in which the authorization server authenticates the resourceowner (e.g. username and password login, session cookies) is beyond the scope ofthis specification.

The means through which the client obtains the location of the authorization endpointare beyond the scope of this specification, but the location is typically provided in theservice documentation.

The endpoint URI MAY include an application/x-www-form-urlencoded formatted(W3C.REC-html401-19991224) query component (RFC3986 section 3.4), whichMUST be retained when adding additional query parameters. The endpoint URIMUST NOT include a fragment component.

Since requests to the authorization endpoint result in user authentication and thetransmission of clear-text credentials (in the HTTP response), the authorization serverMUST require TLS as described in TLS Version when sending requests to theauthorization endpoint.

Chapter 4: Protocol Endpoints

17

Page 18: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The authorization server MUST support the use of the HTTP GET method RFC2616for the authorization endpoint, and MAY support the use of the POST method as well.

Parameters sent without a value MUST be treated as if they were omitted from therequest. The authorization server MUST ignore unrecognized request parameters.Request and response parameters MUST NOT be included more than once.

4.1.1. Response TypeThe authorization endpoint is used by the authorization code grant type and implicitgrant type flows. The client informs the authorization server of the desired grant typeusing the following parameter:

response_typeREQUIRED. The value MUST be one of code for requesting an authorization codeas described by Authorization Request, token for requesting an access token(implicit grant) as described by Authorization Request, or a registered extensionvalue as described by Defining New Authorization Endpoint Response Types.

Extension response types MAY contain a space-delimited (%x20) list of values, wherethe order of values does not matter (e.g. response type a b is the same as b a). Themeaning of such composite response types is defined by their respectivespecifications.

If an authorization request is missing the response_type parameter, or if the responsetype is not understood, the authorization server MUST return an error response asdescribed in Error Response.

4.1.2. Redirection EndpointAfter completing its interaction with the resource owner, the authorization serverdirects the resource owner's user-agent back to the client. The authorization serverredirects the user-agent to the client's redirection endpoint previously establishedwith the authorization server during the client registration process or when making theauthorization request.

The redirection endpoint URI MUST be an absolute URI as defined by RFC3986section 4.3. The endpoint URI MAY include an application/x-www-form-urlencodedformatted (W3C.REC-html401-19991224) query component (RFC3986 section 3.4),which MUST be retained when adding additional query parameters. The endpoint URIMUST NOT include a fragment component.

OAuth 2.0

18

Page 19: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Endpoint Request ConfidentialityThe redirection endpoint SHOULD require the use of TLS as described in TLS Versionwhen the requested response type is code or token, or when the redirection requestwill result in the transmission of sensitive credentials over an open network. Thisspecification does not mandate the use of TLS because at the time of this writing,requiring clients to deploy TLS is a significant hurdle for many client developers. IfTLS is not available, the authorization server SHOULD warn the resource owner aboutthe insecure endpoint prior to redirection.

Lack of transport-layer security can have a severe impact on the security of the clientand the protected resources it is authorized to access. The use of transport-layersecurity is particularly critical when the authorization process is used as a form ofdelegated end-user authentication by the client (e.g. third-party sign-in service).

Registration RequirementsThe authorization server MUST require the following clients to register theirredirection endpoint:

• Public clients.

• Confidential clients utilizing the implicit grant type.

The authorization server SHOULD require all clients to register their redirectionendpoint prior to utilizing the authorization endpoint

The authorization server SHOULD require the client to provide the completeredirection URI (the client MAY use the state request parameter to achieve per-request customization). If requiring the registration of the complete redirection URI isnot possible, the authorization server SHOULD require the registration of the URIscheme, authority, and path (allowing the client to dynamically vary only the querycomponent of the redirection URI when requesting authorization).

The authorization server MAY allow the client to register multiple redirectionendpoints.

Lack of a redirection URI registration requirement can enable an attacker to use theauthorization endpoint as open redirector as described in Open Redirectors.

Dynamic ConfigurationIf multiple redirection URIs have been registered, if only part of the redirection URIhas been registered, or if no redirection URI has been registered, the client MUST

Chapter 4: Protocol Endpoints

19

Page 20: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

include a redirection URI with the authorization request using the redirect_uri requestparameter.

When a redirection URI is included in an authorization request, the authorizationserver MUST compare and match the value received against at least one of theregistered redirection URIs (or URI components) as defined in RFC3986 section 6, ifany redirection URIs were registered. If the client registration included the fullredirection URI, the authorization server MUST compare the two URIs using simplestring comparison as defined in RFC3986 section 6.2.1.

Invalid EndpointIf an authorization request fails validation due to a missing, invalid, or mismatchingredirection URI, the authorization server SHOULD inform the resource owner of theerror, and MUST NOT automatically redirect the user-agent to the invalid redirectionURI.

Endpoint ContentThe redirection request to the client's endpoint typically results in an HTML documentresponse, processed by the user-agent. If the HTML response is served directly asthe result of the redirection request, any script included in the HTML document willexecute with full access to the redirection URI and the credentials it contains.

The client SHOULD NOT include any third-party scripts (e.g. third-party analytics,social plug-ins, ad networks) in the redirection endpoint response. Instead, itSHOULD extract the credentials from the URI and redirect the user-agent again toanother endpoint without exposing the credentials (in the URI or elsewhere). If third-party scripts are included, the client MUST ensure that its own scripts (used to extractand remove the credentials from the URI) will execute first.

4.2. Token EndpointThe token endpoint is used by the client to obtain an access token by presenting itsauthorization grant or refresh token. The token endpoint is used with everyauthorization grant except for the implicit grant type (since an access token is issueddirectly).

The means through which the client obtains the location of the token endpoint arebeyond the scope of this specification but is typically provided in the servicedocumentation.

OAuth 2.0

20

Page 21: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The endpoint URI MAY include an application/x-www-form-urlencoded formatted(W3C.REC-html401-19991224) query component (RFC3986 section 3.4), whichMUST be retained when adding additional query parameters. The endpoint URIMUST NOT include a fragment component.

Since requests to the token endpoint result in the transmission of clear-textcredentials (in the HTTP request and response), the authorization server MUSTrequire TLS as described in TLS Version when sending requests to the tokenendpoint.

The client MUST use the HTTP POST method when making access token requests.

Parameters sent without a value MUST be treated as if they were omitted from therequest. The authorization server MUST ignore unrecognized request parameters.Request and response parameters MUST NOT be included more than once.

4.2.1. Client AuthenticationConfidential clients or other clients issued client credentials MUST authenticate withthe authorization server as described in Client Authentication when making requeststo the token endpoint. Client authentication is used for:

• Enforcing the binding of refresh tokens and authorization codes to the client theywere issued to. Client authentication is critical when an authorization code istransmitted to the redirection endpoint over an insecure channel, or when theredirection URI has not been registered in full.

• Recovering from a compromised client by disabling the client or changing itscredentials, thus preventing an attacker from abusing stolen refresh tokens.Changing a single set of client credentials is significantly faster than revoking anentire set of refresh tokens.

• Implementing authentication management best practices which require periodiccredential rotation. Rotation of an entire set of refresh tokens can be challenging,while rotation of a single set of client credentials is significantly easier.

A public client that was not issued a client password MAY use the client_id requestparameter to identify itself when sending requests to the token endpoint (e.g. for thepurpose of providing end-user context, client usage statistics).

Chapter 4: Protocol Endpoints

21

Page 22: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

4.3. Access Token ScopeThe authorization and token endpoints allow the client to specify the scope of theaccess request using the scope request parameter. In turn, the authorization serveruses the scope response parameter to inform the client of the scope of the accesstoken issued.

The value of the scope parameter is expressed as a list of space-delimited, casesensitive strings. The strings are defined by the authorization server. If the valuecontains multiple space-delimited strings, their order does not matter, and each stringadds an additional access range to the requested scope.

scope = scope-token *( SP scope-token )scope-token = 1*( %x21 / %x23-5B / %x5D-7E )

The authorization server MAY fully or partially ignore the scope requested by theclient based on the authorization server policy or the resource owner's instructions. Ifthe issued access token scope is different from the one requested by the client, theauthorization server MUST include the scope response parameter to inform the clientof the actual scope granted.

If the client omits the scope parameter when requesting authorization, theauthorization server MUST either process the request using a pre-defined defaultvalue, or fail the request indicating an invalid scope. The authorization serverSHOULD document its scope requirements and default value (if defined).

OAuth 2.0

22

Page 23: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

5. Obtaining AuthorizationTo request an access token, the client obtains authorization from the resource owner.The authorization is expressed in the form of an authorization grant which the clientuses to request the access token. OAuth defines four grant types: authorization code,implicit, resource owner password credentials, and client credentials. It also providesan extension mechanism for defining additional grant types.

5.1. Authorization Code GrantThe authorization code grant type is used to obtain both access tokens and refreshtokens and is optimized for confidential clients. As a redirection-based flow, the clientmust be capable of interacting with the resource owner's user-agent (typically a webbrowser) and capable of receiving incoming requests (via redirection) from theauthorization server.

Chapter 5: Obtaining Authorization

23

Page 24: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Authorization Code Flow

+----------+| resource || owner || |+----------+

^|

(B)+----|-----+ Client Identifier +---------------+| -+----(A)-- & Redirection URI ---->| || User- | | Authorization || Agent -+----(B)-- User authenticates --->| Server || | | || -+----(C)-- Authorization Code ---<| |+-|----|---+ +---------------+

| | ^ v(A) (C) | || | | |^ v | |

+---------+ | || |>---(D)-- Authorization Code ---------' || Client | & Redirection URI || | || |<---(E)----- Access Token -------------------'+---------+ (w/ Optional Refresh Token)

Note: The lines illustrating steps A, B, and C are broken into two parts as they passthrough the user-agent.

The flow illustrated in Authorization Code Flow includes the following steps:

A. The client initiates the flow by directing the resource owner's user-agent to theauthorization endpoint. The client includes its client identifier, requested scope,local state, and a redirection URI to which the authorization server will send theuser-agent back once access is granted (or denied).

OAuth 2.0

24

Page 25: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

B. The authorization server authenticates the resource owner (via the user-agent)and establishes whether the resource owner grants or denies the client's accessrequest.

C. Assuming the resource owner grants access, the authorization server redirectsthe user-agent back to the client using the redirection URI provided earlier (in therequest or during client registration). The redirection URI includes anauthorization code and any local state provided by the client earlier.

D. The client requests an access token from the authorization server's tokenendpoint by including the authorization code received in the previous step. Whenmaking the request, the client authenticates with the authorization server. Theclient includes the redirection URI used to obtain the authorization code forverification.

E. The authorization server authenticates the client, validates the authorization code,and ensures the redirection URI received matches the URI used to redirect theclient in step (C). If valid, the authorization server responds back with an accesstoken and optionally, a refresh token.

5.1.1. Authorization RequestThe client constructs the request URI by adding the following parameters to the querycomponent of the authorization endpoint URI using the application/x-www-form-urlencoded format as defined by W3C.REC-html401-19991224:

response_typeREQUIRED. Value MUST be set to code.

client_idREQUIRED. The client identifier as described in Client Identifier.

redirect_uriOPTIONAL. As described in Redirection Endpoint.

scopeOPTIONAL. The scope of the access request as described by Access Token Scope.

stateRECOMMENDED. An opaque value used by the client to maintain state between therequest and callback. The authorization server includes this value when redirecting

Chapter 5: Obtaining Authorization

25

Page 26: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

the user-agent back to the client. The parameter SHOULD be used for preventingcross-site request forgery as described in Cross-Site Request Forgery.

The client directs the resource owner to the constructed URI using an HTTPredirection response, or by other means available to it via the user-agent.

For example, the client directs the user-agent to make the following HTTP requestusing TLS (extra line breaks are for display purposes only):

GET /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/

1.1Host: server.example.com

The authorization server validates the request to ensure all required parameters arepresent and valid. If the request is valid, the authorization server authenticates theresource owner and obtains an authorization decision (by asking the resource owneror by establishing approval via other means).

When a decision is established, the authorization server directs the user-agent to theprovided client redirection URI using an HTTP redirection response, or by othermeans available to it via the user-agent.

5.1.2. Authorization ResponseIf the resource owner grants the access request, the authorization server issues anauthorization code and delivers it to the client by adding the following parameters tothe query component of the redirection URI using the application/x-www-form-urlencoded format:

codeREQUIRED. The authorization code generated by the authorization server. Theauthorization code MUST expire shortly after it is issued to mitigate the risk of leaks.A maximum authorization code lifetime of 10 minutes is RECOMMENDED. Theclient MUST NOT use the authorization code more than once. If an authorizationcode is used more than once, the authorization server MUST deny the request andSHOULD revoke (when possible) all tokens previously issued based on thatauthorization code. The authorization code is bound to the client identifier andredirection URI.

OAuth 2.0

26

Page 27: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

stateREQUIRED if the state parameter was present in the client authorization request.The exact value received from the client.

For example, the authorization server redirects the user-agent by sending thefollowing HTTP response:

HTTP/1.1 302 FoundLocation: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA

&state=xyz

The client MUST ignore unrecognized response parameters. The authorization codestring size is left undefined by this specification. The client should avoid makingassumptions about code value sizes. The authorization server should document thesize of any value it issues.

Error ResponseIf the request fails due to a missing, invalid, or mismatching redirection URI, or if theclient identifier is missing or invalid, the authorization server SHOULD inform theresource owner of the error, and MUST NOT automatically redirect the user-agent tothe invalid redirection URI.

If the resource owner denies the access request or if the request fails for reasonsother than a missing or invalid redirection URI, the authorization server informs theclient by adding the following parameters to the query component of the redirectionURI using the application/x-www-form-urlencoded format:

errorREQUIRED. A single error code from the following:

invalid_requestThe request is missing a required parameter, includes an invalid parameter value,or is otherwise malformed.

unauthorized_clientThe client is not authorized to request an authorization code using this method.

access_deniedThe resource owner or authorization server denied the request.

Chapter 5: Obtaining Authorization

27

Page 28: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

unsupported_response_typeThe authorization server does not support obtaining an authorization code usingthis method.

invalid_scopeThe requested scope is invalid, unknown, or malformed.

server_errorThe authorization server encountered an unexpected condition which prevented itfrom fulfilling the request.

temporarily_unavailableThe authorization server is currently unable to handle the request due to atemporary overloading or maintenance of the server.

error_descriptionOPTIONAL. A human-readable UTF-8 encoded text providing additional information,used to assist the client developer in understanding the error that occurred.

error_uriOPTIONAL. A URI identifying a human-readable web page with information aboutthe error, used to provide the client developer with additional information about theerror.

stateREQUIRED if a state parameter was present in the client authorization request. Theexact value received from the client.

For example, the authorization server redirects the user-agent by sending thefollowing HTTP response:

HTTP/1.1 302 FoundLocation: https://client.example.com/cb?error=access_denied&state=xyz

5.1.3. Access Token RequestThe client makes a request to the token endpoint by adding the following parametersusing the application/x-www-form-urlencoded format in the HTTP request entity-body:

OAuth 2.0

28

Page 29: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

grant_typeREQUIRED. Value MUST be set to authorization_code.

codeREQUIRED. The authorization code received from the authorization server.

redirect_uriREQUIRED, if the redirect_uri parameter was included in the authorization requestas described in Authorization Request, and their values MUST be identical.

If the client type is confidential or the client was issued client credentials (or assignedother authentication requirements), the client MUST authenticate with theauthorization server as described in Client Authentication.

For example, the client makes the following HTTP request using TLS (extra linebreaks are for display purposes only):

POST /token HTTP/1.1Host: server.example.comAuthorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JWContent-Type: application/x-www-form-urlencoded;charset=UTF-8

grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb

The authorization server MUST:

• require client authentication for confidential clients or for any client that wasissued client credentials (or with other authentication requirements),

• authenticate the client if client authentication is included and ensure theauthorization code was issued to the authenticated client,

• verify that the authorization code is valid, and

• ensure that the redirect_uri parameter is present if the redirect_uri parameter wasincluded in the initial authorization request as described in Authorization Request,and if included ensure their values are identical.

Chapter 5: Obtaining Authorization

29

Page 30: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

5.1.4. Access Token ResponseIf the access token request is valid and authorized, the authorization server issues anaccess token and optional refresh token as described in Successful Response. If therequest client authentication failed or is invalid, the authorization server returns anerror response as described in Error Response.

An example successful response:

HTTP/1.1 200 OKContent-Type: application/json;charset=UTF-8Cache-Control: no-storePragma: no-cache

{"access_token":"2YotnFZFEjr1zCsicMWpAA","token_type":"example","expires_in":3600,"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA","example_parameter":"example_value"

}

5.2. Implicit GrantThe implicit grant type is used to obtain access tokens (it does not support theissuance of refresh tokens) and is optimized for public clients known to operate aparticular redirection URI. These clients are typically implemented in a browser usinga scripting language such as JavaScript.

As a redirection-based flow, the client must be capable of interacting with theresource owner's user-agent (typically a web browser) and capable of receivingincoming requests (via redirection) from the authorization server.

Unlike the authorization code grant type in which the client makes separate requestsfor authorization and access token, the client receives the access token as the resultof the authorization request.

The implicit grant type does not include client authentication, and relies on thepresence of the resource owner and the registration of the redirection URI. Becausethe access token is encoded into the redirection URI, it may be exposed to theresource owner and other applications residing on the same device.

OAuth 2.0

30

Page 31: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Implicit Grant Flow

+----------+| Resource || Owner || |+----------+

^|

(B)+----|-----+ Client Identifier +---------------+| -+----(A)-- & Redirection URI --->| || User- | | Authorization || Agent -|----(B)-- User authenticates -->| Server || | | || |<---(C)--- Redirection URI ----<| || | with Access Token +---------------+| | in Fragment| | +---------------+| |----(D)--- Redirection URI ---->| Web-Hosted || | without Fragment | Client || | | Resource || (F) |<---(E)------- Script ---------<| || | +---------------++-|--------+

| |(A) (G) Access Token| |^ v

+---------+| || Client || |+---------+

Note: The lines illustrating steps A and B are broken into two parts as they passthrough the user-agent.

Chapter 5: Obtaining Authorization

31

Page 32: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The flow illustrated in Implicit Grant Flow includes the following steps:

A. The client initiates the flow by directing the resource owner's user-agent to theauthorization endpoint. The client includes its client identifier, requested scope,local state, and a redirection URI to which the authorization server will send theuser-agent back once access is granted (or denied).

B. The authorization server authenticates the resource owner (via the user-agent)and establishes whether the resource owner grants or denies the client's accessrequest.

C. Assuming the resource owner grants access, the authorization server redirectsthe user-agent back to the client using the redirection URI provided earlier. Theredirection URI includes the access token in the URI fragment.

D. The user-agent follows the redirection instructions by making a request to theweb-hosted client resource (which does not include the fragment per RFC2616).The user-agent retains the fragment information locally.

E. The web-hosted client resource returns a web page (typically an HTML documentwith an embedded script) capable of accessing the full redirection URI includingthe fragment retained by the user-agent, and extracting the access token (andother parameters) contained in the fragment.

F. The user-agent executes the script provided by the web-hosted client resourcelocally, which extracts the access token and passes it to the client.

5.2.1. Authorization RequestThe client constructs the request URI by adding the following parameters to the querycomponent of the authorization endpoint URI using the application/x-www-form-urlencoded format:

response_typeREQUIRED. Value MUST be set to token.

client_idREQUIRED. The client identifier as described in Client Identifier.

redirect_uriOPTIONAL. As described in Redirection Endpoint.

scopeOPTIONAL. The scope of the access request as described by Access Token Scope.

OAuth 2.0

32

Page 33: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

stateRECOMMENDED. An opaque value used by the client to maintain state between therequest and callback. The authorization server includes this value when redirectingthe user-agent back to the client. The parameter SHOULD be used for preventingcross-site request forgery as described in Cross-Site Request Forgery.

The client directs the resource owner to the constructed URI using an HTTPredirection response, or by other means available to it via the user-agent.

For example, the client directs the user-agent to make the following HTTP requestusing TLS (extra line breaks are for display purposes only):

GET /authorize?response_type=token&client_id=s6BhdRkqt3&state=xyz&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/

1.1Host: server.example.com

The authorization server validates the request to ensure all required parameters arepresent and valid. The authorization server MUST verify that the redirection URI towhich it will redirect the access token matches a redirection URI registered by theclient as described in Redirection Endpoint.

If the request is valid, the authorization server authenticates the resource owner andobtains an authorization decision (by asking the resource owner or by establishingapproval via other means).

When a decision is established, the authorization server directs the user-agent to theprovided client redirection URI using an HTTP redirection response, or by othermeans available to it via the user-agent.

5.2.2. Access Token ResponseIf the resource owner grants the access request, the authorization server issues anaccess token and delivers it to the client by adding the following parameters to thefragment component of the redirection URI using the application/x-www-form-urlencoded format:

access_tokenREQUIRED. The access token issued by the authorization server.

Chapter 5: Obtaining Authorization

33

Page 34: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

token_typeREQUIRED. The type of the token issued as described in Access Token Types.Value is case insensitive.

expires_inRECOMMENDED. The lifetime in seconds of the access token. For example, thevalue 3600 denotes that the access token will expire in one hour from the time theresponse was generated. If omitted, the authorization server SHOULD provide theexpiration time via other means or document the default value.

scopeOPTIONAL, if identical to the scope requested by the client, otherwise REQUIRED.The scope of the access token as described by Access Token Scope.

stateREQUIRED if the state parameter was present in the client authorization request.The exact value received from the client.

The authorization server MUST NOT issue a refresh token.

For example, the authorization server redirects the user-agent by sending thefollowing HTTP response (URI extra line breaks are for display purposes only):

HTTP/1.1 302 FoundLocation: http://example.com/cb#access_token=2YotnFZFEjr1zCsicMWpAA

&state=xyz&token_type=example&expires_in=3600

Developers should note that some user-agents do not support the inclusion of afragment component in the HTTP Location response header field. Such clients willrequire using other methods for redirecting the client than a 3xx redirection response.For example, returning an HTML page which includes a 'continue' button with anaction linked to the redirection URI.

The client MUST ignore unrecognized response parameters. The access token stringsize is left undefined by this specification. The client should avoid makingassumptions about value sizes. The authorization server should document the size ofany value it issues.

OAuth 2.0

34

Page 35: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Error ResponseIf the request fails due to a missing, invalid, or mismatching redirection URI, or if theclient identifier is missing or invalid, the authorization server SHOULD inform theresource owner of the error, and MUST NOT automatically redirect the user-agent tothe invalid redirection URI.

If the resource owner denies the access request or if the request fails for reasonsother than a missing or invalid redirection URI, the authorization server informs theclient by adding the following parameters to the fragment component of theredirection URI using the application/x-www-form-urlencoded format:

errorREQUIRED. A single error code from the following:

invalid_requestThe request is missing a required parameter, includes an invalid parameter value,or is otherwise malformed.

unauthorized_clientThe client is not authorized to request an access token using this method.

access_deniedThe resource owner or authorization server denied the request.

unsupported_response_typeThe authorization server does not support obtaining an access token using thismethod.

invalid_scopeThe requested scope is invalid, unknown, or malformed.

server_errorThe authorization server encountered an unexpected condition which prevented itfrom fulfilling the request.

temporarily_unavailableThe authorization server is currently unable to handle the request due to atemporary overloading or maintenance of the server.

Chapter 5: Obtaining Authorization

35

Page 36: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

error_descriptionOPTIONAL. A human-readable UTF-8 encoded text providing additional information,used to assist the client developer in understanding the error that occurred.

error_uriOPTIONAL. A URI identifying a human-readable web page with information aboutthe error, used to provide the client developer with additional information about theerror.

stateREQUIRED if a state parameter was present in the client authorization request. Theexact value received from the client.

For example, the authorization server redirects the user-agent by sending thefollowing HTTP response:

HTTP/1.1 302 FoundLocation: https://client.example.com/cb#error=access_denied&state=xyz

5.3. Resource Owner Password Credentials GrantThe resource owner password credentials grant type is suitable in cases where theresource owner has a trust relationship with the client, such as the device operatingsystem or a highly privileged application. The authorization server should take specialcare when enabling this grant type, and only allow it when other flows are not viable.

The grant type is suitable for clients capable of obtaining the resource owner'scredentials (username and password, typically using an interactive form). It is alsoused to migrate existing clients using direct authentication schemes such as HTTPBasic or Digest authentication to OAuth by converting the stored credentials to anaccess token.

OAuth 2.0

36

Page 37: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Resource Owner Password Credentials Flow

+----------+| Resource || Owner || |+----------+

v| Resource Owner

(A) Password Credentials|v

+---------+ +---------------+| |>--(B)---- Resource Owner ------->| || | Password Credentials | Authorization || Client | | Server || |<--(C)---- Access Token ---------<| || | (w/ Optional Refresh Token) | |+---------+ +---------------+

The flow illustrated in Resource Owner Password Credentials Flow includes thefollowing steps:

A. The resource owner provides the client with its username and password.

B. The client requests an access token from the authorization server's tokenendpoint by including the credentials received from the resource owner. Whenmaking the request, the client authenticates with the authorization server.

C. The authorization server authenticates the client and validates the resourceowner credentials, and if valid issues an access token.

5.3.1. Authorization Request and ResponseThe method through which the client obtains the resource owner credentials isbeyond the scope of this specification. The client MUST discard the credentials oncean access token has been obtained.

Chapter 5: Obtaining Authorization

37

Page 38: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

5.3.2. Access Token RequestThe client makes a request to the token endpoint by adding the following parametersusing the application/x-www-form-urlencoded format in the HTTP request entity-body:

grant_typeREQUIRED. Value MUST be set to password.

usernameREQUIRED. The resource owner username, encoded as UTF-8.

passwordREQUIRED. The resource owner password, encoded as UTF-8.

scopeOPTIONAL. The scope of the access request as described by Access Token Scope.

If the client type is confidential or the client was issued client credentials (or assignedother authentication requirements), the client MUST authenticate with theauthorization server as described in Client Authentication.

For example, the client makes the following HTTP request using transport-layersecurity (extra line breaks are for display purposes only):

POST /token HTTP/1.1Host: server.example.comAuthorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JWContent-Type: application/x-www-form-urlencoded;charset=UTF-8

grant_type=password&username=johndoe&password=A3ddj3w

The authorization server MUST:

• require client authentication for confidential clients or for any client that wasissued client credentials (or with other authentication requirements),

• authenticate the client if client authentication is included, and

• validate the resource owner password credentials.

OAuth 2.0

38

Page 39: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Since this access token request utilizes the resource owner's password, theauthorization server MUST protect the endpoint against brute force attacks (e.g.using rate-limitation or generating alerts).

5.3.3. Access Token ResponseIf the access token request is valid and authorized, the authorization server issues anaccess token and optional refresh token as described in Successful Response. If therequest failed client authentication or is invalid, the authorization server returns anerror response as described in Error Response.

An example successful response:

HTTP/1.1 200 OKContent-Type: application/json;charset=UTF-8Cache-Control: no-storePragma: no-cache

{"access_token":"2YotnFZFEjr1zCsicMWpAA","token_type":"example","expires_in":3600,"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA","example_parameter":"example_value"

}

5.4. Client Credentials GrantThe client can request an access token using only its client credentials (or othersupported means of authentication) when the client is requesting access to theprotected resources under its control, or those of another resource owner which hasbeen previously arranged with the authorization server (the method of which isbeyond the scope of this specification).

The client credentials grant type MUST only be used by confidential clients.

Chapter 5: Obtaining Authorization

39

Page 40: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Client Credentials Flow

+---------+ +---------------+| | | || |>--(A)- Client Authentication --->| Authorization || Client | | Server || |<--(B)---- Access Token ---------<| || | | |+---------+ +---------------+

The flow illustrated in Client Credentials Flow includes the following steps:

A. The client authenticates with the authorization server and requests an accesstoken from the token endpoint.

B. The authorization server authenticates the client, and if valid issues an accesstoken.

5.4.1. Authorization Request and ResponseSince the client authentication is used as the authorization grant, no additionalauthorization request is needed.

5.4.2. Access Token RequestThe client makes a request to the token endpoint by adding the following parametersusing the application/x-www-form-urlencoded format in the HTTP request entity-body:

grant_typeREQUIRED. Value MUST be set to client_credentials.

scopeOPTIONAL. The scope of the access request as described by Access Token Scope.

The client MUST authenticate with the authorization server as described in ClientAuthentication.

OAuth 2.0

40

Page 41: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

For example, the client makes the following HTTP request using transport-layersecurity (extra line breaks are for display purposes only):

POST /token HTTP/1.1Host: server.example.comAuthorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JWContent-Type: application/x-www-form-urlencoded;charset=UTF-8

grant_type=client_credentials

The authorization server MUST authenticate the client.

5.4.3. Access Token ResponseIf the access token request is valid and authorized, the authorization server issues anaccess token as described in Successful Response. A refresh token SHOULD NOTbe included. If the request failed client authentication or is invalid, the authorizationserver returns an error response as described in Error Response.

An example successful response:

HTTP/1.1 200 OKContent-Type: application/json;charset=UTF-8Cache-Control: no-storePragma: no-cache

{"access_token":"2YotnFZFEjr1zCsicMWpAA","token_type":"example","expires_in":3600,"example_parameter":"example_value"

}

5.5. Extension GrantsThe client uses an extension grant type by specifying the grant type using an absoluteURI (defined by the authorization server) as the value of the grant_type parameter ofthe token endpoint, and by adding any additional parameters necessary.

Chapter 5: Obtaining Authorization

41

Page 42: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

For example, to request an access token using a SAML 2.0 assertion grant type asdefined by I-D.ietf-oauth-saml2-bearer, the client makes the following HTTP requestusing TLS (line breaks are for display purposes only):

POST /token HTTP/1.1Host: server.example.comContent-Type: application/x-www-form-urlencoded;charset=UTF-8

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2-bearer&assertion=PEFzc2VydGlvbiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDU[...omitted for brevity...]aG5TdGF0ZW1lbnQ-PC9Bc3NlcnRpb24-

If the access token request is valid and authorized, the authorization server issues anaccess token and optional refresh token as described in Successful Response. If therequest failed client authentication or is invalid, the authorization server returns anerror response as described in Error Response.

OAuth 2.0

42

Page 43: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

6. Issuing an Access TokenIf the access token request is valid and authorized, the authorization server issues anaccess token and optional refresh token as described in Successful Response. If therequest failed client authentication or is invalid, the authorization server returns anerror response as described in Error Response.

6.1. Successful ResponseThe authorization server issues an access token and optional refresh token, andconstructs the response by adding the following parameters to the entity body of theHTTP response with a 200 (OK) status code:

access_tokenREQUIRED. The access token issued by the authorization server.

token_typeREQUIRED. The type of the token issued as described in Access Token Types.Value is case insensitive.

expires_inRECOMMENDED. The lifetime in seconds of the access token. For example, thevalue 3600 denotes that the access token will expire in one hour from the time theresponse was generated. If omitted, the authorization server SHOULD provide theexpiration time via other means or document the default value.

refresh_tokenOPTIONAL. The refresh token which can be used to obtain new access tokensusing the same authorization grant as described in Refreshing an Access Token.

scopeOPTIONAL, if identical to the scope requested by the client, otherwise REQUIRED.The scope of the access token as described by Access Token Scope.

The parameters are included in the entity body of the HTTP response using theapplication/json media type as defined by RFC4627. The parameters are serializedinto a JSON structure by adding each parameter at the highest structure level.Parameter names and string values are included as JSON strings. Numerical values

Chapter 6: Issuing an Access Token

43

Page 44: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

are included as JSON numbers. The order of parameters does not matter and canvary.

The authorization server MUST include the HTTP Cache-Control response headerfield RFC2616 with a value of no-store in any response containing tokens,credentials, or other sensitive information, as well as the Pragma response headerfield RFC2616 with a value of no-cache.

For example:

HTTP/1.1 200 OKContent-Type: application/json;charset=UTF-8Cache-Control: no-storePragma: no-cache

{"access_token":"2YotnFZFEjr1zCsicMWpAA","token_type":"example","expires_in":3600,"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA","example_parameter":"example_value"

}

The client MUST ignore unrecognized value names in the response. The sizes oftokens and other values received from the authorization server are left undefined. Theclient should avoid making assumptions about value sizes. The authorization servershould document the size of any value it issues.

6.2. Error ResponseThe authorization server responds with an HTTP 400 (Bad Request) status code andincludes the following parameters with the response:

errorREQUIRED. A single error code from the following:

invalid_requestThe request is missing a required parameter, includes an unsupported parametervalue (other than grant type), repeats a parameter, includes multiple credentials,utilizes more than one mechanism for authenticating the client, or is otherwisemalformed.

OAuth 2.0

44

Page 45: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

invalid_clientClient authentication failed (e.g. unknown client, no client authentication included,or unsupported authentication method). The authorization server MAY return anHTTP 401 (Unauthorized) status code to indicate which HTTP authenticationschemes are supported. If the client attempted to authenticate via theAuthorization request header field, the authorization server MUST respond with anHTTP 401 (Unauthorized) status code, and include the WWW-Authenticateresponse header field matching the authentication scheme used by the client.

invalid_grantThe provided authorization grant (e.g. authorization code, resource ownercredentials) or refresh token is invalid, expired, revoked, does not match theredirection URI used in the authorization request, or was issued to another client.

unauthorized_clientThe authenticated client is not authorized to use this authorization grant type.

unsupported_grant_typeThe authorization grant type is not supported by the authorization server.

invalid_scopeThe requested scope is invalid, unknown, malformed, or exceeds the scopegranted by the resource owner.

error_descriptionOPTIONAL. A human-readable UTF-8 encoded text providing additional information,used to assist the client developer in understanding the error that occurred.

error_uriOPTIONAL. A URI identifying a human-readable web page with information aboutthe error, used to provide the client developer with additional information about theerror.

The parameters are included in the entity body of the HTTP response using theapplication/json media type as defined by RFC4627. The parameters are serializedinto a JSON structure by adding each parameter at the highest structure level.Parameter names and string values are included as JSON strings. Numerical valuesare included as JSON numbers. The order of parameters does not matter and canvary.

Chapter 6: Issuing an Access Token

45

Page 46: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

For example:

HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8Cache-Control: no-storePragma: no-cache

{"error":"invalid_request"

}

OAuth 2.0

46

Page 47: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

7. Refreshing an Access TokenIf the authorization server issued a refresh token to the client, the client makes arefresh request to the token endpoint by adding the following parameters using theapplication/x-www-form-urlencoded format in the HTTP request entity-body:

grant_typeREQUIRED. Value MUST be set to refresh_token.

refresh_tokenREQUIRED. The refresh token issued to the client.

scopeOPTIONAL. The scope of the access request as described by Access Token Scope.The requested scope MUST NOT include any scope not originally granted by theresource owner, and if omitted is treated as equal to the scope originally granted bythe resource owner.

Because refresh tokens are typically long-lasting credentials used to requestadditional access tokens, the refresh token is bound to the client which it was issued.If the client type is confidential or the client was issued client credentials (or assignedother authentication requirements), the client MUST authenticate with theauthorization server as described in Client Authentication.

For example, the client makes the following HTTP request using transport-layersecurity (extra line breaks are for display purposes only):

POST /token HTTP/1.1Host: server.example.comAuthorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JWContent-Type: application/x-www-form-urlencoded;charset=UTF-8

grant_type=refresh_token&refresh_token=tGzv3JOkF0XG5Qx2TlKWIA

The authorization server MUST:

• require client authentication for confidential clients or for any client that wasissued client credentials (or with other authentication requirements),

Chapter 7: Refreshing an Access Token

47

Page 48: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

• authenticate the client if client authentication is included and ensure the refreshtoken was issued to the authenticated client, and

• validate the refresh token.

If valid and authorized, the authorization server issues an access token as describedin Successful Response. If the request failed verification or is invalid, the authorizationserver returns an error response as described in Error Response.

The authorization server MAY issue a new refresh token, in which case the clientMUST discard the old refresh token and replace it with the new refresh token. Theauthorization server MAY revoke the old refresh token after issuing a new refreshtoken to the client. If a new refresh token is issued, the refresh token scope MUST beidentical to that of the refresh token included by the client in the request.

OAuth 2.0

48

Page 49: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

8. Accessing Protected ResourcesThe client accesses protected resources by presenting the access token to theresource server. The resource server MUST validate the access token and ensure ithas not expired and that its scope covers the requested resource. The methods usedby the resource server to validate the access token (as well as any error responses)are beyond the scope of this specification, but generally involve an interaction orcoordination between the resource server and the authorization server.

The method in which the client utilized the access token to authenticate with theresource server depends on the type of access token issued by the authorizationserver. Typically, it involves using the HTTP Authorization request header fieldRFC2617 with an authentication scheme defined by the access token typespecification.

8.1. Access Token TypesThe access token type provides the client with the information required tosuccessfully utilize the access token to make a protected resource request (alongwith type-specific attributes). The client MUST NOT use an access token if it does notunderstand the token type.

For example, the bearer token type defined in I-D.ietf-oauth-v2-bearer is utilized bysimply including the access token string in the request:

GET /resource/1 HTTP/1.1Host: example.comAuthorization: Bearer 7Fjfp0ZBr1KtDRbnfVdmIw

Chapter 8: Accessing Protected Resources

49

Page 50: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

while the mac token type defined in I-D.ietf-oauth-v2-http-mac is utilized by issuing aMAC key together with the access token which is used to sign certain components ofthe HTTP requests:

GET /resource/1 HTTP/1.1Host: example.comAuthorization: MAC id="h480djs93hd8",

nonce="274312:dj83hs9s",mac="kDZvddkndxvhGRXZhvuDjEWhGeE="

The above examples are provided for illustration purposes only. Developers areadvised to consult the I-D.ietf-oauth-v2-bearer and I-D.ietf-oauth-v2-http-macspecifications before use.

Each access token type definition specifies the additional attributes (if any) sent to theclient together with the access_token response parameter. It also defines the HTTPauthentication method used to include the access token when making a protectedresource request.

OAuth 2.0

50

Page 51: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

9. Extensibility9.1. Defining Access Token TypesAccess token types can be defined in one of two ways: registered in the access tokentype registry (following the procedures in The OAuth Access Token Type Registry), orby using a unique absolute URI as its name.

Types utilizing a URI name SHOULD be limited to vendor-specific implementationsthat are not commonly applicable, and are specific to the implementation details ofthe resource server where they are used.

All other types MUST be registered. Type names MUST conform to the type-nameABNF. If the type definition includes a new HTTP authentication scheme, the typename SHOULD be identical to the HTTP authentication scheme name (as defined byRFC2617). The token type example is reserved for use in examples.

type-name = 1*name-charname-char = "-" / "." / "_" / DIGIT / ALPHA

9.2. Defining New Endpoint ParametersNew request or response parameters for use with the authorization endpoint or thetoken endpoint are defined and registered in the parameters registry following theprocedure in The OAuth Parameters Registry.

Parameter names MUST conform to the param-name ABNF and parameter valuessyntax MUST be well-defined (e.g., using ABNF, or a reference to the syntax of anexisting parameter).

param-name = 1*name-charname-char = "-" / "." / "_" / DIGIT / ALPHA

Unregistered vendor-specific parameter extensions that are not commonlyapplicable, and are specific to the implementation details of the authorization serverwhere they are used SHOULD utilize a vendor-specific prefix that is not likely toconflict with other registered values (e.g. begin with 'companyname_').

Chapter 9: Extensibility

51

Page 52: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

9.3. Defining New Authorization Grant TypesNew authorization grant types can be defined by assigning them a unique absoluteURI for use with the grant_type parameter. If the extension grant type requiresadditional token endpoint parameters, they MUST be registered in the OAuthparameters registry as described by The OAuth Parameters Registry.

9.4. Defining New Authorization Endpoint Response TypesNew response types for use with the authorization endpoint are defined andregistered in the authorization endpoint response type registry following theprocedure in The OAuth Authorization Endpoint Response Type Registry. Responsetype names MUST conform to the response-type ABNF.

response-type = response-name *( SP response-name )response-name = 1*response-charresponse-char = "_" / DIGIT / ALPHA

If a response type contains one or more space characters (%x20), it is compared as aspace-delimited list of values in which the order of values does not matter. Only oneorder of values can be registered, which covers all other arrangements of the sameset of values.

For example, the response type token code is left undefined by this specification.However, an extension can define and register the token code response type. Onceregistered, the same combination cannot be registered as code token, but bothvalues can be used to denote the same response type.

9.5. Defining Additional Error CodesIn cases where protocol extensions (i.e. access token types, extension parameters, orextension grant types) require additional error codes to be used with the authorizationcode grant error response (Error Response), the implicit grant error response (ErrorResponse), or the token error response (Error Response), such error codes MAY bedefined.

Extension error codes MUST be registered (following the procedures in The OAuthExtensions Error Registry) if the extension they are used in conjunction with is aregistered access token type, a registered endpoint parameter, or an extension granttype. Error codes used with unregistered extensions MAY be registered.

OAuth 2.0

52

Page 53: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Error codes MUST conform to the error-code ABNF, and SHOULD be prefixed by anidentifying name when possible. For example, an error identifying an invalid value setto the extension parameter example should be named example_invalid.

error-code = ALPHA *error-charerror-char = "-" / "." / "_" / DIGIT / ALPHA

Chapter 9: Extensibility

53

Page 54: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

10. Native ApplicationsNative applications are clients installed and executed on the device used by theresource owner (i.e. desktop application, native mobile application). Nativeapplications require special consideration related to security, platform capabilities,and overall end-user experience.

The authorization endpoint requires interaction between the client and the resourceowner's user-agent. Native applications can invoke an external user-agent or embeda user-agent within the application. For example:

• External user-agent - the native application can capture the response from theauthorization server using a redirection URI with a scheme registered with theoperating system to invoke the client as the handler, manual copy-and-paste ofthe credentials, running a local web server, installing a user-agent extension, orby providing a redirection URI identifying a server-hosted resource under theclient's control, which in turn makes the response available to the nativeapplication.

• Embedded user-agent - the native application obtains the response by directlycommunicating with the embedded user-agent by monitoring state changesemitted during the resource load, or accessing the user-agent's cookies storage.

When choosing between an external or embedded user-agent, developers shouldconsider:

• An External user-agent may improve completion rate as the resource owner mayalready have an active session with the authorization server removing the need tore-authenticate. It provides a familiar end-user experience and functionality. Theresource owner may also rely on user-agent features or extensions to assist withauthentication (e.g. password manager, 2-factor device reader).

• An embedded user-agent may offer improved usability, as it removes the need toswitch context and open new windows.

• An embedded user-agent poses a security challenge because resource ownersare authenticating in an unidentified window without access to the visualprotections found in most external user-agents. An embedded user-agenteducates end-users to trust unidentified requests for authentication (makingphishing attacks easier to execute).

OAuth 2.0

54

Page 55: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

When choosing between the implicit grant type and the authorization code grant type,the following should be considered:

• Native applications that use the authorization code grant type SHOULD do sowithout using client credentials, due to the native application's inability to keepclient credentials confidential.

• When using the implicit grant type flow a refresh token is not returned whichrequires repeating the authorization process once the access token expires.

Chapter 10: Native Applications

55

Page 56: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

11. Security ConsiderationsAs a flexible and extensible framework, OAuth's security considerations depend onmany factors. The following sections provide implementers with security guidelinesfocused on the three client profiles described in Client Types: web application, user-agent-based application, and native application.

A comprehensive OAuth security model and analysis, as well as background for theprotocol design is provided by I-D.ietf-oauth-v2-threatmodel.

11.1. Client AuthenticationThe authorization server establishes client credentials with web application clients forthe purpose of client authentication. The authorization server is encouraged toconsider stronger client authentication means than a client password. Webapplication clients MUST ensure confidentiality of client passwords and other clientcredentials.

The authorization server MUST NOT issue client passwords or other client credentialsto native application or user-agent-based application clients for the purpose of clientauthentication. The authorization server MAY issue a client password or othercredentials for a specific installation of a native application client on a specific device.

When client authentication is not possible, the authorization server SHOULD employother means to validate the client's identity. For example, by requiring the registrationof the client redirection URI or enlisting the resource owner to confirm identity. A validredirection URI is not sufficient to verify the client's identity when asking for resourceowner authorization, but can be used to prevent delivering credentials to a counterfeitclient after obtaining resource owner authorization.

The authorization server must consider the security implications of interacting withunauthenticated clients and take measures to limit the potential exposure of othercredentials (e.g. refresh tokens) issued to such clients.

11.2. Client ImpersonationA malicious client can impersonate another client and obtain access to protectedresources, if the impersonated client fails to, or is unable to, keep its client credentialsconfidential.

OAuth 2.0

56

Page 57: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The authorization server MUST authenticate the client whenever possible. If theauthorization server cannot authenticate the client due to the client's nature, theauthorization server MUST require the registration of any redirection URI used forreceiving authorization responses, and SHOULD utilize other means to protectresource owners from such potentially malicious clients. For example, theauthorization server can engage the resource owner to assist in identifying the clientand its origin.

The authorization server SHOULD enforce explicit resource owner authentication andprovide the resource owner with information about the client and the requestedauthorization scope and lifetime. It is up to the resource owner to review theinformation in the context of the current client, and authorize or deny the request.

The authorization server SHOULD NOT process repeated authorization requestsautomatically (without active resource owner interaction) without authenticating theclient or relying on other measures to ensure the repeated request comes from theoriginal client and not an impersonator.

11.3. Access TokensAccess token credentials (as well as any confidential access token attributes) MUSTbe kept confidential in transit and storage, and only shared among the authorizationserver, the resource servers the access token is valid for, and the client to whom theaccess token is issued. Access token credentials MUST only be transmitted usingTLS as described in TLS Version with server authentication as defined by RFC2818.

When using the implicit grant type, the access token is transmitted in the URIfragment, which can expose it to unauthorized parties.

The authorization server MUST ensure that access tokens cannot be generated,modified, or guessed to produce valid access tokens by unauthorized parties.

The client SHOULD request access tokens with the minimal scope necessary. Theauthorization server SHOULD take the client identity into account when choosing howto honor the requested scope, and MAY issue an access token with a less rights thanrequested.

11.4. Refresh TokensAuthorization servers MAY issue refresh tokens to web application clients and nativeapplication clients.

Chapter 11: Security Considerations

57

Page 58: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Refresh tokens MUST be kept confidential in transit and storage, and shared onlyamong the authorization server and the client to whom the refresh tokens wereissued. The authorization server MUST maintain the binding between a refresh tokenand the client to whom it was issued. Refresh tokens MUST only be transmitted usingTLS as described in TLS Version with server authentication as defined by RFC2818.

The authorization server MUST verify the binding between the refresh token and clientidentity whenever the client identity can be authenticated. When client authenticationis not possible, the authorization server SHOULD deploy other means to detectrefresh token abuse.

For example, the authorization server could employ refresh token rotation in which anew refresh token is issued with every access token refresh response. The previousrefresh token is invalidated but retained by the authorization server. If a refresh tokenis compromised and subsequently used by both the attacker and the legitimate client,one of them will present an invalidated refresh token which will inform theauthorization server of the breach.

The authorization server MUST ensure that refresh tokens cannot be generated,modified, or guessed to produce valid refresh tokens by unauthorized parties.

11.5. Authorization CodesThe transmission of authorization codes SHOULD be made over a secure channel,and the client SHOULD implement TLS for use with its redirection URI if the URIidentifies a network resource. Since authorization codes are transmitted via user-agent redirections, they could potentially be disclosed through user-agent history andHTTP referrer headers.

Authorization codes operate as plaintext bearer credentials, used to verify that theresource owner who granted authorization at the authorization server is the sameresource owner returning to the client to complete the process. Therefore, if the clientrelies on the authorization code for its own resource owner authentication, the clientredirection endpoint MUST require TLS.

Authorization codes MUST be short lived and single use. If the authorization serverobserves multiple attempts to exchange an authorization code for an access token,the authorization server SHOULD attempt to revoke all access tokens already grantedbased on the compromised authorization code.

OAuth 2.0

58

Page 59: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

If the client can be authenticated, the authorization servers MUST authenticate theclient and ensure that the authorization code was issued to the same client.

11.6. Authorization Code Redirection URI ManipulationWhen requesting authorization using the authorization code grant type, the client canspecify a redirection URI via the redirect_uri parameter. If an attacker can manipulatethe value of the redirection URI, it can cause the authorization server to redirect theresource owner user-agent to a URI under the control of the attacker with theauthorization code.

An attacker can create an account at a legitimate client and initiate the authorizationflow. When the attacker's user-agent is sent to the authorization server to grantaccess, the attacker grabs the authorization URI provided by the legitimate client, andreplaces the client's redirection URI with a URI under the control of the attacker. Theattacker then tricks the victim into following the manipulated link to authorize accessto the legitimate client.

Once at the authorization server, the victim is prompted with a normal, valid requeston behalf of a legitimate and trusted client, and authorizes the request. The victim isthen redirected to an endpoint under the control of the attacker with the authorizationcode. The attacker completes the authorization flow by sending the authorizationcode to the client using the original redirection URI provided by the client. The clientexchanges the authorization code with an access token and links it to the attacker'sclient account which can now gain access to the protected resources authorized bythe victim (via the client).

In order to prevent such an attack, the authorization server MUST ensure that theredirection URI used to obtain the authorization code is identical to the redirectionURI provided when exchanging the authorization code for an access token. Theauthorization server MUST require public clients and SHOULD require confidentialclients to register their redirection URIs. If a redirection URI is provided in the request,the authorization server MUST validate it against the registered value.

11.7. Resource Owner Password CredentialsThe resource owner password credentials grant type is often used for legacy ormigration reasons. It reduces the overall risk of storing username and password bythe client, but does not eliminate the need to expose highly privileged credentials tothe client.

Chapter 11: Security Considerations

59

Page 60: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

This grant type carries a higher risk than other grant types because it maintains thepassword anti-pattern this protocol seeks to avoid. The client could abuse thepassword or the password could unintentionally be disclosed to an attacker (e.g. vialog files or other records kept by the client).

Additionally, because the resource owner does not have control over theauthorization process (the resource owner involvement ends when it hands over itscredentials to the client), the client can obtain access tokens with a broader scopethan desired by the resource owner. The authorization server should consider thescope and lifetime of access tokens issued via this grant type.

The authorization server and client SHOULD minimize use of this grant type andutilize other grant types whenever possible.

11.8. Request ConfidentialityAccess tokens, refresh tokens, resource owner passwords, and client credentialsMUST NOT be transmitted in the clear. Authorization codes SHOULD NOT betransmitted in the clear.

The state and scope parameters SHOULD NOT include sensitive client or resourceowner information in plain text as they can be transmitted over insecure channels orstored insecurely.

11.9. Endpoints AuthenticityIn order to prevent man-in-the-middle attacks, the authorization server MUSTimplement and require TLS with server authentication as defined by RFC2818 for anyrequest sent to the authorization and token endpoints. The client MUST validate theauthorization server's TLS certificate as defined by RFC6125, and in accordance withits requirements for server identity authentication.

11.10. Credentials Guessing AttacksThe authorization server MUST prevent attackers from guessing access tokens,authorization codes, refresh tokens, resource owner passwords, and clientcredentials.

The probability of an attacker guessing generated tokens (and other credentials notintended for handling by end-users) MUST be less than or equal to 2^(-128) andSHOULD be less than or equal to 2^(-160).

OAuth 2.0

60

Page 61: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The authorization server MUST utilize other means to protect credentials intended forend-user usage.

11.11. Phishing AttacksWide deployment of this and similar protocols may cause end-users to becomeinured to the practice of being redirected to websites where they are asked to entertheir passwords. If end-users are not careful to verify the authenticity of thesewebsites before entering their credentials, it will be possible for attackers to exploitthis practice to steal resource owners' passwords.

Service providers should attempt to educate end-users about the risks phishingattacks pose, and should provide mechanisms that make it easy for end-users toconfirm the authenticity of their sites. Client developers should consider the securityimplications of how they interact with the user-agent (e.g., external, embedded), andthe ability of the end-user to verify the authenticity of the authorization server.

To reduce the risk of phishing attacks, the authorization servers MUST utilize TLS onevery endpoint used for end-user interaction.

11.12. Cross-Site Request ForgeryCross-site request forgery (CSRF) is an exploit in which an attacker causes the user-agent of a victim end-user to follow a malicious URI (e.g. provided to the user-agentas a misleading link, image, or redirection) to a trusting server (usually established viathe presence of a valid session cookie).

A CSRF attack against the client's redirection URI allows an attacker to inject theirown authorization code or access token, which can result in the client using anaccess token associated with the attacker's protected resources rather than thevictim's (e.g. save the victim's bank account information to a protected resourcecontrolled by the attacker).

The client MUST implement CSRF protection for its redirection URI. This is typicallyaccomplished by requiring any request sent to the redirection URI endpoint to includea value that binds the request to the user-agent's authenticated state (e.g. a hash ofthe session cookie used to authenticate the user-agent). The client SHOULD utilizethe state request parameter to deliver this value to the authorization server whenmaking an authorization request.

Once authorization has been obtained from the end-user, the authorization serverredirects the end-user's user-agent back to the client with the required binding value

Chapter 11: Security Considerations

61

Page 62: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

contained in the state parameter. The binding value enables the client to verify thevalidity of the request by matching the binding value to the user-agent'sauthenticated state. The binding value used for CSRF protection MUST contain anon-guessable value (as described in Credentials Guessing Attacks), and the user-agent's authenticated state (e.g. session cookie, HTML5 local storage) MUST be keptin a location accessible only to the client and the user-agent (i.e., protected by same-origin policy).

A CSRF attack against the authorization server's authorization endpoint can result inan attacker obtaining end-user authorization for a malicious client without involving oralerting the end-user.

The authorization server MUST implement CSRF protection for its authorizationendpoint, and ensure that a malicious client cannot obtain authorization without theawareness and explicit consent of the resource owner.

11.13. ClickjackingIn a clickjacking attack, an attacker registers a legitimate client and then constructs amalicious site in which it loads the authorization server's authorization endpoint webpage in a transparent iframe overlaid on top of a set of dummy buttons which arecarefully constructed to be placed directly under important buttons on theauthorization page. When an end-user clicks a misleading visible button, the end-useris actually clicking an invisible button on the authorization page (such as an"Authorize" button). This allows an attacker to trick a resource owner into granting itsclient access without their knowledge.

To prevent this form of attack, native applications SHOULD use external browsersinstead of embedding browsers within the application when requesting end-userauthorization. For most newer browsers, avoidance of iframes can be enforced by theauthorization server using the (non-standard) x-frame-options header. This headercan have two values, deny and sameorigin, which will block any framing, or framingby sites with a different origin, respectively. For older browsers, javascriptframebusting techniques can be used but may not be effective in all browsers.

11.14. Code Injection and Input ValidationA code injection attack occurs when an input or otherwise external variable is used byan application unsanitized and causes modification to the application logic. This mayallow an attacker to gain access to the application device or its data, cause denial ofservice, or a wide range of malicious side-effects.

OAuth 2.0

62

Page 63: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

The Authorization server and client MUST sanitize (and validate when possible) anyvalue received, in particular, the value of the state and redirect_uri parameters.

11.15. Open RedirectorsThe authorization server authorization endpoint and the client redirection endpointcan be improperly configured and operate as open redirectors. An open redirector isan endpoint using a parameter to automatically redirect a user-agent to the locationspecified by the parameter value without any validation.

Open redirectors can be used in phishing attacks, or by an attacker to get end-usersto visit malicious sites by making the URI's authority look like a familiar and trusteddestination. In addition, if the authorization server allows the client to register onlypart of the redirection URI, an attacker can use an open redirector operated by theclient to construct a redirection URI that will pass the authorization server validationbut will send the authorization code or access token to an endpoint under the controlof the attacker.

Chapter 11: Security Considerations

63

Page 64: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

12. IANA Considerations12.1. The OAuth Access Token Type RegistryThis specification establishes the OAuth access token type registry.

Access token types are registered on the advice of one or more Designated Experts(appointed by the IESG or their delegate), with a Specification Required (usingterminology from RFC5226). However, to allow for the allocation of values prior topublication, the Designated Expert(s) may approve registration once they are satisfiedthat such a specification will be published.

Registration requests should be sent to the [TBD]@ietf.org mailing list for review andcomment, with an appropriate subject (e.g., "Request for access token type:example"). [[ Note to RFC-EDITOR: The name of the mailing list should be determinedin consultation with the IESG and IANA. Suggested name: oauth-ext-review. ]]

Within at most 14 days of the request, the Designated Expert(s) will either approve ordeny the registration request, communicating this decision to the review list andIANA. Denials should include an explanation and, if applicable, suggestions as to howto make the request successful.

Decisions (or lack thereof) made by the Designated Expert(s) can be first appealed toSecurity Area Directors (contactable using [email protected] email address ordirectly by looking up their email addresses on http://www.iesg.org/ website) and, ifthe appellant is not satisfied with the response, to the full IESG (using [email protected] mailing list).

IANA should only accept registry updates from the Designated Expert(s), and shoulddirect all requests for registration to the review mailing list.

12.1.1. Registration TemplateType name:

The name requested (e.g., "example").

Additional Token Endpoint Response Parameters:Additional response parameters returned together with the access_token parameter.New parameters MUST be separately registered in the OAuth parameters registry asdescribed by The OAuth Parameters Registry.

OAuth 2.0

64

Page 65: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

HTTP Authentication Scheme(s):The HTTP authentication scheme name(s), if any, used to authenticate protectedresources requests using access tokens of this type.

Change controller:For standards-track RFCs, state "IETF". For others, give the name of theresponsible party. Other details (e.g., postal address, e-mail address, home pageURI) may also be included.

Specification document(s):Reference to the document that specifies the parameter, preferably including a URIthat can be used to retrieve a copy of the document. An indication of the relevantsections may also be included, but is not required.

12.2. The OAuth Parameters RegistryThis specification establishes the OAuth parameters registry.

Additional parameters for inclusion in the authorization endpoint request, theauthorization endpoint response, the token endpoint request, or the token endpointresponse are registered on the advice of one or more Designated Experts (appointedby the IESG or their delegate), with a Specification Required (using terminology fromRFC5226). However, to allow for the allocation of values prior to publication, theDesignated Expert(s) may approve registration once they are satisfied that such aspecification will be published.

Registration requests should be sent to the [TBD]@ietf.org mailing list for review andcomment, with an appropriate subject (e.g., "Request for parameter: example"). [[Note to RFC-EDITOR: The name of the mailing list should be determined inconsultation with the IESG and IANA. Suggested name: oauth-ext-review. ]]

Within at most 14 days of the request, the Designated Expert(s) will either approve ordeny the registration request, communicating this decision to the review list andIANA. Denials should include an explanation and, if applicable, suggestions as to howto make the request successful.

Decisions (or lack thereof) made by the Designated Expert(s) can be first appealed toSecurity Area Directors (contactable using [email protected] email address ordirectly by looking up their email addresses on http://www.iesg.org/ website) and, ifthe appellant is not satisfied with the response, to the full IESG (using [email protected] mailing list).

Chapter 12: IANA Considerations

65

Page 66: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

IANA should only accept registry updates from the Designated Expert(s), and shoulddirect all requests for registration to the review mailing list.

12.2.1. Registration TemplateParameter name:

The name requested (e.g., "example").

Parameter usage location:The location(s) where parameter can be used. The possible locations are:authorization request, authorization response, token request, or token response.

Change controller:For standards-track RFCs, state "IETF". For others, give the name of theresponsible party. Other details (e.g., postal address, e-mail address, home pageURI) may also be included.

Specification document(s):Reference to the document that specifies the parameter, preferably including a URIthat can be used to retrieve a copy of the document. An indication of the relevantsections may also be included, but is not required.

12.2.2. Initial Registry ContentsThe OAuth Parameters Registry's initial contents are:

• Parameter name: client_id

• Parameter usage location: authorization request, token request

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: client_secret

• Parameter usage location: token request

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: response_type

• Parameter usage location: authorization request

• Change controller: IETF

OAuth 2.0

66

Page 67: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

• Specification document(s): [[ this document ]]

• Parameter name: redirect_uri

• Parameter usage location: authorization request, token request

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: scope

• Parameter usage location: authorization request, authorization response, tokenrequest, token response

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: state

• Parameter usage location: authorization request, authorization response

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: code

• Parameter usage location: authorization response, token request

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: error_description

• Parameter usage location: authorization response, token response

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: error_uri

• Parameter usage location: authorization response, token response

• Change controller: IETF

Chapter 12: IANA Considerations

67

Page 68: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

• Specification document(s): [[ this document ]]

• Parameter name: grant_type

• Parameter usage location: token request

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: access_token

• Parameter usage location: authorization response, token response

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: token_type

• Parameter usage location: authorization response, token response

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: expires_in

• Parameter usage location: authorization response, token response

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: username

• Parameter usage location: token request

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Parameter name: password

• Parameter usage location: token request

• Change controller: IETF

• Specification document(s): [[ this document ]]

OAuth 2.0

68

Page 69: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

• Parameter name: refresh_token

• Parameter usage location: token request, token response

• Change controller: IETF

• Specification document(s): [[ this document ]]

12.3. The OAuth Authorization Endpoint Response TypeRegistryThis specification establishes the OAuth authorization endpoint response typeregistry.

Additional response type for use with the authorization endpoint are registered on theadvice of one or more Designated Experts (appointed by the IESG or their delegate),with a Specification Required (using terminology from RFC5226). However, to allowfor the allocation of values prior to publication, the Designated Expert(s) may approveregistration once they are satisfied that such a specification will be published.

Registration requests should be sent to the [TBD]@ietf.org mailing list for review andcomment, with an appropriate subject (e.g., "Request for response type: example"). [[Note to RFC-EDITOR: The name of the mailing list should be determined inconsultation with the IESG and IANA. Suggested name: oauth-ext-review. ]]

Within at most 14 days of the request, the Designated Expert(s) will either approve ordeny the registration request, communicating this decision to the review list andIANA. Denials should include an explanation and, if applicable, suggestions as to howto make the request successful.

Decisions (or lack thereof) made by the Designated Expert(s) can be first appealed toSecurity Area Directors (contactable using [email protected] email address ordirectly by looking up their email addresses on http://www.iesg.org/ website) and, ifthe appellant is not satisfied with the response, to the full IESG (using [email protected] mailing list).

IANA should only accept registry updates from the Designated Expert(s), and shoulddirect all requests for registration to the review mailing list.

12.3.1. Registration TemplateResponse type name:

The name requested (e.g., "example").

Chapter 12: IANA Considerations

69

Page 70: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

Change controller:For standards-track RFCs, state "IETF". For others, give the name of theresponsible party. Other details (e.g., postal address, e-mail address, home pageURI) may also be included.

Specification document(s):Reference to the document that specifies the type, preferably including a URI thatcan be used to retrieve a copy of the document. An indication of the relevantsections may also be included, but is not required.

12.3.2. Initial Registry ContentsThe OAuth Authorization Endpoint Response Type Registry's initial contents are:

• Response type name: code

• Change controller: IETF

• Specification document(s): [[ this document ]]

• Response type name: token

• Change controller: IETF

• Specification document(s): [[ this document ]]

12.4. The OAuth Extensions Error RegistryThis specification establishes the OAuth extensions error registry.

Additional error codes used together with other protocol extensions (i.e. extensiongrant types, access token types, or extension parameters) are registered on theadvice of one or more Designated Experts (appointed by the IESG or their delegate),with a Specification Required (using terminology from RFC5226). However, to allowfor the allocation of values prior to publication, the Designated Expert(s) may approveregistration once they are satisfied that such a specification will be published.

Registration requests should be sent to the [TBD]@ietf.org mailing list for review andcomment, with an appropriate subject (e.g., "Request for error code: example"). [[Note to RFC-EDITOR: The name of the mailing list should be determined inconsultation with the IESG and IANA. Suggested name: oauth-ext-review. ]]

Within at most 14 days of the request, the Designated Expert(s) will either approve ordeny the registration request, communicating this decision to the review list and

OAuth 2.0

70

Page 71: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

IANA. Denials should include an explanation and, if applicable, suggestions as to howto make the request successful.

Decisions (or lack thereof) made by the Designated Expert(s) can be first appealed toSecurity Area Directors (contactable using [email protected] email address ordirectly by looking up their email addresses on http://www.iesg.org/ website) and, ifthe appellant is not satisfied with the response, to the full IESG (using [email protected] mailing list).

IANA should only accept registry updates from the Designated Expert(s), and shoulddirect all requests for registration to the review mailing list.

12.4.1. Registration TemplateError name:

The name requested (e.g., "example").

Error usage location:The location(s) where the error can be used. The possible locations are:authorization code grant error response (Error Response), implicit grant errorresponse (Error Response), or token error response (Error Response).

Related protocol extension:The name of the extension grant type, access token type, or extension parameter,the error code is used in conjunction with.

Change controller:For standards-track RFCs, state "IETF". For others, give the name of theresponsible party. Other details (e.g., postal address, e-mail address, home pageURI) may also be included.

Specification document(s):Reference to the document that specifies the error code, preferably including a URIthat can be used to retrieve a copy of the document. An indication of the relevantsections may also be included, but is not required.

Chapter 12: IANA Considerations

71

Page 72: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

13. AcknowledgementsThe initial OAuth 2.0 protocol specification was edited by David Recordon, based ontwo previous publications: the OAuth 1.0 community specification RFC5849, andOAuth WRAP (OAuth Web Resource Authorization Profiles) OAuth Web ResourceAuthorization Profiles. The Security Considerations section was drafted by TorstenLodderstedt, Mark McGloin, Phil Hunt, and Anthony Nadalin.

The OAuth 1.0 community specification was edited by Eran Hammer and authored byMark Atwood, Dirk Balfanz, Darren Bounds, Richard M. Conlan, Blaine Cook, LeahCulver, Breno de Medeiros, Brian Eaton, Kellan Elliott-McCrea, Larry Halff, EranHammer, Ben Laurie, Chris Messina, John Panzer, Sam Quigley, David Recordon,Eran Sandler, Jonathan Sergent, Todd Sieling, Brian Slesinsky, and Andy Smith.

The OAuth WRAP specification was edited by Dick Hardt and authored by BrianEaton, Yaron Goland, Dick Hardt, and Allen Tom.

This specification is the work of the OAuth Working Group which includes dozens ofactive and dedicated participants. In particular, the following individuals contributedideas, feedback, and wording which shaped and formed the final specification:

Michael Adams, Amanda Anganes, Andrew Arnott, Dirk Balfanz, Aiden Bell, BrianCampbell, Scott Cantor, Marcos Caceres, Blaine Cook, Roger Crew, Brian Eaton,Leah Culver, Bill de hOra, Andre DeMarre, Brian Eaton, Wolter Eldering, Brian Ellin,Igor Faynberg, George Fletcher, Tim Freeman, Evan Gilbert, Yaron Goland, BrentGoldman, Kristoffer Gronowski, Justin Hart, Dick Hardt, Craig Heath, Phil Hunt,Michael B. Jones, Terry Jones, John Kemp, Mark Kent, Raffi Krikorian, Chasen LeHara, Rasmus Lerdorf, Torsten Lodderstedt, Hui-Lan Lu, Casey Lucas, Paul Madsen,Alastair Mair, Eve Maler, James Manger, Mark McGloin, Laurence Miao, William Mills,Chuck Mortimore, Anthony Nadalin, Julian Reschke, Justin Richer, Peter Saint-Andre,Nat Sakimura, Rob Sayre, Marius Scurtescu, Naitik Shah, Luke Shepard, VladSkvortsov, Justin Smith, Haibin Song, Niv Steingarten, Christian Stubner, JeremySuriel, Paul Tarjan, Christopher Thomas, Henry S. Thompson, Allen Tom, FranklinTse, Nick Walker, Shane Weeden, and Skylar Woodward.

This document was produced under the chairmanship of Blaine Cook, Peter Saint-Andre, Hannes Tschofenig, and Barry Leiba. The area directors included LisaDusseault, Peter Saint-Andre, and Stephen Farrell.

OAuth 2.0

72

Page 73: The OAuth 2.0 Authorization Protocol · PDF fileSuccessful Response ... ii Defining New ... depends on the method used by the client to request authorization and the types

14. References1. OAuth Web Resource Authorization Profiles , January 2010

Chapter 14: References

73