public class LogoutProcessor extends Object implements RequestSecurityProcessor
Modifier and Type | Field and Description |
---|---|
protected AuthenticationManager |
authenticationManager |
static String |
DEFAULT_LOGOUT_METHOD |
static String |
DEFAULT_LOGOUT_URL |
static org.slf4j.Logger |
logger |
protected String |
logoutMethod |
protected LogoutSuccessHandler |
logoutSuccessHandler |
protected String |
logoutUrl |
protected RememberMeManager |
rememberMeManager |
Constructor and Description |
---|
LogoutProcessor()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected 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 the
logoutUrl and the HTTP method matches the logoutMethod . |
void |
setAuthenticationManager(AuthenticationManager authenticationManager) |
void |
setLogoutMethod(String logoutMethod) |
void |
setLogoutSuccessHandler(LogoutSuccessHandler logoutSuccessHandler) |
void |
setLogoutUrl(String logoutUrl) |
void |
setRememberMeManager(RememberMeManager rememberMeManager) |
public static final org.slf4j.Logger logger
public static final String DEFAULT_LOGOUT_URL
public static final String DEFAULT_LOGOUT_METHOD
protected String logoutUrl
protected String logoutMethod
protected AuthenticationManager authenticationManager
protected LogoutSuccessHandler logoutSuccessHandler
protected RememberMeManager rememberMeManager
public void setLogoutUrl(String logoutUrl)
public void setLogoutMethod(String logoutMethod)
public void setAuthenticationManager(AuthenticationManager authenticationManager)
public void setLogoutSuccessHandler(LogoutSuccessHandler logoutSuccessHandler)
public void setRememberMeManager(RememberMeManager rememberMeManager)
public void processRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception
logoutUrl
and the HTTP method matches the logoutMethod
.
If it does, it proceeds to logout the user, by invalidating the authentication through
AuthenticationManager.invalidateAuthentication(Authentication)
processRequest
in interface RequestSecurityProcessor
context
- the context which holds the current request and responseprocessorChain
- the processor chain, used to call the next processorException
protected boolean isLogoutRequest(javax.servlet.http.HttpServletRequest request)
protected void onLogoutSuccess(org.craftercms.commons.http.RequestContext context, Authentication authentication) throws IOException
IOException
Copyright © 2023 CrafterCMS. All rights reserved.