今天的手又痒痒了,觉得应该是时候写点东西了。
这一周的时间在忙活ldap认证,这个已经不是什么新鲜名词了概念就免了;
之所以学ldap,还是为了sso和portal。
经过一周的时间,搭建好了ldap服务器,用的开源的apache的ds,还有apache的studio;配置起来非常的简单主要掌握几个要点就好了:
1、server.xml的配置
adding your own partition resp. suffix
添加自己的数据格式
然后查询examplepartitionconfiguration把他的bean配置重新复制一份需要修改几个地方
class="org.apache.directory.server.core.partition.
impl.btree.mutablebtreepartitionconfiguration">
next give the partition a name and change the suffix to o=mydomain
objectclass: top
objectclass: domain
objectclass: extensibleobject
dc: example ---> o:mydomaim
重新启动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
坏男孩 阅读(7374)
评论(9) 所属分类:
java命令学习