将CAS https认证的方式改为http
来源:互联网 发布:淘宝报名派发报名任务 编辑:程序博客网 时间:2024/05/01 10:42
最近,在做CAS单点登陆的一个模块,由于公司的产品太多,各个系统都要部署,在开发中Https的证书的部署比较麻烦,所以,打算把CAS的Https去掉。具体的修改如下
1.修改cas-servlet.xml
把上面连个bean中的p:cookieSecure="true "修改为p:cookieSecure="false"
2.修改deployerConfigContext.xml
添加p:requireSecure="false"
3.修改casclient的客户端
修改客户端的https验证
(1).edu.yale.its.tp.cas.client.filter.edu.yale.its.tp.cas.client.filter
把这两段内容注释掉
(2).修改edu.yale.its.tp.cas.util.SecureURL
把这段内容注释掉
1.修改cas-servlet.xml
- <bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
- p:cookieSecure="true"
- p:cookieMaxAge="-1"
- p:cookieName="CASPRIVACY"
- p:cookiePath="/cas" />
- <bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
- p:cookieSecure="true "
- p:cookieMaxAge="-1"
- p:cookieName="CASTGC"
- p:cookiePath="/cas" />
<bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"p:cookieSecure="true"p:cookieMaxAge="-1"p:cookieName="CASPRIVACY"p:cookiePath="/cas" /><bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"p:cookieSecure="true "p:cookieMaxAge="-1"p:cookieName="CASTGC"p:cookiePath="/cas" />
把上面连个bean中的p:cookieSecure="true "修改为p:cookieSecure="false"
2.修改deployerConfigContext.xml
- <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
- p:httpClient-ref="httpClient" />
<bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"p:httpClient-ref="httpClient" />
添加p:requireSecure="false"
3.修改casclient的客户端
修改客户端的https验证
(1).edu.yale.its.tp.cas.client.filter.edu.yale.its.tp.cas.client.filter
- if (! casValidate.startsWith("https://")){
- throw new ServletException("validateUrl must start with https://, its current value is [" + casValidate + "]");
- }
- 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 + "]"); }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 + "]"); } }
把这两段内容注释掉
(2).修改edu.yale.its.tp.cas.util.SecureURL
- 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");
- }
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"); }
把这段内容注释掉
- 【SSO-CAS】将CAS https认证的方式改为http
- 将CAS https认证的方式改为http
- 将CAS的HTTPS认证方式改为HTTP
- 将CAS 单点登录协议由https改为http
- 单点登录cas常见问题(十) - 怎么将认证方式改为JDBC方式?
- YALE CAS HTTPS认证方式问题备忘
- CAS 使用 HTTPS 单向认证方式 服务端和客户端配置
- cas 单点登录 及将https 转为http协议
- 将NS2改为plugin方式的尝试
- nginx配置将http请求转发支持ssl双向认证https请求的正向代理
- nginx配置将http请求转发支持ssl双向认证https请求的正向代理
- 新域名访问方式从http改为https(为了支持微信小程序https用)
- 把Tomcat的http改为https的步骤、方法
- Cas(4)-更改认证方式
- Cas(4)-更改认证方式
- SVN如何将版本库url访问地址中的https改为http
- CAS提供的三种JDBC认证方式配置文件写法
- 【Http认证】Http的四种认证方式
- SOA学习前言
- VMWare命令行控制虚拟机
- flex:处理事件
- Linux必学的60个命令
- flex:Flex 组件的定位和布局
- 将CAS https认证的方式改为http
- IE编程3(.net)——应用程序操作IE6
- flex:嵌入应用程序资源
- 【嵌入式Linux学习七步曲之第五篇 Linux内核及驱动编程】揭开Linux Proc文件系统的神秘面纱
- 益智题的递归:)
- mysql存储过程学习及java调用存储过程(转载)
- 刨根问底文件结尾
- JavsScript让irame框架自适应
- 学习一定得从基础开始