问题
I need to configure Liferay with organization LDAP.
My requirement is to import users on demand( on login) to Liferay database.
When I try to login by using screen name which is mapped to sAMAccountNumber in LDAP, I get
authentication failure error
I do not see any users imported in db too.
After a lot of debugging it looks life LDAP connection is done successfully. But no results are returned from LDAP.
I am seeing something like this in the logs .
Search filter before transformation (sAMAccountName=@screen_name‌​@)
Search filter after transformation (sAMAccountName=@screen_name‌​@)
I am not sure why its appending junk characters at the end .
It should just be
"sAMAccountName=@screen_name@ "
Any quick pointers would really help.
Thanks!
回答1:
After lot of debugging and server restarts finally I got to know the issue. Hope it helps somebody else.
As shown in my question there were some junk characters getting appended to authentication search filter ,this was the reason it was not replacing the SAMAccountNamr with actual value I entered on login screen.
This Junk characters were not visible in the text editor I was using and hence not visible to the human eye.
It was only when I changed my text editor encoding to ANSI ,I was able to see these junk characters . I really have no knowledge on how character encoding work ,I tried it just thinking whether text editor is hiding something. I had copied this string from one of the tutorial i.e. web page and might be a reason these junk characters got appended.
After removing them everything was all fine.Thanks Pavel for your suggestions in the debugging process.
来源:https://stackoverflow.com/questions/23478461/ldap-configuration-with-liferay-portal-not-working