Legacy Knowledge Base
Published Jul. 2, 2025

Guest users are able to access an endpoint if PortalSessionAuthVerifier is enabled

Written By

Jose L. Bango

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 have followed this How-To article: How to add security, authentication to my REST service? (Section 5.1), but guest users are still able to access our endpoint from a browser.
  • If we enable PortalSessionAuthVerifier, users without an active session are able to access the endpoint.

Environment

  • Liferay DXP 7.0

Resolution

  • Due to the AuthVerifiers layer design in DXP 7.0, an extra step would be needed to prevent guest users from accessing the endpoint.
  • Implement a user-permission layer inside your REST application to check if a user is signed-in by adding something like this:
    PermissionChecker permissionChecker = PermissionThreadLocal.getPermissionChecker();

    if (!permissionChecker.isSignedIn()) {
    throw new WebApplicationException(Response.Status.FORBIDDEN);
    }

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base