draft-ietf-oauth-revocation-03.txt   draft-ietf-oauth-revocation-04.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: May 28, 2013 Expires: July 11, 2013
M. Scurtescu M. Scurtescu
Google Google
November 24, 2012 January 7, 2013
Token Revocation Token Revocation
draft-ietf-oauth-revocation-03 draft-ietf-oauth-revocation-04
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 access grant. applicable, other tokens based on the same authorization.
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 May 28, 2013. This Internet-Draft will expire on July 11, 2013.
Copyright Notice Copyright Notice
Copyright (c) 2012 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
skipping to change at page 2, line 27 skipping to change at page 2, line 27
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Token Revocation . . . . . . . . . . . . . . . . . . . . . . . 3 2. Token Revocation . . . . . . . . . . . . . . . . . . . . . . . 3
2.1. Cross-Origin Support . . . . . . . . . . . . . . . . . . . 5 2.1. Cross-Origin Support . . . . . . . . . . . . . . . . . . . 5
3. Implementation Note . . . . . . . . . . . . . . . . . . . . . . 5 3. Implementation Note . . . . . . . . . . . . . . . . . . . . . . 5
4. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6 4. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6
6. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 6. Security Considerations . . . . . . . . . . . . . . . . . . . . 6
7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7
7.1. Normative References . . . . . . . . . . . . . . . . . . . 7 7.1. Normative References . . . . . . . . . . . . . . . . . . . 7
7.2. Informative References . . . . . . . . . . . . . . . . . . 7 7.2. Informative References . . . . . . . . . . . . . . . . . . 7
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 7 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 8
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 the external representation of an access types of tokens. A token is a string representing an authorization
grant issued by a resource owner to a particular client. A issued by the resource owner to the client. A revocation request
revocation request will invalidate the actual token and, if will invalidate the actual token and, if applicable, other tokens
applicable, other tokens based on the same access grant and the based on the same authorization and the authorization itself.
access grant itself.
From an end-user's perception, 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 access grant. This behavior prevents a situation where underlying authorization. This behavior prevents a situation where
there is still a valid access grant for a particular client which the there is still a valid authorization for a particular client which
end user is not aware of. This way, token revocation prevents abuse the end user is not aware of. This way, token revocation prevents
of abandoned tokens and facilitates a better end-user experience abuse of abandoned tokens and facilitates a better end-user
since invalidated access grants will no longer turn up in a list of experience since invalidated authorization will no longer turn up in
access grants the authorization server might present to the end-user. a list of authorizations the 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 The client requests the revocation of a particular token by making an
HTTP POST request to the token revocation endpoint. The location of HTTP POST request to the token revocation endpoint. The location of
the token revocation endpoint can be found in the authorization the token revocation endpoint can be found in the authorization
server's documentation. The token endpoint URI MAY include a query server's documentation. The token endpoint URI MAY include a query
component. component.
Implementations MUST support the revocation of refresh tokens and Implementations MUST support the revocation of refresh tokens and
skipping to change at page 4, line 17 skipping to change at page 4, line 17
Note: the authorization server is supposed to detect the Note: the authorization server is supposed to detect the
token type automatically. token type automatically.
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&
The authorization server first validates the client credentials (in The authorization server first validates the client credentials (in
case of a confidential client) and verifies whether the client is case of a confidential client) and then verifies whether the token
authorized to revoke the particular token. These checks are used to was issued to the client making the revocation request. If this
validate whether the token being presented has been issued to the validation fails, the request is refused and the client is informed
client presenting it. of the error by the authorization server as described below.
In the next step, the authorization server invalidates the token and In the next step, the authorization server invalidates the token.
the respective access grant. If the particular token is a refresh The client MUST NOT use this token again after revocation.
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 (see Implementation
Note).
The client MUST NOT use the token again after revocation. Depending on the authorization server's revocation policy, the
revocation of a particular token may cause the revocation of related
tokens and the underlying authorization. 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 authorization (see
Implementation Note).
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. Status code 401 indicates a request by a HTTP status code 200. The error presentation conforms
failed client authentication, whereas a status code 403 is used if to the defintion in section 5.2 of [RFC6749].
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 The following additional error codes are defined for the token
response as defined in section 5.2. of [RFC6749]. The following revocation endpoint:
error codes are 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. invalid_token The presented token is invalid.
2.1. Cross-Origin Support 2.1. Cross-Origin Support
The revokation end-point SHOULD support CORS [W3C.WD-cors-20120403] The revocation end-point SHOULD support CORS [W3C.WD-cors-20120403]
if it is aimed at use in combination with user-agent-based if it is aimed at use in combination with user-agent-based
applications. In addition, for interoperability with legacy user- applications.
agents, it MAY offer JSONP [jsonp] by allowing GET requests with an
additional parameter:
callback The qualified name of a JavaScript function. In addition, for interoperability with legacy user-agents, it MAY
offer JSONP [jsonp] by allowing GET requests with an additional
parameter:
Example request: callback OPTIONAL. The qualified name of a JavaScript function.
https://example.com/revoke?token=45ghiukldjahdnhzdauz& For example, a client may request the revocation of an access token
callback=package.myCallback with the following request (line breaks are for display purposes
only):
https://example.com/revoke?token=agabcdefddddafdd&
callback=package.myCallback
Successful response: Successful response:
package.myCallback(); package.myCallback();
Error response: Error response:
package.myCallback({"error":"invalid_token"}); package.myCallback({"error":"invalid_token"});
Clients should be aware that when relying on JSONP, a malicious Clients should be aware that when relying on JSONP, a malicious
revokation 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
Depending on the authorization server's token design, revocation of OAuth 2.0 allows deployment flexibility with respect to the style of
access tokens might be a costly process. For example, revocation of access tokens. The access tokens may be self-contained so that an
self-contained access tokens requires (time-consuming) backend calls resource server needs no further interaction with an authorization
between resource and authorization server on every request to the server issuing these tokens to perform an authorization decision of
resource server or to push notifications from the authorization the client requesting access to a protected resource. A system
server to the affected resource servers. Alternatively, design may, however, instead use access tokens that are handles
authorization servers may choose to issue short living access tokens, referring to authorization data stored at the authorization server.
which can be refreshed at any time using the corresponding refresh This consequently requires a resource server to issue a request to
tokens. In this case, a client would revoke the refresh token and the respective authorization server to retrieve the content of the
access tokens issued based on this particular refresh token are at access token every time a client presents an access token.
most valid until expiration. Whether this is an viable option or
whether access token revocation is required should be decided based While these are not the only options they illustrate the implications
on the service provider's risk analysis. for revocation. In the latter case the authorization server is able
to revoke an access token previously issued to a client when the
resource server relays a received access token. In the former case
some (currently non-standardized) backend interaction between the
authorization server and the resource server may be used when
immediate access token revocation is desired. Another design
alternative is to issue short-lived access tokens, which can be
refreshed at any time using the corresponding refresh tokens. This
allows the authorization server to impose a limit on the time revoked
access tokens are in use.
Which approach of token revocation is chosen will depend on the
overall system design and on the application service provider's risk
analysis. The cost of revocation in terms of required state and
communication overhead is ultimately the result of the desired
security properties.
4. Acknowledgements 4. Acknowledgements
We would like to thank Hannes Tschofenig, Michiel de Jong, Doug We would like to thank Peter, Mauritius, Amanda Anganes, Mark Wubben,
Foiles, Paul Madsen, George Fletcher, Sebastian Ebling, Christian Hannes Tschofenig, Michiel de Jong, Doug Foiles, Paul Madsen, George
Stuebner, Brian Campbell, Igor Faynberg, Lukas Rosenstock, and Justin Fletcher, Sebastian Ebling, Christian Stuebner, Brian Campbell, Igor
Richer for their valuable feedback. Faynberg, Lukas Rosenstock, and Justin Richer for their valuable
feedback.
5. IANA Considerations 5. IANA Considerations
This draft includes no request to IANA. This draft includes no request to IANA.
6. Security Considerations 6. Security Considerations
If the authorization server does not support access token revocation, If the authorization server does not support access token revocation,
access tokens will not be immediately invalidated when the access tokens will not be immediately invalidated when the
corresponding refresh token is revoked. Deployments MUST take this corresponding refresh token is revoked. Deployments MUST take this
in account when conducting their security risk analysis. into account when conducting their security risk analysis.
Cleaning up tokens using revocation contributes to overall security Cleaning up tokens using revocation contributes to overall security
and privacy since it reduces the likelihood for abuse of abandoned and privacy since it reduces the likelihood for abuse of abandoned
tokens. This specification in general does not intend to provide tokens. This specification in general does not intend to provide
countermeasures against token theft and abuse. For a discussion of countermeasures against token theft and abuse. For a discussion of
respective threats and countermeasures, consult the security respective threats and countermeasures, consult the security
considerations given in section 10 of the OAuth core specification considerations given in section 10 of the OAuth core specification
[RFC6749] and the OAuth threat model document [RFC6749] and the OAuth threat model document
[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. well, MUST be applied to the revocation endpoint (see
[I-D.ietf-oauth-v2-threatmodel], section 4.4.1.11).
A malicious client may attempt to guess valid tokens on this A malicious client may attempt to guess valid tokens on this endpoint
endpoints. As a pre-requisite, the client either requires a valid by making revocation requests against potential token strings.
client_id of a public client or the credentials of a confidential According to this specification, a client's request must contain a
client. An sucessful attempt would result in the revocation of the valid client_id, in the case of a public client, or valid client
respective token, thus causing the legitimate client to lose its credentials, in the case of a confidential client. The token being
authorization. The malicious client does not gain further revoked must also belong to the requesting client. If an attacker is
advantages. 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
tokens, they could do much worse damage by using the token elsewhere
than by revoking it. If they chose to revoke the token, the
legitimate client will lose its authorization and will need to prompt
the user again. No further damage is done and the guessed token is
now worthless.
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.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, August 2008. (TLS) Protocol Version 1.2", RFC 5246, August 2008.
 End of changes. 30 change blocks. 
78 lines changed or deleted 107 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/