"User 0 is not allowed to access URL" Error

Vishnu S Kumar, modified 6 Years ago. Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts
We are creating an actionURL with an OTP hash to reset customer passwords. However, when the customer clicks the action link from the email we send them, we get this error. The action command is a part of the custom login portlet with guest view permissions. It only works if the customer opens the link in the same browser and within 10-15 minutes.

Code for custom action URL
PortletURL actionUrl = PortletURLFactoryUtil.create(request, themeDisplay.getPortletDisplay().getId(),
                        themeDisplay.getPlid(), PortletRequest.ACTION_PHASE);
actionUrl.setWindowState(LiferayWindowState.NORMAL);
actionUrl.setPortletMode(LiferayPortletMode.VIEW);
actionUrl.setParameter("javax.portlet.action", AuthConstants.VALIDATE_OTP);
actionUrl.setParameter("otp", Encryptor.encrypt(key, otp.toJsonString()));
Vishnu S Kumar, modified 6 Years ago. Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts
I Solved it.add this property in the portlet class
    "javax.portlet.init-param.check-auth-token=false"