Foren

Liferay Security API

curious Liferay, geändert vor 14 Jahren.

Liferay Security API

Junior Member Beiträge: 57 Beitrittsdatum: 08.10.09 Neueste Beiträge
Hi,
I am using Liferay 5.2. I was wondering if it is possible to use some Liferay API to manage roles in a LDAP or a database and manage permissions of portlets to these roles using some Liferay API. Any suggestion is welcome.
thumbnail
Amos Fong, geändert vor 14 Jahren.

RE: Liferay Security API

Liferay Legend Beiträge: 2047 Beitrittsdatum: 07.10.08 Neueste Beiträge
Hello,

Yes there is a java API to manage roles and permissions. Managing roles should be easy but managing permissions through the API can be a bit complicated unless you know what you're doing.
curious Liferay, geändert vor 14 Jahren.

RE: Liferay Security API

Junior Member Beiträge: 57 Beitrittsdatum: 08.10.09 Neueste Beiträge
Here is what I am trying to do. Correct me if you think it is not making sense.
We have an external application for authentication, which basically returns a userId on successful login with username/password. I am thinking of storing the above returned userId and user groups in a LDAP OR in a database. Based on the group (user belongs to), I want to display certain portlets and what to hide certain portlets. I want to skip Liferay login screen, just want user to login once thru our external authentication app. I hope it is feasible. If it is, then I want to know the API that I can use to implement the part thru which I can skip the login screen, and take care of showing and hiding portlets based on user groups.


Thanks for your help.
thumbnail
Amos Fong, geändert vor 14 Jahren.

RE: Liferay Security API

Liferay Legend Beiträge: 2047 Beitrittsdatum: 07.10.08 Neueste Beiträge
I've never done it myself but this should be possible. Maybe someone else who has done it can speak about how they did it.

For external authentication, what you want to do is look at is this property:

auto.login.hooks=

You can set it to your own class that work with your own SSO server.

At some point, users will need to be imported into Liferay's database though(can be done through API, or use built-in LDAP integration). You will need more than just userId and password. You'll need at minimum email addres, first last name, and screenname.

Next, assigning users to roles can be done through API and setting permissions too.

Finally, to only show portlets to users who have view permission, set this property to false:

layout.show.portlet.access.denied=false

Hope that helps
curious Liferay, geändert vor 14 Jahren.

RE: Liferay Security API

Junior Member Beiträge: 57 Beitrittsdatum: 08.10.09 Neueste Beiträge
Can anyone please point me in the right direction. I want to store user, userGroup and Roles in a LDAP and want to show only certain portlets corresponding to certain users, based on the LDAP data. Can somebody point me to right documentation?
thumbnail
Lisa Simpson, geändert vor 14 Jahren.

RE: Liferay Security API

Liferay Legend Beiträge: 2034 Beitrittsdatum: 05.03.09 Neueste Beiträge
You probably want to look in the Guide - http://www.liferay.com/web/guest/community/documentation/5_2 and read about custom roles.