去除CAS4.0的 SSL驗證,和3.5.2是一樣的

來源:互聯網
上載者:User

標籤:style   http   color   io   ar   line   res   ui   

下載了CAS4.0,改變比較大,計劃慢慢研究,慢慢更新。

按以下方法去除CAS4.0的SSL強制要求,這和3.5.2是一樣的,FT,明明去除了,但提示還在,一直以為沒修改成功。

修改第一處:

 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"/>

   修改第二處:

  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",同理為HTTPS驗證相關,TRUE為採用HTTPS驗證,FALSE為不採用https驗證。

參數p:cookieMaxAge="-1",簡單說是COOKIE的最大生命週期,-1為無生命週期,即只在當前開啟的IE視窗有效,IE關閉或重新開啟其它視窗,仍會要求驗證。可以根據需要修改為大於0的數字,比如3600等,意思是在3600秒內,開啟任意IE視窗,都不需要驗證。

 這裡把 cookieSecure修改為false就行了

同第二步修改cas/WEB-INF/spring-configuration/warnCookieGenerator.xml

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.