十、使CAS支持HTTP协议
我们知道CAS SSO 是基于HTTPS协议的单点登陆,如果要用HTTP协议进行传输,那么就需要修改CAS的相关的配置文件,图了方便,但是安全性大打折扣。
10.1 修改 deployerConfigContext.xml 配置文件
添加 p:requireSecure=”false” 属性。
<bean
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
p:httpClient-ref="httpClient" p:requireSecure="false"/>
10.2 修改ticketGrantingTicketCookieGenerator.xml配置文件
p:cookieSecure=”true” 改为 p:cookieSecure=”false”
<bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="true"
p:cookieMaxAge="-1"
p:cookieName="CASTGC"
p:cookiePath="/cas" />
10.3 修改 warnCookieGenerator.xml 配置文件
p:cookieSecure=”true” 改为 p:cookieSecure=”false”
<bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="true"
p:cookieMaxAge="-1"
p:cookieName="CASPRIVACY"
p:cookiePath="/cas" />
10.4 修改客户端web.xml文件
客户端web.xml文件中,cas过滤器链接修改为http协议
十一、CAS技术原理及分析
11.1 参考网站