GUACAMOLE-234: Correctly handle bind failure.

This commit is contained in:
Nick Couchman
2018-12-27 10:28:09 -05:00
committed by Virtually Nick
parent 791cfeabbb
commit 742b0c4e65

View File

@@ -150,6 +150,8 @@ public class LDAPConnectionService {
bindRequest.setDn(userDN);
bindRequest.setCredentials(password);
ldapConnection.bind(bindRequest);
if (ldapConnection.isConnected() && ldapConnection.isAuthenticated())
return ldapConnection;
}
@@ -162,7 +164,8 @@ public class LDAPConnectionService {
CredentialsInfo.USERNAME_PASSWORD);
}
return ldapConnection;
throw new GuacamoleInvalidCredentialsException("Authentication failed.",
CredentialsInfo.USERNAME_PASSWORD);
}