Legacy Knowledge Base
Published Sep. 10, 2025

Unauthenticated user unable to view the Json web service.

Written By

Prarthana Jadhav

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

  • While accessing http://localhost:8080/api/jsonws as an unauthenticated (Guest) user and selecting the context path, an "Access denied" error is thrown.
  • For example, when creating a simple Service Builder Module and keeping it default as it will create FOO.

    • Write a simple getData() method inside FooServiceImpl, build this module and deploy it.

    • After deploying, open http://localhost:8080/api/jsonws as an unauthenticated user, select context name as foo ->Click on getData ->Click on Invoke. The below error is thrown;

      "Access denied to com.liferay.ws.service.FooService#getData"

Environment

  • Liferay DXP 7.1

Resolution

    • The above error can be resolved by following the below steps:
      1) Navigate to Control Panel> Configuration>Service Access Policy
      2) Click on "+" icon to add a new policy, 
      3) Check the "enabled" and "default" checkbox.
      4) Provide any name and title along with Class Name and Method name which needs to be exposed and save it. Refer the below image.

      example.PNG
  • The unauthenticated users will now be able to access the newly created web services.
Did this article resolve your issue ?

Legacy Knowledge Base