mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Authentication success event and listener.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package net.sourceforge.guacamole.net.event;
|
||||
|
||||
import net.sourceforge.guacamole.net.auth.Credentials;
|
||||
|
||||
/**
|
||||
* 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().
|
||||
*
|
||||
* @author Michael Jumper
|
||||
*/
|
||||
public class AuthenticationSuccessEvent implements CredentialEvent {
|
||||
|
||||
/**
|
||||
* The credentials which passed authentication
|
||||
*/
|
||||
private Credentials credentials;
|
||||
|
||||
/**
|
||||
* Creates a new AuthenticationSuccessEvent which represents a successful
|
||||
* authentication attempt with the given credentials.
|
||||
*
|
||||
* @param credentials The credentials which passed authentication.
|
||||
*/
|
||||
public AuthenticationSuccessEvent(Credentials credentials) {
|
||||
this.credentials = credentials;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Credentials getCredentials() {
|
||||
return credentials;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package net.sourceforge.guacamole.net.event.listener;
|
||||
|
||||
import net.sourceforge.guacamole.net.event.AuthenticationSuccessEvent;
|
||||
|
||||
/**
|
||||
* A listener whose hooks will fire immediately before and after a user's
|
||||
* authentication attempt succeeds. If a user successfully authenticates,
|
||||
* the authenticationSucceeded() hook has the opportunity to cancel the
|
||||
* authentication and force it to fail.
|
||||
*
|
||||
* @author Michael Jumper
|
||||
*/
|
||||
public interface AuthenticationSuccessListener {
|
||||
|
||||
/**
|
||||
* Event hook which fires immediately after a user's authentication attempt
|
||||
* succeeds. The return value of this hook dictates whether the
|
||||
* successful authentication attempt is canceled.
|
||||
*
|
||||
* @param e The AuthenticationFailureEvent describing the authentication
|
||||
* failure that just occurred.
|
||||
* @return true if the successful authentication attempt should be
|
||||
* allowed, or false if the attempt should be denied, causing
|
||||
* the attempt to effectively fail.
|
||||
*/
|
||||
public boolean authenticationSucceeded(AuthenticationSuccessEvent e);
|
||||
|
||||
}
|
Reference in New Issue
Block a user