Fórum

Adding Users to Liferay

Shireesha Veerapaneni, modificado 6 Anos atrás.

Adding Users to Liferay

New Member Postagens: 12 Data de Entrada: 05/07/17 Postagens Recentes
I am trying to use User and Organizations in Control panel.
Control panel >Users>Users and Organizations
When I add user there is a unique user id that gets generated. I am having issues with that unique Id. Can we change that ID ?
Attached screen shots for your reference.

Thanks
Isha
thumbnail
Samuel Kong, modificado 6 Anos atrás.

RE: Adding Users to Liferay

Liferay Legend Postagens: 1902 Data de Entrada: 10/03/08 Postagens Recentes
No. Why do you need to change the id?
Shireesha Veerapaneni, modificado 6 Anos atrás.

RE: Adding Users to Liferay

New Member Postagens: 12 Data de Entrada: 05/07/17 Postagens Recentes
We are using third party systme (UIMS) for authentication and authorization.
We have users already added to that system from our application. We need to send user name to them in order to authorize the logged in user. Liferay is sending this user ID which is not identified by UIMS.
Which fails to get access to the portlet.

Thanks
Isha
Shireesha Veerapaneni, modificado 6 Anos atrás.

RE: Adding Users to Liferay

New Member Postagens: 12 Data de Entrada: 05/07/17 Postagens Recentes
I am trying to access user information in controller as below.

String userName = request.getRemoteUser();

I want to get user login information.
thumbnail
Olaf Kock, modificado 6 Anos atrás.

RE: Adding Users to Liferay

Liferay Legend Postagens: 6403 Data de Entrada: 23/09/08 Postagens Recentes
In that case the (seemingly custom) integration is wrong and you shouldn't rely on the numeric ID (as it's obviously different) but rather should use a value that's shared by both systems. E.g. you can get the current user from the themeDisplay object (from within a portlet):

themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
User user=themeDisplay.getUser(); 
Shireesha Veerapaneni, modificado 6 Anos atrás.

RE: Adding Users to Liferay

New Member Postagens: 12 Data de Entrada: 05/07/17 Postagens Recentes
I got this fixed using as below

String id = request.getRemoteUser();
User user = UserServiceUtil.getUserById(Long.parseLong(id));
String userName = user.getEmailAddress();
logger.debug( "The remote user is " + userName );

This worked for me. emoticon

Thank You so much.
thumbnail
Manish Yadav, modificado 6 Anos atrás.

RE: Adding Users to Liferay

Expert Postagens: 493 Data de Entrada: 26/05/12 Postagens Recentes
You can use screen name instead of userid .Screen Name also always unique.
Shireesha Veerapaneni, modificado 6 Anos atrás.

RE: Adding Users to Liferay

New Member Postagens: 12 Data de Entrada: 05/07/17 Postagens Recentes
True.
Screen name is unique but our third party system authentication is configured based on email address.
Shireesha Veerapaneni, modificado 6 Anos atrás.

RE: Adding Users to Liferay

New Member Postagens: 12 Data de Entrada: 05/07/17 Postagens Recentes
HI,
We are currently migrating web center portal (portlets) to liferay portal. Most commonly I am seeing issue on UI (JSP pages).
JSP pages have javascripts in them and none of the javascript functions are triggered on liferay.
Appreciate if someone can help me with this issue.
There are coupl action buttons in JSP file and non of those buttons are working and reason is associated javascript function are not been called.

Thanks
Shireesha Veerapaneni
thumbnail
Olaf Kock, modificado 6 Anos atrás.

RE: Adding Users to Liferay

Liferay Legend Postagens: 6403 Data de Entrada: 23/09/08 Postagens Recentes
Shireesha Veerapaneni:
Appreciate if someone can help me with this issue.
There are coupl action buttons in JSP file and non of those buttons are working and reason is associated javascript function are not been called.

You're probably aware that we'll need some more details in order to help?