Class LogoutProcessor
- java.lang.Object
-
- org.craftercms.security.processors.impl.LogoutProcessor
-
- All Implemented Interfaces:
RequestSecurityProcessor
public class LogoutProcessor extends Object implements RequestSecurityProcessor
Processes logout requests.- Author:
- Alfonso Vásquez
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthenticationManagerauthenticationManagerstatic StringDEFAULT_LOGOUT_METHODstatic StringDEFAULT_LOGOUT_URLstatic org.slf4j.Loggerloggerprotected StringlogoutMethodprotected LogoutSuccessHandlerlogoutSuccessHandlerprotected StringlogoutUrlprotected RememberMeManagerrememberMeManager
-
Constructor Summary
Constructors Constructor Description LogoutProcessor()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisLogoutRequest(javax.servlet.http.HttpServletRequest request)protected voidonLogoutSuccess(org.craftercms.commons.http.RequestContext context, Authentication authentication)voidprocessRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain)Checks if the request URL matches thelogoutUrland the HTTP method matches thelogoutMethod.voidsetAuthenticationManager(AuthenticationManager authenticationManager)voidsetLogoutMethod(String logoutMethod)voidsetLogoutSuccessHandler(LogoutSuccessHandler logoutSuccessHandler)voidsetLogoutUrl(String logoutUrl)voidsetRememberMeManager(RememberMeManager rememberMeManager)
-
-
-
Field Detail
-
logger
public static final org.slf4j.Logger logger
-
DEFAULT_LOGOUT_URL
public static final String DEFAULT_LOGOUT_URL
- See Also:
- Constant Field Values
-
DEFAULT_LOGOUT_METHOD
public static final String DEFAULT_LOGOUT_METHOD
- See Also:
- Constant Field Values
-
logoutUrl
protected String logoutUrl
-
logoutMethod
protected String logoutMethod
-
authenticationManager
protected AuthenticationManager authenticationManager
-
logoutSuccessHandler
protected LogoutSuccessHandler logoutSuccessHandler
-
rememberMeManager
protected RememberMeManager rememberMeManager
-
-
Method Detail
-
setLogoutUrl
public void setLogoutUrl(String logoutUrl)
-
setLogoutMethod
public void setLogoutMethod(String logoutMethod)
-
setAuthenticationManager
public void setAuthenticationManager(AuthenticationManager authenticationManager)
-
setLogoutSuccessHandler
public void setLogoutSuccessHandler(LogoutSuccessHandler logoutSuccessHandler)
-
setRememberMeManager
public void setRememberMeManager(RememberMeManager rememberMeManager)
-
processRequest
public void processRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) throws ExceptionChecks if the request URL matches thelogoutUrland the HTTP method matches thelogoutMethod. If it does, it proceeds to logout the user, by invalidating the authentication throughAuthenticationManager.invalidateAuthentication(Authentication)- Specified by:
processRequestin interfaceRequestSecurityProcessor- Parameters:
context- the context which holds the current request and responseprocessorChain- the processor chain, used to call the next processor- Throws:
Exception
-
isLogoutRequest
protected boolean isLogoutRequest(javax.servlet.http.HttpServletRequest request)
-
onLogoutSuccess
protected void onLogoutSuccess(org.craftercms.commons.http.RequestContext context, Authentication authentication) throws IOException- Throws:
IOException
-
-