rfc-7009

OAuth 2.0 Token Revocation

T. Lodderstedt (Editor), S. Dronia, M. Scurtescu
date2013-08 streamIETF areasec wgoauth statusPROPOSED STANDARD pages11 canonicalhttps://www.rfc-editor.org/rfc/rfc7009 doi10.17487/RFC7009 errataview
This document proposes an additional endpoint for OAuth authorization servers, which allows clients to notify the authorization server that a previously obtained refresh or access token is no longer needed. This allows the authorization server to clean up security credentials. A revocation request will invalidate the actual token and, if applicable, other tokens based on the same authorization grant.

Extracted elements (23)

design-rationale §3

Access tokens may be self-contained (resource server needs no authorization server interaction) or handle-based (resource server must query authorization server). Immediate revocation of self-contained tokens requires non-standardized backend interaction, making short-lived access tokens a practical alternative.

oauth, security

design-rationale §2.3

Clients relying on JSONP should be aware that a malicious revocation endpoint may attempt to inject malicious code into the client, since JSONP executes a JavaScript callback from the server response.

oauth, security

design-rationale §2.2

Invalid tokens do not cause an error response because the client cannot handle such an error in a reasonable way, and the purpose of the revocation request — invalidating the token — is already achieved by the time an invalid token is presented.

oauth

interoperability-note §2.1

A client compliant with RFC 6749 must be prepared to handle unexpected token invalidation at any time, independent of this revocation mechanism. Different server policies on cascading token revocation do not pose interoperability problems.

oauth

normative-requirement §2.1 MUST NOT

After the authorization server returns HTTP 200, the token is immediately invalidated and clients must not try to use it again. Implementations should minimize any propagation delay window.

oauth, security

normative-requirement §2.1 SHOULD

If the revoked token is a refresh token and the authorization server supports access token revocation, it SHOULD also invalidate all access tokens based on the same authorization grant. If an access token is revoked, the server MAY revoke the respective refresh token as well.

oauth, security

normative-requirement §2.2.1 MUST

If the server responds with HTTP 503, the client must assume the token still exists and may retry after a reasonable delay. The server may include a 'Retry-After' header to indicate unavailability duration.

oauth, http

normative-requirement §2 SHOULD

If the token revocation endpoint host is also reachable over HTTP, the server SHOULD offer a revocation service at the corresponding HTTP URI but MUST NOT publish it as a token revocation endpoint, ensuring accidentally HTTP-sent tokens are revoked.

oauth, security

normative-requirement §2 MUST

Implementations MUST support the revocation of refresh tokens and SHOULD support the revocation of access tokens.

oauth, security

normative-requirement §2 MUST

The token revocation endpoint URL MUST conform to the rules given in RFC 6749 Section 3.1, and clients MUST verify that the URL is an HTTPS URL.

oauth, security, tls

normative-requirement §2 MUST

URLs for token revocation endpoints MUST be HTTPS URLs, and the authorization server MUST use TLS in a version compliant with RFC 6749 Section 1.6, because requests transmit plaintext credentials.

oauth, security, tls

protocol-element §2.2.1

A new error code 'unsupported_token_type' is defined for the revocation endpoint, returned when the authorization server does not support revocation of the presented token type (e.g., access token revocation not supported).

oauth

protocol-element §2.2

The authorization server responds with HTTP status code 200 for both successful revocation and for invalid (unknown or already-expired) tokens. The response body content is ignored by the client.

oauth, http

protocol-element §2.1

The revocation endpoint accepts HTTP POST requests with an 'application/x-www-form-urlencoded' body containing a REQUIRED 'token' parameter and an OPTIONAL 'token_type_hint' parameter. Client authentication credentials are also included as described in RFC 6749 Section 2.3.

oauth, http

protocol-element §2.3

The revocation endpoint MAY support CORS for use with user-agent-based applications, and MAY also offer JSONP for legacy user-agents via GET requests with an optional 'callback' parameter naming a JavaScript function.

oauth, http

protocol-element §2.1

The 'token_type_hint' parameter is an optional hint to help the authorization server optimize token lookup. If the server cannot locate the token using the given hint, it MUST extend its search across all supported token types; it MAY ignore this parameter entirely.

oauth

registry §4.1.2

This specification establishes the 'OAuth Token Type Hints' registry with Specification Required policy, with initial values 'access_token' and 'refresh_token'. New values are reviewed on [email protected] for two weeks before registration.

oauth, registry

registry §4.1.1

This specification registers the 'unsupported_token_type' error value in the IANA 'OAuth Extensions Error Registry' defined in RFC 6749, for use at the revocation endpoint error response.

oauth, registry

security-consideration §5

A malicious client attempting to guess valid tokens via revocation requests is constrained because the request must include valid client credentials and the token must belong to the requesting client. Successful guessing would allow worse abuse than revocation, limiting the incremental risk.

oauth, security

security-consideration §5

Cleaning up tokens via revocation contributes to overall security and privacy by reducing the likelihood of abuse of abandoned tokens, and prevents valid authorization grants from persisting without the end-user's awareness.

oauth, security, privacy

security-consideration §5

Clients MUST obtain the revocation endpoint location from a trustworthy source only, and MUST authenticate the endpoint (certificate validation, etc.) to prevent attackers from capturing valid tokens via a counterfeit revocation endpoint.

oauth, security, tls, pkix

security-consideration §5

If the authorization server does not support access token revocation, access tokens will not be immediately invalidated when the corresponding refresh token is revoked. Deployments must account for this gap in their security risk analysis.

oauth, security

security-consideration §5

Malicious clients could attempt denial-of-service attacks against the revocation endpoint; countermeasures MUST be applied, equivalent to those for the token endpoint. Invalid token_type_hint values can cause additional database lookups, so care MUST be taken to prevent exploitation for DoS.

oauth, security