GUACAMOLE-234: Only try LDAP bind if user authenticated with LDAP.

This commit is contained in:
Nick Couchman authored and Virtually Nick committed 2019-08-10 13:57:51 -04:00
1 parent fc5c4c538e
commit 791cfeabbb
1 file changed
+3
@@ -300,6 +300,7 @@ public class AuthenticationProviderService {
// Bind using credentials associated with AuthenticatedUser // Bind using credentials associated with AuthenticatedUser
Credentials credentials = authenticatedUser.getCredentials(); Credentials credentials = authenticatedUser.getCredentials();
if (authenticatedUser instanceof LDAPAuthenticatedUser) {
Dn bindDn = ((LDAPAuthenticatedUser) authenticatedUser).getBindDn(); Dn bindDn = ((LDAPAuthenticatedUser) authenticatedUser).getBindDn();
LdapNetworkConnection ldapConnection = ldapService.bindAs(bindDn, credentials.getPassword()); LdapNetworkConnection ldapConnection = ldapService.bindAs(bindDn, credentials.getPassword());
@@ -316,6 +317,8 @@ public class AuthenticationProviderService {
finally { finally {
ldapService.disconnect(ldapConnection); ldapService.disconnect(ldapConnection);
} }
}
return null;
} }