cas取消HTTPS協議

cas server 

官網下載地址:https://github.com/Jasig/cas/releases

 解壓下載的 cas-server-4.0.0-release.zip 壓縮包,把cas-server-4.0.0\modules\cas-server-webapp-4.0.0.war

  重命名爲cas.war

2、cas.war 放到tomcat的webapps目錄下

3、CAS 默認認證方式使用的是HTTPS協議,一般對安全性不高的話建議取消改成HTTP方式。開啓的話會經常提示證書過期、需         要用戶確認等,對客戶的感知不好,當前有需要的可以開啓。

取消HTTPS協議

webapps\cas\WEB-INF\spring-configuration\warnCookieGenerator.xml ,找到如下配置

<bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
        p:cookieSecure="true"
        p:cookieMaxAge="-1"
        p:cookieName="CASPRIVACY"
        p:cookiePath="/cas"/>
修改  p:cookieSecure="true" 爲 p:cookieSecure="false"
webapps\cas\WEB-INF\spring-configuration\ticketGrantingTicketCookieGenerator.xml ,找到如下配置

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

修改  p:cookieSecure="true" 爲 p:cookieSecure="false"

webapps\cas\WEB-INF\deployerConfigContext.xml 文件 ,找到如下配置:

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

增加p:requireSecure="false"即HTTPS爲不採用。
修改後爲:

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

4、啓動tomcat ,訪問  http://localhost:8085/cas  則可以看到登陸界面,4.0 之後默認是配置在 deployerConfigContext.xml 配置文件中,可以看到用戶名密碼爲 casuser/Mellon

5、deployerConfigContext.xml  

連接mysql的配置詳情見:http://www.cnblogs.com/wuweidu/p/4567824.html

本文出自:http://www.lxway.com/44505584.htm

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章