Search code examples
ldapliferayliferay-6liferay-ide

Cannot login using ldap user in Liferay


It was working until few days back but right now it doesnt login in.It shows authentication failed please try again.Im using Liferay 6.2 and this is my portal-ext.properties

#jdbc.default.jndi.name=jdbc/LiferayPool
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root

echolaide.database.name=echolaidedb
echolaide.database.username=root
echolaide.database.password=root
echolaide.database.hostname=localhost
echolaide.database.connection=jdbc:mysql://localhost/echolaidedb?user=root&password=root

json.service.auth.token.hosts.allowed=127.0.0.1
json.service.auth.token.enabled=false
jsonws.web.service.public.methods=*
jsonws.servlet.hosts.allowed=127.0.0.1


#users.screen.name.validator=com.liferay.portal.security.auth.LiberalScreenNameValidator
#users.screen.name.allow.numeric=true


ldap.base.provider.url= ldap://localhost:389
ldap.base.dn= dc=echolaide,dc=schoolx
ldap.security.principal= cn=admin
ldap.security.credentials= x1234#
auth.pipeline.pre=com.liferay.portal.security.auth.LDAPAuth

ldap.auth.enabled=true
ldap.auth.required=true
ldap.password.policy.enabled=true
ldap.users.dn= dc=echolaide,dc=schoolx
ldap.groups.dn= dc=echolaide,dc=schoolx

ldap.import.enabled=true
ldap.import.interval=10
ldap.import.on.startup=true
ldap.import.method=group
ldap.import.group.search.filter.enabled=true


ldap.user.mappings=screenName=cn\npassword=userPassword\nemailAddress=mail\nfirstName=givenName\nlastName=sn
#ldap.user.impl=com.liferay.portal.security.ldap.LDAPUser

ldap.group.mappings=groupName=cn\ndescription=description\nuser=member

ldap.import.user.search.filter=(objectClass=inetOrgPerson)

ldap.import.group.search.filter=(objectClass=groupOfEntries)

ldap.auth.search.filter=(mail=@email_address@)

ldap.import.create.role.per.group=true


axis.servlet.hosts.allowed=
axis.servlet.https.required=false
company.security.auth.type=emailAddress
search.container.show.pagination.top=false
setup.wizard.enabled=false
#passwords.default.policy.change.required=false

I tested the ldap connection,user and groups from the control panel. They all are fine.I could see the user i tried to login.But im not able to login using the user.Can any one help me to identify the issue?

Log

16:07:01,799 ERROR [liferay/scheduler_dispatch-4][PortalLDAPImporterImpl:1061] Unable to load user {createtimestamp=createTimestamp: 20150209095349Z, mail=mail: raman@gmail.com, userpassword=userPassword: [B@b10e15, creatorsname=creatorsName: cn=Directory Manager,cn=Root DNs,cn=config, givenname=givenName: raman, sn=sn: raman, cn=cn: raman raman}
com.liferay.portal.UserScreenNameException
    at com.liferay.portal.service.impl.UserLocalServiceImpl.validateScreenName(UserLocalServiceImpl.java:6158)
    at com.liferay.portal.service.impl.UserLocalServiceImpl.validate(UserLocalServiceImpl.java:5897)
    at com.liferay.portal.service.impl.UserLocalServiceImpl.addUserWithWorkflow(UserLocalServiceImpl.java:746)
    at com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:608)
    at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
    at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
    at com.sun.proxy.$Proxy106.addUser(Unknown Source)
    at com.liferay.portal.service.UserLocalServiceUtil.addUser(UserLocalServiceUtil.java:1166)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.addUser(PortalLDAPImporterImpl.java:521)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importUser(PortalLDAPImporterImpl.java:930)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importUsers(PortalLDAPImporterImpl.java:1042)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAPByGroup(PortalLDAPImporterImpl.java:664)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:197)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:139)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:101)
    at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:39)
    at com.liferay.portlet.admin.messaging.LDAPImportMessageListener.doReceive(LDAPImportMessageListener.java:51)
    at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
    at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
    at com.sun.proxy.$Proxy297.receive(Unknown Source)
    at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:76)
    at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
    at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
    at java.lang.Thread.run(Thread.java:745)

Solution

  • The exception says the userScreenName has issue. The LDAP attribute which is mapped to Liferay screenName has value which is rejected by Liferay. If it has some special characters, you can set "allowed special characters" using a property in portal-ext.properties file.