View RSS Feed

Spring Framework

Logging Out with Spring Security

Rating: 1 votes, 1.00 average.
by , 11-27-2011 at 10:52 PM (2611 Views)
In my previous tips, I showed you how to configure and setup Spring Security as well as the login form autogenerated when auto-config is set to true. In this tip, I will show you how to setup the logout for your application. Basically the <logout> element will setup a Spring Security filter that will invalidate a user session. If it is used as is, the filter set up by <logout> is mapped to /j_spring_security_ logout. In order to ensure that there is no collision with the DispatcherServlet, you must to override the filterís URL much as we did for the login form. In order to that, you need to set the logout-url attribute:

Java Code:
<logout logout-url="/static/j_spring_security_logout"/>
Thatís how you setup logging out. in my last tip, I will look at intercepting requests.

Submit "Logging Out with Spring Security" to Facebook Submit "Logging Out with Spring Security" to Digg Submit "Logging Out with Spring Security" to del.icio.us Submit "Logging Out with Spring Security" to StumbleUpon Submit "Logging Out with Spring Security" to Google

Categories
Security , Web , Spring 3

Comments