Legacy Knowledge Base
Published Jul. 2, 2025

Is there a REST API method to revoke the OAuth2 tokens?

Written By

Jorge Diaz

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

We want to provide a public REST API method to revoke the OAuth2 tokens following the RFC 7009 specification https://datatracker.ietf.org/doc/html/rfc7009#section-2.1

Does Liferay provide this functionality?

Environment

  • Liferay DXP 7.3
  • Liferay DXP 7.4

Resolution

Unfortunately, Liferay doesn't provide a REST API method to revoke the OAuth2 tokens.

The RFC 7009 is an extension to OAuth2 core specs, so it's not mandatory to implement it:

  • The OAuth 2.0 core specification [RFC6749] defines several ways for a client to obtain refresh and access tokens.
  • The RFC 7009 supplements the core specification with a mechanism to revoke both types of tokens.

The internal OAUTH2-27 issue is opened to track this feature request, but there is no plan to implement this in a short term.

The only way to revoke tokens is to use the user interface as it is explained in the official documentation:

As a workaround you could implement a revoke API with a custom development using the Liferay API to revoke the tokens:

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base