Class LogoutProcessor
java.lang.Object
org.craftercms.security.processors.impl.LogoutProcessor
- All Implemented Interfaces:
RequestSecurityProcessor
Processes logout requests.
- Author:
- Alfonso Vásquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthenticationManagerstatic final Stringstatic final Stringstatic final org.slf4j.Loggerprotected Stringprotected LogoutSuccessHandlerprotected Stringprotected RememberMeManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 Details
-
logger
public static final org.slf4j.Logger logger -
DEFAULT_LOGOUT_URL
- See Also:
-
DEFAULT_LOGOUT_METHOD
- See Also:
-
logoutUrl
-
logoutMethod
-
authenticationManager
-
logoutSuccessHandler
-
rememberMeManager
-
-
Constructor Details
-
LogoutProcessor
public LogoutProcessor()Default constructor.
-
-
Method Details
-
setLogoutUrl
-
setLogoutMethod
-
setAuthenticationManager
-
setLogoutSuccessHandler
-
setRememberMeManager
-
processRequest
public void processRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception Checks 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
-