2013-10-22 73 views
1

我多發部位.. 例如:Spring MVC的安全自動登錄使用CAS服務器JASIG

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> 

任何建議將幫助我。

回答

0

Spring Security只會在資源受到保護時強制認證。如果您希望CAS立即對您的用戶進行身份驗證,則需要更改您的彈簧安全角色映射,以使ANONYMOUS用戶無法訪問您的索引頁等。

相關問題