org.springframework.security.ui.logout
Class LogoutFilter
java.lang.Object
org.springframework.security.ui.SpringSecurityFilter
org.springframework.security.ui.logout.LogoutFilter
- All Implemented Interfaces:
- Filter, Ordered
public class LogoutFilter
- extends SpringSecurityFilter
Logs a principal out.
Polls a series of LogoutHandler
s. The handlers should be specified in the order they are required.
Generally you will want to call logout handlers TokenBasedRememberMeServices
and
SecurityContextLogoutHandler
(in that order).
After logout, the URL specified by logoutSuccessUrl
will be shown.
- Version:
- $Id$
- Author:
- Ben Alex
LogoutFilter
public LogoutFilter(String logoutSuccessUrl,
LogoutHandler[] handlers)
doFilterHttp
public void doFilterHttp(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain)
throws IOException,
ServletException
- Specified by:
doFilterHttp
in class SpringSecurityFilter
- Throws:
IOException
ServletException
requiresLogout
protected boolean requiresLogout(HttpServletRequest request,
HttpServletResponse response)
- Allow subclasses to modify when a logout should take place.
- Parameters:
request
- the requestresponse
- the response
- Returns:
true
if logout should occur, false
otherwise
determineTargetUrl
protected String determineTargetUrl(HttpServletRequest request,
HttpServletResponse response)
- Returns the target URL to redirect to after logout.
By default it will check for a logoutSuccessUrl parameter in
the request and use this. If that isn't present it will use the configured logoutSuccessUrl. If this
hasn't been set it will check the Referer header and use the URL from there.
sendRedirect
protected void sendRedirect(HttpServletRequest request,
HttpServletResponse response,
String url)
throws IOException
- Allow subclasses to modify the redirection message.
- Parameters:
request
- the requestresponse
- the responseurl
- the URL to redirect to
- Throws:
IOException
- in the event of any failure
setFilterProcessesUrl
public void setFilterProcessesUrl(String filterProcessesUrl)
getLogoutSuccessUrl
protected String getLogoutSuccessUrl()
getFilterProcessesUrl
protected String getFilterProcessesUrl()
setUseRelativeContext
public void setUseRelativeContext(boolean useRelativeContext)
getOrder
public int getOrder()
Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.