cas3.5配置LDAP域控

cas3.5配置LDAP域控 一、 安装cas3.51. 点击下载 CAS 3.5.2 CAS2. 解压缩下载的 cas-server-3.5.2-release.zip在 %CAS%\modules文件夹中找到cas-server-webapp-3.5.2.war 将其重命名为 cas.war3. 将 cas.war 拷贝到%TOMCAT_HOME%\webapps文件夹下启动 Tomcat就会看到 Tomcat 自动将cas.war 解压到 cas 文件夹中。4. 测试 CAS在默认配置下CAS3.5 认为只要用户名密码相同即登录成功。输入网址 https://localhost:8443/cas/login ,也可以使用配置 SSL 证书实现 HTTPS 访问文档设置的虚拟域名访问。二、 配置LDAP域控1. 扩展jar包放入到%TOMCAT_HOME%\webapps\cas\WEB-INF\lib 下• cas-server-support-ldap-3.4.11.jarcas-server-3.5.2-release.zip的 modules下• spring-ldap-core-1.3.1.RELEASE.jar点击下载或联系博主Amadeus获取2. 修改web的配置文件 WEB-INF\deployerConfigContext.xml2.1 在beans根节点下增加beanContextSource 的配置!-- LDAP配置 -- bean idcontextSource classorg.springframework.ldap.core.support.LdapContextSource property nameanonymousReadOnly valuefalse / property namepassword value域管理员密码 / property namepooled valuetrue / property nameurls list valueldap://xxx.xxx.xxx.xxx:389//value /list /property !-- 如果是老版本这里应该用的是userName而不是userDn -- property nameuserDn valuecn域管理员名字,CNUsers,DCxx,DCcom / property namebaseEnvironmentProperties map entry !--none 端口 389-- !--ssl 端口 636-- key valuejava.naming.security.protocol/value /key valuenone/value /entry entry key valuejava.naming.security.authentication/value /key valuesimple/value /entry /map /property /bean2.2 在bean id”authenticationManager” /下找到SimpleTestUsernamePasswordAuthenticationHandler的配置替换成如下list !-- bean classorg.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler / -- bean classorg.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler property namefilter valuesAMAccountName%u / property namesearchBase valueouxxx,dcxx,dccom / property namecontextSource refcontextSource / /bean /listTHATS ALL