CAS不启用HTTPS

来源:互联网 发布:windows me安装教程 编辑:程序博客网 时间:2024/06/05 06:19

 

转自:http://blog.csdn.net/yys79/article/details/6456915

 

摘录主要内容如下:

 

  1. 修改第一处:

    cas/WEB-INF/deployerConfigContext.xml 

    <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" p:httpClient-ref="httpClient"/>

    增加参数p:requireSecure="false",是否需要安全验证,即HTTPS,false为不采用。修改后为:

    <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" p:httpClient-ref="httpClient"  p:requireSecure="false"/> 


  2. 修改第二处

     cas/WEB-INF/spring-configuration/ticketGrantingTicketCookieGenerator.xml

    <bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"  p:cookieSecure="false"       p:cookieMaxAge="-1" p:cookieName="CASTGC" p:cookiePath="/cas" />   

    参数p:cookieSecure="true",同理为HTTPS验证相关,TRUE为采用HTTPS验证,FALSE为不采用https验证。
    参数p:cookieMaxAge="-1",简单说是COOKIE的最大生命周期,-1为无生命周期,即只在当前打开的IE窗口有效,IE关闭或重新打开其它窗口,仍会要求验证。可以根据需要修改为大于0的数字,比如3600等,意思是在3600秒内,打开任意IE窗口,都不需要验证。
    这里把 cookieSecure修改为false就行了

  3. 修改客户端应用的web.xml,修改CAS相关的filtermapping

     这里假设我们先前添加了CAS相关的filtermapping,那么把CAS相关的HTTPS修改为HTTP即可。

     

原创粉丝点击