2014-01-08 26 views
1

我是新來的春天安全和CAS。 在我的項目中,我有一個cas(CenteralAuthenticationServer)服務器和一個服務服務器。 我想爲我的應用程序中的某些用戶實現切換用戶過濾器。 我應該在哪裏放這些線?實現彈簧開關用戶過濾器與cas

<bean id="switchUserProcessingFilter" class="org.springframework.security.web.authentication.switchuser.SwitchUserFilter"> 
<property name="userDetailsService" ref="userDetailsService" /> 
<property name="switchUserUrl" value="/j_spring_security_switch_user" /> 
<property name="exitUserUrl" value="/j_spring_security_exit_user" /> 
<property name="targetUrl" value="/index.jsp" /> 
</bean> 

在我的cas項目或我的web應用程序? 我應該告訴tomcat在web.xml中使用這個過濾器嗎? 有沒有實現的例子? 我應該創建java類來實現這個fitler嗎?

回答

0

將其添加到您的Web應用程序(dispatcher-servlet.xml)中。如果需要,請檢查此示例。 switch user link

+1

你的答案中的一些示例代碼會很好。鏈接可能過時 –