Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
"User 0 is not allowed to access URL" Error
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
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()));
I Solved it.add this property in the portlet class
"javax.portlet.init-param.check-auth-token=false"