public class LogoutFilter extends GenericFilterBean
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, a redirect will be performed to the URL determined by either the configured LogoutSuccessHandler or the logoutSuccessUrl, depending on which constructor was used.
logger
Constructor and Description |
---|
LogoutFilter(LogoutSuccessHandler logoutSuccessHandler,
LogoutHandler... handlers)
Constructor which takes a LogoutSuccessHandler instance to determine the target destination
after logging out.
|
LogoutFilter(String logoutSuccessUrl,
LogoutHandler... handlers) |
Modifier and Type | Method and Description |
---|---|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain) |
protected String |
getFilterProcessesUrl()
Deprecated.
|
protected boolean |
requiresLogout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Allow subclasses to modify when a logout should take place.
|
void |
setFilterProcessesUrl(String filterProcessesUrl)
Deprecated.
|
void |
setLogoutRequestMatcher(RequestMatcher logoutRequestMatcher) |
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
public LogoutFilter(LogoutSuccessHandler logoutSuccessHandler, LogoutHandler... handlers)
public LogoutFilter(String logoutSuccessUrl, LogoutHandler... handlers)
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
protected boolean requiresLogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request
- the requestresponse
- the responsetrue
if logout should occur, false
otherwisepublic void setLogoutRequestMatcher(RequestMatcher logoutRequestMatcher)
@Deprecated public void setFilterProcessesUrl(String filterProcessesUrl)
@Deprecated protected String getFilterProcessesUrl()