draft-ietf-oauth-v2-02.txt   draft-ietf-oauth-v2-03.txt 
Network Working Group E. Hammer-Lahav, Ed. Network Working Group E. Hammer-Lahav, Ed.
Internet-Draft Yahoo! Internet-Draft Yahoo!
Intended status: Standards Track D. Recordon Intended status: Standards Track D. Recordon
Expires: November 7, 2010 Facebook Expires: November 10, 2010 Facebook
D. Hardt D. Hardt
May 6, 2010 May 9, 2010
The OAuth 2.0 Protocol The OAuth 2.0 Protocol
draft-ietf-oauth-v2-02 draft-ietf-oauth-v2-03
Abstract Abstract
This specification describes the OAuth 2.0 protocol. OAuth provides This specification describes the OAuth 2.0 protocol. OAuth provides
a method for making authenticated HTTP requests using a token - an a method for making authenticated HTTP requests using a token - an
identifier used to denote an access grant with specific scope, identifier used to denote an access grant with specific scope,
duration, and other attributes. Tokens are issued to third-party duration, and other attributes. Tokens are issued to third-party
clients by an authorization server with the approval of the resource clients by an authorization server with the approval of the resource
owner. OAuth defines multiple flows for obtaining a token to support owner. OAuth defines multiple flows for obtaining a token to support
a wide range of client types and user experience. a wide range of client types and user experience.
skipping to change at page 1, line 38 skipping to change at page 1, line 38
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on November 7, 2010. This Internet-Draft will expire on November 10, 2010.
Copyright Notice Copyright Notice
Copyright (c) 2010 IETF Trust and the persons identified as the Copyright (c) 2010 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 24 skipping to change at page 2, line 24
2.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3. Example . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3. Example . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4. Notational Conventions . . . . . . . . . . . . . . . . . . 8 2.4. Notational Conventions . . . . . . . . . . . . . . . . . . 8
2.5. Conformance . . . . . . . . . . . . . . . . . . . . . . . 8 2.5. Conformance . . . . . . . . . . . . . . . . . . . . . . . 8
3. Obtaining an Access Token . . . . . . . . . . . . . . . . . . 8 3. Obtaining an Access Token . . . . . . . . . . . . . . . . . . 8
3.1. Authorization Endpoint . . . . . . . . . . . . . . . . . . 9 3.1. Authorization Endpoint . . . . . . . . . . . . . . . . . . 9
3.2. Token Endpoint . . . . . . . . . . . . . . . . . . . . . . 9 3.2. Token Endpoint . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1. Response Format . . . . . . . . . . . . . . . . . . . 10 3.2.1. Response Format . . . . . . . . . . . . . . . . . . . 10
3.3. Flow Parameters . . . . . . . . . . . . . . . . . . . . . 11 3.3. Flow Parameters . . . . . . . . . . . . . . . . . . . . . 11
3.4. Client Credentials . . . . . . . . . . . . . . . . . . . . 12 3.4. Client Credentials . . . . . . . . . . . . . . . . . . . . 12
3.5. User Delegation Flows . . . . . . . . . . . . . . . . . . 12 3.5. User-Agent Flow . . . . . . . . . . . . . . . . . . . . . 12
3.5.1. User-Agent Flow . . . . . . . . . . . . . . . . . . . 12 3.5.1. Client Requests Authorization . . . . . . . . . . . . 14
3.5.2. Web Server Flow . . . . . . . . . . . . . . . . . . . 17 3.5.2. Client Extracts Access Token . . . . . . . . . . . . . 17
3.5.3. Device Flow . . . . . . . . . . . . . . . . . . . . . 23 3.6. Web Server Flow . . . . . . . . . . . . . . . . . . . . . 17
4. End-user Credentials Flows . . . . . . . . . . . . . . . . . . 28 3.6.1. Client Requests Authorization . . . . . . . . . . . . 19
4.1. Username and Password Flow . . . . . . . . . . . . . . . . 29 3.6.2. Client Requests Access Token . . . . . . . . . . . . . 21
4.1.1. Client Requests Access Token . . . . . . . . . . . . . 30 3.7. Device Flow . . . . . . . . . . . . . . . . . . . . . . . 23
5. Autonomous Client Flows . . . . . . . . . . . . . . . . . . . 32 3.7.1. Client Requests Authorization . . . . . . . . . . . . 25
5.1. Client Credentials Flow . . . . . . . . . . . . . . . . . 32 3.7.2. Client Requests Access Token . . . . . . . . . . . . . 26
5.1.1. Client Requests Access Token . . . . . . . . . . . . . 32 4. Username and Password Flow . . . . . . . . . . . . . . . . . . 28
5.2. Assertion Flow . . . . . . . . . . . . . . . . . . . . . . 34 4.1. Client Requests Access Token . . . . . . . . . . . . . . . 30
5.2.1. Client Requests Access Token . . . . . . . . . . . . . 35 5. Client Credentials Flow . . . . . . . . . . . . . . . . . . . 31
6. Refreshing an Access Token . . . . . . . . . . . . . . . . . . 36 5.1. Client Requests Access Token . . . . . . . . . . . . . . . 32
7. Accessing a Protected Resource . . . . . . . . . . . . . . . . 38 6. Assertion Flow . . . . . . . . . . . . . . . . . . . . . . . . 33
7.1. The Authorization Request Header . . . . . . . . . . . . . 39 6.1. Client Requests Access Token . . . . . . . . . . . . . . . 34
7.2. Bearer Token Requests . . . . . . . . . . . . . . . . . . 40 7. Refreshing an Access Token . . . . . . . . . . . . . . . . . . 36
7.2.1. URI Query Parameter . . . . . . . . . . . . . . . . . 41 8. Accessing a Protected Resource . . . . . . . . . . . . . . . . 38
7.2.2. Form-Encoded Body Parameter . . . . . . . . . . . . . 41 8.1. The Authorization Request Header . . . . . . . . . . . . . 39
7.3. Cryptographic Tokens Requests . . . . . . . . . . . . . . 42 8.2. Bearer Token Requests . . . . . . . . . . . . . . . . . . 40
7.3.1. The 'hmac-sha256' Algorithm . . . . . . . . . . . . . 43 8.2.1. URI Query Parameter . . . . . . . . . . . . . . . . . 41
8. Identifying a Protected Resource . . . . . . . . . . . . . . . 46 8.2.2. Form-Encoded Body Parameter . . . . . . . . . . . . . 41
8.1. The WWW-Authenticate Response Header . . . . . . . . . . . 46 8.3. Cryptographic Tokens Requests . . . . . . . . . . . . . . 42
8.1.1. The 'realm' Attribute . . . . . . . . . . . . . . . . 47 8.3.1. The 'hmac-sha256' Algorithm . . . . . . . . . . . . . 42
8.1.2. The 'authorization-uri' Attribute . . . . . . . . . . 47 9. Identifying a Protected Resource . . . . . . . . . . . . . . . 45
8.1.3. The 'algorithms' Attribute . . . . . . . . . . . . . . 47 9.1. The WWW-Authenticate Response Header . . . . . . . . . . . 46
8.1.4. The 'error' Attribute . . . . . . . . . . . . . . . . 47 9.1.1. The 'realm' Attribute . . . . . . . . . . . . . . . . 46
9. Security Considerations . . . . . . . . . . . . . . . . . . . 47 9.1.2. The 'authorization-uri' Attribute . . . . . . . . . . 46
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 9.1.3. The 'algorithms' Attribute . . . . . . . . . . . . . . 46
11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 47 9.1.4. The 'error' Attribute . . . . . . . . . . . . . . . . 47
10. Security Considerations . . . . . . . . . . . . . . . . . . . 47
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47
12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 47
Appendix A. Differences from OAuth 1.0a . . . . . . . . . . . . . 47 Appendix A. Differences from OAuth 1.0a . . . . . . . . . . . . . 47
Appendix B. Document History . . . . . . . . . . . . . . . . . . 48 Appendix B. Document History . . . . . . . . . . . . . . . . . . 47
12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 48 13. References . . . . . . . . . . . . . . . . . . . . . . . . . . 48
12.1. Normative References . . . . . . . . . . . . . . . . . . . 48 13.1. Normative References . . . . . . . . . . . . . . . . . . . 48
12.2. Informative References . . . . . . . . . . . . . . . . . . 49 13.2. Informative References . . . . . . . . . . . . . . . . . . 49
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 50 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 49
1. Authors 1. Authors
This specification was authored with the participation and based on This specification was authored with the participation and based on
the work of Allen Tom (Yahoo!), Brian Eaton (Google), Brent Goldman the work of Allen Tom (Yahoo!), Brian Eaton (Google), Brent Goldman
(Facebook), Luke Shepard (Facebook), Raffi Krikorian (Twitter), and (Facebook), Luke Shepard (Facebook), Raffi Krikorian (Twitter), and
Yaron Goland (Microsoft). Yaron Goland (Microsoft).
2. Introduction 2. Introduction
skipping to change at page 7, line 27 skipping to change at page 7, line 27
Figure 2 Figure 2
This specification defines a number of authorization flows to support This specification defines a number of authorization flows to support
different client types and scenarios. These authorization flows can different client types and scenarios. These authorization flows can
be separated into three groups: user delegation flows, end-user be separated into three groups: user delegation flows, end-user
credentials flows, and autonomous flows. credentials flows, and autonomous flows.
Additional authorization flows may be defined by other specifications Additional authorization flows may be defined by other specifications
to cover different scenarios and client types. to cover different scenarios and client types.
User delegation authorization enable clients to act on behalf of an User delegation flows are used to grant client access to protected
end-user after obtaining authorization from the end-user. The user resources by the end-user without sharing the end-user credentials
delegation flows defined by this specifications are: (e.g. a username and password) with the client. Instead, the end-
user authenticates directly with the authorization server, and grants
client access to its protected resources. The user delegation flows
defined by this specifications are:
o User-Agent Flow - This flow is designed for clients running inside o User-Agent Flow - This flow is designed for clients running inside
a user-agent (typically a web browser). This flow is described in a user-agent (typically a web browser). This flow is described in
Section 3.5.1. Section 3.5.
o Web Server Flow - This flow is optimized for clients that are part o Web Server Flow - This flow is optimized for clients that are part
of a web server application, accessible via HTTP requests. This of a web server application, accessible via HTTP requests. This
flow is described in Section 3.5.2. flow is described in Section 3.6.
o Device Flow - This flow is suitable for clients executing on o Device Flow - This flow is suitable for clients executing on
limited devices, but where the end-user has separate access to a limited devices, but where the end-user has separate access to a
user-agent on another computer or device. This flow is described user-agent on another computer or device. This flow is described
in Section 3.5.3. in Section 3.7.
End-user credentials flow enable clients with direct access to the End-user credentials flow enable clients with direct access to the
end-user's credentials to exchange them for an access token without end-user's credentials to exchange them for an access token without
seeking additional authorization. These flows are only suitable when seeking additional authorization. These flows are only suitable when
there is a high degree of trust between the end-user and the client. there is a high degree of trust between the end-user and the client.
The end-user credentials flow defined by this specification is: The end-user credentials flow defined by this specification is:
o Username and Password Flow - This flow is used in cases where the o Username and Password Flow - This flow is used in cases where the
end-user trusts the client to handle its credentials but it is end-user trusts the client to handle its credentials but it is
still undesirable for the client to store the end-user's username still undesirable for the client to store the end-user's username
and password. This flow is described in Section 4.1. and password. This flow is described in Section 4.
Autonomous flows enable clients to act for their own behalf (the Autonomous flows enable clients to act for their own behalf (the
client is also the resource owner). The autonomous authorization client is also the resource owner). The autonomous authorization
flows defined by this specifications are: flows defined by this specifications are:
o Client Credentials Flow - The client uses its credentials to o Client Credentials Flow - The client uses its credentials to
obtain an access token. This flow is described in Section 5.1. obtain an access token. This flow is described in Section 5.
o Assertion Flow - The client presents an assertion such as a SAML o Assertion Flow - The client presents an assertion such as a SAML
[OASIS.saml-core-2.0-os] assertion to the authorization server in [OASIS.saml-core-2.0-os] assertion to the authorization server in
exchange for an access token. This flow is described in exchange for an access token. This flow is described in
Section 5.2. Section 6.
2.3. Example 2.3. Example
[[ Todo ]] [[ Todo ]]
2.4. Notational Conventions 2.4. Notational Conventions
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT',
'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
skipping to change at page 9, line 17 skipping to change at page 9, line 18
the resource server when receiving a protected resource request, and the resource server when receiving a protected resource request, and
by the authorization server when receiving a token refresh request. by the authorization server when receiving a token refresh request.
In many cases it is desirable to issue access tokens with a shorter In many cases it is desirable to issue access tokens with a shorter
lifetime than the duration of the authorization grant. However, it lifetime than the duration of the authorization grant. However, it
may be undesirable to require the resource owner to authorize the may be undesirable to require the resource owner to authorize the
request again. Instead, the authorization server issues a refresh request again. Instead, the authorization server issues a refresh
token in addition to the access token. When the access token token in addition to the access token. When the access token
expires, the client can request a new access token without involving expires, the client can request a new access token without involving
the resource owner as long as the authorization grant is still valid. the resource owner as long as the authorization grant is still valid.
The token refresh method is described in Section 6. The token refresh method is described in Section 7.
3.1. Authorization Endpoint 3.1. Authorization Endpoint
Clients direct the resource owner to the authorization endpoint to Clients direct the resource owner to the authorization endpoint to
approve their access request. Before granting access, the resource approve their access request. Before granting access, the resource
owner first authenticates with the authorization server. The way in owner first authenticates with the authorization server. The way in
which the authorization server authenticates the end-user (e.g. which the authorization server authenticates the end-user (e.g.
username and password login, OpenID, session cookies) and in which username and password login, OpenID, session cookies) and in which
the authorization server obtains the end-user's authorization, the authorization server obtains the end-user's authorization,
including whether it uses a secure channel such as TLS/SSL, is beyond including whether it uses a secure channel such as TLS/SSL, is beyond
the scope of this specification. However, the authorization server the scope of this specification. However, the authorization server
MUST first verify the identity of the end-user. MUST first verify the identity of the end-user.
The URI of the authorization endpoint can be found in the service The URI of the authorization endpoint can be found in the service
documentation, or can be obtained by the client by making an documentation, or can be obtained by the client by making an
unauthorized protected resource request (from the "WWW-Authenticate" unauthorized protected resource request (from the "WWW-Authenticate"
response header auth-uri (Section 8.1.2) attribute). response header auth-uri (Section 9.1.2) attribute).
The authorization endpoint advertised by the resource server MAY The authorization endpoint advertised by the resource server MAY
include a query component as defined by [RFC3986] section 3. include a query component as defined by [RFC3986] section 3.
Since requests to the authorization endpoint result in user Since requests to the authorization endpoint result in user
authentication and the transmission of sensitive values, the authentication and the transmission of sensitive values, the
authorization server SHOULD require the use of a transport-layer authorization server SHOULD require the use of a transport-layer
mechanism such as TLS/SSL (or a secure channel with equivalent mechanism such as TLS/SSL (or a secure channel with equivalent
protections) when sending requests to the authorization endpoints. protections) when sending requests to the authorization endpoints.
3.2. Token Endpoint 3.2. Token Endpoint
After obtaining authorization from the resource owner, clients After obtaining authorization from the resource owner, clients
request an access token from the authorization server's token request an access token from the authorization server's token
endpoint. endpoint.
The URI of the token endpoint can be found in the service The URI of the token endpoint can be found in the service
documentation, or can be obtained by the client by making an documentation, or can be obtained by the client by making an
unauthorized protected resource request (from the "WWW-Authenticate" unauthorized protected resource request (from the "WWW-Authenticate"
response header token-uri (Section 8.1.2) attribute). response header token-uri (Section 9.1.2) attribute).
The token endpoint advertised by the resource server MAY include a The token endpoint advertised by the resource server MAY include a
query component as defined by [RFC3986] section 3. query component as defined by [RFC3986] section 3.
Since requests to the token endpoint result in the transmission of Since requests to the token endpoint result in the transmission of
plain text credentials in the HTTP request and response, the plain text credentials in the HTTP request and response, the
authorization server MUST require the use of a transport-layer authorization server MUST require the use of a transport-layer
mechanism such as TLS/SSL (or a secure channel with equivalent mechanism such as TLS/SSL (or a secure channel with equivalent
protections) when sending requests to the token endpoints. protections) when sending requests to the token endpoints.
skipping to change at page 11, line 7 skipping to change at page 11, line 7
access_token access_token
REQUIRED. The access token issued by the authorization server. REQUIRED. The access token issued by the authorization server.
expires_in expires_in
OPTIONAL. The duration in seconds of the access token OPTIONAL. The duration in seconds of the access token
lifetime. lifetime.
refresh_token refresh_token
OPTIONAL. The refresh token used to obtain new access tokens OPTIONAL. The refresh token used to obtain new access tokens
using the same end-user access grant as described in Section 6. using the same end-user access grant as described in Section 7.
access_token_secret access_token_secret
REQUIRED if requested by the client. The corresponding access REQUIRED if requested by the client. The corresponding access
token secret as requested by the client. token secret as requested by the client.
For example (line breaks are for display purposes only): For example (line breaks are for display purposes only):
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
skipping to change at page 11, line 42 skipping to change at page 11, line 42
error error
REQUIRED. The parameter value MUST be set to one of the values REQUIRED. The parameter value MUST be set to one of the values
specified by each flow. specified by each flow.
For example: For example:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"error"="incorrect_client_credentials"} {"error":"incorrect_client_credentials"}
3.3. Flow Parameters 3.3. Flow Parameters
The sizes of tokens and other values received from the authorization The sizes of tokens and other values received from the authorization
server, are left undefined by this specification. Clients should server, are left undefined by this specification. Clients should
avoid making assumptions about value sizes. Servers should document avoid making assumptions about value sizes. Servers should document
the expected size of any value they issue. the expected size of any value they issue.
Unless otherwise noted, all the protocol parameter names and values Unless otherwise noted, all the protocol parameter names and values
are case sensitive. are case sensitive.
skipping to change at page 12, line 32 skipping to change at page 12, line 32
as for providing different service levels to different clients. They as for providing different service levels to different clients. They
can also be used to block unauthorized clients from requesting can also be used to block unauthorized clients from requesting
access. access.
Due to the nature of some clients, authorization servers SHOULD NOT Due to the nature of some clients, authorization servers SHOULD NOT
make assumptions about the confidentiality of client credentials make assumptions about the confidentiality of client credentials
without establishing trust with the client operator. Authorization without establishing trust with the client operator. Authorization
servers SHOULD NOT issue client secrets to clients incapable of servers SHOULD NOT issue client secrets to clients incapable of
keeping their secrets confidential. keeping their secrets confidential.
3.5. User Delegation Flows 3.5. User-Agent Flow
User delegation flows are used to grant client access to protected
resources by the end-user without sharing the end-user credentials
(e.g. a username and password) with the client. Instead, the end-
user authenticates directly with the authorization server, and grants
client access to its protected resources.
3.5.1. User-Agent Flow
The user-agent flow is a user delegation flow suitable for client The user-agent flow is a user delegation flow suitable for client
applications residing in a user-agent, typically implemented in a applications residing in a user-agent, typically implemented in a
browser using a scripting language such as JavaScript. These clients browser using a scripting language such as JavaScript. These clients
cannot keep client secrets confidential and the authentication of the cannot keep client secrets confidential and the authentication of the
client is based on the user-agent's same-origin policy. client is based on the user-agent's same-origin policy.
Unlike other flows in which the client makes separate authorization Unlike other flows in which the client makes separate authorization
and access token requests, the client received the access token as a and access token requests, the client received the access token as a
result of the authorization request in the form of an HTTP result of the authorization request in the form of an HTTP
skipping to change at page 14, line 16 skipping to change at page 14, line 12
request to the web server which does not include the fragment. request to the web server which does not include the fragment.
The user-agent retains the fragment information locally. The user-agent retains the fragment information locally.
(E) The web server returns a web page containing a script capable of (E) The web server returns a web page containing a script capable of
extracting the access token from the URI fragment retained by extracting the access token from the URI fragment retained by
the user-agent. the user-agent.
(F) The user-agent executes the script provided by the web server (F) The user-agent executes the script provided by the web server
which extracts the access token and passes it to the client. which extracts the access token and passes it to the client.
3.5.1.1. Client Requests Authorization 3.5.1. Client Requests Authorization
In order for the end-user to grant the client access, the client In order for the end-user to grant the client access, the client
sends the end-user to the authorization server. The client sends the end-user to the authorization server. The client
constructs the request URI by adding the following URI query constructs the request URI by adding the following URI query
parameters to the user authorization endpoint URI: parameters to the user authorization endpoint URI:
type type
REQUIRED. The parameter value MUST be set to "user_agent". REQUIRED. The parameter value MUST be set to "user_agent".
client_id client_id
REQUIRED. The client identifier as described in Section 3.4. REQUIRED. The client identifier as described in Section 3.4.
redirect_uri redirect_uri
REQUIRED unless a redirection URI has been established between REQUIRED unless a redirection URI has been established between
the client and authorization server via other means. An the client and authorization server via other means. An
absolute URI to which the authorization server will redirect absolute URI to which the authorization server will redirect
the user-agent to when the end-user authorization step is the user-agent to when the end-user authorization step is
completed. The authorization server SHOULD require the client completed. The authorization server SHOULD require the client
to pre-register their redirection URI. Authorization servers to pre-register their redirection URI. Authorization servers
MAY restritc the redirection URI to not include a query MAY restrict the redirection URI to not include a query
component as defined by [RFC3986] section 3. component as defined by [RFC3986] section 3.
state state
OPTIONAL. An opaque value used by the client to maintain state OPTIONAL. An opaque value used by the client to maintain state
between the request and callback. The authorization server between the request and callback. The authorization server
includes this value when redirecting the user-agent back to the includes this value when redirecting the user-agent back to the
client. client.
scope scope
OPTIONAL. The scope of the access request expressed as a list OPTIONAL. The scope of the access request expressed as a list
skipping to change at page 15, line 20 skipping to change at page 15, line 16
end-user's identity via other means (e.g. browser cookies) and end-user's identity via other means (e.g. browser cookies) and
checks if the end-user has previously approved an identical checks if the end-user has previously approved an identical
access request by the same client and if that access grant is access request by the same client and if that access grant is
still active. If the authorization server does not support an still active. If the authorization server does not support an
immediate check or if it is unable to establish the end-user's immediate check or if it is unable to establish the end-user's
identity or approval status, it MUST deny the request without identity or approval status, it MUST deny the request without
prompting the end-user. Defaults to "false" if omitted. prompting the end-user. Defaults to "false" if omitted.
secret_type secret_type
OPTIONAL. The access token secret type as described by OPTIONAL. The access token secret type as described by
Section 7.3. If omitted, the authorization server will issue a Section 8.3. If omitted, the authorization server will issue a
bearer token (an access token without a matching secret) as bearer token (an access token without a matching secret) as
described by Section 7.2. described by Section 8.2.
The client directs the end-user to the constructed URI using an HTTP The client directs the end-user to the constructed URI using an HTTP
redirection response, or by other means available to it via the end- redirection response, or by other means available to it via the end-
user's user-agent. The request MUST use the HTTP "GET" method. user's user-agent. The request MUST use the HTTP "GET" method.
For example, the client directs the end-user's user-agent to make the For example, the client directs the end-user's user-agent to make the
following HTTPS request (line breaks are for display purposes only): following HTTPS request (line breaks are for display purposes only):
GET /authorize?type=user_agent&client_id=s6BhdRkqt3& GET /authorize?type=user_agent&client_id=s6BhdRkqt3&
redirect_uri=https%3A%2F%2FEexample%2Ecom%2Frd HTTP/1.1 redirect_uri=https%3A%2F%2FEexample%2Ecom%2Frd HTTP/1.1
skipping to change at page 15, line 46 skipping to change at page 15, line 42
authorization server, the authorization server MUST verify that the authorization server, the authorization server MUST verify that the
redirection URI received matches the registered URI associated with redirection URI received matches the registered URI associated with
the client identifier. the client identifier.
The authorization server authenticates the end-user and obtains an The authorization server authenticates the end-user and obtains an
authorization decision (by asking the end-user or establishing authorization decision (by asking the end-user or establishing
approval via other means). The authorization server sends the end- approval via other means). The authorization server sends the end-
user's user-agent to the provided client redirection URI using an user's user-agent to the provided client redirection URI using an
HTTP redirection response. HTTP redirection response.
3.5.1.1.1. End-user Grants Authorization 3.5.1.1. End-user Grants Authorization
If the end-user authorizes the access request, the authorization If the end-user authorizes the access request, the authorization
server issues an access token and delivers it to the client by adding server issues an access token and delivers it to the client by adding
the following parameters, using the the following parameters, using the
"application/x-www-form-urlencoded" format as defined by "application/x-www-form-urlencoded" format as defined by
[W3C.REC-html40-19980424], to the redirection URI fragment: [W3C.REC-html40-19980424], to the redirection URI fragment:
access_token access_token
REQUIRED. The access token. REQUIRED. The access token.
skipping to change at page 16, line 32 skipping to change at page 16, line 30
access_token_secret access_token_secret
REQUIRED if requested by the client. The corresponding access REQUIRED if requested by the client. The corresponding access
token secret as requested by the client. token secret as requested by the client.
For example, the authorization server redirects the end-user's user- For example, the authorization server redirects the end-user's user-
agent by sending the following HTTP response: agent by sending the following HTTP response:
HTTP/1.1 302 Found HTTP/1.1 302 Found
Location: http://example.com/rd#access_token=FJQbwq9&expires_in=3600 Location: http://example.com/rd#access_token=FJQbwq9&expires_in=3600
3.5.1.1.2. End-user Denies Authorization 3.5.1.2. End-user Denies Authorization
If the end-user denied the access request, the authorization server If the end-user denied the access request, the authorization server
responds to the client by adding the following parameters, using the responds to the client by adding the following parameters, using the
"application/x-www-form-urlencoded" format as defined by "application/x-www-form-urlencoded" format as defined by
[W3C.REC-html40-19980424], to the redirection URI fragment: [W3C.REC-html40-19980424], to the redirection URI fragment:
error error
REQUIRED. The parameter value MUST be set to "user_denied". REQUIRED. The parameter value MUST be set to "user_denied".
state state
skipping to change at page 17, line 12 skipping to change at page 17, line 7
authorization request. Set to the exact value received from authorization request. Set to the exact value received from
the client. the client.
For example, the authorization server responds with the following: For example, the authorization server responds with the following:
HTTP/1.1 302 Found HTTP/1.1 302 Found
Location: http://example.com/rd#error=user_denied Location: http://example.com/rd#error=user_denied
The authorization flow concludes unsuccessfully. To extract the The authorization flow concludes unsuccessfully. To extract the
error message, the client follows the steps described in error message, the client follows the steps described in
Section 3.5.1.2. Section 3.5.2.
3.5.1.2. Client Extracts Access Token 3.5.2. Client Extracts Access Token
The user-agent follows the authorization server redirection response The user-agent follows the authorization server redirection response
by making an HTTP "GET" request to the URI received in the "Location" by making an HTTP "GET" request to the URI received in the "Location"
HTTP response header. The user-agent SHALL NOT include the fragment HTTP response header. The user-agent SHALL NOT include the fragment
component with the request. component with the request.
For example, the user-agent makes the following HTTP "GET" request in For example, the user-agent makes the following HTTP "GET" request in
response to the redirection directive received from the authorization response to the redirection directive received from the authorization
server: server:
GET /rd HTTP/1.1 GET /rd HTTP/1.1
Host: example.com Host: example.com
The HTTP response to the redirection request returns a web page The HTTP response to the redirection request returns a web page
(typically an HTML page with an embedded script) capable of accessing (typically an HTML page with an embedded script) capable of accessing
the full redirection URI including the fragment retained by the user- the full redirection URI including the fragment retained by the user-
agent, and extracting the access token (and other parameters) agent, and extracting the access token (and other parameters)
contained in the fragment. contained in the fragment.
3.5.2. Web Server Flow 3.6. Web Server Flow
The web server flow is a user delegation flow suitable for clients The web server flow is a user delegation flow suitable for clients
capable of interacting with the end-user's user-agent (typically a capable of interacting with the end-user's user-agent (typically a
web browser) and capable of receiving incoming requests from the web browser) and capable of receiving incoming requests from the
authorization server (capable of acting as an HTTP server). authorization server (capable of acting as an HTTP server).
+----------+ Client Identifier +---------------+ +----------+ Client Identifier +---------------+
| -+----(A)-- & Redirect URI ------->| | | -+----(A)-- & Redirect URI ------->| |
| End-user | | Authorization | | End-user | | Authorization |
| at |<---(B)-- User authenticates --->| Server | | at |<---(B)-- User authenticates --->| Server |
skipping to change at page 19, line 8 skipping to change at page 19, line 8
code for the client to use to obtain an access token. code for the client to use to obtain an access token.
(D) The client requests an access token from the authorization (D) The client requests an access token from the authorization
server by including its client credentials (identifier and server by including its client credentials (identifier and
secret), as well as the verification code received in the secret), as well as the verification code received in the
previous step. previous step.
(E) The authorization server validates the client credentials and (E) The authorization server validates the client credentials and
the verification code and responds back with the access token. the verification code and responds back with the access token.
3.5.2.1. Client Requests Authorization 3.6.1. Client Requests Authorization
In order for the end-user to grant the client access, the client In order for the end-user to grant the client access, the client
sends the end-user to the authorization server. The client sends the end-user to the authorization server. The client
constructs the request URI by adding the following URI query constructs the request URI by adding the following URI query
parameters to the user authorization endpoint URI: parameters to the user authorization endpoint URI:
type type
REQUIRED. The parameter value MUST be set to "web_server". REQUIRED. The parameter value MUST be set to "web_server".
client_id client_id
REQUIRED. The client identifier as described in Section 3.4. REQUIRED. The client identifier as described in Section 3.4.
redirect_uri redirect_uri
REQUIRED unless a redirection URI has been established between REQUIRED unless a redirection URI has been established between
the client and authorization server via other means. An the client and authorization server via other means. An
absolute URI to which the authorization server will redirect absolute URI to which the authorization server will redirect
the user-agent to when the end-user authorization step is the user-agent to when the end-user authorization step is
completed. The authorization server MAY require the client to completed. The authorization server MAY require the client to
pre-register their redirection URI. Authorization servers MAY pre-register their redirection URI. Authorization servers MAY
restritc the redirection URI to not include a query component restrict the redirection URI to not include a query component
as defined by [RFC3986] section 3. as defined by [RFC3986] section 3.
state state
OPTIONAL. An opaque value used by the client to maintain state OPTIONAL. An opaque value used by the client to maintain state
between the request and callback. The authorization server between the request and callback. The authorization server
includes this value when redirecting the user-agent back to the includes this value when redirecting the user-agent back to the
client. client.
scope scope
OPTIONAL. The scope of the access request expressed as a list OPTIONAL. The scope of the access request expressed as a list
skipping to change at page 20, line 32 skipping to change at page 20, line 32
redirection URI received matches the registered URI associated with redirection URI received matches the registered URI associated with
the client identifier. the client identifier.
The authorization server authenticates the end-user and obtains an The authorization server authenticates the end-user and obtains an
authorization decision (by asking the end-user or establishing authorization decision (by asking the end-user or establishing
approval via other means). The authorization server sends the end- approval via other means). The authorization server sends the end-
user's user-agent to the provided client redirection URI using an user's user-agent to the provided client redirection URI using an
HTTP redirection response, or by other means available to it via the HTTP redirection response, or by other means available to it via the
end-user's user-agent. end-user's user-agent.
3.5.2.1.1. End-user Grants Authorization 3.6.1.1. End-user Grants Authorization
If the end-user authorizes the access request, the authorization If the end-user authorizes the access request, the authorization
server generates a verification code and associates it with the server generates a verification code and associates it with the
client identifier and redirection URI. The authorization server client identifier and redirection URI. The authorization server
constructs the request URI by adding the following parameters to the constructs the request URI by adding the following parameters to the
query component of redirection URI provided by the client: query component of redirection URI provided by the client:
code code
REQUIRED. The verification code generated by the authorization REQUIRED. The verification code generated by the authorization
server. server.
skipping to change at page 21, line 18 skipping to change at page 21, line 18
HTTP/1.1 302 Found HTTP/1.1 302 Found
Location: https://client.example.com/cb?code=i1WsRn1uB1 Location: https://client.example.com/cb?code=i1WsRn1uB1
In turn, the end-user's user-agent makes the following HTTPS "GET" In turn, the end-user's user-agent makes the following HTTPS "GET"
request: request:
GET /cb?code=i1WsRn1uB1 HTTP/1.1 GET /cb?code=i1WsRn1uB1 HTTP/1.1
Host: client.example.com Host: client.example.com
3.5.2.1.2. End-user Denies Authorization 3.6.1.2. End-user Denies Authorization
If the end-user denied the access request, the authorization server If the end-user denied the access request, the authorization server
constructs the request URI by adding the following parameters to the constructs the request URI by adding the following parameters to the
query component of the redirection URI provided by the client: query component of the redirection URI provided by the client:
error error
REQUIRED. The parameter value MUST be set to "user_denied". REQUIRED. The parameter value MUST be set to "user_denied".
state state
REQUIRED if the "state" parameter was present in the client REQUIRED if the "state" parameter was present in the client
skipping to change at page 21, line 40 skipping to change at page 21, line 40
the client. the client.
For example, the authorization server directs the client to make the For example, the authorization server directs the client to make the
following HTTP request: following HTTP request:
GET /cb?error=user_denied HTTP/1.1 GET /cb?error=user_denied HTTP/1.1
Host: client.example.com Host: client.example.com
The authorization flow concludes unsuccessfully. The authorization flow concludes unsuccessfully.
3.5.2.2. Client Requests Access Token 3.6.2. Client Requests Access Token
The client obtains an access token from the authorization server by The client obtains an access token from the authorization server by
making an HTTP "POST" request to the token endpoint. The client making an HTTP "POST" request to the token endpoint. The client
constructs a request URI by adding the following parameters to the constructs a request URI by adding the following parameters to the
request: request:
type type
REQUIRED. The parameter value MUST be set to "web_server". REQUIRED. The parameter value MUST be set to "web_server".
client_id client_id
skipping to change at page 22, line 24 skipping to change at page 22, line 24
code code
REQUIRED. The verification code received from the REQUIRED. The verification code received from the
authorization server. authorization server.
redirect_uri redirect_uri
REQUIRED. The redirection URI used in the initial request. REQUIRED. The redirection URI used in the initial request.
secret_type secret_type
OPTIONAL. The access token secret type as described by OPTIONAL. The access token secret type as described by
Section 7.3. If omitted, the authorization server will issue a Section 8.3. If omitted, the authorization server will issue a
bearer token (an access token without a matching secret) as bearer token (an access token without a matching secret) as
described by Section 7.2. described by Section 8.2.
For example, the client makes the following HTTPS request (line For example, the client makes the following HTTPS request (line
breaks are for display purposes only): breaks are for display purposes only):
POST /token HTTP/1.1 POST /token HTTP/1.1
Host: server.example.com Host: server.example.com
Content-Type: application/x-www-form-urlencoded Content-Type: application/x-www-form-urlencoded
type=web_server&client_id=s6BhdRkqt3& type=web_server&client_id=s6BhdRkqt3&
client_secret=gX1fBat3bV&code=i1WsRn1uB1& client_secret=gX1fBat3bV&code=i1WsRn1uB1&
skipping to change at page 23, line 30 skipping to change at page 23, line 30
o "bad_verification_code" o "bad_verification_code"
o "incorrect_client_credentials" o "incorrect_client_credentials"
For example: For example:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"error"="incorrect_client_credentials"} {"error":"incorrect_client_credentials"}
3.5.3. Device Flow 3.7. Device Flow
The device flow is a user delegation flow suitable for clients The device flow is a user delegation flow suitable for clients
executing on devices which do not have an easy data-entry method executing on devices which do not have an easy data-entry method
(e.g. game consoles or media hub), but where the end-user has (e.g. game consoles or media hub), but where the end-user has
separate access to a user-agent on another computer or device (e.g. separate access to a user-agent on another computer or device (e.g.
home computer, a laptop, or a smartphone). The client is incapable home computer, a laptop, or a smartphone). The client is incapable
of receiving incoming requests from the authorization server of receiving incoming requests from the authorization server
(incapable of acting as an HTTP server). (incapable of acting as an HTTP server).
Instead of interacting with the end-user's user-agent, the client Instead of interacting with the end-user's user-agent, the client
skipping to change at page 25, line 19 skipping to change at page 25, line 19
(E) While the end-user authorizes (or denies) the client's request (E) While the end-user authorizes (or denies) the client's request
(D), the client repeatedly polls the authorization server to (D), the client repeatedly polls the authorization server to
find out if the end-user completed the user authorization step. find out if the end-user completed the user authorization step.
The client includes the verification code and its client The client includes the verification code and its client
identifier. identifier.
(F) Assuming the end-user granted access, the authorization server (F) Assuming the end-user granted access, the authorization server
validates the verification code provided by the client and validates the verification code provided by the client and
responds back with the access token. responds back with the access token.
3.5.3.1. Client Requests Authorization 3.7.1. Client Requests Authorization
The client initiates the flow by requesting a set of verification The client initiates the flow by requesting a set of verification
codes from the authorization server by making an HTTP "GET" request codes from the authorization server by making an HTTP "GET" request
to the token endpoint. The client constructs a request URI by adding to the token endpoint. The client constructs a request URI by adding
the following parameters to the request: the following parameters to the request:
type type
REQUIRED. The parameter value MUST be set to "device_code". REQUIRED. The parameter value MUST be set to "device_code".
client_id client_id
skipping to change at page 26, line 44 skipping to change at page 26, line 44
the end-user, and instructs the end-user to visit the URI using a the end-user, and instructs the end-user to visit the URI using a
user-agent and enter the user code. user-agent and enter the user code.
The end-user manually types the provided URI and authenticates with The end-user manually types the provided URI and authenticates with
the authorization server. The authorization server prompts the end- the authorization server. The authorization server prompts the end-
user to authorize the client's request by entering the user code user to authorize the client's request by entering the user code
provided by the client. Once the end-user approves or denies the provided by the client. Once the end-user approves or denies the
request, the authorization server informs the end-user to return to request, the authorization server informs the end-user to return to
the device for further instructions. the device for further instructions.
3.5.3.2. Client Requests Access Token 3.7.2. Client Requests Access Token
Since the client is unable to receive incoming requests from the Since the client is unable to receive incoming requests from the
authorization server, it polls the authorization server repeatedly authorization server, it polls the authorization server repeatedly
until the end-user grants or denies the request, or the verification until the end-user grants or denies the request, or the verification
code expires. code expires.
The client makes the following request at an arbitrary but reasonable The client makes the following request at an arbitrary but reasonable
interval which MUST NOT exceed the minimum interval rate provided by interval which MUST NOT exceed the minimum interval rate provided by
the authorization server (if present via the "interval" parameter). the authorization server (if present via the "interval" parameter).
Alternatively, the client MAY provide a user interface for the end- Alternatively, the client MAY provide a user interface for the end-
skipping to change at page 27, line 26 skipping to change at page 27, line 26
REQUIRED. The parameter value MUST be set to "device_token". REQUIRED. The parameter value MUST be set to "device_token".
client_id client_id
REQUIRED. The client identifier as described in Section 3.4. REQUIRED. The client identifier as described in Section 3.4.
code code
The verification code received from the authorization server. The verification code received from the authorization server.
secret_type secret_type
OPTIONAL. The access token secret type as described by OPTIONAL. The access token secret type as described by
Section 7.3. If omitted, the authorization server will issue a Section 8.3. If omitted, the authorization server will issue a
bearer token (an access token without a matching secret) as bearer token (an access token without a matching secret) as
described by Section 7.2. described by Section 8.2.
For example, the client makes the following HTTPS request (line For example, the client makes the following HTTPS request (line
breaks are for display purposes only): breaks are for display purposes only):
GET /token?type=device_token&client_id=s6BhdRkqt3 GET /token?type=device_token&client_id=s6BhdRkqt3
&code=J2vC42OifV HTTP/1.1 &code=J2vC42OifV HTTP/1.1
Host: server.example.com Host: server.example.com
If the end-user authorized the request, the authorization server If the end-user authorized the request, the authorization server
issues an access token response as described in Section 3.2.1.1. issues an access token response as described in Section 3.2.1.1.
skipping to change at page 28, line 19 skipping to change at page 28, line 19
o "authorization_declined" o "authorization_declined"
o "bad_verification_code" o "bad_verification_code"
For example: For example:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"error"="authorization_declined"} {"error":"authorization_declined"}
If the end-user authorization is pending or expired without receiving If the end-user authorization is pending or expired without receiving
any response from the end-user, or the client is exceeding the any response from the end-user, or the client is exceeding the
allowed polling interval, the authorization server returns an error allowed polling interval, the authorization server returns an error
response as described in Section 3.2.1.2 with one of the following response as described in Section 3.2.1.2 with one of the following
error codes: error codes:
o "'authorization_pending" o "'authorization_pending"
o "slow_down" o "slow_down"
o "code_expired" o "code_expired"
For example: For example:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"error"="authorization_pending"} {"error":"authorization_pending"}
4. End-user Credentials Flows
End-user credential flows are used to grant client access to
protected resources by the end-user directly sharing the end-user's
username and password with the client. Unlike user delegation flows,
end-user credentials flows require a much higher degree of trust
between the client and end-user.
These flows are suitable in cases where the end-user already has a
trust relationship with the client, such as its computer operating
system or highly privileged applications. Authorization servers
SHOULD take special care when enabling user credentials flows, and
SHOULD only do so when other delegation flows are not viable.
However, unlike the HTTP Basic authentication scheme defined in
[RFC2617], the end-user's credentials are used in a single request
and are exchanged for an access token and refresh token which
eliminates the client need to store them for future use.
4.1. Username and Password Flow 4. Username and Password Flow
The username and password flow is an end-user credentials flow The username and password flow is an end-user credentials flow
suitable for clients capable of asking end users for their usernames suitable for clients capable of asking end users for their usernames
and passwords. It is also used to migrate existing clients using and passwords. It is also used to migrate existing clients using
direct authentication schemes such as HTTP Basic or Digest direct authentication schemes such as HTTP Basic or Digest
authentication to OAuth by converting the end-user credentials stored authentication to OAuth by converting the end-user credentials stored
with tokens. with tokens.
However, unlike the HTTP Basic authentication scheme defined in
[RFC2617], the end-user's credentials are used in a single request
and are exchanged for an access token and refresh token which
eliminates the client need to store them for future use.
The methods through which the client prompts end users for their The methods through which the client prompts end users for their
usernames and passwords is beyond the scope of this specification. usernames and passwords is beyond the scope of this specification.
The client MUST discard the usernames and passwords once an access The client MUST discard the usernames and passwords once an access
token has been obtained. token has been obtained.
This flow is suitable in cases where the end-user already has a trust
relationship with the client, such as its computer operating system
or highly privileged applications. Authorization servers should take
special care when enabling the username and password flow, and only
when other delegation flows are not viable.
End-user End-user
v v
: :
(A) (A)
: :
v v
+--------+ +---------------+ +--------+ +---------------+
| | Client Credentials | | | | Client Credentials | |
| |>--(B)--- & User Credentials ---->| Authorization | | |>--(B)--- & User Credentials ---->| Authorization |
| Client | | Server | | Client | | Server |
skipping to change at page 30, line 14 skipping to change at page 30, line 8
(A) The end-user provides the client with its username and password. (A) The end-user provides the client with its username and password.
(B) The client sends an access token request to the authorization (B) The client sends an access token request to the authorization
server and includes its client identifier and client secret, and server and includes its client identifier and client secret, and
the end-user's username and password. the end-user's username and password.
(C) The authorization server validates the end-user credentials and (C) The authorization server validates the end-user credentials and
the client credentials and issues an access token. the client credentials and issues an access token.
4.1.1. Client Requests Access Token 4.1. Client Requests Access Token
The client requests an access token by making an HTTP "POST" request The client requests an access token by making an HTTP "POST" request
to the token endpoint. The client constructs a request URI by adding to the token endpoint. The client constructs a request URI by adding
the following parameters to the request: the following parameters to the request:
type type
REQUIRED. The parameter value MUST be set to "username". REQUIRED. The parameter value MUST be set to "username".
client_id client_id
REQUIRED. The client identifier as described in Section 3.4. REQUIRED. The client identifier as described in Section 3.4.
skipping to change at page 30, line 46 skipping to change at page 30, line 40
scope scope
OPTIONAL. The scope of the access request expressed as a list OPTIONAL. The scope of the access request expressed as a list
of space-delimited strings. The value of the "scope" parameter of space-delimited strings. The value of the "scope" parameter
is defined by the authorization server. If the value contains is defined by the authorization server. If the value contains
multiple space-delimited strings, their order does not matter, multiple space-delimited strings, their order does not matter,
and each string adds additional access range to the requested and each string adds additional access range to the requested
scope. scope.
secret_type secret_type
OPTIONAL. The access token secret type as described by OPTIONAL. The access token secret type as described by
Section 7.3. If omitted, the authorization server will issue a Section 8.3. If omitted, the authorization server will issue a
bearer token (an access token without a matching secret) as bearer token (an access token without a matching secret) as
described by Section 7.2. described by Section 8.2.
For example, the client makes the following HTTPS request (line For example, the client makes the following HTTPS request (line
breaks are for display purposes only): breaks are for display purposes only):
POST /token HTTP/1.1 POST /token HTTP/1.1
Host: server.example.com Host: server.example.com
type=username&client_id=s6BhdRkqt3&client_secret= type=username&client_id=s6BhdRkqt3&client_secret=
47HDu8s&username=johndoe&password=A3ddj3w 47HDu8s&username=johndoe&password=A3ddj3w
skipping to change at page 31, line 42 skipping to change at page 31, line 33
o "unauthorized_client'" - The client is not permitted to use this o "unauthorized_client'" - The client is not permitted to use this
flow. flow.
For example: For example:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"error"="incorrect_client_credentials"} {"error":"incorrect_client_credentials"}
5. Autonomous Client Flows
Autonomous client flows are used to grant client access to protected
resources controlled by the client (i.e. the client is the resource
owner). For example, these flows are useful when a service provides
both client-specific resources in addition to end-user resources.
5.1. Client Credentials Flow 5. Client Credentials Flow
The client credentials flow is used when the client acts autonomously The client credentials flow is used when the client acts autonomously
without acting on behalf of a separate resource owner. The client without acting on behalf of a separate resource owner. The client
secret is assumed to be high-entropy since it is not designed to be secret is assumed to be high-entropy since it is not designed to be
memorized by an end-user. memorized by an end-user.
+--------+ +---------------+ +--------+ +---------------+
| | | | | | | |
| |>--(A)--- Client Credentials ---->| Authorization | | |>--(A)--- Client Credentials ---->| Authorization |
| Client | | Server | | Client | | Server |
skipping to change at page 32, line 38 skipping to change at page 32, line 24
The client credential flow illustrated in Figure 7 includes the The client credential flow illustrated in Figure 7 includes the
following steps: following steps:
(A) The client sends an access token request to the authorization (A) The client sends an access token request to the authorization
server and includes its client identifier and client secret. server and includes its client identifier and client secret.
(B) The authorization server validates the client credentials and (B) The authorization server validates the client credentials and
issues an access token. issues an access token.
5.1.1. Client Requests Access Token 5.1. Client Requests Access Token
The client requests an access token by making an HTTP "POST" request The client requests an access token by making an HTTP "POST" request
to the token endpoint. The client constructs a request URI by adding to the token endpoint. The client constructs a request URI by adding
the following parameters to the request: the following parameters to the request:
type type
REQUIRED. The parameter value MUST be set to REQUIRED. The parameter value MUST be set to
"client_credentials". "client_credentials".
client_id client_id
skipping to change at page 33, line 21 skipping to change at page 32, line 50
scope scope
OPTIONAL. The scope of the access request expressed as a list OPTIONAL. The scope of the access request expressed as a list
of space-delimited strings. The value of the "scope" parameter of space-delimited strings. The value of the "scope" parameter
is defined by the authorization server. If the value contains is defined by the authorization server. If the value contains
multiple space-delimited strings, their order does not matter, multiple space-delimited strings, their order does not matter,
and each string adds additional access range to the requested and each string adds additional access range to the requested
scope. scope.
secret_type secret_type
OPTIONAL. The access token secret type as described by OPTIONAL. The access token secret type as described by
Section 7.3. If omitted, the authorization server will issue a Section 8.3. If omitted, the authorization server will issue a
bearer token (an access token without a matching secret) as bearer token (an access token without a matching secret) as
described by Section 7.2. described by Section 8.2.
For example, the client makes the following HTTPS request (line For example, the client makes the following HTTPS request (line
breaks are for display purposes only): breaks are for display purposes only):
POST /token HTTP/1.1 POST /token HTTP/1.1
Host: server.example.com Host: server.example.com
type=client_credentials&client_id=s6BhdRkqt3&client_secret=47HDu8s type=client_credentials&client_id=s6BhdRkqt3&client_secret=47HDu8s
The authorization server MUST validate the client credentials and if The authorization server MUST validate the client credentials and if
skipping to change at page 34, line 13 skipping to change at page 33, line 39
error codes: error codes:
o "incorrect_client_credentials" o "incorrect_client_credentials"
For example: For example:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"error"="incorrect_client_credentials"} {"error":"incorrect_client_credentials"}
5.2. Assertion Flow 6. Assertion Flow
The assertion flow is used when a client wishes to exchange an The assertion flow is used when a client wishes to exchange an
existing security token or assertion for an access token. This flow existing security token or assertion for an access token. This flow
is suitable when the client is acting autonomously or on behalf of is suitable when the client is acting autonomously or on behalf of
the end-user (based on the content of the assertion used). the end-user (based on the content of the assertion used).
The assertion flow requires the client to obtain a assertion (such as The assertion flow requires the client to obtain a assertion (such as
a SAML [OASIS.saml-core-2.0-os] assertion) from an assertion issuer a SAML [OASIS.saml-core-2.0-os] assertion) from an assertion issuer
or to self-issue an assertion prior to initiating the flow. The or to self-issue an assertion prior to initiating the flow. The
assertion format, the process by which the assertion is obtained, and assertion format, the process by which the assertion is obtained, and
skipping to change at page 35, line 8 skipping to change at page 34, line 34
The assertion flow illustrated in Figure 8 includes the following The assertion flow illustrated in Figure 8 includes the following
steps: steps:
(A) The client sends an access token request to the authorization (A) The client sends an access token request to the authorization
server and includes an assertion. server and includes an assertion.
(B) The authorization server validates the assertion and issues an (B) The authorization server validates the assertion and issues an
access token. access token.
5.2.1. Client Requests Access Token 6.1. Client Requests Access Token
The client requests an access token by making an HTTP "POST" request The client requests an access token by making an HTTP "POST" request
to the token endpoint. The client constructs a request URI by adding to the token endpoint. The client constructs a request URI by adding
the following parameters to the request: the following parameters to the request:
type type
REQUIRED. The parameter value MUST be set to "assertion". REQUIRED. The parameter value MUST be set to "assertion".
format format
REQUIRED. The format of the assertion as defined by the REQUIRED. The format of the assertion as defined by the
skipping to change at page 35, line 34 skipping to change at page 35, line 18
scope scope
OPTIONAL. The scope of the access request expressed as a list OPTIONAL. The scope of the access request expressed as a list
of space-delimited strings. The value of the "scope" parameter of space-delimited strings. The value of the "scope" parameter
is defined by the authorization server. If the value contains is defined by the authorization server. If the value contains
multiple space-delimited strings, their order does not matter, multiple space-delimited strings, their order does not matter,
and each string adds additional access range to the requested and each string adds additional access range to the requested
scope. scope.
secret_type secret_type
OPTIONAL. The access token secret type as described by OPTIONAL. The access token secret type as described by
Section 7.3. If omitted, the authorization server will issue a Section 8.3. If omitted, the authorization server will issue a
bearer token (an access token without a matching secret) as bearer token (an access token without a matching secret) as
described by Section 7.2. described by Section 8.2.
For example, the client makes the following HTTPS request (line For example, the client makes the following HTTPS request (line
breaks are for display purposes only): breaks are for display purposes only):
POST /token HTTP/1.1 POST /token HTTP/1.1
Host: server.example.com Host: server.example.com
type=assertion&format=_______&assertion=_______ type=assertion&format=_______&assertion=_______
The authorization server MUST validate the assertion and if valid The authorization server MUST validate the assertion and if valid
issues an access token response as described in Section 3.2.1.1. The issues an access token response as described in Section 3.2.1.1. The
authorization server SHOULD NOT issue a refresh token. authorization server SHOULD NOT issue a refresh token.
For example (line breaks are for display purposes only): For example (line breaks are for display purposes only):
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"access_token":"SlAV32hkKG"} {"access_token":"SlAV32hkKG","expires_in":3600}
If the request is invalid, the authorization server returns an error If the request is invalid, the authorization server returns an error
response as described in Section 3.2.1.2 with one of the following response as described in Section 3.2.1.2 with one of the following
error codes: error codes:
o "invalid_assertion" o "invalid_assertion"
o "unknown_format" o "unknown_format"
For example: For example:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"error"="invalid_assertion"} {"error":"invalid_assertion"}
Authorization servers SHOULD issue access tokens with a limited Authorization servers SHOULD issue access tokens with a limited
lifetime and require clients to refresh them by requesting a new lifetime and require clients to refresh them by requesting a new
access token using the same assertion if it is still valid. access token using the same assertion if it is still valid.
Otherwise the client MUST obtain a new valid assertion. Otherwise the client MUST obtain a new valid assertion.
6. Refreshing an Access Token 7. Refreshing an Access Token
Token refresh is used when the lifetime of an access token is shorter Token refresh is used when the lifetime of an access token is shorter
than the lifetime of the authorization grant. It allows clients to than the lifetime of the authorization grant. It allows clients to
obtain a new access token without having to go through the obtain a new access token without having to go through the
authorization flow again or involve the resource owner. It is also authorization flow again or involve the resource owner. It is also
used to obtain a new token with different security properties (e.g. used to obtain a new token with different security properties (e.g.
bearer token, token with shared symmetric secret). bearer token, token with shared symmetric secret).
+--------+ Client Credentials, +---------------+ +--------+ Client Credentials, +---------------+
| | Refresh Token, | | | | Refresh Token, | |
skipping to change at page 37, line 35 skipping to change at page 37, line 17
client_secret client_secret
REQUIRED if the client was issued a secret. The client secret. REQUIRED if the client was issued a secret. The client secret.
refresh_token refresh_token
REQUIRED. The refresh token associated with the access token REQUIRED. The refresh token associated with the access token
to be refreshed. to be refreshed.
secret_type secret_type
OPTIONAL. The access token secret type as described by OPTIONAL. The access token secret type as described by
Section 7.3. If omitted, the authorization server will issue a Section 8.3. If omitted, the authorization server will issue a
bearer token (an access token without a matching secret) as bearer token (an access token without a matching secret) as
described by Section 7.2. described by Section 8.2.
For example, the client makes the following HTTPS request (line break For example, the client makes the following HTTPS request (line break
are for display purposes only): are for display purposes only):
POST /token HTTP/1.1 POST /token HTTP/1.1
Host: server.example.com Host: server.example.com
Content-Type: application/x-www-form-urlencoded Content-Type: application/x-www-form-urlencoded
type=refresh_token&client_id=s6BhdRkqt3&client_secret=8eSEIpnqmM type=refresh_token&client_id=s6BhdRkqt3&client_secret=8eSEIpnqmM
&refresh_token=n4E9O119d&secret_type=hmac-sha256 &refresh_token=n4E9O119d&secret_type=hmac-sha256
skipping to change at page 38, line 33 skipping to change at page 38, line 17
o "authorization_expired" o "authorization_expired"
o "unsupported_secret_type" o "unsupported_secret_type"
For example: For example:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{"error"="incorrect_client_credentials"} {"error":"incorrect_client_credentials"}
7. Accessing a Protected Resource 8. Accessing a Protected Resource
Clients access protected resources by presenting an access token to Clients access protected resources by presenting an access token to
the resource server. The methods used by the resource server to the resource server. The methods used by the resource server to
validate the access token are beyond the scope of this specification, validate the access token are beyond the scope of this specification,
but generally involve an interaction or coordination between the but generally involve an interaction or coordination between the
resource server and authorization server. resource server and authorization server.
The method in which a client uses an access token depends on the The method in which a client uses an access token depends on the
security properties of the access tokens. By default, access tokens security properties of the access tokens. By default, access tokens
are issued without a matching secret. Clients MAY request an access are issued without a matching secret. Clients MAY request an access
skipping to change at page 39, line 29 skipping to change at page 39, line 10
When an access token includes a matching secret, the secret is not When an access token includes a matching secret, the secret is not
included directly in the request but is used instead to generate a included directly in the request but is used instead to generate a
cryptographic signature of the request. The signature can only be cryptographic signature of the request. The signature can only be
generated and verified by entities with access to the secret. generated and verified by entities with access to the secret.
Clients SHOULD NOT make authenticated requests with an access token Clients SHOULD NOT make authenticated requests with an access token
to unfamiliar resource servers, especially when using bearer tokens, to unfamiliar resource servers, especially when using bearer tokens,
regardless of the presence of a secure channel. regardless of the presence of a secure channel.
7.1. The Authorization Request Header 8.1. The Authorization Request Header
The "Authorization" request header field is used by clients to make The "Authorization" request header field is used by clients to make
both bearer token and cryptographic token requests. When making both bearer token and cryptographic token requests. When making
bearer token requests, the client uses the "token" attribute to bearer token requests, the client uses the "token" attribute to
include the access token in the request without any of the other include the access token in the request without any of the other
attributes. Additional methods for making bearer token requests are attributes. Additional methods for making bearer token requests are
described in Section 7.2. described in Section 8.2.
For example: For example:
GET /resource HTTP/1.1 GET /resource HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: Token token="vF9dft4qmT" Authorization: Token token="vF9dft4qmT"
When making a cryptographic token request (using an access token with When making a cryptographic token request (using an access token with
a matching secret) the client uses the "token" attribute to include a matching secret) the client uses the "token" attribute to include
the access token in the request, and uses the "nonce", "timestamp", the access token in the request, and uses the "nonce", "timestamp",
skipping to change at page 40, line 36 skipping to change at page 40, line 23
token-id = "token" "=" <"> token <"> token-id = "token" "=" <"> token <">
timestamp = "timestamp" "=" <"> 1*DIGIT <"> timestamp = "timestamp" "=" <"> 1*DIGIT <">
nonce = "nonce" "=" <"> token <"> nonce = "nonce" "=" <"> token <">
algorithm = "algorithm" "=" algorithm-name algorithm = "algorithm" "=" algorithm-name
algorithm-name = "hmac-sha256" / algorithm-name = "hmac-sha256" /
token token
signature = "signature" "=" <"> token <"> signature = "signature" "=" <"> token <">
7.2. Bearer Token Requests 8.2. Bearer Token Requests
Clients make bearer token requests by including the access token Clients make bearer token requests by including the access token
using the HTTP "Authorization" request header with the "Token" using the HTTP "Authorization" request header with the "Token"
authentication scheme as described in Section 7.1. The access token authentication scheme as described in Section 8.1. The access token
is included using the "token" parameter. is included using the "token" parameter.
For example, the client makes the following HTTPS request: For example, the client makes the following HTTPS request:
GET /resource HTTP/1.1 GET /resource HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: Token token="vF9dft4qmT" Authorization: Token token="vF9dft4qmT"
The resource server MUST validate the access token and ensure it has The resource server MUST validate the access token and ensure it has
not expired and that its scope covers the requested resource. If the not expired and that its scope covers the requested resource. If the
token expired or is invalid, the resource server MUST reply with an token expired or is invalid, the resource server MUST reply with an
HTTP 401 status code (Unauthorized) and include the HTTP HTTP 401 status code (Unauthorized) and include the HTTP
"WWW-Authenticate" response header as described in Section 8.1. "WWW-Authenticate" response header as described in Section 9.1.
For example: For example:
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
WWW-Authenticate: Token realm='Service', error='token_expired' WWW-Authenticate: Token realm='Service', error='token_expired'
Alternatively, the client MAY include the access token using the HTTP Alternatively, the client MAY include the access token using the HTTP
request URI in the query component as described in Section 7.2.1, or request URI in the query component as described in Section 8.2.1, or
in the HTTP body when using the "application/x-www-form-urlencoded" in the HTTP body when using the "application/x-www-form-urlencoded"
content type as described in Section 7.2.2. Clients SHOULD only use content type as described in Section 8.2.2. Clients SHOULD only use
the request URI or body when the "Authorization" request header is the request URI or body when the "Authorization" request header is
not available, and MUST NOT use more than one method in each request. not available, and MUST NOT use more than one method in each request.
7.2.1. URI Query Parameter 8.2.1. URI Query Parameter
When including the access token in the HTTP request URI, the client When including the access token in the HTTP request URI, the client
adds the access token to the request URI query component as defined adds the access token to the request URI query component as defined
by [RFC3986] using the "oauth_token" parameter. by [RFC3986] using the "oauth_token" parameter.
For example, the client makes the following HTTPS request: For example, the client makes the following HTTPS request:
GET /resource?oauth_token=vF9dft4qmT HTTP/1.1 GET /resource?oauth_token=vF9dft4qmT HTTP/1.1
Host: server.example.com Host: server.example.com
The HTTP request URI query can include other request-specific The HTTP request URI query can include other request-specific
parameters, in which case, the "oauth_token" parameters SHOULD be parameters, in which case, the "oauth_token" parameters SHOULD be
appended following the request-specific parameters, properly appended following the request-specific parameters, properly
separated by an "&" character (ASCII code 38). separated by an "&" character (ASCII code 38).
The resource server MUST validate the access token and ensure it has The resource server MUST validate the access token and ensure it has
not expired and its scope includes the requested resource. If the not expired and its scope includes the requested resource. If the
resource expired or is not valid, the resource server MUST reply with resource expired or is not valid, the resource server MUST reply with
an HTTP 401 status code (Unauthorized) and include the HTTP an HTTP 401 status code (Unauthorized) and include the HTTP
"WWW-Authenticate" response header as described in Section 8.1. "WWW-Authenticate" response header as described in Section 9.1.
7.2.2. Form-Encoded Body Parameter 8.2.2. Form-Encoded Body Parameter
When including the access token in the HTTP request entity-body, the When including the access token in the HTTP request entity-body, the
client adds the access token to the request body using the client adds the access token to the request body using the
"oauth_token" parameter. The client can use this method only if the "oauth_token" parameter. The client can use this method only if the
following REQUIRED conditions are met: following REQUIRED conditions are met:
o The entity-body is single-part. o The entity-body is single-part.
o The entity-body follows the encoding requirements of the o The entity-body follows the encoding requirements of the
"application/x-www-form-urlencoded" content-type as defined by "application/x-www-form-urlencoded" content-type as defined by
skipping to change at page 42, line 35 skipping to change at page 42, line 22
POST /resource HTTP/1.1 POST /resource HTTP/1.1
Host: server.example.com Host: server.example.com
Content-Type: application/x-www-form-urlencoded Content-Type: application/x-www-form-urlencoded
oauth_token=vF9dft4qmT oauth_token=vF9dft4qmT
The resource server MUST validate the access token and ensure it has The resource server MUST validate the access token and ensure it has
not expired and its scope includes the requested resource. If the not expired and its scope includes the requested resource. If the
resource expired or is not valid, the resource server MUST reply with resource expired or is not valid, the resource server MUST reply with
an HTTP 401 status code (Unauthorized) and include the HTTP an HTTP 401 status code (Unauthorized) and include the HTTP
"WWW-Authenticate" response header as described in Section 8.1. "WWW-Authenticate" response header as described in Section 9.1.
7.3. Cryptographic Tokens Requests 8.3. Cryptographic Tokens Requests
Clients make authenticated protected resource requests using an Clients make authenticated protected resource requests using an
access token with a matching secret by calculating a set of values access token with a matching secret by calculating a set of values
and including them in the request using the "Authorization" header and including them in the request using the "Authorization" header
field. The way clients calculate these values depends on the access field. The way clients calculate these values depends on the access
token secret type as issued by the authorization server. token secret type as issued by the authorization server.
This specification defines the "hmac-sha256" algorithm, and This specification defines the "hmac-sha256" algorithm, and
establishes a registry for providing additional algorithms. Clients establishes a registry for providing additional algorithms. Clients
obtain an access token with a matching "hmac-sha256" secret by using obtain an access token with a matching "hmac-sha256" secret by using
the "token_type" parameter when requesting an access token. the "secret_type" parameter when requesting an access token.
7.3.1. The 'hmac-sha256' Algorithm 8.3.1. The 'hmac-sha256' Algorithm
The "hmac-sha256" algorithm uses the HMAC method as defined in The "hmac-sha256" algorithm uses the HMAC method as defined in
[RFC2104] together with the SHA-256 hash function defined in [NIST [RFC2104] together with the SHA-256 hash function defined in [NIST
FIPS-180-3] to apply the access token secret to the request and FIPS-180-3] to apply the access token secret to the request and
generate a signature value that is included in the request instead of generate a signature value that is included in the request instead of
transmitting the secret in the clear. transmitting the secret in the clear.
To use the "hmac-sha256" algorithm, clients: To use the "hmac-sha256" algorithm, clients:
1. Calculate the request timestamp and generate a request nonce as 1. Calculate the request timestamp and generate a request nonce as
described in Section 7.3.1.1. described in Section 8.3.1.1.
2. Construct the normalized request string as described in 2. Construct the normalized request string as described in
Section 7.3.1.2. Section 8.3.1.2.
3. Calculate the request signature as described in Section 7.3.1.3. 3. Calculate the request signature as described in Section 8.3.1.3.
4. Include the timestamp, nonce, algorithm name, and calculated 4. Include the timestamp, nonce, algorithm name, and calculated
signature in the request using the "Authorization" header field. signature in the request using the "Authorization" header field.
For example: For example:
GET /resource HTTP/1.1 GET /resource HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: Token token="vF9dft4qmT", Authorization: Token token="vF9dft4qmT",
nonce="s8djwd", nonce="s8djwd",
skipping to change at page 43, line 43 skipping to change at page 43, line 30
algorithm="hmac-sha256", algorithm="hmac-sha256",
signature="wOJIO9A2W5mFwDgiDvZbTSMK/PY=" signature="wOJIO9A2W5mFwDgiDvZbTSMK/PY="
The resource server MUST validate the access token and ensure it has The resource server MUST validate the access token and ensure it has
not expired and that its scope covers the requested resource. The not expired and that its scope covers the requested resource. The
resource server MUST also recalculate the request signature using the resource server MUST also recalculate the request signature using the
attributes provided by the client and compare it to the signature attributes provided by the client and compare it to the signature
provided. If the token expired or is invalid, or if the signature is provided. If the token expired or is invalid, or if the signature is
incorrect, the resource server MUST reply with an HTTP 401 status incorrect, the resource server MUST reply with an HTTP 401 status
code (Unauthorized) and include the HTTP "WWW-Authenticate" response code (Unauthorized) and include the HTTP "WWW-Authenticate" response
header as described in Section 8.1. header as described in Section 9.1.
For example: For example:
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
Date: Tue, 15 Nov 2010 08:12:31 GMT Date: Tue, 15 Nov 2010 08:12:31 GMT
WWW-Authenticate: Token realm='Service', WWW-Authenticate: Token realm='Service',
algorithms='hmac-sha256', algorithms='hmac-sha256',
error='invalid_signature' error='invalid_signature'
[[ Errors list ]] [[ Errors list ]]
7.3.1.1. Nonce and Timestamp 8.3.1.1. Nonce and Timestamp
A timestamp in combination with unique nonce values is used to A timestamp in combination with unique nonce values is used to
protect against replay attacks when transmitted over an insecure protect against replay attacks when transmitted over an insecure
channel. channel.
The nonce is a random string, uniquely generated by the client to The nonce is a random string, uniquely generated by the client to
allow the resource server to verify that a request has never been allow the resource server to verify that a request has never been
made before and helps prevent replay attacks when requests are made made before and helps prevent replay attacks when requests are made
over a non-secure channel. The nonce value MUST be unique across all over a non-secure channel. The nonce value MUST be unique across all
requests with the same timestamp and token combinations. requests with the same timestamp and token combinations.
skipping to change at page 44, line 38 skipping to change at page 44, line 20
seconds since January 1, 1970 00:00:00 GMT, and MUST be a positive seconds since January 1, 1970 00:00:00 GMT, and MUST be a positive
integer. integer.
To avoid the need to retain an infinite number of nonce values for To avoid the need to retain an infinite number of nonce values for
future checks, resource servers MAY choose to restrict the time future checks, resource servers MAY choose to restrict the time
period after which a request with an old timestamp is rejected. When period after which a request with an old timestamp is rejected. When
resource servers apply such a restriction, clients SHOULD synchronize resource servers apply such a restriction, clients SHOULD synchronize
their clocks by using the resource server's time as indicated by the their clocks by using the resource server's time as indicated by the
HTTP "Date" response header field as defined in [RFC2616]. HTTP "Date" response header field as defined in [RFC2616].
7.3.1.2. Normalized String Construction 8.3.1.2. Normalized String Construction
The normalized request string is a consistent, reproducible The normalized request string is a consistent, reproducible
concatenation of several of the HTTP request elements into a single concatenation of several of the HTTP request elements into a single
string. The string is used as an input to the selected cryptographic string. The string is used as an input to the selected cryptographic
method and includes the HTTP request method (e.g. "GET", "POST", method and includes the HTTP request method (e.g. "GET", "POST",
etc.), the authority as declared by the HTTP "Host" request header, etc.), the authority as declared by the HTTP "Host" request header,
and the request resource URI. and the request resource URI.
The normalized request string does not cover the entire HTTP request. The normalized request string does not cover the entire HTTP request.
Most notably, it does not include the entity-body or most HTTP Most notably, it does not include the entity-body or most HTTP
entity-headers. It is important to note that the resource server entity-headers. It is important to note that the resource server
cannot verify the authenticity of the excluded request elements cannot verify the authenticity of the excluded request elements
without using additional protections such as TLS/SSL. without using additional protections such as TLS/SSL.
The normalized request string is constructed by concatenating The normalized request string is constructed by concatenating
together, in order, the following HTTP request elements, separated by together, in order, the following HTTP request elements, separated by
the "," character (ASCII code 44): the "," character (ASCII code 44):
1. The request timestamp as described in Section 7.3.1.1. 1. The request timestamp as described in Section 8.3.1.1.
2. The request nonce as described in Section 7.3.1.1. 2. The request nonce as described in Section 8.3.1.1.
3. The cryptographic algorithm used. 3. The cryptographic algorithm used.
4. The HTTP request method in uppercase. For example: "HEAD", 4. The HTTP request method in uppercase. For example: "HEAD",
"GET", "POST", etc. "GET", "POST", etc.
5. The hostname, colon-separated (ASCII code 58) from the TCP port 5. The hostname, colon-separated (ASCII code 58) from the TCP port
used to make the request as included in the HTTP request "Host" used to make the request as included in the HTTP request "Host"
header field. The port MUST be included even if it is not header field. The port MUST be included even if it is not
included in the "Host" header field (i.e. the default port for included in the "Host" header field (i.e. the default port for
skipping to change at page 45, line 35 skipping to change at page 45, line 16
6. The request resource URI. 6. The request resource URI.
For example, the normalized request string for the "GET" request URI For example, the normalized request string for the "GET" request URI
"http://example.com/resource", request timestamp "137131200", request "http://example.com/resource", request timestamp "137131200", request
nonce "s8djwd", and "hmac-sha256" algorithm (line breaks are for nonce "s8djwd", and "hmac-sha256" algorithm (line breaks are for
display purposes only): display purposes only):
137131200,s8djwd,hmac-sha256,GET,example.com:80, 137131200,s8djwd,hmac-sha256,GET,example.com:80,
http://example.com/resource http://example.com/resource
7.3.1.3. Signature Calculation 8.3.1.3. Signature Calculation
Clients calculate the request signature using the HMAC-SHA256 Clients calculate the request signature using the HMAC-SHA256
function: function:
digest = HMAC-SHA256 (key, text) digest = HMAC-SHA256 (key, text)
by setting the function variables are follows: by setting the function variables are follows:
text text
is set to the value of the normalize request string as is set to the value of the normalize request string as
described in Section 7.3.1.2. described in Section 8.3.1.2.
key key
is set to the access token secret. is set to the access token secret.
The request signature is the calculated value of the "digest" The request signature is the calculated value of the "digest"
variable after the result octet string is base64-encoded per variable after the result octet string is base64-encoded per
[RFC2045] section 6.8. [RFC2045] section 6.8.
8. Identifying a Protected Resource 9. Identifying a Protected Resource
Clients access protected resources after locating the appropriate Clients access protected resources after locating the appropriate
authorization and token endpoints and obtaining an access token. In authorization and token endpoints and obtaining an access token. In
many cases, interacting with a protected resource requires prior many cases, interacting with a protected resource requires prior
knowledge of the protected resource properties and methods, as well knowledge of the protected resource properties and methods, as well
as its authentication requirements (i.e. establishing client as its authentication requirements (i.e. establishing client
identity, locating the authorization and token endpoints). identity, locating the authorization and token endpoints).
However, there are cases in which clients are unfamiliar with the However, there are cases in which clients are unfamiliar with the
protected resource, including whether the resource requires protected resource, including whether the resource requires
authentication. When clients attempt to access an unfamiliar authentication. When clients attempt to access an unfamiliar
protected resource without an access token, the resource server protected resource without an access token, the resource server
denies the request and informs the client of the required credentials denies the request and informs the client of the required credentials
using an HTTP authentication challenge. using an HTTP authentication challenge.
In addition, when receiving an invalid authenticated request, the In addition, when receiving an invalid authenticated request, the
resource server issues an authentication challenge including the resource server issues an authentication challenge including the
error type and message. error type and message.
8.1. The WWW-Authenticate Response Header 9.1. The WWW-Authenticate Response Header
A resource server receiving a request for a protected resource A resource server receiving a request for a protected resource
without a valid access token MUST respond with a 401 HTTP status code without a valid access token MUST respond with a 401 HTTP status code
(Unauthorized), and includes at least one "Token" "WWW-Authenticate" (Unauthorized), and includes at least one "Token" "WWW-Authenticate"
response header field challenge. response header field challenge.
The "WWW-Authenticate" header field uses the framework defined by The "WWW-Authenticate" header field uses the framework defined by
[RFC2617] as follows: [RFC2617] as follows:
challenge = "Token" RWS token-challenge challenge = "Token" RWS token-challenge
skipping to change at page 47, line 20 skipping to change at page 46, line 38
[ CS algorithms ] [ CS algorithms ]
[ CS error ] [ CS error ]
authz-uri = "auth-uri" "=" URI-Reference authz-uri = "auth-uri" "=" URI-Reference
token-uri = "token-uri" "=" URI-Reference token-uri = "token-uri" "=" URI-Reference
algorithms = "algorithms" "=" <"> 1#algorithm-name <"> algorithms = "algorithms" "=" <"> 1#algorithm-name <">
error = "error" "=" <"> token <"> error = "error" "=" <"> token <">
CS = OWS "," OWS CS = OWS "," OWS
8.1.1. The 'realm' Attribute 9.1.1. The 'realm' Attribute
The "realm" attribute is used to provide the protected resources The "realm" attribute is used to provide the protected resources
partition as defined by [RFC2617]. partition as defined by [RFC2617].
8.1.2. The 'authorization-uri' Attribute 9.1.2. The 'authorization-uri' Attribute
8.1.3. The 'algorithms' Attribute
8.1.4. The 'error' Attribute 9.1.3. The 'algorithms' Attribute
9.1.4. The 'error' Attribute
9. Security Considerations 10. Security Considerations
[[ Todo ]] [[ Todo ]]
10. IANA Considerations 11. IANA Considerations
[[ Not Yet ]] [[ Not Yet ]]
11. Acknowledgements 12. Acknowledgements
[[ Add OAuth 1.0a authors + WG contributors ]] [[ Add OAuth 1.0a authors + WG contributors ]]
Appendix A. Differences from OAuth 1.0a Appendix A. Differences from OAuth 1.0a
[[ Todo ]] [[ Todo ]]
Appendix B. Document History Appendix B. Document History
[[ to be removed by RFC editor before publication as an RFC ]] [[ to be removed by RFC editor before publication as an RFC ]]
-03
o Fixed typo in JSON error examples.
o Fixed general typos.
o Moved all flows sections up one level.
-02 -02
o Removed restriction on "redirect_uri" including a query. o Removed restriction on "redirect_uri" including a query.
o Added "scope" parameter. o Added "scope" parameter.
o Initial proposal for a JSON-based token response format. o Initial proposal for a JSON-based token response format.
-01 -01
o Editorial changes based on feedback from Brian Eaton, Bill Keenan, o Editorial changes based on feedback from Brian Eaton, Bill Keenan,
and Chuck Mortimore. and Chuck Mortimore.
o Changed devide flow "type" parameter values and switch to use only o Changed devide flow "type" parameter values and switch to use only
the token endpoint. the token endpoint.
-00 -00
o Initial draft based on a combination of WRAP and OAuth 1.0a. o Initial draft based on a combination of WRAP and OAuth 1.0a.
12. References 13. References
12.1. Normative References 13.1. Normative References
[I-D.ietf-httpbis-p1-messaging] [I-D.ietf-httpbis-p1-messaging]
Fielding, R., Gettys, J., Mogul, J., Nielsen, H., Fielding, R., Gettys, J., Mogul, J., Nielsen, H.,
Masinter, L., Leach, P., Berners-Lee, T., and J. Reschke, Masinter, L., Leach, P., Berners-Lee, T., and J. Reschke,
"HTTP/1.1, part 1: URIs, Connections, and Message "HTTP/1.1, part 1: URIs, Connections, and Message
Parsing", draft-ietf-httpbis-p1-messaging-09 (work in Parsing", draft-ietf-httpbis-p1-messaging-09 (work in
progress), March 2010. progress), March 2010.
[NIST FIPS-180-3] [NIST FIPS-180-3]
National Institute of Standards and Technology, "Secure National Institute of Standards and Technology, "Secure
skipping to change at page 49, line 39 skipping to change at page 49, line 21
[RFC4627] Crockford, D., "The application/json Media Type for [RFC4627] Crockford, D., "The application/json Media Type for
JavaScript Object Notation (JSON)", RFC 4627, July 2006. JavaScript Object Notation (JSON)", RFC 4627, July 2006.
[W3C.REC-html40-19980424] [W3C.REC-html40-19980424]
Hors, A., Raggett, D., and I. Jacobs, "HTML 4.0 Hors, A., Raggett, D., and I. Jacobs, "HTML 4.0
Specification", World Wide Web Consortium Specification", World Wide Web Consortium
Recommendation REC-html40-19980424, April 1998, Recommendation REC-html40-19980424, April 1998,
<http://www.w3.org/TR/1998/REC-html40-19980424>. <http://www.w3.org/TR/1998/REC-html40-19980424>.
12.2. Informative References 13.2. Informative References
[I-D.hammer-oauth] [I-D.hammer-oauth]
Hammer-Lahav, E., "The OAuth 1.0 Protocol", Hammer-Lahav, E., "The OAuth 1.0 Protocol",
draft-hammer-oauth-10 (work in progress), February 2010. draft-hammer-oauth-10 (work in progress), February 2010.
[I-D.hardt-oauth] [I-D.hardt-oauth]
Hardt, D., Tom, A., Eaton, B., and Y. Goland, "OAuth Web Hardt, D., Tom, A., Eaton, B., and Y. Goland, "OAuth Web
Resource Authorization Profiles", draft-hardt-oauth-01 Resource Authorization Profiles", draft-hardt-oauth-01
(work in progress), January 2010. (work in progress), January 2010.
 End of changes. 103 change blocks. 
170 lines changed or deleted 159 lines changed or added

This html diff was produced by rfcdiff 1.38. The latest version is available from http://tools.ietf.org/tools/rfcdiff/