无法将用户从Ldap服务器加载到Liferay com.liferay

时间:2015-04-13 07:59:26

标签: ldap liferay liferay-6 portal liferay-ide

我尝试从ldap服务器验证用户到liferay。我的要求是使用screename登录liferay。

ldap.base.provider.url= ldap://localhost:389
ldap.base.dn= dc=soas,dc=schoolx
ldap.security.principal= cn=admin
ldap.security.credentials= blahblah
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=soas,dc=schoolx
ldap.groups.dn= dc=soas,dc=schoolx

ldap.import.enabled=true
ldap.import.interval=1
ldap.import.on.startup=true

ldap.import.method=group
ldap.import.group.search.filter.enabled=true
ldap.import.group.cache.enabled=false
#ldap.export.enabled=true

ldap.auth.password.encryption.algorithm=

ldap.user.mappings=screenName=cn\npassword=userPassword\nemailAddress=mail\nfirstName=givenName\nlastName=sn

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=(cn=@screen_name@)

当我从ldap服务器使用用户登录时,我得到以下异常。

07:20:28,513 ERROR [liferay/scheduler_dispatch-2][PortalLDAPImporterImpl:1061] Unable to load user {createtimestamp=createTimestamp: 20150331045703Z, mail=mail: vimekvanamali@gmail.com, userpassword=userPassword: [B@6c01fb, creatorsname=creatorsName: cn=Directory Manager,cn=Root DNs,cn=config, givenname=givenName: vimekedited, sn=sn: vanamali, cn=cn: vimekeditedmali}
com.liferay.portal.GroupFriendlyURLException
    at com.liferay.portal.service.impl.UserLocalServiceImpl.validateScreenName(UserLocalServiceImpl.java:6181)
    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.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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.$Proxy105.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)

enter image description here

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

Liferay为每个用户创建一个私人群组,其屏幕名称为唯一友好的URL。 我想这里的问题是,已经存在一个友好的URL与用户的屏幕名称相同的组。 因此,liferay无法将此用户导入其数据库。

在liferay数据库中,尝试执行此查询并查看它是否返回任何组。

select groupId, name, friendlyURL from Group_ where friendlyURL like '%vimekeditedmali%';

如果这返回任何现有的组,则需要更改该组的友好URL以使导入用户工作。