CAS单点登录https协议修改成http协议
来源:互联网 发布:战地3正在同步云数据 编辑:程序博客网 时间:2024/05/18 02:24
最近在研究CAS单点登录,因为https被浏览器的不信任问题,影响登录。故将https协议修改成http协议。现将修改步骤记录如下:
CAS服务端修改:
1、修改 cas\WEB-INF\spring-configuration目录下的ticketGrantingTicketCookieGenerator.xml
<bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"p:cookieSecure="true"p:cookieMaxAge="-1"p:cookieName="CASTGC"p:cookiePath="/cas" />
把cookieSecure属性修改为false。(默认true是用的http是协议)。
2、修改deployerConfigContext.xml
<bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"p:httpClient-ref="httpClient" />
添加p:requireSecure="false" 属性。
3、修改部署CAS服务端的tomcat容器的server.xml
注释掉配置https协议添加的如下代码:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="D:/keys/smallkey" keystorePass="111111"/>
CAS客服端修改
下载casclient的源码cas-client-3.1.6-SRC.zip,解压。
1、修改edu.yale.its.tp.cas.client.filter.edu.yale.its.tp.cas.client.filter 包下的CASFilter.java
if (casServiceUrl != null){ if (! (casServiceUrl.startsWith("https://")|| (casServiceUrl.startsWith("http://") ))){ throw new ServletException("service URL must start with http:// or https://; its current value is [" + casServiceUrl + "]"); }
if (! casValidate.startsWith("https://")){ throw new ServletException("validateUrl must start with https://, its current value is [" + casValidate + "]");
注释掉以上两段代码。
2、修改edu.yale.its.tp.cas.util包下的SecureURL.java
if (!u.getProtocol().equals("https")){ // IOException may not be the best exception we could throw here // since the problem is with the URL argument we were passed, not // IO. -awp9 log.error("retrieve(" + url + ") on an illegal URL since protocol was not https.");throw new IOException("only 'https' URLs are valid for this method"); }
注释以上一段代码。
重新编译以上两个类为.class文件,打包 casclient的源码为.jar。替换掉客服端的casclient.jar
3、修改客服端项目的web.xml中的casServerLoginUrl属性为http://xxx:xx/cas/login
重启服务,大功告成!
- CAS单点登录https协议修改成http协议
- cas 单点登录 服务端搭建http协议与https协议
- 将CAS 单点登录协议由https改为http
- cas 单点登录 及将https 转为http协议
- Cas单点登录(2)HTTPS协议
- CAS SSO研究一:抛弃Https让Cas以Http协议提供单点登录服务
- CAS SSO研究一:抛弃Https让Cas以Http协议提供单点登录服务
- CAS单点登录五-使用http而不是https
- cas取消HTTPS协议
- cas 使用 http协议
- CAS协议介绍和在apache使用cas实现单点登录sso
- CAS单点登录(二)---非SSL协议 CAS服务端部署及客户端配置
- CAS单点登录(一):前期准备以及为CAS-Server配置SSL协议
- CAS取消https安全协议
- CAS单点登录-https配置(四)
- HTTP协议 VS HTTPS协议
- http协议与https协议
- HTTP协议和HTTPS协议
- Android中AsyncTask的使用详解
- JAVA学习笔记-------无边框窗口
- 见证海马S7手动型的高配置
- CSS 布局:40个教程、技巧、例子和最佳实践
- repo 的一些用法和理解
- CAS单点登录https协议修改成http协议
- 手机电容触摸屏技术简介
- hadoop命令distcp注意事项
- 怎么提高网站用户体验 降低跳出率
- Hashtable的使用
- Socket简介
- Android基础概念Context的详解
- 关于SQL视图的创建和使用方法
- Spring Scope