cas+ldap实现单点登录
2014-04-17 10:19
260 查看
cas+ldap 连接多哥ldap时大多数引用的都是这个类,但是我中cas -server -supper-ldap3以上的jar中都找不到此类,迷惑了很久于是我找了源码配置文件发现根本不是引用这个类,下面介绍一下cas+ldap连接的两种方式
方式一: 连接单个ldap
方式二: 可连接多ldap
使用的jar
cas-server-support-ldap-3.4.3.1.jar spring-ldap-1.3.1.RELEASE-all.jar
方式一: 连接单个ldap
在cas的deployerConfigContext.xml这个文件中找到<bean class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />注释掉添加下面的bean <bean class="org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler"> <property name="filter" value="uid=%u,ou=People,o=tcl,c=cn" /> <property name="contextSource" ref="contextSource" /> </bean> 在根节点中添加 <bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource"> <property name="pooled" value="false"/> <property name="url" value="ldap://192.168.0.114:389" /> <property name="userDn" value="cn=Manager,o=tcl,c=cn"/> <property name="password" value="secret"/> <property name="baseEnvironmentProperties"> <map> <entry key="com.sun.jndi.ldap.connect.timeout" value="3000" /> <entry key="com.sun.jndi.ldap.read.timeout" value="3000" /> <entry key="java.naming.security.authentication" value="simple" /> </map> </property> </bean>
方式二: 可连接多ldap
<bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler"> <property name="filter" value="uid=%u" /> <property name="searchBase" value="ou=People,o=tcl,c=cn" /> <property name="contextSource" ref="contextSource" /> </bean> 根节点添加 <bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource"> <property name="anonymousReadOnly" value="false" /> <property name="password" value="secret" /> <property name="pooled" value="true" /> <property name="urls"> <list> <value>ldap://192.168.0.114:389/</value> </list> </property> <property name="userDn" value="cn=Manager,o=tcl,c=cn" /> <property name="baseEnvironmentProperties"> <map> <!--<entry> <key><value>java.naming.security.protocol</value></key> <value>ssl</value> </entry>--> <entry> <key><value>java.naming.security.authentication</value></key> <value>simple</value> </entry> </map> </property> </bean>
使用的jar
cas-server-support-ldap-3.4.3.1.jar spring-ldap-1.3.1.RELEASE-all.jar
相关文章推荐
- cas+openldap实现单点登录认证一
- SSO之CAS+LDAP实现单点登录认证
- CAS+LDAP实现单点登录认证
- SSL+CAS+LdAP实现单点登录
- CAS 实现单点登录(SSO)基本实现流程(一)
- 使用 CAS 在 Tomcat 中实现单点登录
- 用CAS框架实现单点登录(tomcat7,jdk1.7)
- 【Tech】单点登录系统CAS服务器端搭建及实现用户名密码由MYSQL数据库验证
- 使用 CAS 在 Tomcat 中实现单点登录
- CAS实现单点登录(SSO)经典完整教程
- 使用 CAS 在 Tomcat 中实现单点登录
- CAS实现单点登录(SSO)经典完整教程
- CAS实现SSO(单点登录)
- CAS实现单点登录(SSO)经典完整教程
- CAS实现单点登录SSO执行原理探究(终于明白了)
- cas实现单点登录
- Tomcat下配置与使用CAS实现单点登录
- mvnForum同CAS整合实现单点登录
- 使用 CAS 在 Tomcat 中实现单点登录
- CAS实现单点登录原理与实例解析