CAS 登录一个app1 了,点击App 2还是要登录,没法无缝登录

来源:互联网 发布:c语言指针教学视频 编辑:程序博客网 时间:2024/06/04 18:02

因为我没有使用https协议,使用的是http协议,而CAS里面的https协议没有进行修改导致的
1修改cas server \ WEB-INF\deployerConfigContext.xml配置文件

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

修改为

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

2修改cas server \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:rememberMeMaxAge="${rememberMeDuration:1209600}"/>

修改为

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

3.修改 cas server \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" />

修改后

<bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"        p:cookieSecure="false"        p:cookieMaxAge="-1"        p:cookieName="CASPRIVACY"        p:cookiePath="/cas" />
原创粉丝点击