標籤:cas https
1.修改WEB-INF/deployerConfigContext.xml
<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
<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
<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
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M00/8A/AF/wKioL1g35rPwNMwCAAFKgMZKaFc573.png" title="11.png" alt="wKioL1g35rPwNMwCAAFKgMZKaFc573.png" />
網上很多資料只提示修改前面3個配置,卻沒有更改註冊服務配置,所以就會出現
Application Not Authorized to Use CAS
The application you attempted to authenticate to is not authorized to use CAS.
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/8A/B0/wKioL1g355fzxJuZAAC_YtKcIGA432.png" title="123.png" alt="wKioL1g355fzxJuZAAC_YtKcIGA432.png" />
本文出自 “楓林晚” 部落格,請務必保留此出處http://fengwan.blog.51cto.com/508652/1876603
CAS 4.1.10關閉HTTPS