Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Login process customize
Hi,
I am using liferay 7.1 in my project, where user authenticate through LDAP. But I need to authenticate user on with condition.
1) First user authenticate with LDAP. (Which I have already done)
2) If user authetication failed from LDAP, than custom login class called where user authenticate from liferay database with some condition.
Kindly help me to find any solution on it.
I am using liferay 7.1 in my project, where user authenticate through LDAP. But I need to authenticate user on with condition.
1) First user authenticate with LDAP. (Which I have already done)
2) If user authetication failed from LDAP, than custom login class called where user authenticate from liferay database with some condition.
Kindly help me to find any solution on it.
You probably need to implement your own authenticator:
https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/authentication-pipelines
https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/authentication-pipelines
Hi Christoph,
I have already tried it through provided URL.
Actually my problem is, I have two type of user in liferay database.
1) LDAP imported, 2) Manually created from admin
I want to authenticate in one way, means, if user exist in ldpa(connected to AD) and password failed, than no need to call "auth.pipeline.post".
If user not in ldap, than to call "auth.pipeline.post", which is my own custom authentication class.
Currently, what happend, if user failed from LDAP, than it again try to authenticate it from database through "auth.pipeline.post" and login successfully.
I have already tried it through provided URL.
Actually my problem is, I have two type of user in liferay database.
1) LDAP imported, 2) Manually created from admin
I want to authenticate in one way, means, if user exist in ldpa(connected to AD) and password failed, than no need to call "auth.pipeline.post".
If user not in ldap, than to call "auth.pipeline.post", which is my own custom authentication class.
Currently, what happend, if user failed from LDAP, than it again try to authenticate it from database through "auth.pipeline.post" and login successfully.
I wonder if you could override the service with a higher ranking --
.. this way you could implement your own logic when the process failed. The only thing is that, at least from my experience, sometimes I have tried this only to find that there are some internal classes that I can't access. There are tricks to get around this scenarion (David Nebinger wrote a great blog post outlining one way to do it) -- but looking at the import statements in that class, I don't actually see any explicit "internal" package references.
NOTE: According to the docs (in the portal.properties), the auth.pipeline.post is actually depracated and doesn't seem to be used anymore.
@Component(
immediate = true, property = "key=auth.pipeline.pre",
service = Authenticator.class
)
public class LDAPAuth implements Authenticator {
.. this way you could implement your own logic when the process failed. The only thing is that, at least from my experience, sometimes I have tried this only to find that there are some internal classes that I can't access. There are tricks to get around this scenarion (David Nebinger wrote a great blog post outlining one way to do it) -- but looking at the import statements in that class, I don't actually see any explicit "internal" package references.
NOTE: According to the docs (in the portal.properties), the auth.pipeline.post is actually depracated and doesn't seem to be used anymore.
Workaround idea: Can't you simply set the Liferay password for users from ldap to something secret (really long and random)? Then ldap users can only authenticate through ldap.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™