Package org.apache.guacamole.net.event
Class AuthenticationSuccessEvent
java.lang.Object
org.apache.guacamole.net.event.AuthenticationSuccessEvent
- All Implemented Interfaces:
AuthenticationProviderEvent
,CredentialEvent
,UserEvent
public class AuthenticationSuccessEvent
extends Object
implements UserEvent, CredentialEvent, AuthenticationProviderEvent
An event which is triggered whenever a user's credentials pass
authentication. The credentials that passed authentication are included
within this event, and can be retrieved using getCredentials().
If a Listener
throws
a GuacamoleException when handling an event of this type, successful authentication
is effectively vetoed and will be subsequently processed as though the
authentication failed.
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationSuccessEvent
(AuthenticatedUser authenticatedUser) Creates a new AuthenticationSuccessEvent which represents a successful authentication attempt by the user identified by the given AuthenticatedUser object.AuthenticationSuccessEvent
(AuthenticatedUser authenticatedUser, boolean existingSession) Creates a new AuthenticationSuccessEvent which represents a successful authentication attempt by the user identified by the given AuthenticatedUser object. -
Method Summary
Modifier and TypeMethodDescriptionReturns the AuthenticatedUser identifying the user triggering the event, if any.Returns the AuthenticationProvider that resulted in the event, if any.Returns the current credentials of the user triggering the event, if any.boolean
Returns whether the successful authentication attempt represented by this event is related to an established Guacamole session.
-
Constructor Details
-
AuthenticationSuccessEvent
Creates a new AuthenticationSuccessEvent which represents a successful authentication attempt by the user identified by the given AuthenticatedUser object. The authentication attempt is presumed to be a fresh authentication attempt unrelated to an established session (a login attempt).- Parameters:
authenticatedUser
- The AuthenticatedUser identifying the user that successfully authenticated.
-
AuthenticationSuccessEvent
Creates a new AuthenticationSuccessEvent which represents a successful authentication attempt by the user identified by the given AuthenticatedUser object. Whether the authentication attempt is related to an established session (a periodic re-authentication attempt that updates session status) or not (a fresh login attempt) is determined by the value of the provided flag.- Parameters:
authenticatedUser
- The AuthenticatedUser identifying the user that successfully authenticated.existingSession
- Whether this AuthenticationSuccessEvent represents an re-authentication attempt that updates the status of an established Guacamole session.
-
-
Method Details
-
getAuthenticatedUser
Description copied from interface:UserEvent
Returns the AuthenticatedUser identifying the user triggering the event, if any.- Specified by:
getAuthenticatedUser
in interfaceUserEvent
- Returns:
- The AuthenticatedUser identifying the user triggering the event, if any, or null if no AuthenticatedUser is associated with the event.
-
getCredentials
Description copied from interface:CredentialEvent
Returns the current credentials of the user triggering the event, if any.- Specified by:
getCredentials
in interfaceCredentialEvent
- Returns:
- The current credentials of the user triggering the event, if any, or null if no credentials are associated with the event.
-
getAuthenticationProvider
Description copied from interface:AuthenticationProviderEvent
Returns the AuthenticationProvider that resulted in the event, if any. If the event occurred without any definite causing AuthenticationProvider, this may be null.- Specified by:
getAuthenticationProvider
in interfaceAuthenticationProviderEvent
- Returns:
- The AuthenticationProvider that resulted in the event, or null if no such AuthenticationProvider is known.
-
isExistingSession
public boolean isExistingSession()Returns whether the successful authentication attempt represented by this event is related to an established Guacamole session. During normal operation, the Guacamole web application will periodically re-authenticate with the server to verify its authentication token and update the session state, in which case the value returned by this function will be true. If the user was not already authenticated and has just initially logged in, false is returned.- Returns:
- true if this AuthenticationSuccessEvent is related to a Guacamole session that was already established, false otherwise.
-