本来主要详细是介绍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的更多相关文章

  1. SSO之CAS单点登录实例演示

    本文目录: 一.概述 二.演示环境 三.JDK安装配置 四.安全证书配置 五.部署CAS-Server相关的Tomcat 六.部署CAS-Client相关的Tomcat 七. 测试验证SSO 一.概述 ...

  2. SSO之CAS单点登录详细搭建教程

    本教程是我个人编写,花费几个小时的时间,给需要学习的人员学习使用,希望能帮助到你们. [环境说明]:本文演示过程在同一个机器上的(也可以在三台实体机器或者三个的虚拟机上),环境如下: windows7 ...

  3. SSO之CAS总结

    1.采用kerberos原理 2.特点,经纪人模式即需要sso的所有用户账号要集中在一起 3.安全性保证方法: 关键就是保证TS和TGC的安全. 3.1)TS生成是采用足够随机算法,一次性使用,设置有 ...

  4. sso demo ( cas )

    1. generate keystore command : keytool -genkey -alias testtomcat -keyalg RSA -keystore "C:\User ...

  5. 单点登录系统(SSO)之CAS(中央认证服务)

    SSO(Single Sign On)单点登录系统,是在多个系统中值要求只要登录一次,就可以用已登录的身份访问多个系统,去掉了每次访问不同的系统都要重新登录的弊端. CAS(中央/集中认证服务):Th ...

  6. SSO之CAS备忘

    http://blog.chinaunix.net/uid-28380443-id-4740103.html 自己负责的公司基于CAS单点登录平台架构已经上线运行,很多细节的东西是时候备忘一下了,开源 ...

  7. SSO之CAS基础及应用视频教程(2)

    CAS介绍 CAS = Central Authentication Service,中央认证服务.CAS 是 Yale 大学发起的一个开源项目,能够为 Web 应用系统或者非Web应用系统提供一种可 ...

  8. SSO 基于CAS实现单点登录 实例解析(二)

    本文目录: 概述 演示环境 部署CAS-Server相关的Tomcat 部署CAS-Client相关的Tomcat 测试验证SSO 第一: 本demo在一个机器上实现(三个虚拟主机),来看SSO单点登 ...

  9. (一)SSO之CAS框架通俗原理

    版权声明:本文为博主原创文章.转载请标明出处. https://blog.csdn.net/lovesummerforever/article/details/36068249 SSO统一验证     ...

随机推荐

  1. MVC使用StructureMap实现依赖注入Dependency Injection

    使用StructureMap也可以实现在MVC中的依赖注入,为此,我们不仅要使用StructureMap注册各种接口及其实现,还需要自定义控制器工厂,借助StructureMap来生成controll ...

  2. 怎样用代码方式退出IOS程序

    原文 :iOS Developer Library Technical Q&A QA1561 How do I programmatically quit my iOS application ...

  3. extjs 事件监听 三种方式

    xtype : 'textarea', name : 'dataSetField', labelSeparator:'', fieldLabel:'', hideLabel: true, allowB ...

  4. DocumentManager 在标签位置显示气泡框 z

    关于DevExpress DockManager下的DocumentManager头部标签如何显示气泡框,类似Visual studio那样显示文件的路径,如下图所示,------- 方式很简单,从工 ...

  5. Dom4j学习笔记

    一.Loading XML Data 以下代码从File中或一个URL中读取一个XML文件,并产生一个Document对象.一个Document对象表示了内存中的一棵XML树,可以在这个XML树中进行 ...

  6. Git 学习(三)本地仓库操作——git add & commit

    Git 学习(三)本地仓库操作——git add & commit Git 和其他版本控制系统如SVN的一个不同之处就是有暂存区的概念.这在上文已有提及,本文具体说明什么是工作区及暂存区,以及 ...

  7. Guava Files 源码分析(一)

    Files中的工厂 Files类中对InputStream, OutputStream以及Reader,Writer的操作封装了抽象工厂模式,抽象工厂是InputSupplier与OutputSupp ...

  8. 洛谷P1772 [ZJOI2006]物流运输 题解

    题目描述 物流公司要把一批货物从码头A运到码头B.由于货物量比较大,需要n天才能运完.货物运输过程中一般要转停好几个码头.物流公司通常会设计一条固定的运输路线,以便对整个运输过程实施严格的管理和跟踪. ...

  9. Hadoop目录

    1. 通过java读取HDFS的数据 (转) 2. FLume监控文件夹,将数据发送给Kafka以及HDFS的配置文件详解 3. 开启hadoop和Hbase集群的lzo压缩功能(转) 4. Hado ...

  10. 倒计时实现方案总结 Timer Handler

    利用Timer实现倒计时 @BindView(R.id.send) Button send;//发送验证码 private int time = 60;//倒计时 private Timer time ...