Legacy Knowledge Base
Published Jun. 30, 2025

How to change the number of digits in the CSRF token parameter "p_auth

Written By

Shimada Taro

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

  • Can I change the number of digits in the CSRF token parameter "p_auth"?

Environment

  • DXP 7.0+

solution

  • The number of digits of the relevant parameter is controlled by the following property, which can be changed.
    However, as described in the property description, performance effects may occur as tokens become longer.
    https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/portal.properties#L3779-L3785
  • This parameter is only aauthorizedtoken and will not function withoutauthentication status.
    The token is invalidated when the session expires or when the user logs out.
    Also, attempts to reuse past tokens will result in an authentication error.

    Since this parameter only works after authentication, it is recognized that the default setting has no particular effect on security.
Did this article resolve your issue ?

Legacy Knowledge Base