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 AuthenticationManager
static final String
static final String
static final org.slf4j.Logger
protected String
protected LogoutSuccessHandler
protected String
protected RememberMeManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isLogoutRequest
(javax.servlet.http.HttpServletRequest request) protected void
onLogoutSuccess
(org.craftercms.commons.http.RequestContext context, Authentication authentication) void
processRequest
(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) Checks if the request URL matches thelogoutUrl
and the HTTP method matches thelogoutMethod
.void
setAuthenticationManager
(AuthenticationManager authenticationManager) void
setLogoutMethod
(String logoutMethod) void
setLogoutSuccessHandler
(LogoutSuccessHandler logoutSuccessHandler) void
setLogoutUrl
(String logoutUrl) void
setRememberMeManager
(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 thelogoutUrl
and the HTTP method matches thelogoutMethod
. If it does, it proceeds to logout the user, by invalidating the authentication throughAuthenticationManager.invalidateAuthentication(Authentication)
- Specified by:
processRequest
in 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
-