@Component(value="cuba_RememberMeAuthenticationProvider") public class RememberMeAuthenticationProvider extends AbstractAuthenticationProvider implements org.springframework.core.Ordered
Modifier and Type | Field and Description |
---|---|
protected GlobalConfig |
globalConfig |
protected TimeSource |
timeSource |
protected java.util.List<UserAccessChecker> |
userAccessCheckers |
protected java.util.List<UserCredentialsChecker> |
userCredentialsCheckers |
protected UserSessionManager |
userSessionManager |
messages, MSG_PACK, persistence
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
HIGHEST_PLATFORM_PRECEDENCE, LOWEST_PLATFORM_PRECEDENCE
Constructor and Description |
---|
RememberMeAuthenticationProvider(Persistence persistence,
Messages messages) |
Modifier and Type | Method and Description |
---|---|
AuthenticationDetails |
authenticate(Credentials credentials)
Authenticates a user and provides authentication details.
|
protected void |
checkUserAccess(Credentials loginAndPassword,
AuthenticationDetails authenticationDetails) |
protected void |
checkUserCredentials(Credentials credentials) |
protected UserSession |
createSession(RememberMeCredentials credentials,
User user,
java.util.Locale userLocale) |
int |
getOrder() |
protected boolean |
isTokenExpired(RememberMeToken rememberMeToken) |
protected RememberMeToken |
loadRememberMeToken(User user,
java.lang.String rememberMeToken) |
boolean |
supports(java.lang.Class<?> credentialsClass)
Checks if this provider supports passed credentials class or not.
|
getExpiredRememberMeTokenMessage, getInvalidCredentialsMessage, getUserLocale, loadUser, loadUser, setClientSessionParams
@Inject protected java.util.List<UserAccessChecker> userAccessCheckers
@Inject protected java.util.List<UserCredentialsChecker> userCredentialsCheckers
@Inject protected UserSessionManager userSessionManager
@Inject protected TimeSource timeSource
@Inject protected GlobalConfig globalConfig
@Inject public RememberMeAuthenticationProvider(Persistence persistence, Messages messages)
public AuthenticationDetails authenticate(Credentials credentials) throws LoginException
AuthenticationProvider
authenticate
in interface AuthenticationProvider
credentials
- credentialsLoginException
- if authentication failsprotected UserSession createSession(RememberMeCredentials credentials, User user, java.util.Locale userLocale) throws LoginException
LoginException
protected void checkUserCredentials(Credentials credentials) throws LoginException
LoginException
protected void checkUserAccess(Credentials loginAndPassword, AuthenticationDetails authenticationDetails) throws LoginException
LoginException
@Nullable protected RememberMeToken loadRememberMeToken(User user, java.lang.String rememberMeToken)
protected boolean isTokenExpired(RememberMeToken rememberMeToken)
public boolean supports(java.lang.Class<?> credentialsClass)
AuthenticationProvider
supports
in interface AuthenticationProvider
credentialsClass
- credentials classCredentials
object.public int getOrder()
getOrder
in interface org.springframework.core.Ordered