Home  >  Article  >  Backend Development  >  cas 单点的java,php客户端 跳过SSL认证,用http形式登录

cas 单点的java,php客户端 跳过SSL认证,用http形式登录

WBOY
WBOYOriginal
2016-06-13 13:11:52971browse

cas 单点的java,php客户端 跳过SSL认证,用http模式登录


这里可以简单说一下修改的内容,也是之前从网上查询的!

下面是jar包的修改内容和java,php客户端的相应需要修改的配置说明!

?

1.\WEB-INF\deployerConfigContext.xml

bean?class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"

??????????????????p:httpClient-ref="httpClient"?/>

?????????增加参数p:requireSecure="false",是否需要安全验证,即HTTPSfalse为不采用,加上去之后如下:

???????????????????????????????????????????????p:httpClient-ref="httpClient"??p:requireSecure="false"/>

?

?

2.??????\WEB-INF\ cas-servlet.xml

bean?id="warnCookieGenerator"?class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"

???????p:cookieSecure="false"

???????p:cookieMaxAge="-1"

???????p:cookieName="CASPRIVACY"

???????p:cookiePath="/cas"?/>

参数p:cookieSecure="true",同理为HTTPS验证相关,TRUE为采用HTTPS验证,与deployerConfigContext.xml的参数保持一致。

参数p:cookieMaxAge="-1",简单说是COOKIE的最大生命周期,-1为无生命周期,即只在当前打开的IE窗口有效,IE关闭或重新打开其它窗口,仍会要求验证。

?

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请求才能读到cookie中的值,而http访问时不能从cookie中取的值.

?

?

?

?

java客户端的修改:

下面绿色部分是修改部分,将原来的https地址换成http

??

?????CASFilter

?????edu.yale.its.tp.cas.client.filter.CASFilter?

??????

?????????edu.yale.its.tp.cas.client.filter.loginUrl?

?????????http://localhost:8080/cas/login?

??????

??????

?????????edu.yale.its.tp.cas.client.filter.validateUrl?

?????????http://localhost:8080/cas/proxyValidate?

??????

??????

?????????????edu.yale.its.tp.cas.client.filter.serverName?

?????????????localhost:8088?

??????

?

?????CASFilter?

?????/*?

?

?


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn