CAS单点登录入门
一、单点登录简介
SOO是现在企业比较流行的业务整合解决方案之一,定义解决登录,可以应用在不同系统中,用户只需要登录一次,就可以访问所有相互信任的应用系统(模块开发、同家公司不同产品等等),例如百度,旗下的子系统。
架构图如下

二、环境搭建(准备需要用的cas-server包并配置)
1.从CAS官网下载:上cas的官网下载cas server 官网地址:https://github.com/Jasig/cas/releases
2.准备一份新的tomcat
3.解压出cas-server包在”cas-server-4.0.0\modules下的”cas-server-webapp-4.0.0.war复制一份到新的tomcat中运行。

tomcat启动,运行效果如下。

浏览器浏览效果如下:默认的账号:casuser 密码:Mellon 此默认配置可以在“apache-tomcat-7.0.93\webapps\cas\WEB-INF\deployerConfigContext.xml” 中修改

4.配置cas 去除Https认证
1.在apache-tomcat-7.0.93\webapps\cas\WEB-INF\deployerConfigContext.xml p:requireSecure="false"配置这个属性
<!-- Required for proxy ticket mechanism. -->
<bean id="proxyAuthenticationHandler"
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
p:httpClient-ref="httpClient" p:requireSecure="false" />
2.在apache-tomcat-7.0.93\webapps\cas\WEB-INF\spring-configuration\ticketGrantingTicketCookieGenerator.xml中配置如下属性
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<description>
Defines the cookie that stores the TicketGrantingTicket. You most likely should never modify these (especially the "secure" property).
You can change the name if you want to make it harder for people to guess.
</description>
<bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="false" ---->改成false
p:cookieMaxAge="3600" ---->设置ticket的cookie,以秒为单位
p:cookieName="CASTGC"
p:cookiePath="/cas" />
</beans>
3.apache-tomcat-7.0.93\webapps\cas\WEB-INF\spring-configuration\warnCookieGenerator.xml 配置如下属性
<bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="false" --->改成false
p:cookieMaxAge="3600" --->设置ticket的cookie,以秒为单位
p:cookieName="CASPRIVACY" p:cookiePath="/cas" />
4.重启tomcat即可。

三、Cas demo入门程序
CAS单点登录入门的更多相关文章
- CAS单点登录系列之极速入门于实战教程(4.2.7)
@ 目录 一. SSO简介 1.1 单点登录定义 1.2 单点登录角色 1.3 单点登录分类 二. CAS简介 2.1 CAS简单定义 2.2 CAS体系结构 2.3 CAS原理 三.CAS服务端搭建 ...
- SSO之CAS单点登录实例演示
本文目录: 一.概述 二.演示环境 三.JDK安装配置 四.安全证书配置 五.部署CAS-Server相关的Tomcat 六.部署CAS-Client相关的Tomcat 七. 测试验证SSO 一.概述 ...
- CAS 单点登录【2】自定义用户验证
基础不太熟的同学可以先去看:CAS 单点登录[1]入门 方案1:CAS默认的JDBC扩展方案: CAS自带了两种简单的通过JDBC方式验证用户的处理器. 1.QueryDatabaseAuthe ...
- cas 单点登录出现org.jasig.cas.client.util.CommonUtils.getResponseFromServer - 拒绝连接 Connection refused
cas 单点登录出现org.jasig.cas.client.util.CommonUtils.getResponseFromServer - 拒绝连接 Connection refused 环境: ...
- CAS单点登录中文用户名乱码问题
CAS单点登录中文用户名乱码问题,有两种情况 1. CAS server乱码 即在向server端提交用户名和密码时,发生了乱码,解决方法是: 打开WEB-INF/web.xml,在其它的Filter ...
- CAS单点登录系统整合——注册的问题
最近一段时间在搞CAS单点登录系统,涉及到几个子系统的整合问题.对于注册,这里遇到了一个选择: 在子系统内完成注册,然后把信息同步到CAS系统: 在CAS系统中完成基本信息的注册,比如:用户名.邮箱. ...
- Asp.net Mvc4 使用Cas单点登录
因项目需要,使用了耶鲁大学的Cas单点登录方案,在java中使用一直正常,但是在.Net中碰到了循环重定向的问题,反复测试后,总算解决了,最终的配置如下: <?xml version=" ...
- CAS单点登录之mysql数据库用户验证及常见问题
前面已经介绍了CAS服务器的搭建,详情见:搭建CAS单点登录服务器.然而前面只是简单地介绍了服务器的搭建,其验证方式是原始的配置文件的方式,这显然不能满足日常的需求.下面介绍下通过mysql数据库认证 ...
- SSO之CAS单点登录详细搭建教程
本教程是我个人编写,花费几个小时的时间,给需要学习的人员学习使用,希望能帮助到你们. [环境说明]:本文演示过程在同一个机器上的(也可以在三台实体机器或者三个的虚拟机上),环境如下: windows7 ...
随机推荐
- 【原创】运维基础之Docker(4)实用工具ctop
ctop类似于top,top监控的是进程,ctop监控的是容器(container top) 安装 # wget https://github.com/bcicen/ctop/releases/dow ...
- ionic3 验证比特币,以太坊,莱特币和其他流行的加密货币地址
Install ❯❯❯ npm install cryptaddress-validatorionic3 中的引入 import * as cryptaddress from 'cryptaddres ...
- Team Queue (HDU:1387)
Queues and Priority Queues are data structures which are known to most computer scientists. The Team ...
- 忘记加入spring-aop-4.3.16.RELEASE.jar出错
出错代码: java.lang.NoClassDefFoundError: org/springframework/aop/framework/AopProxyUtils at org.springf ...
- SQL窗口函数RANK(),Dense_Rank(),row_number(),NTILE()
数据源 CREATE TABLE student( no int, ca ), name ), subject ), scorce int ); /* 数据 */ , ); , ); , ); , ) ...
- js判断是否在微信中打开
var ua = navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i)=="micromessenger&quo ...
- Node.js API 学习笔记
常用 API 学习笔记 url 函数 url.parse: 解析 url 地址 url.resolve: 向 url 地址添加或替换字段 url.format: 生成 url 地址 querystri ...
- phonegap走起
最近phonegap已发布4.0的了..速度提升了不少,很给力.小白们可以看下如何构建phonegap开发平台. 此文将说明如何建立一个可以被vs2015打开的phonegap的项目.我还会加上ion ...
- vue-video-player集成videojs-contrib-hls实现.m3u8文件播放
// 安装依赖 npm install vue-video-player --save npm install videojs-contrib-hls --save // 在main.js中全局引入 ...
- Codeforces 852I Dating 树上莫队
Dating 随便树上莫队搞一搞就好啦. #include<bits/stdc++.h> #define LL long long #define LD long double #defi ...