当前位置: 首页 > 知识库问答 >
问题:

在Liferay中从LDAP导入用户

沈良策
2023-03-14

从5天开始,我就遇到了同样的问题,无法从OpenLDAP导入用户和组到Liferay CE 6.1...下面是我的OpenLDAP的结构:

World
--tn
----com
------domain
--------admin
--------Computers
--------domain
--------Groups
----------IT
------------cn
------------gidNumber
------------objectClass
------------memberUid (n member)
--------Users
----------uid0001
------------cn
------------gidNumber
------------homeDirectory
------------objectClass 
------------sn
------------uid
------------uidNumber
------------givenName
------------loginShell
------------userPassword
## LDAP Server Settings
ldap.base.provider.url=ldap://controller.domain.com.tn:389
ldap.base.dn=DC=domain,DC=com,DC=tn 

# authentication
ldap.security.principal=cn=admin,dc=domain,dc=com,dc=tn
ldap.security.credentials=My Password !

# search from this point in the tree
ldap.users.dn=DC=domain,DC=com,DC=tn

# You can write your own class that implements
# com.liferay.portal.security.ldap.AttributesTransformer to transform the
# LDAP attributes before a user or group is imported to the LDAP store.

ldap.attrs.transformer.impl=com.liferay.portal.security.ldap.DefaultAttributesTransformer
# standard mappings, must be present in LDAP or we get an exception
#ldap.user.mappings=screenName=cn\npassword=userPassword\nemailAddress=\nfirstName=givenName\nlastName=sn\njobTitle=\ngroup=
ldap.user.mappings=screenName=cn\npassword=userPassword\nfirstName=givenName\nlastName=sn\njobTitle=title\ngroup=groupMembership\nemailAddress=uid

ldap.auth.search.filter=(mail=@user_id@)
ldap.import.user.search.filter=(objectClass=inetOrgPerson)

## Import,  users can be imported on demand at login or at startup and at regular intervals.
ldap.import.enabled=true
ldap.import.interval=360
ldap.import.on.startup=true

ldap.export.enabled=false 
ldap.user.default.object.classes=inetOrgPerson,organizationalPerson

## Custom Mappings, same format as ldap.user.mappings
##Commented by ME : ldap.user.custom.mappings=nickname=mailNickname\ndisplay=cn

## Added from this link : http://www.liferay.com/community/forums/-/message_boards/message/5681334
users.screen.name.validator=com.liferay.portal.security.auth.LiberalScreenNameValidator
users.screen.name.allow.numeric=true

##added from this link :  http://issues.liferay.com/browse/LPS-14519
users.screen.name.always.autogenerate=true

##added from this link : http://vkbardia.blogspot.com/2012/05/liferay-authentication-fails-for-screen.html?showComment=1345199625453#c3592789922325172023
users.email.address.required= false


#Groups
ldap.group.mappings=groupName=cn\ndescription=description\nuser=memberUid
ldap.import.create.role.per.group=false
13:35:47,450 ERROR [PortalLDAPImporterImpl:196] Error importing LDAP users and groups
java.lang.NullPointerException
    at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:33)
    at com.liferay.portal.kernel.util.PropertiesUtil.load(PropertiesUtil.java:199)
    at com.liferay.portal.kernel.util.PropertiesUtil.load(PropertiesUtil.java:192)
    at com.liferay.portal.security.ldap.LDAPSettingsUtil.getUserExpandoMappings(LDAPSettingsUtil.java:124)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:169)
    at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:128)
    at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:34)
    at com.liferay.portal.util.PortalInstances._initCompany(PortalInstances.java:448)
    at com.liferay.portal.util.PortalInstances.initCompany(PortalInstances.java:92)
    at com.liferay.portal.servlet.MainServlet.initCompanies(MainServlet.java:766)
    at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:336)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5001)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)

等待你的帮助。

最好的和问候

共有1个答案

井昊乾
2023-03-14

希望这能帮到你,

http://www.liferay.com/community/forums/-/message_boards/message/8246721

 类似资料:
  • 因此,我使用Liferay6.1CE,LDAP服务器与我的所有用户和组。我要做的是将用户及其组从LDAP导入到Liferay。我在Liferay的控制面板中使用这些参数进行配置: 感谢(&D)

  • 我正在尝试将LDAP用户和组导入Liferay6.1。 在之后,只能从LDAP导入用户,而不能导入 有什么建议吗。

  • 在我的场景中,这是否是导入和验证的正确方式。它似乎断断续续地起作用。也就是说,有时用户会根据ldap进行身份验证,有时则不然。我没有从控制面板更改任何设置。

  • 我有这个问题: 我已经启用Liferay从/向OpenLDAP服务器导入和导出用户。 在Liferay中创建用户时,将获得以下页面: 因此,我创建了一个新用户,Liferay为其分配了一个密码(3ZBPK6KA)。

  • 实际上,我只导入liferay LDAP配置中的users组,如下所示: 知道吗? 谢谢

  • 我正在尝试从Ldap服务器对用户进行身份验证。 以下是我的Ldap用户: 我的管理员的路径是cn=admin,dc=ldap,dc=agem,dc=com 我错过了什么?