mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +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.UserContext;
|
||||||
import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
|
import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
|
||||||
import org.apache.guacamole.net.auth.credentials.GuacamoleCredentialsException;
|
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.auth.credentials.GuacamoleInvalidCredentialsException;
|
||||||
import org.apache.guacamole.net.event.AuthenticationFailureEvent;
|
import org.apache.guacamole.net.event.AuthenticationFailureEvent;
|
||||||
import org.apache.guacamole.net.event.AuthenticationSuccessEvent;
|
import org.apache.guacamole.net.event.AuthenticationSuccessEvent;
|
||||||
@@ -170,7 +171,13 @@ public class AuthenticationService {
|
|||||||
return authenticatedUser;
|
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) {
|
catch (GuacamoleCredentialsException e) {
|
||||||
if (authFailure == null)
|
if (authFailure == null)
|
||||||
authFailure = e;
|
authFailure = e;
|
||||||
|
Reference in New Issue
Block a user