今天的手又痒痒了,觉得应该是时候写点东西了。
这一周的时间在忙活LDAP认证,这个已经不是什么新鲜名词了概念就免了;
之所以学LDAP,还是为了SSO和PORTAL。
经过一周的时间,搭建好了LDAP服务器,用的开源的APACHE的DS,还有APACHE的studio;配置起来非常的简单主要掌握几个要点就好了:
1、server.xml的配置
Adding your own partition resp. suffix
添加自己的数据格式
<property name="contextPartitionConfigurations">
<set>
<ref bean="examplePartitionConfiguration"/>
<ref bean="myPartitionConfiguration"/>
</set>
</property>
然后查询examplePartitionConfiguration把他的bean配置重新复制一份需要修改几个地方
<bean id="myPartitionConfiguration"
class="org.apache.directory.server.core.partition.
impl.btree.MutableBTreePartitionConfiguration">
Next give the partition a name and change the suffix to o=mydomain
<property name="name" value="mydomain" />
<property name="contextEntry">
<value>
objectClass: top
objectClass: domain
objectClass: extensibleObject
dc: example ---> o:mydomaim
</value>
</property>
重新启动apache ds;
2、LDIF文件的格式
第一步:组织结构以及管理员信息
dn: o=chinantn,dc=com
objectclass: organization
objectclass: top
o: chinantn
dn: cn=manager,o=chinantn,dc=com
objectclass: organizationalPerson
objectclass: person
objectclass: top
cn: manager
sn: badboyryan
userpassword:: c2VjcmV0
dn: ou=departments,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: departments
dn: ou=market,ou=departments,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: market
dn: ou=developer,ou=departments,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: developer
dn: ou=service,ou=departments,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: service
dn: ou=finance,ou=departments,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: finance
dn: ou=directorate,ou=departments,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: directorate
dn: ou=engineer,ou=departments,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: engineer
dn: ou=partners,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: partners
dn: ou=customers,ou=partners,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: customers
dn: ou=suppliers,ou=partners,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: suppliers
dn: ou=employees,ou=partners,o=chinantn,dc=com
objectclass: organizationalUnit
objectclass: top
ou: employees
第二步:人员信息
dn: uid=scf,ou=developer,ou=departments,o=chinantn,dc=com
objectClass: person
objectClass: uidObject
objectClass: organizationalPerson
objectClass: top
cn: sss
sn: scf
uid: scf
userpassword:: e01ENX1YTXNwY1ZWVFhUbFh1K1M0QllLY0hBPT0=
人员信息就少写一点了,有空你再慢慢的补充上。
第三步:导入LDIF文件,这个时候LDAP服务器里面就有了一棵树(组织结构)
第四步:被指jira让他利用LDAP认证来登录系统,如下图所示:
经过上面的折腾就完成了一个通过LDAP认证的小例子了。
注意转帖的时候带上:
©所有:http://badboyryan.blogjava.net
随意的转帖不受法律约束。
posted on 2007-09-28 13:16
坏男孩 阅读(7541)
评论(9) 编辑 收藏 所属分类:
java命令学习