@Component(value="cuba_AuthenticationService") public class AuthenticationServiceBean extends java.lang.Object implements AuthenticationService
Modifier and Type | Field and Description |
---|---|
protected Authentication |
authentication |
protected AuthenticationManager |
authenticationManager |
protected TrustedLoginHandler |
trustedLoginHandler |
protected UserSessionLog |
userSessionLog |
protected UserSessionSource |
userSessionSource |
NAME
Constructor and Description |
---|
AuthenticationServiceBean() |
Modifier and Type | Method and Description |
---|---|
AuthenticationDetails |
authenticate(Credentials credentials)
Authenticates a user and provides authentication details.
|
AuthenticationDetails |
login(Credentials credentials)
Authenticates a user, starts session and provides authentication details.
|
void |
logout()
Log out and destroy an active user session.
|
protected void |
preprocessCredentials(Credentials credentials) |
UserSession |
substituteUser(User substitutedUser)
Substitute a user, obtaining all its security related environment.
|
protected LoginException |
wrapInLoginException(java.lang.Throwable throwable) |
@Inject protected AuthenticationManager authenticationManager
@Inject protected UserSessionSource userSessionSource
@Inject protected UserSessionLog userSessionLog
@Inject protected Authentication authentication
@Inject protected TrustedLoginHandler trustedLoginHandler
@Nonnull public AuthenticationDetails authenticate(Credentials credentials) throws LoginException
AuthenticationService
authenticate
in interface AuthenticationService
credentials
- credentialsLoginException
- if authentication fails@Nonnull public AuthenticationDetails login(Credentials credentials) throws LoginException
AuthenticationService
login
in interface AuthenticationService
credentials
- credentialsLoginException
- if authentication fails@Nonnull public UserSession substituteUser(User substitutedUser)
AuthenticationService
substituteUser
in interface AuthenticationService
substitutedUser
- a user to substitute. Must be in the current users' User.getSubstitutions()
list.public void logout()
AuthenticationService
logout
in interface AuthenticationService
protected LoginException wrapInLoginException(java.lang.Throwable throwable)
protected void preprocessCredentials(Credentials credentials)