CAS 4.1.10关闭HTTPS




1.修改WEB-INF/deployerConfigContext.xml

1
2
3
4
     < bean  id = "proxyAuthenticationHandler"
           class = "org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
           p:httpClient-ref = "supportsTrustStoreSslSocketFactoryHttpClient"
           p:requireSecure = "false"  />

在p:httpClient-ref="supportsTrustStoreSslSocketFactoryHttpClient"后

增加p:requireSecure="false"


2.修改WEB-INF/spring-configuration/ticketGrantingTicketCookieGenerator.xml

1
2
3
4
5
6
     < bean  id = "ticketGrantingTicketCookieGenerator"  class = "org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
           c:casCookieValueManager-ref = "cookieValueManager"
           p:cookieSecure = "false"
           p:cookieMaxAge = "-1"
           p:cookieName = "TGC"
           p:cookiePath = "" />

将p:cookieSecure="true"修改为p:cookieSecure="false"


3.修改WEB-INF/spring-configuration/warnCookieGenerator.xml

1
2
3
4
5
6
     < bean  id = "warnCookieGenerator"  class = "org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
           p:cookieHttpOnly = "false"
           p:cookieSecure = "false"
           p:cookieMaxAge = "-1"
           p:cookieName = "CASPRIVACY"
           p:cookiePath = "" />

将p:cookieSecure="true"修改为p:cookieSecure="false"


4.修改注册服务WEB-INF/classes/services/HTTPSandIMAPS-10000001.json

将"serviceId" : "^(https|imaps)://.*"修改为"serviceId" : "^(https|http|imaps)://.*"


5.测试HTTP/HTTPS

http://192.168.10.102:8080/cas/login?service=http://www.a.com

wKioL1g35rPwNMwCAAFKgMZKaFc573.png



网上很多资料只提示修改前面3个配置,却没有更改注册服务配置,所以就会出现

Application Not Authorized to Use CAS

The application you attempted to authenticate to is not authorized to use CAS.

wKioL1g355fzxJuZAAC_YtKcIGA432.png


本文转自 rong341233 51CTO博客,原文链接:http://blog.51cto.com/fengwan/1876603



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值