Legacy Knowledge Base
Published Jul. 2, 2025

LiferayPortletURLs Generated For a .War File Do Not Have Authentication Token

Written By

Brett Ripley

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

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

This article is a legacy article. It applies to previous versions of the Liferay product. While the article is no longer maintained, the information may still be applicable.

Subscribers often develop custom portlets and themes based on the APIs Liferay provides. As part of the portlet and theme development processes and as a security measure, Liferay has implemented auth tokens in the URLs; each portlet has a p_p_auth token in the URL.

The token check can be enabled or disabled with the propertyportlet.add.default.resource.check.enabledin portal.properties.

A white list of portlets or actions can be defined in portal.properties to bypass this security check:
"portlet.add.default.resource.check.whitelist"
"portlet.add.default.resource.check.whitelist.actions"

Looking at the Java classes, when PortletURLFactoryUtil is called from a portlet, a LiferayPortletURL object is returned. However, if the portlet is not properly configured, the LiferayPortletURL that is returned will not have an authentication token that is required for the particular object to be of use.

Resolution

  1. The file liferay-portlet.xml contains all the "out of the box" portlets' properties. Subscribers developing a custom portlet can include the information about their portlet here.
  2. To ensure that the p_p_auth token is generated, add true
  3. Save the file.
  4. Start the portal.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base