Liferay Symposium 2016 | Reserve your seat today.
6. Portal Framework
(Opens New Window)
Mark as an Answer
programatically portlet login
November 9, 2007 7:46 AM
Rank: Junior Member
Join Date: June 13, 2007
Hi all (first of all excuse my very basic english)
Since I had a lot of problems with soap dialog, I choose the next sollution: create a servlet in the portal side asociated with a url iside the portal and define the dialog passing the data in the form of http parameters. For example a basic use case could be: the client should pass the userId, passwird, companyId document title and document data in the httprequest and the servlet has to login the user and invoke the DL service util function for adding the document.
This is working pretty well, except for the login part. For login in the portal, from my servlet I'm doing:
LoginAction.login(request, response, userId, psswd, false); //that calls UserServiceUtil.authenticateByUserId(...)
Loggin in this way seems to work in the portal but not inside individual portlets. For example, the lines
System.out.println("remote user: "+req.getRemoteUser());
System.out.println("user principal: "+req.getUserPrincipal());
the lines inside an struts action portlet file prints
where in the normal usage (normal login) they print:
So my question is how do I set the user principal in the http session?
Hope you can understand my problem. thanks in advance
Sign in to vote.
Please sign in to flag this as inappropriate.