Forums de discussion

To get the login of connected user in portlet

Nobilet Stéphane, modifié il y a 15 années.

To get the login of connected user in portlet

Regular Member Publications: 100 Date d'inscription: 28/02/08 Publications récentes
Hello,

My liferay portal use LDAP.
My liferay portal use screenname for authentification

I have a portlet who want to know login

When I use the code :


Principal princ = request.getUserPrincipal();
princ.getName();



I find liferay id user.

Do you know how to get login (screenname) ?

Thanks
thumbnail
Tobias Amon, modifié il y a 15 années.

RE: To get the login of connected user in portlet

Liferay Master Publications: 546 Date d'inscription: 08/08/07 Publications récentes
Hello,

maybe you can use this piece of code:

UserLocalServiceUtil.getUserById(userId)
Nobilet Stéphane, modifié il y a 15 années.

RE: To get the login of connected user in portletPortalUtil.getUser(request

Regular Member Publications: 100 Date d'inscription: 28/02/08 Publications récentes
Another answer on the french forum :


PortalUtil.getUser(request).getScreenName()