简体   繁体   中英

Implementing Spring Switch User Filter with cas

I'm new to Spring security and cas. In my project I have a cas(CenteralAuthenticationServer) server and a service server. I want to implement Switch user filter for some users in my application. Where I should put these lines?

<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>

In my cas project or in my web application? Should I tell tomcat to use this filter in web.xml? Is there any implementation example? Should I create java class to implement this fitler?

Add it in your web application (dispatcher-servlet.xml). Check this example if you need. switch user link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM