This content has been marked as final.
Show 3 replies
-
1. Re: how to get user credentials from a portlet
knyazsh Dec 7, 2009 11:04 AM (in response to knyazsh)Discussing this at the eXo platform forum. Dunno how to input the direct link to the forum here... It's not transparent actually =)
I shall post the correct solution here once I get it. -
2. Re: how to get user credentials from a portlet
apemberton Dec 9, 2009 12:11 AM (in response to knyazsh)Not sure exactly what you mean by user credentials, but:
1. The user's login name (used for authentication) can be obtained through the standard portlet API:PortletRequest.getRemoteUser()
or the principal:PortletRequest.getUserPrincipal()
2. JSR286 also has support for retrieving other user attributes when configured in portlet.xml (see the JSR286 spec http://jcp.org/en/jsr/detail?id=286). -
3. Re: how to get user credentials from a portlet
knyazsh Dec 9, 2009 10:15 AM (in response to knyazsh)Hi apemberton =)
I've found the solution already, the one I used was:
import org.jboss.portletbridge.seam.PortalIdentity;
...
username = PortalIdentity.instance().getPrincipal().getName();
This was exactly the one I was looking for.