draft-ietf-oauth-revocation-04.txt   draft-ietf-oauth-revocation-05.txt 
OAuth Working Group T. Lodderstedt, Ed. OAuth Working Group T. Lodderstedt, Ed.
Internet-Draft Deutsche Telekom AG Internet-Draft Deutsche Telekom AG
Intended status: Standards Track S. Dronia Intended status: Standards Track S. Dronia
Expires: July 11, 2013 Expires: August 16, 2013
M. Scurtescu M. Scurtescu
Google Google
January 7, 2013 February 12, 2013
Token Revocation Token Revocation
draft-ietf-oauth-revocation-04 draft-ietf-oauth-revocation-05
Abstract Abstract
This document proposes an additional endpoint for OAuth authorization This document proposes an additional endpoint for OAuth authorization
servers, which allows clients to notify the authorization server that servers, which allows clients to notify the authorization server that
a previously obtained refresh or access token is no longer needed. a previously obtained refresh or access token is no longer needed.
This allows the authorization server to cleanup security credentials. This allows the authorization server to cleanup security credentials.
A revocation request will invalidate the actual token and, if A revocation request will invalidate the actual token and, if
applicable, other tokens based on the same authorization. applicable, other tokens based on the same authorization grant.
Requirements Language Requirements Language
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 RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
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
skipping to change at page 1, line 44 skipping to change at page 1, line 44
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 July 11, 2013. This Internet-Draft will expire on August 16, 2013.
Copyright Notice Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the Copyright (c) 2013 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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Token Revocation . . . . . . . . . . . . . . . . . . . . . . . 3 2. Token Revocation . . . . . . . . . . . . . . . . . . . . . . . 3
2.1. Cross-Origin Support . . . . . . . . . . . . . . . . . . . 5 2.1. Revocation Request . . . . . . . . . . . . . . . . . . . . 4
3. Implementation Note . . . . . . . . . . . . . . . . . . . . . . 5 2.2. Revocation Response . . . . . . . . . . . . . . . . . . . . 5
4. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6 2.2.1. Error Response . . . . . . . . . . . . . . . . . . . . 5
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 2.3. Cross-Origin Support . . . . . . . . . . . . . . . . . . . 5
6. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 3. Implementation Note . . . . . . . . . . . . . . . . . . . . . . 6
7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 7
7.1. Normative References . . . . . . . . . . . . . . . . . . . 7 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7
7.2. Informative References . . . . . . . . . . . . . . . . . . 7 6. Security Considerations . . . . . . . . . . . . . . . . . . . . 7
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 8 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.1. Normative References . . . . . . . . . . . . . . . . . . . 8
7.2. Informative References . . . . . . . . . . . . . . . . . . 8
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Introduction 1. Introduction
The OAuth 2.0 core specification [RFC6749] defines several ways for a The OAuth 2.0 core specification [RFC6749] defines several ways for a
client to obtain refresh and access tokens. This specification client to obtain refresh and access tokens. This specification
supplements the core specification with a mechanism to revoke both supplements the core specification with a mechanism to revoke both
types of tokens. A token is a string representing an authorization types of tokens. A token is a string representing an authorization
issued by the resource owner to the client. A revocation request grant issued by the resource owner to the client. A revocation
will invalidate the actual token and, if applicable, other tokens request will invalidate the actual token and, if applicable, other
based on the same authorization and the authorization itself. tokens based on the same authorization grant and the authorization
grant itself.
From an end-user's perspective, OAuth is often used to log into a From an end-user's perspective, OAuth is often used to log into a
certain site or app. This revocation mechanism allows a client to certain site or app. This revocation mechanism allows a client to
invalidate its tokens if the end-user logs out, changes identity, or invalidate its tokens if the end-user logs out, changes identity, or
uninstalls the respective app. Notifying the authorization server uninstalls the respective app. Notifying the authorization server
that the token is no longer needed allows the authorization server to that the token is no longer needed allows the authorization server to
clean up data associated with that token (e.g. session data) and the clean up data associated with that token (e.g. session data) and the
underlying authorization. This behavior prevents a situation where underlying authorization grant. This behavior prevents a situation
there is still a valid authorization for a particular client which where there is still a valid authorization grant for a particular
the end user is not aware of. This way, token revocation prevents client which the end user is not aware of. This way, token
abuse of abandoned tokens and facilitates a better end-user revocation prevents abuse of abandoned tokens and facilitates a
experience since invalidated authorization will no longer turn up in better end-user experience since invalidated authorization grants
a list of authorizations the authorization server might present to will no longer turn up in a list of authorization grants the
the end-user. authorization server might present to the end-user.
2. Token Revocation 2. Token Revocation
The client requests the revocation of a particular token by making an
HTTP POST request to the token revocation endpoint. The location of
the token revocation endpoint can be found in the authorization
server's documentation. The token endpoint URI MAY include a query
component.
Implementations MUST support the revocation of refresh tokens and Implementations MUST support the revocation of refresh tokens and
SHOULD support the revocation of access tokens (see Implementation SHOULD support the revocation of access tokens (see Implementation
Note). Note).
The client requests the revocation of a particular token by making an
HTTP POST request to the token revocation endpoint URL. The token
endpoint URL MAY include a query component. The means to obtain the
location of the revocation endpoint is out of scope of this
specification. For example, the client developler may consult the
server's documentation or automatic discovery may be used. As this
endpoint is handling security credentials, the endpoint location MUST
be obtained from a trustworthy source.
Since requests to the token revocation endpoint result in the Since requests to the token revocation endpoint result in the
transmission of plain text credentials in the HTTP request, the transmission of plain text credentials in the HTTP request, the
authorization server MUST require the use of a transport-layer authorization server MUST require the use of a transport-layer
security mechanism when sending requests to the token revocation security mechanism when sending requests to the token revocation
endpoints. The authorization server MUST support TLS 1.0 endpoints. The authorization server MUST support TLS 1.0
([RFC2246]), SHOULD support TLS 1.2 ([RFC5246]) and its future ([RFC2246]), SHOULD support TLS 1.2 ([RFC5246]) and its future
replacements, and MAY support additional transport-layer mechanisms replacements, and MAY support additional transport-layer mechanisms
meeting its security requirements. meeting its security requirements.
2.1. Revocation Request
The client constructs the request by including the following The client constructs the request by including the following
parameters using the "application/x-www-form-urlencoded" format in parameters using the "application/x-www-form-urlencoded" format in
the HTTP request entity-body: the HTTP request entity-body:
token REQUIRED. The token that the client wants to get revoked. token REQUIRED. The token that the client wants to get revoked.
Note: the authorization server is supposed to detect the
token type automatically. token_type_hint OPTIONAL. A hint about the type of the token
submitted for revocation. Clients MAY pass this parameter in
order to help the authorization server to optimize the token
lookup. If the server is unable to locate the token using
the given hint, it MUST extend its search accross all of its
supported token types. An authorization server MAY ignore
this parameter, particularly if it is able to detect the
token type automatically. This specification defines two
such values:
* access_token An Access Token as defined in [RFC6749]
section 1.4
* refresh_token A Refresh Token as defined in [RFC6749]
section 1.5
Specific implementations, profiles, and extensions of this
specification MAY define other values for this parameter.
The client also includes its authentication credentials as described The client also includes its authentication credentials as described
in Section 2.3. of [RFC6749]. in Section 2.3. of [RFC6749].
For example, a client may request the revocation of a refresh token For example, a client may request the revocation of a refresh token
with the following request (line breaks are for display purposes with the following request (line breaks are for display purposes
only): only):
POST /revoke HTTP/1.1 POST /revoke 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
Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW
token=45ghiukldjahdnhzdauz& token=45ghiukldjahdnhzdauz&token_type_hint=refresh_token
The authorization server first validates the client credentials (in The authorization server first validates the client credentials (in
case of a confidential client) and then verifies whether the token case of a confidential client) and then verifies whether the token
was issued to the client making the revocation request. If this was issued to the client making the revocation request. If this
validation fails, the request is refused and the client is informed validation fails, the request is refused and the client is informed
of the error by the authorization server as described below. of the error by the authorization server as described below.
In the next step, the authorization server invalidates the token. In the next step, the authorization server invalidates the token.
The client MUST NOT use this token again after revocation. The client MUST assume the revocation is immediate upon the return of
the request. The client MUST NOT use the token again after the
revocation.
Depending on the authorization server's revocation policy, the Depending on the authorization server's revocation policy, the
revocation of a particular token may cause the revocation of related revocation of a particular token may cause the revocation of related
tokens and the underlying authorization. If the particular token is tokens and the underlying authorization grant. If the particular
a refresh token and the authorization server supports the revocation token is a refresh token and the authorization server supports the
of access tokens, then the authorization server SHOULD also revocation of access tokens, then the authorization server SHOULD
invalidate all access tokens based on the same authorization (see also invalidate all access tokens based on the same authorization
Implementation Note). grant (see Implementation Note). If the token passed to the request
is an access token, the server MAY decide to revoke the respective
refresh token as well.
Note: A client compliant with [RFC6749] must be prepared to handle
unexpected token invalidation at any time. Independent of the
revocation mechanism specified in this document, resource owners may
decide to revoke authorization grants or the authorization server may
invalidate tokens in order to mitigate security threats. Thus having
different server policies with respect to cascading the revocation of
tokens should not pose interoperability problems.
2.2. Revocation Response
The authorization server indicates a successful processing of the The authorization server indicates a successful processing of the
request by a HTTP status code 200. The error presentation conforms request by a HTTP status code 200. This also applies if the client
to the defintion in section 5.2 of [RFC6749]. submits an invalid token to the revocation endpoint.
The following additional error codes are defined for the token 2.2.1. Error Response
revocation endpoint:
The error presentation conforms to the defintion in section 5.2 of
[RFC6749]. The following additional error code is defined for the
token revocation endpoint:
unsupported_token_type The authorization server does not support the unsupported_token_type The authorization server does not support the
revocation of the presented token type. I.e. the client revocation of the presented token type. I.e. the client
tried to revoke an access token on a server not supporting tried to revoke an access token on a server not supporting
this feature. this feature.
invalid_token The presented token is invalid. 2.3. Cross-Origin Support
2.1. Cross-Origin Support
The revocation end-point SHOULD support CORS [W3C.WD-cors-20120403] The revocation end-point MAY support CORS [W3C.WD-cors-20120403] if
if it is aimed at use in combination with user-agent-based it is aimed at use in combination with user-agent-based applications.
applications.
In addition, for interoperability with legacy user-agents, it MAY In addition, for interoperability with legacy user-agents, it MAY
offer JSONP [jsonp] by allowing GET requests with an additional also offer JSONP [jsonp] by allowing GET requests with an additional
parameter: parameter:
callback OPTIONAL. The qualified name of a JavaScript function. callback OPTIONAL. The qualified name of a JavaScript function.
For example, a client may request the revocation of an access token For example, a client may request the revocation of an access token
with the following request (line breaks are for display purposes with the following request (line breaks are for display purposes
only): only):
https://example.com/revoke?token=agabcdefddddafdd& https://example.com/revoke?token=agabcdefddddafdd&
callback=package.myCallback callback=package.myCallback
Successful response: Successful response:
package.myCallback(); package.myCallback();
Error response: Error response:
package.myCallback({"error":"invalid_token"}); package.myCallback({"error":"unsupported_token_type"});
Clients should be aware that when relying on JSONP, a malicious Clients should be aware that when relying on JSONP, a malicious
revocation end-point may attempt to inject malicious code into the revocation end-point may attempt to inject malicious code into the
client. client.
3. Implementation Note 3. Implementation Note
OAuth 2.0 allows deployment flexibility with respect to the style of OAuth 2.0 allows deployment flexibility with respect to the style of
access tokens. The access tokens may be self-contained so that an access tokens. The access tokens may be self-contained so that an
resource server needs no further interaction with an authorization resource server needs no further interaction with an authorization
skipping to change at page 7, line 13 skipping to change at page 8, line 4
[I-D.ietf-oauth-v2-threatmodel]. [I-D.ietf-oauth-v2-threatmodel].
Malicious clients could attempt to use the new endpoint to launch Malicious clients could attempt to use the new endpoint to launch
denial of service attacks on the authorization server. Appropriate denial of service attacks on the authorization server. Appropriate
countermeasures, which should be in place for the token endpoint as countermeasures, which should be in place for the token endpoint as
well, MUST be applied to the revocation endpoint (see well, MUST be applied to the revocation endpoint (see
[I-D.ietf-oauth-v2-threatmodel], section 4.4.1.11). [I-D.ietf-oauth-v2-threatmodel], section 4.4.1.11).
A malicious client may attempt to guess valid tokens on this endpoint A malicious client may attempt to guess valid tokens on this endpoint
by making revocation requests against potential token strings. by making revocation requests against potential token strings.
According to this specification, a client's request must contain a According to this specification, a client's request must contain a
valid client_id, in the case of a public client, or valid client valid client_id, in the case of a public client, or valid client
credentials, in the case of a confidential client. The token being credentials, in the case of a confidential client. The token being
revoked must also belong to the requesting client. If an attacker is revoked must also belong to the requesting client. If an attacker is
able to successfully guess a public client's client_id and one of able to successfully guess a public client's client_id and one of
their tokens, or a private client's credentials and one of their their tokens, or a private client's credentials and one of their
tokens, they could do much worse damage by using the token elsewhere tokens, they could do much worse damage by using the token elsewhere
than by revoking it. If they chose to revoke the token, the than by revoking it. If they chose to revoke the token, the
legitimate client will lose its authorization and will need to prompt legitimate client will lose its authorization grant and will need to
the user again. No further damage is done and the guessed token is prompt the user again. No further damage is done and the guessed
now worthless. token is now worthless.
Since the revocation endpoint is handling security credentials,
clients shall obtain its location from a trustworthy source only.
Otherwise, an attacker could capture valid security tokens by
utilizing a counterfeit revocation endpoint.
7. References 7. References
7.1. Normative References 7.1. Normative References
[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.
[RFC2246] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", [RFC2246] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0",
RFC 2246, January 1999. RFC 2246, January 1999.
 End of changes. 23 change blocks. 
54 lines changed or deleted 100 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/