Reputation: 293
I need to implement liferay authentication against organization LDAP. Once user successfully logs in I want user to be checked against a local group created in liferay.
For e.g. users in certain team should only be able to get into the application.As there is nothing in LDAP which distinguish these users from other users in LDAP ,I need to implement something locally in liferay.
When user logs in he/she should be authenticated against LDAP and then local liferay group should be looked up to check whether user is part of that group.This group should be configurable by liferay admin. Only when he/she is part of that group home page of application with data should be displayed.
Any pointers on this would help.Thanks.
Upvotes: 2
Views: 736
Reputation: 21
One thing to remember is that there is already an LDAP Authenticator class in Liferay source LDAPauth.
If you want to log in to [email protected], you can add it to your LDAP. (I realize this may break the requirements for the use of the LDAP). It is also common to create a special admin account for yourself/organization(in LDAP and Liferay) Simply revert to standard Liferay Authentication, log in to your [email protected] default admin, and make sure the Liferay-version of that user has correct GLOBAL Administrator role.
Also, You can add multiple authentications in your Liferay Authentication pipeline.
I am assuming you have added to portal-ext.properties(or hook properties override) the following line:
auth.pipeline.pre=com.YourLDAPAuthenticator
You may also have this line:
auth.pipeline.enable.liferay.check=false
You can keep Liferay check (set to true) and you can login with Liferay credentials for you default admin, but that is not recommended if you are not syncing Liferay and LDAP passwords - for all other Users.
In your custom Authenticator authenticateBy*() overrides, you can programmatically check the current user trying to log in, and you can retrieve the User from Liferay (UserLocalServiceUtil) and perform a few custom checks, only for one(or few) Users you do not want to store in LDAP.
Upvotes: 0
Reputation: 11698
Here is what I have understood:
If this is what you want then here are my few pointers:
LoginPostAction hook
for this purpose.Hope this helps, let me know if what I have understood is correct.
Upvotes: 3