I need to set a session in Authenticator class (key=auth.pipeline.pre)
in Liferay. In this Authenticator class, I need to check credentials via another web service and set some attributes in session which should be shared with every other portlet.
I know this topic: Liferay 7 Shared Session Attributes
Problem is that I can't retrieve request (portletRequest as well) in Authenticator class.
I try the solution with PortalSessionThreadLocal
like this:
String sharedKey = "LIFERAY_SHARED_" + key;
HttpSession session = PortalSessionThreadLocal.getHttpSession();
session.setAttribute(sharedKey, bean);
but I cant retrieve this session attribute in another portlet like this way:
key = "LIFERAY_SHARED_" + key;
HttpSession session = PortalSessionThreadLocal.getHttpSession();
Object bean = session.getAttribute(key);
Can you recommend me some sort of solution?