SSO之CAS + LDAP
本来主要详细是介绍CAS和LDAP整合实现单点登录的步骤。
1. 依《SSO之安装CAS Server》所述安装好CAS Server。
2. 安装ApacheDS。安装好ApacheDS后可以用Apache Directory Studio对其进行维护。需要注意的是ApacheDS端口号是10389,默认用户uid=admin,ou=system,密码secret。
3. 建立组织架构。所有人员建立在ou=people,dc=comple,dc=com下面,第一阶是部门,再下面可以是职员,也可以是子部门。
4. 打开tomcat/webapps/cas/WEB-INF/deployerConfigContext.xml,找到如下内容:
<!--
| This is the authentication handler declaration that every CAS deployer will need to change before deploying CAS
| into production. The default SimpleTestUsernamePasswordAuthenticationHandler authenticates UsernamePasswordCredentials
| where the username equals the password. You will need to replace this with an AuthenticationHandler that implements your
| local authentication strategy. You might accomplish this by coding a new such handler and declaring
| edu.someschool.its.cas.MySpecialHandler here, or you might use one of the handlers provided in the adaptors modules.
+-->
<bean
class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />
修改成如下:
<!--
<bean
class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />
-->
<bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler">
<property name="filter" value="cn=%u" />
<property name="searchBase" value="ou=people,dc=example,dc=com" />
<property name="contextSource" ref="contextSource" />
<property name="allowMultipleAccounts" value="true" />
</bean>
还要在最后加上contextSource定义:
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="userDn" value="uid=admin,ou=system" />
<property name="password" value="secret" />
<property name="pooled" value="true" />
<property name="urls">
<list>
<value>ldap://192.168.12.250:10389</value>
</list>
</property>
<property name="baseEnvironmentProperties">
<map>
<entry key="java.naming.security.authentication" value="simple" />
</map>
</property>
</bean>
5. 将cas-server-3.5.2.1-release.zip里面的modules/cas-server-support-ldap-3.5.2.1.jar复制到cas/WEB-INF/lib。下载spring-ldap-core和spring-ldap-core-tiger到cas/WEB-INF/lib,注意对当前cas server来说,最好用1.3.2的版本。具体可以参考《Eclipse调试cas server 3.5.2.1》。
6. 重启tomcat,登录cas/login测试。

注意事项:
1. CAS验证有问题时可以通过cas.log查询一下。
2. LDAP不需要uid属性,但一定需要userPassword属性。
参考:
SSO之CAS+LDAP实现单点登录认证
SSO之CAS单点登录实例演示
Eclipse调试cas server 3.5.2.1
SSO之CAS + LDAP的更多相关文章
- SSO之CAS单点登录实例演示
本文目录: 一.概述 二.演示环境 三.JDK安装配置 四.安全证书配置 五.部署CAS-Server相关的Tomcat 六.部署CAS-Client相关的Tomcat 七. 测试验证SSO 一.概述 ...
- SSO之CAS单点登录详细搭建教程
本教程是我个人编写,花费几个小时的时间,给需要学习的人员学习使用,希望能帮助到你们. [环境说明]:本文演示过程在同一个机器上的(也可以在三台实体机器或者三个的虚拟机上),环境如下: windows7 ...
- SSO之CAS总结
1.采用kerberos原理 2.特点,经纪人模式即需要sso的所有用户账号要集中在一起 3.安全性保证方法: 关键就是保证TS和TGC的安全. 3.1)TS生成是采用足够随机算法,一次性使用,设置有 ...
- sso demo ( cas )
1. generate keystore command : keytool -genkey -alias testtomcat -keyalg RSA -keystore "C:\User ...
- 单点登录系统(SSO)之CAS(中央认证服务)
SSO(Single Sign On)单点登录系统,是在多个系统中值要求只要登录一次,就可以用已登录的身份访问多个系统,去掉了每次访问不同的系统都要重新登录的弊端. CAS(中央/集中认证服务):Th ...
- SSO之CAS备忘
http://blog.chinaunix.net/uid-28380443-id-4740103.html 自己负责的公司基于CAS单点登录平台架构已经上线运行,很多细节的东西是时候备忘一下了,开源 ...
- SSO之CAS基础及应用视频教程(2)
CAS介绍 CAS = Central Authentication Service,中央认证服务.CAS 是 Yale 大学发起的一个开源项目,能够为 Web 应用系统或者非Web应用系统提供一种可 ...
- SSO 基于CAS实现单点登录 实例解析(二)
本文目录: 概述 演示环境 部署CAS-Server相关的Tomcat 部署CAS-Client相关的Tomcat 测试验证SSO 第一: 本demo在一个机器上实现(三个虚拟主机),来看SSO单点登 ...
- (一)SSO之CAS框架通俗原理
版权声明:本文为博主原创文章.转载请标明出处. https://blog.csdn.net/lovesummerforever/article/details/36068249 SSO统一验证 ...
随机推荐
- .NET:CLR via C#The Managed Heap and Garbage Collection
Allocating Resources from the Managed Heap The CLR requires that all objects be allocated from the m ...
- Selenium2+python自动化53-unittest批量执行(discover)
前言 我们在写用例的时候,单个脚本的用例好执行,那么多个脚本的时候,如何批量执行呢?这时候就需要用到unittet里面的discover方法来加载用例了. 加载用例后,用unittest里面的Text ...
- 《Windows核心编程》第八章——用户模式下的线程同步
下面起了两个线程,每个对一个全局变量加500次,不假思索进行回答,会认为最后这个全局变量的值会是1000,然而事实并不是这样: #include<iostream> #include &l ...
- russian-doll-envelopes
https://leetcode.com/problems/russian-doll-envelopes/ // Use map (Russian doll number -> vector o ...
- Informatica 常用组件Expression之一 概述
转换类型:被动.已连接 可以在写入目标前,使用表达式转换计算单行中的值.例如,您可能需要调整员工薪酬.连接姓名或将字符串转换为数字.您可以使用表达式转换执行任意非聚合计算.在将结果输出 ...
- C语言数字与字符串转换 atoi()函数、itoa()函数、sprintf()函数
在编程中经常需要用到数字与字符串的转换,下面就总结一下. 1.atoi() C/C++标准库函数,用于字符串到整数的转换. 函数原型:int atoi (const char * str); #inc ...
- jQuery的一个关键函数
jQuery.extend = jQuery.fn.extend = function() { // copy reference to target object var target = argu ...
- Android之WifiManager
移动设备离不开网络,android平台中在包android.net.wifi下提供了一些类专门用于管理设备的Wifi功能.该包下主要存在如下几个类: 1. ScanResult:主要用来描述通过Wi ...
- 应用程序无法正常启动0xc000007b解决
可能原因: 1.电脑没有安装DirectX9或者DirectX 9.0 组件损坏; 2.电脑没有安装Microsoft Visual C++ 3.电脑上没有安装.net 解决方案: 1/2.下载Dir ...
- iOS_2_button控制物体形变
终于效果图: BeyondViewController.h // // BeyondViewController.h // 02_button控制物体形变 // // Created by beyon ...