OAuth Working Group | T. Lodderstedt, Ed. |
Internet-Draft | Deutsche Telekom AG |
Intended status: Standards Track | S. Dronia |
Expires: April 07, 2013 | M. Scurtescu |
October 6, 2012 |
Token Revocation
draft-ietf-oauth-revocation-01
This draft proposes an additional endpoint for OAuth authorization servers for revoking tokens.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http:/⁠/⁠datatracker.ietf.org/⁠drafts/⁠current/⁠.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 07, 2013.
Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http:/⁠/⁠trustee.ietf.org/⁠license-⁠info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
The OAuth 2.0 core specification [I-D.ietf-oauth-v2] defines several ways for a client to obtain refresh and access tokens. This specification supplements the core specification with a mechanism to revoke both types of tokens. A token is the external representation of an access grant issued by a resource owner to a particular client. A revocation request may discard the actual token as well as other tokens based on the same access grant and the access grant itself.
This mechanism facilitates the following use cases:
In the end, security, usability, and ease of use are increased by token revocation.
By using an additional endpoint, the token revocation endpoint, clients can request the revocation of a particular token. Compliant implementation MUST support the revocation of refresh tokens, access token revocation MAY be supported.
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.
Since requests to the token revocation endpoint result in the transmission of plain text credentials in the HTTP request, the authorization server MUST require the use of a transport-layer security mechanism when sending requests to the token revocation endpoints. The authorization server MUST support TLS 1.0 ([RFC2246]), SHOULD support TLS 1.2 ([RFC5246]) and its future replacements, and MAY support additional transport-layer mechanisms meeting its security requirements.
The client constructs the request by including the following parameters using the "application/x-www-form-urlencoded" format in the HTTP request entity-body:
The client also includes its authentication credentials as described in Section 2.3. of [I-D.ietf-oauth-v2].
For example, a client may request the revocation of a refresh token with the following request (line breaks are for display purposes only):
POST /revoke HTTP/1.1 Host: server.example.com Content-Type: application/x-www-form-urlencoded Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW token=45ghiukldjahdnhzdauz&
The authorization server first validates the client credentials (in case of a confidential client) and verifies whether the client is authorized to revoke the particular token based on the client identity and its policy. For example, only the client the token has been issued for might be allowed to revoke it. It is also conceivable to allow a dedicated user self-care portal to revoke all kinds of tokens.
In the next step, the authorization server invalidates the token and the respective access grant. If the particular token is a refresh token and the authorization server supports the revocation of access tokens, then the authorization server SHOULD also invalidate all access tokens based on the same access grant.
Whether the revocation takes effect instantly or with some delay depends on the architecture of the particular deployment. The client MUST NOT make any assumptions about the timing and MUST NOT use the token again.
The authorization server indicates a successful processing of the request by a HTTP status code 200. Status code 401 indicates a failed client authentication, whereas a status code 403 is used if the client is not authorized to revoke the particular token. For all other error conditions, a status code 400 is used along with an error response as defined in section 5.2. of [I-D.ietf-oauth-v2]. The following error codes are defined for the token revocation endpoint:
The revokation end-point SHOULD support CORS [W3C.WD-cors-20120403] if it is aimed at use in combination with user-agent-based applications. In addition, for interoperability with legacy user-agents, it MAY offer JSONP [jsonp] by allowing GET requests with an additional parameter:
Example request:
https://example.com/revoke?token=45ghiukldjahdnhzdauz& callback=package.myCallback
Successful response:
package.myCallback();
Error response:
package.myCallback({"error":"invalid_token"});
Clients should be aware that when relying on JSONP, a malicious revokation end-point may attempt to inject malicious code into the client.
We would like to thank Michiel de Jong, Doug Foiles, Paul Madsen, George Fletcher, Sebastian Ebling, Christian Stübner, Brian Campbell, Igor Faynberg, Lukas Rosenstock, and Justin P. Richer for their valuable feedback.
This draft includes no request to IANA.
All relevant security considerations have been given in the functional specification.
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. |
[RFC2246] | Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC 2246, January 1999. |
[RFC5246] | Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, August 2008. |
[I-D.ietf-oauth-v2] | Hammer-Lahav, E, Recordon, D and D Hardt, "The OAuth 2.0 Authorization Protocol", Internet-Draft draft-ietf-oauth-v2-25, March 2012. |
[W3C.WD-cors-20120403] | Kesteren, A., "Cross-Origin Resource Sharing", World Wide Web Consortium LastCall WD-cors-20120403, April 2012. |
[jsonp] | Ippolito, B., "Remote JSON - JSONP", December 2005. |