@Component(value="cuba_AuthenticationManager") public class AuthenticationManagerBean extends java.lang.Object implements AuthenticationManager
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<AuthenticationProvider> |
authenticationProviders |
protected ClusterManager |
clusterManager |
protected Events |
events |
protected Persistence |
persistence |
protected UserSession |
serverSession |
protected UserSessionManager |
userSessionManager |
protected UserSessionsAPI |
userSessions |
protected UserSessionSource |
userSessionSource |
NAME| Constructor and Description |
|---|
AuthenticationManagerBean() |
| Modifier and Type | Method and Description |
|---|---|
AuthenticationDetails |
authenticate(Credentials credentials)
Authenticates a user and provides authentication details.
|
protected AuthenticationDetails |
authenticateInternal(Credentials credentials) |
protected java.util.List<AuthenticationProvider> |
getProviders() |
protected User |
loadSubstitutedUser(User substitutedUser,
UserSession currentSession,
EntityManager em) |
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 |
publishAfterAuthenticationEvent(Credentials credentials,
AuthenticationDetails authenticationDetails) |
protected void |
publishAfterLoginEvent(Credentials credentials,
AuthenticationDetails authenticationDetails) |
protected void |
publishAuthenticationFailed(Credentials credentials,
AuthenticationProvider provider,
LoginException e) |
protected void |
publishAuthenticationSuccess(AuthenticationDetails details,
Credentials credentials) |
protected void |
publishBeforeAuthenticationEvent(Credentials credentials) |
protected void |
publishBeforeLoginEvent(Credentials credentials) |
protected void |
publishUserLoggedInEvent(Credentials credentials,
AuthenticationDetails authenticationDetails) |
protected void |
publishUserLoggedOut(UserSession session) |
protected void |
publishUserSubstitutedEvent(UserSession currentSession,
UserSession substitutedSession) |
protected void |
setSessionAttributes(Credentials credentials,
AuthenticationDetails authenticationDetails) |
protected void |
setTimeZone(Credentials credentials,
AuthenticationDetails authenticationDetails) |
protected void |
storeSession(Credentials credentials,
AuthenticationDetails authenticationDetails) |
UserSession |
substituteUser(User substitutedUser)
Substitute a user, obtaining all its security related environment.
|
@Inject protected Events events
@Inject protected UserSessionSource userSessionSource
@Inject protected UserSessionManager userSessionManager
@Inject protected UserSessionsAPI userSessions
@Inject protected Persistence persistence
@Inject protected ClusterManager clusterManager
@Inject protected java.util.List<AuthenticationProvider> authenticationProviders
protected UserSession serverSession
@Nonnull public AuthenticationDetails authenticate(Credentials credentials) throws LoginException
AuthenticationManagerauthenticate in interface AuthenticationManagercredentials - credentialsLoginException - if authentication fails@Nonnull public AuthenticationDetails login(Credentials credentials) throws LoginException
AuthenticationManagerlogin in interface AuthenticationManagercredentials - credentialsLoginException - if authentication failsprotected void setTimeZone(Credentials credentials, AuthenticationDetails authenticationDetails)
protected void setSessionAttributes(Credentials credentials, AuthenticationDetails authenticationDetails)
protected void storeSession(Credentials credentials, AuthenticationDetails authenticationDetails)
@Nonnull public UserSession substituteUser(User substitutedUser)
AuthenticationManagersubstituteUser in interface AuthenticationManagersubstitutedUser - a user to substitute. Must be in the current users' User.getSubstitutions() list.AuthenticationService.substituteUser(User)public void logout()
AuthenticationManagerlogout in interface AuthenticationManagerAuthenticationService.logout()protected AuthenticationDetails authenticateInternal(Credentials credentials) throws LoginException
LoginExceptionprotected User loadSubstitutedUser(User substitutedUser, UserSession currentSession, EntityManager em)
protected void publishAfterLoginEvent(Credentials credentials, AuthenticationDetails authenticationDetails)
protected void publishUserSubstitutedEvent(UserSession currentSession, UserSession substitutedSession)
protected void publishUserLoggedInEvent(Credentials credentials, AuthenticationDetails authenticationDetails)
protected void publishBeforeLoginEvent(Credentials credentials) throws LoginException
LoginExceptionprotected void publishBeforeAuthenticationEvent(Credentials credentials) throws LoginException
LoginExceptionprotected void publishAfterAuthenticationEvent(Credentials credentials, AuthenticationDetails authenticationDetails) throws LoginException
LoginExceptionprotected void publishAuthenticationFailed(Credentials credentials, AuthenticationProvider provider, LoginException e) throws LoginException
LoginExceptionprotected void publishAuthenticationSuccess(AuthenticationDetails details, Credentials credentials) throws LoginException
LoginExceptionprotected void publishUserLoggedOut(UserSession session)
protected java.util.List<AuthenticationProvider> getProviders()