Openldap安装 配置,及为gatein增加openldap支持

先是安装openldap

 

我是使用yum方式安装的openldap 关与redhat5使用yum参见我上一篇文章。

 

yum install openldap*

 

很简单就装好了。。。。。。编译安装太费事了。

 

 

使用和配置参考两篇文章:

 

http://www.l-penguin.idv.tw/article/ldap-1.htm

 

http://bbs.51cto.com/archiver/tid-455330.html

 

几个关键点

 

vim /etc/openldap/slapd.conf 

 

suffix "dc=l-penguin,dc=idv,dc=tw"
rootdn "cn=Manager,dc=l-penguin,dc=idv,dc=tw"
rootpw secret

 

 

# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
is not owned by "ldap"
# chown ldap:ldap -R /var/lib/ldap/
Failed to read entry
就是你还没有在这个ldap服务中创建初始数据。也就是no entry的错误。导入初期数据(一定要导入这个后再导入另外的ldif)
dn: dc=<MY-DOMAIN>,dc=<COM> 
objectclass: dcObject 
objectclass: organization 
o: <MY ORGANIZATION> 
dc: <MY-DOMAIN> 

dn: cn=Manager,dc=<MY-DOMAIN>,dc=<COM> 
objectclass: organizationalRole 
cn: Manager
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f example.ldif 

现在用LDAP Browser连接应该没问题了。

设置Gatein
管方文档
http://community.jboss.org/wiki/GateInWithLDAPAsADefaultUserAndGroupStore

简单的反译,说明一下:

OpenLDAP

This tutorial assumes that OpenLDAP is installed and available with connection details listed below.
      
      
  • rootDN: dc=my-domain,dc=com
  • admin user: cn=Manager,dc=my-domain,dc=com
  • admin password: secret
  • host: localhost
  • port 1389

假设你的Openldap的安装配置如上所述 (我的安装完了不是这样的,我用的基本都是默认的,下面贴下我的)

 


            
            
  • rootDN: dc=dgsoft,dc=net
  • admin user: cn=Manager,dc=dgsoft,dc=net
  • admin password: secret
  • host: 192.168.0.200
  • port 389

 

Populate server with "initial-openldap.ldif" file that is attached to this document. Modify the ldif file if you have different root suffix.


导入

"initial-openldap.ldif"(可在原文档中下载)到你的Openldap中去,如果你的的root suffix不同那么要修改(不同是一定的了。下载后一定要改,还要注意你的openldap的根一定要先导入 )

 

 


 

 
Download GateIn and unzip  
下载gatein 和 unzip (这个应该不用了,相信你的机器上都有了)
With GateIn 3.0 Final attached file "picketlink-idm-openldap-config.xmlneeds to be placed under "(gatein.ear)/portal.war/WEB-INF/conf/organization/picketlink-idm/examples/"
GateIn3.0 Final 需要使用的配置文件"picketlink-idm-openldap-config.xml" 在 "(gatein.ear)/portal.war/WEB-INF/conf/organization/picketlink-idm/examples/" 中(下面有各种ldap的标准配置
In portal.war (in JBoss under gatein.ear) edit WEB-INF/conf/organization/idm-configuration.xml and uncomment:
在portal.war(在JBoss部署目录的gatein.ear中)编辑 WEB-INF/conf/organization/idm-configuration.xml  解除注释:
war:/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-config.xml (原文附件中有,Gatein中也自带没必要下载)
 
(注意:这里要先把原来的value注释掉,再解除注释)
Following groupTypeMappings:
 
(这个直接解除注释就行了,以上两件看原文吧,有加粗)
       
       
  • Start the server

启动服务器(先不要急,因为设置不同,还要修改别的地方,在后面说怎么修改)

 

Log into portal (http://localhost:8080/portal) user: root password: gtn

登录portal(http://localhost:8080/portal)用户 root 密码:gtn(不用怀疑,gatein已经自动建立用户和密码)

 

 

In LDAP you can see that:

 

在你的LDAP中你能看到新加的用户像这样:

  • ou=People,o=portal,o=gatein,dc=my-domain,dc=com contains all portal users
  • ou=Platform,o=portal,o=gatein,dc=my-domain,dc=com contains portal groups stored under /platform. Those groups contain references to users with "member" attribute.
  • ou=Organization,o=portal,o=gatein,dc=my-domain,dc=com contains portal groups stored under /organization. Those groups contain membership information (member attribute) that represents tree structure from GateIn.

 

 

 

 

To use different LDAP server setup or directory data please edit file /WEB-INF/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-config.xml and change following values:
使用用不同的LDAP服务安装配置,请编辑文件 /WEB-INF/conf/organization/picketlink-idm/examples/picketlink-idm-openldap-config.xml 并改变如下面的值: 
   
   
  • ctxDNs options values: (注意:这个有多个,在文档中查找了全部都要改,其它的就只有一个)
    • ou=People,o=portal,o=gatein,dc=my-domain,dc=com
    • ou=Platform,o=portal,o=gatein,dc=my-domain,dc=com
    • ou=Organization,o=portal,o=gatein,dc=my-domain,dc=com
  • providerURL  option value
    • ldap://localhost:1389
  • adminDN option value
    • cn=Manager,dc=my-domain,dc=com
  • adminPassword
    • secret

(注意:后面还有一个地方需要修改,先不要启动服务)

For additional customizations please read PicketLink IDM Reference Guide and dedicated chapter of GateIn Reference Guide.

如需要其它自定设置参考GateIn用户手册,中有关于PicketLink IDM 的一章

 

How does it work (它是怎样工作的)
In the same way as explained for OpenDS and MSAD...  There are few special configuration tweaks for OpenLDAP:
方式和OpenDS和MSAD一样的,有一些为OPENLDAP的特殊的设置
Special option disables use of Sort LDAP control as it is not supported by OpenLDAP
OpenLDAP不支持排序,要禁用LDAP排序设置(默认就已经禁用了)
 
OpenLDAP uses a strict and RFC compliant schema in which 'member' attribute is required by 'groupOfNames' object class. This means that every entry of such objectClass needs to have at least one member assigned. PicketLink IDM workarounds this by adding a special "placeholder" entry that is ignored during relationship resolution:
不明白说些什么,我对LDAP也不熟,大概是说Openldap的schema设置很严格,所以需要一个特殊设置,如下

 

(把dc改成你的,行了,可以启动你的服务器了,我的是jboss ./run.sh -b 0.0.0.0)

 

 

好了。。现在Gatein已经成功的使用OpenLDAP来作身份验证了,关于其它的东东,以后再写吧








 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值