Message Boards

Assign user to site programmatically

thumbnail
Bharamani P Tashildar, modified 6 Years ago.

Assign user to site programmatically

Junior Member Posts: 48 Join Date: 8/27/14 Recent Posts
Hi All,

How to assign user to site programmatically in Liferay Dxp?

Users are coming from Ldap to Liferay, after login I need to assign these users to site.


How can I achieve this?

Please help!!
thumbnail
Christoph Rabel, modified 6 Years ago.

RE: Assign user to site programmatically (Answer)

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
If it's the same site for all users, you could do it by configuration:
Control Panel -> Instance Settings -> Users -> Tab Default User Associations

You can add default associations for all users there.
Or if you need to do it by group, then you could import ldap groups too and assign the groups to the sites where they belong as members.
habeeb shaik, modified 3 Years ago.

RE: Assign user to site programmatically

New Member Posts: 2 Join Date: 7/1/20 Recent Posts
while selecting site for user, it is loading for some time and then it come "gateway timeout error"
thumbnail
Olaf Kock, modified 3 Years ago.

RE: Assign user to site programmatically

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
habeeb shaik:

while selecting site for user, it is loading for some time and then it come "gateway timeout error"

Gateway timeout is typically an error that your reverse proxy signals before it can reach any application server that it's expected to serve. You'll have to figure out why: Wrong URL, server died, conditional proxying, network issues, cluster setup problems - could be anything
habeeb shaik, modified 3 Years ago.

RE: Assign user to site programmatically

New Member Posts: 2 Join Date: 7/1/20 Recent Posts
Thank you for you help