`
likaidalian
  • 浏览: 53955 次
社区版块
存档分类
最新评论

liferay 6.1 CE LDAP

 
阅读更多

goole了许多网页,讲的是五花八门,最后想起来去portal.properties看看,才发现别人讲的不一定正确,或者是自己理解有误。

重要提示:
1. user mapping 中有5个必须映射的字段,否则出错。

    • screenName
    • password
    • emailAddress
    • firstName
    • lastName

2. 如果在控制面板中配置了LDAP,则portal-ext 中的关于ldap设置会全部失效, 所以只能二选一(控制面板 or portal-ext)
3. 如果想让控制面板中配置的ldap信息失效,只有一个办法:
    找到portalpreferences表,删除其中的一条记录, 此记录信息如下
    plid=0
    portletid=LIFERAY_PORTAL
    the "preferences" field will start with "<portlet-preferences><preference><name>ldap.base.dn</name>"



仔细看看portal.properties

##
## LDAP
##

    #
    # Set the values used to connect to a LDAP store.
    #
    ldap.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
    ldap.referral=follow

    #
    # Settings for com.liferay.portal.security.auth.LDAPAuth can be configured
    # from the Admin portlet. It provides out-of-the-box support for Apache
    # Directory Server, Microsoft Active Directory Server, Novell eDirectory,
    # and OpenLDAP. The default settings are for Apache Directory Server.
    #
    # The LDAPAuth class must be specified in the property "auth.pipeline.pre"
    # to be executed.
    #
    # Encryption is implemented by com.liferay.util.Encryptor.provider.class in
    # system.properties.
    #
    ldap.auth.enabled=false
    ldap.auth.required=false

    #
    # Set the page size for directory servers that support paging. This value
    # needs to be 1000 or less for Microsoft Active Directory Server.
    #
    ldap.page.size=1000

    #
    # Set the number of values to return in each query to a multivalued
    # attribute for directory servers that support range retrieval. The range
    # size must be 1000 or less for Windows 2000 and 1500 or less for Windows
    # Server 2003.
    #
    ldap.range.size=1000

    #
    # Set either bind or password-compare for the LDAP authentication method.
    # Bind is preferred by most vendors so that you don't have to worry about
    # encryption strategies.
    #
    ldap.auth.method=bind
    #ldap.auth.method=password-compare

    #
    # Set the password encryption to use for comparing passwords during import
    # and to use for encrypting passwords during export. Comparing passwords
    # during import will only be used when the property "ldap.auth.method" is
    # set to password-compare. If the encryption is set to NONE, which is the
    # default value, passwords are considered as plain text. The SHA-512
    # algorithm is currently unsupported.
    #
    #ldap.auth.password.encryption.algorithm=BCRYPT
    #ldap.auth.password.encryption.algorithm=MD2
    #ldap.auth.password.encryption.algorithm=MD5
    ldap.auth.password.encryption.algorithm=NONE
    #ldap.auth.password.encryption.algorithm=SHA
    #ldap.auth.password.encryption.algorithm=SHA-256
    #ldap.auth.password.encryption.algorithm=SHA-384
    #ldap.auth.password.encryption.algorithm=SSHA
    #ldap.auth.password.encryption.algorithm=UFC-CRYPT

    #
    # 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

    #
    # Specify the settings for LDAP connections. Any property prefixed with
    # "ldap.connection." will be passed to the LDAP context as an environment
    # variable.
    #
    # To enable LDAP connection pooling, you have to set
    # "ldap.connection.com.sun.jndi.ldap.connect.pool" to true and provide
    # additional JVM system properties via the JVM start-up options via:
    #
    #     java ... -Dcom.sun.jndi.ldap.connect.pool.maxsize=50 -Dcom.sun.jndi.ldap.connect.pool.timeout=10000
    #
    # See the following link:
    #     http://docs.oracle.com/javase/6/docs/technotes/guides/jndi/jndi-ldap.html#POOL
    #
    ldap.connection.com.sun.jndi.ldap.connect.pool=true
    ldap.connection.com.sun.jndi.ldap.connect.timeout=500
    ldap.connection.com.sun.jndi.ldap.read.timeout=15000

    #
    # Settings for importing users and groups from LDAP to the portal.
    #
    ldap.import.enabled=false
    ldap.import.on.startup=false
    ldap.import.interval=10

    #
    # Set either user or group for import method. If set to user, the portal
    # will import all users and the groups associated with those users. If set
    # to group, the portal import all groups and the users associated those
    # groups. This value should be set based on how your LDAP server stores
    # group membership information.
    #
    ldap.import.method=user
    #ldap.import.method=group

    #
    # Set the lock expiration time for LDAP import. By default, the expiration
    # time is 1 day.
    #
    ldap.import.lock.expiration.time=86400000

    #
    # If set to true, the group filter will be applied, but only to groups in
    # the specified base DN. If set to false, the filter will not be applied and
    # all groups that are associated with the imported users will be imported
    # regardless of the base DN.
    #
    ldap.import.group.search.filter.enabled=true

    #
    # Specify whether group DN lookups will be cached during LDAP import and
    # login. If set to true, this will speed up LDAP import and login, but
    # updates to group attributes will not be recognized until the cache entry
    # expires. The cache size and timeout may be configured in the configuration
    # file specifed in the property "ehcache.single.vm.config.location".
    #
    ldap.import.group.cache.enabled=true

    #
    # Set this to true if the portal should automatically create a role per
    # group imported from LDAP. The role will be assigned to the group so that
    # users can automatically inherit that role when they are assigned to the
    # group.
    #
    ldap.import.create.role.per.group=false

    #
    # Set these values to be a portion of the error message returned by the
    # appropriate directory server to allow the portal to recognize messages
    # from the LDAP server. The default values will work for Fedora DS.
    #
    ldap.error.password.age=age
    ldap.error.password.expired=expired
    ldap.error.password.history=history
    ldap.error.password.not.changeable=not allowed to change
    ldap.error.password.syntax=syntax
    ldap.error.password.trivial=trivial
    ldap.error.user.lockout=retry limit

    #
    # Set this to true to use LDAP's password policy instead of the portal
    # password policy.
    #
    # If set to true, it is possbile that portal generated passwords will not
    # match the LDAP policy. See the "passwords.regexptoolkit.*" properties for
    # details on configuring RegExpToolkit in generating these passwords.
    #
    ldap.password.policy.enabled=false

    #
    # Set this to false when the LDAP user's password should not be imported to
    # the Liferay user.
    #
    ldap.import.user.password.enabled=true

    #
    # Set this to true to autogenerate passwords for users imported from
    # LDAP.
    #
    # This property is only in use if the property
    # "ldap.import.user.password.enabled" is set to false.
    #
    # If an LDAP password policy is enabled (see the property
    # "ldap.password.policy.enabled"), the password will be generated using
    # RegExpToolkit. Set the "auth.pipeline.enable.liferay.check" property to
    # false to disable password checking by the portal's internal authentication
    # (which is not compatible with LDAP), and set the "auth.pipeline.pre"
    # property to com.liferay.portal.security.auth.LDAPAuth so that password
    # checking will be delegated to the LDAPAuth authenticator.
    #
    # Note that enabling LDAP export, by setting the "ldap.export.enabled"
    # property to true, may lead to overwriting the LDAP user's password with an
    # autogenerated password.
    #
    ldap.import.user.password.autogenerated=false

    #
    # Set either screenName or plain text as the default password for the
    # imported LDAP user. Setting the value to screenName will use the user's
    # screen name as the password for the imported LDAP user. Setting the value
    # to any other plain text value will use that value as the password for the
    # imported LDAP user.
    #
    # This property is only in use if the properties
    # "ldap.import.user.password.enabled" and
    # "ldap.import.user.password.autogenerated" are both set to false.
    #
    ldap.import.user.password.default=test
    #ldap.import.user.password.default=screenName

    #
    # Settings for exporting users from the portal to LDAP. This allows a user
    # to modify his first name, last name, etc. in the portal and have that
    # change pushed to the LDAP server. This setting is not used unless the
    # property "ldap.auth.enabled" is set to true.
    #
    ldap.export.enabled=false

    #
    # Set this to true if groups and their associations should be exported from
    # the portal to LDAP. This setting is not used unless the property
    # "ldap.auth.enabled" is set to true.
    #
    ldap.export.group.enabled=true

    #
    # Set the values used to connect to a LDAP store.
    #
    # The list of properties must end with a subsequent integer (0, 1, etc.) and
    # it is assumed that the list has reached an end when the pattern or
    # replacement is not set.
    #
    #ldap.base.provider.url.0=ldap://localhost:10389
    #ldap.base.dn.0=dc=example,dc=com
    #ldap.security.principal.0=uid=admin,ou=system
    #ldap.security.credentials.0=secret

    #
    # Active Directory stores information about the user account as a series of
    # bit fields in the UserAccountControl attribute.
    #
    # If you want to prevent disabled accounts from logging into the portal you
    # need to use a search filter similiar to the following:
    # (&(objectclass=person)(userprincipalname=@email_address@)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))
    #
    # See the following links:
    #     http://support.microsoft.com/kb/305144/
    #     http://support.microsoft.com/?kbid=269181
    #
    #ldap.auth.search.filter.0=(mail=@email_address@)

    #
    # When importing and exporting users, the portal will use this mapping to
    # connect LDAP user attributes and portal contact attributes.
    #
    # See com.liferay.portal.model.ContactModel for a list of attributes.
    #
    #ldap.contact.mappings.0=aimSn=\nbirthday=\nfacebookSn=\nicqSn=\njabberSn=\njobTitle=\nmsnSn=\nmySpaceSn=\nskypeSn=\nsmsSn=\ntwitterSn=\nymSn=

    #
    # When importing and exporting users, the portal will use this mapping to
    # connect LDAP user attributes and portal contact's custom attributes.
    #
    #ldap.contact.custom.mappings.0=

    #
    # When a user is exported to LDAP and the user does not exist, the user will
    # be created with the following default object classes.
    #
    #ldap.user.default.object.classes.0=top,person,inetOrgPerson,organizationalPerson

    #
    # When importing and exporting users, the portal will use this mapping to
    # connect LDAP user attributes and portal user attributes.
    #
    # See com.liferay.portal.model.UserModel for a list of attributes.
    #
    #ldap.user.mappings.0=emailAddress=mail\nfirstName=givenName\ngroup=groupMembership\njobTitle=title\nlastName=sn\npassword=userPassword\nscreenName=cn\nuuid=uuid\n

    #
    # When importing and exporting users, the portal will use this mapping to
    # connect LDAP user attributes and portal user's custom attributes.
    #
    #ldap.user.custom.mappings.0=

    #
    # Set the user attributes that are controlled from the portal. When adding
    # or updating a user from LDAP, these attributes will be skipped.
    #
    ldap.user.ignore.attributes=
    #ldap.user.ignore.attributes=aimSn,comments,facebookId,facebookSn,greeting,icqSn,jabberSn,jobTitle,languageId,msnSn,mySpaceSn,openId,prefixId,reminderQueryAnswer,reminderQueryQuestion,skypeSn,smsSn,suffixId,timeZoneId,twitterSn,ymSn

    #
    # When a group is exported to LDAP and the group does not exist, the group
    # will be created with the following default object classes.
    #
    #ldap.group.default.object.classes.0=top,groupOfUniqueNames

    #
    # When importing groups, the portal will use this mapping to connect LDAP
    # group attributes and portal user group attributes.
    #
    #ldap.group.mappings.0=description=description\ngroupName=cn\nuser=uniqueMember

    #
    # Settings for importing users and groups from LDAP to the portal. These
    # setttings are not used unless the property "ldap.import.enabled" is set
    # to true.
    #
    #ldap.import.user.search.filter.0=(objectClass=inetOrgPerson)
    #ldap.import.group.search.filter.0=(objectClass=groupOfUniqueNames)

    #
    # New users and groups will be created at the specified DN. This will only
    # be active if the property "ldap.auth.enabled" and "ldap.export.enabled"
    # are set to true.
    #
    #ldap.users.dn.0=ou=users,dc=example,dc=com
    #ldap.groups.dn.0=ou=groups,dc=example,dc=com

分享到:
评论

相关推荐

    liferay6.1开发学习

    【Liferay 6.1 开发学习】 Liferay 是一款开源的企业级门户平台,它提供了内容管理、社交网络、协作工具等功能,适用于构建企业内部或对外的网站和工作平台。Liferay 6.1 版本是其重要的里程碑,包含了丰富的功能...

    LifeRay 6.1 User Guide PDF版(英文版)

    ### Liferay 6.1 用户指南关键知识点解析 #### 一、Liferay 是什么? Liferay是一款开源的企业级门户平台,旨在帮助企业构建功能强大的网站、社区门户和企业应用。它提供了一系列工具和服务来帮助用户创建复杂的...

    liferay6.1,Eclipse3.6开发环境搭建

    3. **Liferay Plugin SDK**:文件名为`liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760.zip`,包含Liferay 6.1所需的SDK。 4. **Liferay Tomcat Bundle**:文件名为`liferay-portal-tomcat-6.1.0-ce-ga1-...

    Liferay6.1 权限管理

    ### Liferay 6.1 权限管理深度解析 #### 一、权限管理概述 Liferay 6.1 的权限管理是一项重要的功能,它确保了门户的安全性和灵活性。权限管理主要包括用户管理、组织机构管理、站点管理和角色管理等多个方面。...

    liferay6.1Eclipse3.6开发环境搭建

    ### Liferay 6.1与Eclipse 3.6开发环境搭建详解 #### 一、前言 在软件开发领域,构建一个高效稳定的开发环境至关重要。对于基于Liferay平台进行开发的团队而言,确保开发环境的顺利搭建是项目成功的关键之一。本文...

    Liferay 6.1开发学习转载别人的文档.doc

    Liferay 6.1 版本在2011年发布,此版本引入了许多关键改进,包括文件同步功能,提升了文档库的性能,改进了用户界面,增加了表单和工作流设计工具,以及增强了对移动设备的支持。这使得 Liferay 更加适应企业的需求...

    liferay-webcontent-migration-6.1-to-6.2:从Liferay 6.1迁移到Liferay 6.2时解决Web内容某些问题的Portlet

    从Liferay 6.1到Liferay 6.2 将内容从Liferay 6.1版本迁移到6.2版本时,迁移的结构存在一个常见问题。 在Liferay 6.2中,结构的字段名称必须在全局范围内唯一,而在6.1中,它们的名称仅在层次结构级别上必须唯一。 ...

    Liferay6.1 strutsDemo-ext

    用Liferay6.1做的一个ext demo,通过struts可以对mysql进行增删改查(只做了查找和删除),里面的jsp会报错,不用管,能正常运行,数据库连接选项自己修改。 感谢http://hu437.iteye.com/blog/727055给了我很大的...

    liferay6.1的SSI整合4(SDK开发)

    标题 "Liferay6.1的SSI整合4(SDK开发)" 涉及的是在Liferay 6.1版本中集成Server Side Includes (SSI) 的技术,并且是该系列教程的第四部分,主要关注通过Liferay SDK进行开发。Liferay是一款开源的企业级Portal...

    LifeRay 6.1GA2开发手册-英文

    ### LifeRay 6.1GA2开发手册关键知识点解析 #### 一、前言与介绍 根据提供的“LifeRay 6.1GA2开发手册”文档摘要,该手册主要介绍了如何利用LifeRay 6.1.1 GA2版本进行开发工作。LifeRay是一款功能强大的企业级...

    Using Liferay Portal 6.1

    Using Liferay Portal 6.1

    liferay_6.1_开发学习

    【Liferay 6.1 开发学习】 Liferay 是一款开源的企业级门户平台,它提供了丰富的功能和可扩展性,适合构建复杂的业务应用和企业网站。Liferay 6.1 版本是其发展历程中的一个重要里程碑,具备稳定性和性能优化。这篇...

    Liferay_6.1开发学习

    【Liferay 6.1 开发学习】 Liferay 是一个高度可定制的开源企业级门户平台,主要用于构建数字化工作环境、社交网络和企业内部协作系统。它的核心功能包括内容管理、用户管理和工作流程,旨在提供统一的用户体验。...

    liferay6.1权限验证时序图

    liferay的权限时序图,给大家共享一下,希望大家批评指正,沟通。

    Liferay6.1 ServiceBuilder增删改查示例 源代码

    Service Builder是Liferay IDE(SDK)提供的一种代码生成方案,开发人员只需要编辑一个数据库的实体描述文件,即可根据本XML文件生成Spring层代码、Hibernate层代码、SQL、SQL索引创建文件、Spring和hibernate的配置...

    liferay-portlet-icefaces-archetype-6.1.30.zip

    commons-configuration-gae.zip,配置的实现(由apache commons配置库提供),使用google app engine datastore api存储配置参数;配置的实现(由apache commons配置库提供),使用google app engine datastore api...

    calendar-liferay-6-1:Liferay 6.1中的日历插件

    这个插件(或Portlet项目)只不过为Liferay Portal 6.1提出了响应时间表(移动或桌面)。 关于前端已从Code Canyon的产品代码开始开发。 然后修改了CSS和JavaScript / jQuery。 对于后端,我使用了API Liferay ...

    liferay6.1.2开发环境的搭建

    进入 Liferay 官方网站,点击“Downloads”下载 Liferay Portal 6.1Community Edition GA3 中的 3 项“Bundled with Tomcat”,“Portal Source”,“Plugins SDK”再选择“Additional Files”找到“Liferay Portal ...

    Liferay与LDAP集成

    Liferay与LDAP集成是将Liferay门户与目录服务相结合,实现单点登录、用户身份验证和用户数据同步等功能,提升企业级应用的安全性和用户体验。 OpenLDAP是LDAP协议的开源实现,包括slapd(LDAP服务守护进程)、...

    Liferay开发指南

    打开Liferay IDE,Window--&gt;Preferences--&gt;Server--&gt;Runtime Environment,点击右边Add…,在弹出的服务器选择里面选择Liferay,Inc--&gt;Liferay v6.1 CE (Tomcat 7),请打“Create a new location server”打上勾。...

Global site tag (gtag.js) - Google Analytics