draft-ietf-oauth-v2-bearer-03.txt   draft-ietf-oauth-v2-bearer-04.txt 
Network Working Group M. Jones Network Working Group M. Jones
Internet-Draft Microsoft Internet-Draft Microsoft
Intended status: Standards Track D. Hardt Intended status: Standards Track D. Hardt
Expires: August 29, 2011 independent Expires: October 2, 2011 independent
D. Recordon D. Recordon
Facebook Facebook
February 25, 2011 March 31, 2011
The OAuth 2.0 Protocol: Bearer Tokens The OAuth 2.0 Protocol: Bearer Tokens
draft-ietf-oauth-v2-bearer-03 draft-ietf-oauth-v2-bearer-04
Abstract Abstract
This specification describes how to use bearer tokens when accessing This specification describes how to use bearer tokens when accessing
OAuth 2.0 protected resources. OAuth 2.0 protected resources.
Status of this Memo Status of this Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
skipping to change at page 1, line 34 skipping to change at page 1, line 34
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 August 29, 2011. This Internet-Draft will expire on October 2, 2011.
Copyright Notice Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the Copyright (c) 2011 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 20 skipping to change at page 2, line 20
1.3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Authenticated Requests . . . . . . . . . . . . . . . . . . . . 4 2. Authenticated Requests . . . . . . . . . . . . . . . . . . . . 4
2.1. The Authorization Request Header Field . . . . . . . . . . 5 2.1. The Authorization Request Header Field . . . . . . . . . . 5
2.2. Form-Encoded Body Parameter . . . . . . . . . . . . . . . 5 2.2. Form-Encoded Body Parameter . . . . . . . . . . . . . . . 5
2.3. URI Query Parameter . . . . . . . . . . . . . . . . . . . 6 2.3. URI Query Parameter . . . . . . . . . . . . . . . . . . . 6
2.4. The WWW-Authenticate Response Header Field . . . . . . . . 7 2.4. The WWW-Authenticate Response Header Field . . . . . . . . 7
2.4.1. Error Codes . . . . . . . . . . . . . . . . . . . . . 8 2.4.1. Error Codes . . . . . . . . . . . . . . . . . . . . . 8
3. Security Considerations . . . . . . . . . . . . . . . . . . . 9 3. Security Considerations . . . . . . . . . . . . . . . . . . . 9
3.1. Security Threats . . . . . . . . . . . . . . . . . . . . . 9 3.1. Security Threats . . . . . . . . . . . . . . . . . . . . . 9
3.2. Threat Mitigation . . . . . . . . . . . . . . . . . . . . 9 3.2. Threat Mitigation . . . . . . . . . . . . . . . . . . . . 9
3.3. Summary of Recommendations . . . . . . . . . . . . . . . . 10 3.3. Summary of Recommendations . . . . . . . . . . . . . . . . 11
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11
4.1. OAuth Access Token Type Registration . . . . . . . . . . . 11 4.1. OAuth Access Token Type Registration . . . . . . . . . . . 11
4.1.1. The "Bearer" OAuth Access Token Type . . . . . . . . . 11 4.1.1. The "Bearer" OAuth Access Token Type . . . . . . . . . 12
4.2. The OAuth Parameters Registry . . . . . . . . . . . . . . 12 4.2. The OAuth Errors Registry . . . . . . . . . . . . . . . . 12
4.2.1. Registration Template . . . . . . . . . . . . . . . . 12 4.2.1. Registration Template . . . . . . . . . . . . . . . . 12
4.2.2. OAuth Parameters Registration . . . . . . . . . . . . 13 4.2.2. Initial Registry Contents . . . . . . . . . . . . . . 13
4.3. The OAuth Errors Registry . . . . . . . . . . . . . . . . 13 5. References . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.1. Registration Template . . . . . . . . . . . . . . . . 14 5.1. Normative References . . . . . . . . . . . . . . . . . . . 14
4.3.2. Initial Registry Contents . . . . . . . . . . . . . . 14 5.2. Informative References . . . . . . . . . . . . . . . . . . 15
5. References . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 15
5.1. Normative References . . . . . . . . . . . . . . . . . . . 15 Appendix B. Document History . . . . . . . . . . . . . . . . . . 15
5.2. Informative References . . . . . . . . . . . . . . . . . . 16 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 17
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 16
Appendix B. Document History . . . . . . . . . . . . . . . . . . 16
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 18
1. Introduction 1. Introduction
OAuth enables clients to access protected resources by obtaining an OAuth enables clients to access protected resources by obtaining an
access token, which is defined in [I-D.ietf-oauth-v2] as "a string access token, which is defined in [I-D.ietf-oauth-v2] as "a string
representing an access authorization issued to the client", rather representing an access authorization issued to the client", rather
than using the resource owner's credentials. than using the resource owner's credentials.
Tokens are issued to clients by an authorization server with the Tokens are issued to clients by an authorization server with the
approval of the resource owner. The client uses the access token to approval of the resource owner. The client uses the access token to
access the protected resources hosted by the resource server. This access the protected resources hosted by the resource server. This
specification describes how to make protected resource requests by specification describes how to make protected resource requests when
treating an OAuth access token as a bearer token. the OAuth access token is a bearer token.
This specification defines the use of bearer tokens with OAuth over This specification defines the use of bearer tokens with OAuth over
HTTP [RFC2616] using TLS [RFC2818]. Other specifications may extend HTTP [RFC2616] using TLS [RFC5246]. Other specifications may extend
it for use with other transport protocols. it for use with other transport protocols.
1.1. Notational Conventions 1.1. 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].
This document uses the Augmented Backus-Naur Form (ABNF) notation of This document uses the Augmented Backus-Naur Form (ABNF) notation of
[I-D.ietf-httpbis-p1-messaging]. Additionally, the following rules [I-D.ietf-httpbis-p1-messaging]. Additionally, the following rules
are included from [RFC2617]: auth-param; from [RFC3986]: URI- are included from [RFC2617]: realm; from [RFC3986]: URI-Reference;
Reference; and from [I-D.ietf-httpbis-p1-messaging]: RWS and quoted- and from [I-D.ietf-httpbis-p1-messaging]: RWS and quoted-string.
string.
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.
1.2. Terminology 1.2. Terminology
All terms are as defined in [I-D.ietf-oauth-v2]. Bearer Token
A security token with the property that any party in possession of
the token (a "bearer") can use the token in any way that any other
party in possession of it can. Using a bearer token does not
require a bearer to prove possession of cryptographic key material
(proof-of-possession).
All other terms are as defined in [I-D.ietf-oauth-v2].
1.3. Overview 1.3. Overview
OAuth provides a method for clients to access a protected resource on OAuth provides a method for clients to access a protected resource on
behalf of a resource owner. Before a client can access a protected behalf of a resource owner. Before a client can access a protected
resource, it must first obtain authorization (access grant) from the resource, it must first obtain authorization (access grant) from the
resource owner and then exchange the access grant for an access token resource owner and then exchange the access grant for an access token
(representing the grant's scope, duration, and other attributes). (representing the grant's scope, duration, and other attributes).
The client accesses the protected resource by presenting the access The client accesses the protected resource by presenting the access
token to the resource server. token to the resource server.
skipping to change at page 4, line 41 skipping to change at page 4, line 47
this document: this document:
E) The client makes a protected resource request to the resource E) The client makes a protected resource request to the resource
server by presenting the access token. server by presenting the access token.
F) The resource server validates the access token, and if valid, F) The resource server validates the access token, and if valid,
serves the request. serves the request.
2. Authenticated Requests 2. Authenticated Requests
Clients make authenticated token requests using the "Authorization" Clients SHOULD make authenticated requests with a bearer token using
request header field. Resource servers MUST accept authenticated the "Authorization" request header field defined by [RFC2617].
requests using the "Bearer" HTTP authentication scheme as described Resource servers MUST accept authenticated requests using the
in Section 2.1, and MAY support additional methods. "Bearer" HTTP authorization scheme as described in Section 2.1, and
MAY support additional methods.
Alternatively, clients MAY attempt to include the access token in the Alternatively, clients MAY transmit the access token in the HTTP body
HTTP body when using the "application/x-www-form-urlencoded" content when using the "application/x-www-form-urlencoded" content type as
type as described in Section 2.2 or using the HTTP request URI in the described in Section 2.2; or clients MAY transmit the access token in
query component as described in Section 2.3. Resource servers MAY the HTTP request URI in the query component as described in
support these alternative methods. Section 2.3. Resource servers MAY support these alternative methods.
Clients SHOULD only use the request body or URI when the Clients SHOULD NOT use the request body or URI unless the
"Authorization" request header field is not available, and MUST NOT "Authorization" request header field is not available, and MUST NOT
use more than one method to transport the token in each request. use more than one method to transmit the token in each request.
Because of the Security Considerations (Section 3) associated with Because of the Security Considerations (Section 3) associated with
the URI method, it SHOULD only be used if no other method is the URI method, it SHOULD NOT be used unless no other method is
feasible. feasible.
2.1. The Authorization Request Header Field 2.1. The Authorization Request Header Field
The "Authorization" request header field is used by clients to make The "Authorization" request header field is used by clients to make
authenticated token requests. The client uses the "Bearer" authenticated requests with bearer tokens. The client uses the
authentication scheme to include the access token in the request. "Bearer" authentication scheme to transmit the access token in the
request.
For example: For example:
GET /resource HTTP/1.1 GET /resource HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: Bearer vF9dft4qmT Authorization: Bearer vF9dft4qmT
The "Authorization" header field uses the framework defined by The "Authorization" header field uses the framework defined by
[RFC2617] as follows: [RFC2617] as follows:
credentials = "Bearer" RWS access-token [ RWS 1#auth-param ] credentials = "Bearer" RWS access-token
access-token = 1*( quoted-char / <"> ) access-token = 1*( quoted-char / <"> )
quoted-char = "!" / "#" / "$" / "%" / "&" / "'" / "(" quoted-char = "!" / "#" / "$" / "%" / "&" / "'" / "("
/ ")" / "*" / "+" / "-" / "." / "/" / DIGIT / ")" / "*" / "+" / "-" / "." / "/" / DIGIT
/ ":" / "<" / "=" / ">" / "?" / "@" / ALPHA / ":" / "<" / "=" / ">" / "?" / "@" / ALPHA
/ "[" / "]" / "^" / "_" / "`" / "{" / "|" / "[" / "]" / "^" / "_" / "`" / "{" / "|"
/ "}" / "~" / "\" / "," / ";" / "}" / "~" / "\" / "," / ";"
2.2. Form-Encoded Body Parameter 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 "bearer_token" parameter. The client MUST NOT use this method unless
following REQUIRED conditions are met: the following conditions are met:
o The HTTP request entity-body is single-part. o The HTTP request 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
[W3C.REC-html401-19991224]. [W3C.REC-html401-19991224].
o The HTTP request entity-header includes the "Content-Type" header o The HTTP request entity-header includes the "Content-Type" header
field set to "application/x-www-form-urlencoded". field set to "application/x-www-form-urlencoded".
o The HTTP request method is one for which a body is permitted to be o The HTTP request method is one for which a body is permitted to be
present in the request. In particular, this means that the "GET" present in the request. In particular, this means that the "GET"
method MAY NOT be used. method MUST NOT be used.
The entity-body can include other request-specific parameters, in The entity-body can include other request-specific parameters, in
which case, the "oauth_token" parameters SHOULD be appended following which case, the "bearer_token" parameter MUST be properly separated
the request-specific parameters, properly separated by an "&" from the request-specific parameters by an "&" character (ASCII code
character (ASCII code 38). 38).
For example, the client makes the following HTTP request using For example, the client makes the following HTTP request using
transport-layer security: transport-layer security:
POST /resource HTTP/1.1 POST /resource HTTP/1.1
Host: server.example.com Host: server.example.com
Content-Type: application/x-www-form-urlencoded Content-Type: application/x-www-form-urlencoded
oauth_token=vF9dft4qmT bearer_token=vF9dft4qmT
The "application/x-www-form-urlencoded" method should typically only The "application/x-www-form-urlencoded" method SHOULD NOT be used
be used in application contexts where participating browsers do not except in application contexts where participating browsers do not
have access to the "Authorization" request header field. have access to the "Authorization" request header field.
2.3. URI Query Parameter 2.3. 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 "bearer_token" parameter.
For example, the client makes the following HTTP request using For example, the client makes the following HTTP request using
transport-layer security: transport-layer security:
GET /resource?oauth_token=vF9dft4qmT HTTP/1.1 GET /resource?bearer_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 "bearer_token" parameter MUST be
appended following the request-specific parameters, properly properly separated from the request-specific parameters by an "&"
separated by an "&" character (ASCII code 38). character (ASCII code 38).
For example: For example:
http://example.com/resource?x=y&oauth_token=vF9dft4qmT http://example.com/resource?x=y&bearer_token=vF9dft4qmT
Because of the Security Considerations (Section 3) associated with Because of the Security Considerations (Section 3) associated with
the URI method, it SHOULD only be used if no other method is the URI method, it SHOULD NOT be used unless no other method is
feasible. feasible.
2.4. The WWW-Authenticate Response Header Field 2.4. The WWW-Authenticate Response Header Field
If the protected resource request does not include authentication If the protected resource request does not include authentication
credentials, contains an invalid access token, or is malformed, the credentials or contains an invalid access token, the resource server
resource server MUST include the HTTP "WWW-Authenticate" response MUST include the HTTP "WWW-Authenticate" response header field; it
header field. The "WWW-Authenticate" header field uses the framework MAY include it in response to other conditions as well. The
defined by [RFC2617] as follows: "WWW-Authenticate" header field uses the framework defined by
[RFC2617] as follows:
challenge = "Bearer" [ RWS 1#param ] challenge = "Bearer" [ RWS 1#param ]
param = scope / param = realm / scope /
error / error-desc / error-uri / error / error-desc / error-uri /
( token "=" ( token / quoted-string ) ) ( token "=" ( token / quoted-string ) )
scope = "scope" "=" <"> scope-v *( SP scope-v ) <"> scope = "scope" "=" <"> scope-v *( SP scope-v ) <">
scope-v = 1*quoted-char scope-v = 1*quoted-char
quoted-char = ALPHA / DIGIT / quoted-char = ALPHA / DIGIT /
"!" / "#" / "$" / "%" / "&" / "'" / "(" / ")" / "!" / "#" / "$" / "%" / "&" / "'" / "(" / ")" /
"*" / "+" / "-" / "." / "/" / ":" / "<" / "=" / "*" / "+" / "-" / "." / "/" / ":" / "<" / "=" /
">" / "?" / "@" / "[" / "]" / "^" / "_" / "`" / ">" / "?" / "@" / "[" / "]" / "^" / "_" / "`" /
skipping to change at page 7, line 52 skipping to change at page 8, line 12
"error_description" attribute to provide a human-readable "error_description" attribute to provide a human-readable
explanation, and the "error_uri" attribute with an absolute URI explanation, and the "error_uri" attribute with an absolute URI
identifying a human-readable web page explaining the error. The identifying a human-readable web page explaining the error. The
"error", "error_description", and "error_uri" attribute MUST NOT "error", "error_description", and "error_uri" attribute MUST NOT
appear more than once. appear more than once.
For example, in response to a protected resource request without For example, in response to a protected resource request without
authentication: authentication:
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer WWW-Authenticate: Bearer realm="example"
And in response to a protected resource request with an And in response to a protected resource request with an
authentication attempt using an expired access token: authentication attempt using an expired access token:
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer WWW-Authenticate: Bearer realm="example"
error="invalid_token", error="invalid_token",
error_description="The access token expired" error_description="The access token expired"
2.4.1. Error Codes 2.4.1. Error Codes
When a request fails, the resource server responds using the When a request fails, the resource server responds using the
appropriate HTTP status code (typically, 400, 401, or 403), and appropriate HTTP status code (typically, 400, 401, or 403), and
includes one of the following error codes in the response: includes one of the following error codes in the response:
invalid_request invalid_request
skipping to change at page 8, line 40 skipping to change at page 8, line 50
request. request.
insufficient_scope insufficient_scope
The request requires higher privileges than provided by the The request requires higher privileges than provided by the
access token. The resource server SHOULD respond with the HTTP access token. The resource server SHOULD respond with the HTTP
403 (Forbidden) status code and MAY include the "scope" 403 (Forbidden) status code and MAY include the "scope"
attribute with the scope necessary to access the protected attribute with the scope necessary to access the protected
resource. resource.
New errors MUST be separately registered in the OAuth Errors registry New errors MUST be separately registered in the OAuth Errors registry
as described by Section 4.3. as described by Section 4.2.
If the request lacks any authentication information (i.e. the client If the request lacks any authentication information (i.e. the client
was unaware authentication is necessary or attempted using an was unaware authentication is necessary or attempted using an
unsupported authentication method), the resource server SHOULD not unsupported authentication method), the resource server SHOULD NOT
include an error code or other error information. include an error code or other error information.
For example: For example:
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer WWW-Authenticate: Bearer realm="example"
3. Security Considerations 3. Security Considerations
This section describes the relevant security threats regarding token This section describes the relevant security threats regarding token
handling when using bearer tokens and describes how to mitigate these handling when using bearer tokens and describes how to mitigate these
threats. threats.
3.1. Security Threats 3.1. Security Threats
The following list presents several common threats against protocols The following list presents several common threats against protocols
skipping to change at page 9, line 39 skipping to change at page 9, line 49
Token redirect: An attacker uses the token generated for consumption Token redirect: An attacker uses the token generated for consumption
by resource server to obtain access to another resource server. by resource server to obtain access to another resource server.
Token replay: An attacker attempts to use a token that has already Token replay: An attacker attempts to use a token that has already
been used with that resource server in the past. been used with that resource server in the past.
3.2. Threat Mitigation 3.2. Threat Mitigation
A large range of threats can be mitigated by protecting the contents A large range of threats can be mitigated by protecting the contents
of the token by using a digital signature or a keyed message digest. of the token by using a digital signature or a Message Authentication
Alternatively, the contents of the token could be passed by reference Code (MAC). Alternatively, a bearer token can contain a reference to
rather than by value (requiring a separate message exchange to authorization information, rather than encoding the information
resolve the reference to the token contents). directly. Such references MUST be infeasible for an attacker to
guess; using a reference may require an extra interaction between a
server and the token issuer to resolve the reference to the
authorization information.
This document does not specify the encoding or the contents of the This document does not specify the encoding or the contents of the
token; hence detailed recommendations for token integrity protection token; hence detailed recommendations for token integrity protection
are outside the scope of this document. We assume that the token are outside the scope of this document. We assume that the token
integrity protection is sufficient to prevent the token from being integrity protection is sufficient to prevent the token from being
modified. modified.
To deal with token redirect, it is important for the authorization To deal with token redirect, it is important for the authorization
server to include the identity of the intended recipients, namely a server to include the identity of the intended recipients, namely a
single resource server (or a list of resource servers). Restricting single resource server (or a list of resource servers). Restricting
the use of the token to a specific scope is also recommended. the use of the token to a specific scope is also recommended.
To provide protection against token disclosure, confidentiality To provide protection against token disclosure, confidentiality
protection is applied via TLS with a ciphersuite that offers protection is applied via TLS [RFC5246] with a ciphersuite that
confidentiality protection. This requires that the communication offers confidentiality protection. This requires that the
interaction between the client and the authorization server, as well communication interaction between the client and the authorization
as the interaction between the client and the resource server, server, as well as the interaction between the client and the
utilize confidentiality protection. Since TLS is mandatory to resource server, utilize confidentiality protection. Since TLS is
implement and to use with this specification, it is the preferred mandatory to implement and to use with this specification, it is the
approach for preventing token disclosure via the communication preferred approach for preventing token disclosure via the
channel. For those cases where the client is prevented from communication channel. For those cases where the client is prevented
observing the contents of the token, token encryption has to be from observing the contents of the token, token encryption has to be
applied in addition to the usage of TLS protection. applied in addition to the usage of TLS protection.
To deal with token capture and replay, the following recommendations To deal with token capture and replay, the following recommendations
are made: First, the lifetime of the token has to be limited by are made: First, the lifetime of the token has to be limited by
putting a validity time field inside the protected part of the token. putting a validity time field inside the protected part of the token.
Note that using short-lived (one hour or less) tokens significantly Note that using short-lived (one hour or less) tokens significantly
reduces the impact of one of them being leaked. Second, reduces the impact of one of them being leaked. Second,
confidentiality protection of the exchanges between the client and confidentiality protection of the exchanges between the client and
the authorization server and between the client and the resource the authorization server and between the client and the resource
server MUST be applied. As a consequence, no eavesdropper along the server MUST be applied, for instance, through the use of TLS
communication path is able to observe the token exchange. [RFC5246]. As a consequence, no eavesdropper along the communication
Consequently, such an on-path adversary cannot replay the token. path is able to observe the token exchange. Consequently, such an
Furthermore, when presenting the token to a resource server, the on-path adversary cannot replay the token. Furthermore, when
client MUST verify the identity of that resource server. Note that presenting the token to a resource server, the client MUST verify the
the client MUST validate the TLS certificate chain when making these identity of that resource server, as per [RFC2818]. Note that the
client MUST validate the TLS certificate chain when making these
requests to protected resources. Presenting the token to an requests to protected resources. Presenting the token to an
unauthenticated and unauthorized resource server or failing to unauthenticated and unauthorized resource server or failing to
validate the certificate chain will allow adversaries to steal the validate the certificate chain will allow adversaries to steal the
token and gain unauthorized access to protected resources. token and gain unauthorized access to protected resources.
3.3. Summary of Recommendations 3.3. Summary of Recommendations
Safeguard bearer tokens Client implementations MUST ensure that Safeguard bearer tokens Client implementations MUST ensure that
bearer tokens are not leaked to unintended parties, as they will bearer tokens are not leaked to unintended parties, as they will
be able to use them to gain access to protected resources. This be able to use them to gain access to protected resources. This
is the primary security consideration when using bearer tokens is the primary security consideration when using bearer tokens and
with OAuth and underlies all the more specific recommendations underlies all the more specific recommendations that follow.
that follow.
Validate SSL certificate chains The client must validate the TLS Validate SSL certificate chains The client must validate the TLS
certificate chain when making requests to protected resources. certificate chain when making requests to protected resources.
Failing to do so may enable DNS hijacking attacks to steal the Failing to do so may enable DNS hijacking attacks to steal the
token and gain unintended access. token and gain unintended access.
Always use TLS (https) Clients MUST always use TLS (https) when Always use TLS (https) Clients MUST always use TLS [RFC5246] (https)
making requests with bearer tokens. Failing to do so exposes the when making requests with bearer tokens. Failing to do so exposes
token to numerous attacks that could give attackers unintended the token to numerous attacks that could give attackers unintended
access. access.
Don't store bearer tokens in cookies As cookies are generally sent Don't store bearer tokens in cookies Implementations MUST NOT store
in the clear, implementations MUST NOT store bearer tokens within bearer tokens within cookies that can be sent in the clear (which
them. is the default transmission mode for cookies).
Issue short-lived bearer tokens Using short-lived (one hour or less) Issue short-lived bearer tokens Using short-lived (one hour or less)
bearer tokens can reduce the impact of one of them being leaked. bearer tokens can reduce the impact of one of them being leaked.
The User-Agent flow should only issue short lived access tokens. In particular, only short-lived bearer tokens should be issued to
clients that run within a web browser or other environments where
information leakage may occur.
Don't pass bearer tokens in page URLs Browsers, web servers, and Don't pass bearer tokens in page URLs Browsers, web servers, and
other software may not adequately secure URLs in the browser other software may not adequately secure URLs in the browser
history, web server logs, and other data structures. If bearer history, web server logs, and other data structures. If bearer
tokens are passed in page URLs (typically as query string tokens are passed in page URLs (typically as query string
parameters), attackers might be able to steal them from the parameters), attackers might be able to steal them from the
history data, logs, or other unsecured locations. Instead, pass history data, logs, or other unsecured locations. Instead, pass
browser tokens in message bodies for which confidentiality bearer tokens in HTTP message headers or message bodies for which
measures are taken. confidentiality measures are taken.
4. IANA Considerations 4. IANA Considerations
4.1. OAuth Access Token Type Registration 4.1. OAuth Access Token Type Registration
This specification registers the following access token type in the This specification registers the following access token type in the
OAuth Access Token Type Registry. OAuth Access Token Type Registry.
4.1.1. The "Bearer" OAuth Access Token Type 4.1.1. The "Bearer" OAuth Access Token Type
Type name: Type name:
Bearer Bearer
Additional Resource Request Parameters: Additional Token Endpoint Response Parameters:
oauth_token (none)
HTTP Authentication Scheme(s): HTTP Authentication Scheme(s):
Bearer Bearer
Change controller: Change controller:
IETF IETF
Specification document(s): Specification document(s):
[[ this document ]] [[ this document ]]
4.2. The OAuth Parameters Registry 4.2. The OAuth Errors Registry
This specification augments the OAuth Parameters registry established
by [I-D.ietf-oauth-v2] by adding two additional parameter usage
locations: "resource request" and "resource response".
Additional parameters for inclusion in the resource endpoint request
or the resource endpoint response are registered on the advice of one
or more Designated Experts (appointed by the IESG or their delegate),
with a Specification Required (using terminology from [RFC5226]).
However, to allow for the allocation of values prior to publication,
the Designated Expert(s) may approve registration once they are
satisfied that such a specification will be published.
Registration requests should be sent to the [TBD]@ietf.org mailing
list for review and comment, with an appropriate subject (e.g.,
"Request for parameter: example"). [[ Note to RFC-EDITOR: The name of
the mailing list should be determined in consultation with the IESG
and IANA. Suggested name: oauth-ext-review. ]]
Before a period of 14 days has passed, the Designated Expert(s) will
either approve or deny the registration request, communicating this
decision both to the review list and to IANA. Denials should include
an explanation and, if applicable, suggestions as to how to make the
request successful. Registration requests that are undetermined for
a period longer than 21 days can be brought to the IESG's attention
(using the iesg@iesg.org mailing list) for resolution.
4.2.1. Registration Template
Parameter name:
The name requested (e.g., "example").
Parameter usage location:
The location(s) where parameter can be used. The additional
locations are: resource request, resource response. These are in
addition to the locations authorization request, authorization
response, token request, and token response already established by
[I-D.ietf-oauth-v2].
Change controller:
For standards-track RFCs, state "IETF". For others, give the name
of the responsible party. Other details (e.g., postal address,
e-mail address, home page URI) may also be included.
Specification document(s):
Reference to document that specifies the parameter, preferably
including a URI that can be used to retrieve a copy of the
document. An indication of the relevant sections may also be
included, but is not required.
4.2.2. OAuth Parameters Registration
This specification registers the following parameters in the OAuth
Parameters Registry.
4.2.2.1. The "oauth_token" OAuth Parameter
Parameter name: oauth_token
Parameter usage location: resource request
Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
4.2.2.2. The "error" OAuth Parameter
Parameter name: error
Parameter usage location: authorization response, token response,
resource response
Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
4.3. The OAuth Errors Registry
This specification establishes the OAuth Errors registry. This specification establishes the OAuth Errors registry.
Additional errors for inclusion in the authorization endpoint Additional errors for inclusion in the authorization endpoint
response, the token endpoint response, or the resource endpoint response, the token endpoint response, or the resource endpoint
response are registered on the advice of one or more Designated response are registered on the advice of one or more Designated
Experts (appointed by the IESG or their delegate), with a Experts (appointed by the IESG or their delegate), with a
Specification Required (using terminology from [RFC5226]). However, Specification Required (using terminology from [RFC5226]). However,
to allow for the allocation of values prior to publication, the to allow for the allocation of values prior to publication, the
Designated Expert(s) may approve registration once they are satisfied Designated Expert(s) may approve registration once they are satisfied
skipping to change at page 14, line 19 skipping to change at page 12, line 49
IANA. Suggested name: oauth-ext-review. ]] IANA. Suggested name: oauth-ext-review. ]]
Before a period of 14 days has passed, the Designated Expert(s) will Before a period of 14 days has passed, the Designated Expert(s) will
either approve or deny the registration request, communicating this either approve or deny the registration request, communicating this
decision both to the review list and to IANA. Denials should include decision both to the review list and to IANA. Denials should include
an explanation and, if applicable, suggestions as to how to make the an explanation and, if applicable, suggestions as to how to make the
request successful. Registration requests that are undetermined for request successful. Registration requests that are undetermined for
a period longer than 21 days can be brought to the IESG's attention a period longer than 21 days can be brought to the IESG's attention
(using the iesg@iesg.org mailing list) for resolution. (using the iesg@iesg.org mailing list) for resolution.
4.3.1. Registration Template 4.2.1. Registration Template
Error name: Error name:
The name requested (e.g., "example"). The name requested (e.g., "example").
Error usage location: Error usage location:
The location(s) where error can be used. The possible locations The location(s) where the error can be used. The possible
are: authorization response, token response, resource response. locations are: authorization response, token response, resource
response.
Change controller: Change controller:
For standards-track RFCs, state "IETF". For others, give the name For standards-track RFCs, state "IETF". For others, give the name
of the responsible party. Other details (e.g., postal address, of the responsible party. Other details (e.g., postal address,
e-mail address, home page URI) may also be included. e-mail address, home page URI) may also be included.
Specification document(s): Specification document(s):
Reference to document that specifies the error, preferably Reference to document that specifies the error, preferably
including a URI that can be used to retrieve a copy of the including a URI that can be used to retrieve a copy of the
document. An indication of the relevant sections may also be document. An indication of the relevant sections may also be
included, but is not required. included, but is not required.
4.3.2. Initial Registry Contents 4.2.2. Initial Registry Contents
The OAuth Errors Registry's initial contents are: The OAuth Errors Registry's initial contents are:
o Error name: invalid_request o Error name: invalid_request
o Error usage location: resource response o Error usage location: resource response
o Change controller: IETF o Change controller: IETF
o Specification document(s): [[ this document ]] o Specification document(s): [[ this document ]]
skipping to change at page 15, line 28 skipping to change at page 14, line 13
o Specification document(s): [[ this document ]] o Specification document(s): [[ this document ]]
5. References 5. References
5.1. Normative References 5.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-13 (work in
progress), March 2010. progress), March 2011.
[I-D.ietf-oauth-v2] [I-D.ietf-oauth-v2]
Hammer-Lahav, E., Recordon, D., and D. Hardt, "The OAuth Hammer-Lahav, E., Recordon, D., and D. Hardt, "The OAuth
2.0 Authorization Protocol", draft-ietf-oauth-v2-13 (work 2.0 Authorization Protocol", draft-ietf-oauth-v2-13 (work
in progress), February 2011. in progress), February 2011.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
skipping to change at page 16, line 11 skipping to change at page 14, line 43
[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, January 2005. RFC 3986, January 2005.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226, IANA Considerations Section in RFCs", BCP 26, RFC 5226,
May 2008. May 2008.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, August 2008.
[W3C.REC-html401-19991224] [W3C.REC-html401-19991224]
Raggett, D., Hors, A., and I. Jacobs, "HTML 4.01 Raggett, D., Hors, A., and I. Jacobs, "HTML 4.01
Specification", World Wide Web Consortium Specification", World Wide Web Consortium
Recommendation REC-html401-19991224, December 1999, Recommendation REC-html401-19991224, December 1999,
<http://www.w3.org/TR/1999/REC-html401-19991224>. <http://www.w3.org/TR/1999/REC-html401-19991224>.
5.2. Informative References 5.2. Informative References
[I-D.ietf-httpbis-p7-auth]
Fielding, R., Gettys, J., Mogul, J., Nielsen, H.,
Masinter, L., Leach, P., Berners-Lee, T., and J. Reschke,
"HTTP/1.1, part 7: Authentication",
draft-ietf-httpbis-p7-auth-13 (work in progress),
March 2011.
[NIST800-63] [NIST800-63]
Burr, W., Dodson, D., Perlner, R., Polk, T., Gupta, S., Burr, W., Dodson, D., Perlner, R., Polk, T., Gupta, S.,
and E. Nabbus, "NIST Special Publication 800-63-1, and E. Nabbus, "NIST Special Publication 800-63-1,
INFORMATION SECURITY", December 2008. INFORMATION SECURITY", December 2008.
Appendix A. Acknowledgements Appendix A. Acknowledgements
The following people contributed to preliminary versions of this The following people contributed to preliminary versions of this
document: Blaine Cook (BT), Brian Eaton (Google), Yaron Goland document: Blaine Cook (BT), Brian Eaton (Google), Yaron Goland
(Microsoft), Brent Goldman (Facebook), Raffi Krikorian (Twitter), (Microsoft), Brent Goldman (Facebook), Raffi Krikorian (Twitter),
skipping to change at page 16, line 46 skipping to change at page 15, line 41
de hOra, Brian Ellin, Igor Faynberg, George Fletcher, Tim Freeman, de hOra, Brian Ellin, Igor Faynberg, George Fletcher, Tim Freeman,
Evan Gilbert, Justin Hart, John Kemp, Eran Hammer-Lahav, Chasen Le Evan Gilbert, Justin Hart, John Kemp, Eran Hammer-Lahav, Chasen Le
Hara, Michael B. Jones, Torsten Lodderstedt, Eve Maler, James Manger, Hara, Michael B. Jones, Torsten Lodderstedt, Eve Maler, James Manger,
Laurence Miao, Chuck Mortimore, Anthony Nadalin, Justin Richer, Peter Laurence Miao, Chuck Mortimore, Anthony Nadalin, Justin Richer, Peter
Saint-Andre, Nat Sakimura, Rob Sayre, Marius Scurtescu, Naitik Shah, Saint-Andre, Nat Sakimura, Rob Sayre, Marius Scurtescu, Naitik Shah,
Justin Smith, Jeremy Suriel, Christian Stuebner, Paul Tarjan, and Justin Smith, Jeremy Suriel, Christian Stuebner, Paul Tarjan, and
Franklin Tse. Franklin Tse.
Appendix B. Document History Appendix B. Document History
[[ to be removed by RFC editor before publication as an RFC ]] [[ to be removed by the RFC editor before publication as an RFC ]]
-04
o Edits responding to working group last call feedback on -03.
Specific edits enumerated below.
o Added Bearer Token definition in Terminology section.
o Changed parameter name "oauth_token" to "bearer_token".
o Added realm parameter to "WWW-Authenticate" response to comply
with [RFC2617].
o Removed "[ RWS 1#auth-param ]" from "credentials" definition since
it did not comply with the ABNF in [I-D.ietf-httpbis-p7-auth].
o Removed restriction that the "bearer_token" (formerly
"oauth_token") parameter be the last parameter in the entity-body
and the HTTP request URI query.
o Do not require WWW-Authenticate Response in a reply to a malformed
request, as an HTTP 400 Bad Request response without a WWW-
Authenticate header is likely the right response in some cases of
malformed requests.
o Removed OAuth Parameters registry extension.
o Numerous editorial improvements suggested by working group
members.
-03 -03
o Restored the WWW-Authenticate response header functionality o Restored the WWW-Authenticate response header functionality
deleted from the framework specification in draft 12 based upon deleted from the framework specification in draft 12 based upon
the specification text from draft 11. the specification text from draft 11.
o Augmented the OAuth Parameters registry by adding two additional o Augmented the OAuth Parameters registry by adding two additional
parameter usage locations: "resource request" and "resource parameter usage locations: "resource request" and "resource
response". response".
o Registered the "oauth_token" OAuth parameter with usage location o Registered the "oauth_token" OAuth parameter with usage location
"resource request". "resource request".
 End of changes. 53 change blocks. 
188 lines changed or deleted 159 lines changed or added

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