Foren

Adding Users to Liferay

Shireesha Veerapaneni, geändert vor 6 Jahren.

Adding Users to Liferay

New Member Beiträge: 12 Beitrittsdatum: 05.07.17 Neueste Beiträge
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, geändert vor 6 Jahren.

RE: Adding Users to Liferay

Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
No. Why do you need to change the id?
Shireesha Veerapaneni, geändert vor 6 Jahren.

RE: Adding Users to Liferay

New Member Beiträge: 12 Beitrittsdatum: 05.07.17 Neueste Beiträge
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, geändert vor 6 Jahren.

RE: Adding Users to Liferay

New Member Beiträge: 12 Beitrittsdatum: 05.07.17 Neueste Beiträge
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, geändert vor 6 Jahren.

RE: Adding Users to Liferay

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
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, geändert vor 6 Jahren.

RE: Adding Users to Liferay

New Member Beiträge: 12 Beitrittsdatum: 05.07.17 Neueste Beiträge
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, geändert vor 6 Jahren.

RE: Adding Users to Liferay

Expert Beiträge: 493 Beitrittsdatum: 26.05.12 Neueste Beiträge
You can use screen name instead of userid .Screen Name also always unique.
Shireesha Veerapaneni, geändert vor 6 Jahren.

RE: Adding Users to Liferay

New Member Beiträge: 12 Beitrittsdatum: 05.07.17 Neueste Beiträge
True.
Screen name is unique but our third party system authentication is configured based on email address.
Shireesha Veerapaneni, geändert vor 6 Jahren.

RE: Adding Users to Liferay

New Member Beiträge: 12 Beitrittsdatum: 05.07.17 Neueste Beiträge
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, geändert vor 6 Jahren.

RE: Adding Users to Liferay

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
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?