我有多个站点.. 示例:
http://example1.com
http://example2.com
我有 cas 服务器https://example.com
,如果我已经登录 cas 服务器,为什么在我的其他站点没有自动登录,必须有一些动作,比如转到 url http://example2.com/login
,我不希望用户做一些动作,如果我已经登录我的 cas 服务器之后我去其他网站,该网站可以自动登录。
这是我的春季安全配置..
<authentication-manager alias="authenticationManager">
<authentication-provider ref="casAuthenticationProvider" />
</authentication-manager>
<beans:bean id="casSingleSignOutFilter" class="org.jasig.cas.client.session.SingleSignOutFilter"/>
<beans:bean id="casAuthEntryPoint"
class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
<beans:property name="loginUrl" value="https://example.com/cas/" />
<beans:property name="serviceProperties" ref="casService" />
</beans:bean>
<beans:bean id="casService"
class="org.springframework.security.cas.ServiceProperties">
<beans:property name="service"
value="http://example2.com/auth_check"></beans:property>
</beans:bean>
<beans:bean id="casAuthenticationFilter"
class="org.springframework.security.cas.web.CasAuthenticationFilter">
<beans:property name="authenticationManager" ref="authenticationManager" /> <!-- Required -->
<beans:property name="filterProcessesUrl" value="/auth_check" />
</beans:bean>
<!-- Auth Provider -->
<beans:bean id="casAuthenticationProvider"
class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<beans:property name="ticketValidator" ref="casTicketValidator" /><!-- Required -->
<!-- <beans:property name="ticketValidator" ref="samlTicketValidator"/> -->
<beans:property name="serviceProperties" ref="casService" /> <!-- Required -->
<beans:property name="key" value="example2-cas" /> <!-- Required -->
<beans:property name="authenticationUserDetailsService"
ref="authenticationUserDetailsService" />
</beans:bean>
任何建议都会对我有所帮助。