RE: Not able to Login with LDAP User

thumbnail
Nirav Prajapati, modified 7 Years ago. Regular Member Posts: 133 Join Date: 6/25/15 Recent Posts

I am working with Liferay 6.2 CE - GA6. 


I have configured LDAP with Apache Active Directory with Liferay.


I have created a user in LDAP and after successful configuration when I clicked on Test LDAP User I am able to see LDAP User.


When I am trying to Login with that LDAP user it shows error as Invalid Filter. But I am able to login with test@liferay.com

Error Message

05:26:49,378 ERROR [http-bio-8080-exec-3][LDAPAuth:341] Problem accessing LDAP server com.liferay.portal.kernel.ldap.LDAPFilterException: Invalid filter prajapatinrv13@gmail.com at com.liferay.portal.kernel.ldap.LDAPUtil.validateFilter(LDAPUtil.java:285) at com.liferay.portal.security.ldap.LDAPSettingsUtil.getAuthSearchFilter(LDAPSettingsUtil.java:63) at com.liferay.portal.security.auth.LDAPAuth.authenticate(LDAPAuth.java:251) at com.liferay.portal.security.auth.LDAPAuth.authenticateAgainstPreferredLDAPServer(LDAPAuth.java:496) at com.liferay.portal.security.auth.LDAPAuth.authenticate(LDAPAuth.java:375) at com.liferay.portal.security.auth.LDAPAuth.authenticateByEmailAddress(LDAPAuth.java:80) at com.liferay.portal.security.auth.AuthPipeline._authenticate(AuthPipeline.java:227) at com.liferay.portal.security.auth.AuthPipeline.authenticateByEmailAddress(AuthPipeline.java:40) at com.liferay.portal.service.impl.UserLocalServiceImpl.authenticate(UserLocalServiceImpl.java:5473) at com.liferay.portal.service.impl.UserLocalServiceImpl.authenticateByEmailAddress(UserLocalServiceImpl.java:1071) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 

Here is my configuration setting

 

Connection

a.       Server Name : ApacheDSServer
b.      Default Values : Apache Directory Studio
c.       Base Provider URL : ldap://localhost:10389
d.      Base DN : dc=example,dc=com
e.      Principal : uid=admin,ou=system
f.       Credentials : secret
 
Users/User Mapping
a.       Authentication Search Filter  :  (mail=@email_address@)
b.      Import Search Filter : (objectClass=person)
c.       UUID : mail
d.      Screen Name : cn
e.      Email Address : mail
f.        Password : userPassword
g.       First Name : givenName
h.      Last Name : sn
i.       Job Title : title
 
Exports
 
a.      User DN : dc=example,dc=com
b.      User Default Object Classes : top,person,inetOrgPerson,organizationalPerson
thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Nirav Prajapati:
05:26:49,378 ERROR [http-bio-8080-exec-3][LDAPAuth:341] Problem accessing LDAP server
com.liferay.portal.kernel.ldap.LDAPFilterException: Invalid filter prajapatinrv13@gmail.com
 at com.liferay.portal.kernel.ldap.LDAPUtil.validateFilter(LDAPUtil.java:285)
 at com.liferay.portal.security.ldap.LDAPSettingsUtil.getAuthSearchFilter(LDAPSettingsUtil.java:63)
 at com.liferay.portal.security.auth.LDAPAuth.authenticate(LDAPAuth.java:251)
 at com.liferay.portal.security.auth.LDAPAuth.authenticateAgainstPreferredLDAPServer(LDAPAuth.java:496)
 at com.liferay.portal.security.auth.LDAPAuth.authenticate(LDAPAuth.java:375)
 at com.liferay.portal.security.auth.LDAPAuth.authenticateByEmailAddress(LDAPAuth.java:80)
 at com.liferay.portal.security.auth.AuthPipeline._authenticate(AuthPipeline.java:227)
 at com.liferay.portal.security.auth.AuthPipeline.authenticateByEmailAddress(AuthPipeline.java:40)
 at com.liferay.portal.service.impl.UserLocalServiceImpl.authenticate(UserLocalServiceImpl.java:5473)
 at com.liferay.portal.service.impl.UserLocalServiceImpl.authenticateByEmailAddress(UserLocalServiceImpl.java:1071)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Based on the error message, the value you think you set for "Authentication Search Filter" is not the actual value that Liferay is using, because the filter doesn't have any parentheses anymore, like the (mail=@email_address@) would suggest. Can you enable debug logging on com.liferay.portal.security.ldap.LDAPSettingsUtil so we can see what Liferay thinks the search filter is before the string transformation?