RE: Add cookie in auth.pipeline.post Authenticator

N H, modified 6 Years ago. New Member Post: 1 Join Date: 11/7/18 Recent Posts

Hi;

I call a web service to retrieve a certain value after login , and i need to set this value in a cookie, i implemented an authenticator class with the property = {"key=auth.pipeline.post"}, now authenticator is called successfully and the value is retrieved from the web service, is there any way to add this value to a cookie and send back to the browser after successful authentication.

 

thumbnail
Amos Fong, modified 6 Years ago. Liferay Legend Posts: 2047 Join Date: 10/7/08 Recent Posts

hm...I'm not sure if this will work but the only thing I can think of is to try ServiceContextThreadLocal and then get the HttpServletResponse from the ServiceContext.

 

If that doesn't work, then I think you'll have to set the cookie in a different place. If you only have the value here, maybe use a threadLocal to store the value and retrieve it later to add the cookie?