mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-684: Insufficient credentials should take precedence over other credentials errors.
This commit is contained in:
@@ -36,6 +36,7 @@ import org.apache.guacamole.net.auth.Credentials;
|
||||
import org.apache.guacamole.net.auth.UserContext;
|
||||
import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
|
||||
import org.apache.guacamole.net.auth.credentials.GuacamoleCredentialsException;
|
||||
import org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException;
|
||||
import org.apache.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException;
|
||||
import org.apache.guacamole.net.event.AuthenticationFailureEvent;
|
||||
import org.apache.guacamole.net.event.AuthenticationSuccessEvent;
|
||||
@@ -170,7 +171,13 @@ public class AuthenticationService {
|
||||
return authenticatedUser;
|
||||
}
|
||||
|
||||
// First failure takes priority for now
|
||||
// Insufficient credentials should take precedence
|
||||
catch (GuacamoleInsufficientCredentialsException e) {
|
||||
if (authFailure == null || authFailure instanceof GuacamoleInvalidCredentialsException)
|
||||
authFailure = e;
|
||||
}
|
||||
|
||||
// Catch other credentials exceptions and assign the first one
|
||||
catch (GuacamoleCredentialsException e) {
|
||||
if (authFailure == null)
|
||||
authFailure = e;
|
||||
|
Reference in New Issue
Block a user