public class LoginProcessor extends Object implements RequestSecurityProcessor
Modifier and Type | Field and Description |
---|---|
protected AuthenticationManager |
authenticationManager |
static String |
DEFAULT_LOGIN_METHOD |
static String |
DEFAULT_LOGIN_URL |
static String |
DEFAULT_PASSWORD_PARAM |
static String |
DEFAULT_REMEMBER_ME_PARAM |
static String |
DEFAULT_USERNAME_PARAM |
static org.slf4j.Logger |
logger |
protected LoginFailureHandler |
loginFailureHandler |
protected String |
loginMethod |
protected LoginSuccessHandler |
loginSuccessHandler |
protected String |
loginUrl |
protected String |
passwordParameter |
protected RememberMeManager |
rememberMeManager |
protected String |
rememberMeParameter |
protected TenantsResolver |
tenantsResolver |
protected String |
usernameParameter |
Constructor and Description |
---|
LoginProcessor()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearSession(javax.servlet.http.HttpServletRequest request) |
protected String |
getPassword(javax.servlet.http.HttpServletRequest request) |
protected boolean |
getRememberMe(javax.servlet.http.HttpServletRequest request) |
protected String |
getUsername(javax.servlet.http.HttpServletRequest request) |
protected boolean |
isLoginRequest(javax.servlet.http.HttpServletRequest request) |
protected void |
onLoginFailure(org.craftercms.commons.http.RequestContext context,
AuthenticationException e) |
protected void |
onLoginSuccess(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
loginUrl and the HTTP method matches the loginMethod . |
protected void |
saveException(javax.servlet.http.HttpServletRequest request,
AuthenticationException e) |
void |
setAuthenticationManager(AuthenticationManager authenticationManager) |
void |
setLoginFailureHandler(LoginFailureHandler loginFailureHandler) |
void |
setLoginMethod(String loginMethod) |
void |
setLoginSuccessHandler(LoginSuccessHandler loginSuccessHandler) |
void |
setLoginUrl(String loginUrl) |
void |
setPasswordParameter(String passwordParameter) |
void |
setRememberMeManager(RememberMeManager rememberMeManager) |
void |
setRememberMeParameter(String rememberMeParameter) |
void |
setTenantsResolver(TenantsResolver tenantsResolver) |
void |
setUsernameParameter(String usernameParameter) |
public static final org.slf4j.Logger logger
public static final String DEFAULT_LOGIN_URL
public static final String DEFAULT_LOGIN_METHOD
public static final String DEFAULT_USERNAME_PARAM
public static final String DEFAULT_PASSWORD_PARAM
public static final String DEFAULT_REMEMBER_ME_PARAM
protected String loginUrl
protected String loginMethod
protected String usernameParameter
protected String passwordParameter
protected String rememberMeParameter
protected TenantsResolver tenantsResolver
protected AuthenticationManager authenticationManager
protected LoginSuccessHandler loginSuccessHandler
protected LoginFailureHandler loginFailureHandler
protected RememberMeManager rememberMeManager
public void setLoginUrl(String loginUrl)
public void setLoginMethod(String loginMethod)
public void setPasswordParameter(String passwordParameter)
public void setUsernameParameter(String usernameParameter)
public void setRememberMeParameter(String rememberMeParameter)
public void setAuthenticationManager(AuthenticationManager authenticationManager)
public void setLoginSuccessHandler(LoginSuccessHandler loginSuccessHandler)
public void setLoginFailureHandler(LoginFailureHandler loginFailureHandler)
public void setRememberMeManager(RememberMeManager rememberMeManager)
public void setTenantsResolver(TenantsResolver tenantsResolver)
public void processRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception
loginUrl
and the HTTP method matches the loginMethod
. If
it does, it proceeds to login the user using the username/password specified in the parameters.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 isLoginRequest(javax.servlet.http.HttpServletRequest request)
protected String getUsername(javax.servlet.http.HttpServletRequest request)
protected String getPassword(javax.servlet.http.HttpServletRequest request)
protected boolean getRememberMe(javax.servlet.http.HttpServletRequest request)
protected void onLoginSuccess(org.craftercms.commons.http.RequestContext context, Authentication authentication) throws Exception
Exception
protected void onLoginFailure(org.craftercms.commons.http.RequestContext context, AuthenticationException e) throws Exception
Exception
protected void saveException(javax.servlet.http.HttpServletRequest request, AuthenticationException e)
protected void clearSession(javax.servlet.http.HttpServletRequest request)
Copyright © 2023 CrafterCMS. All rights reserved.