mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-234: Only try LDAP bind if user authenticated with LDAP.
This commit is contained in:
committed by
Virtually Nick
parent
fc5c4c538e
commit
791cfeabbb
@@ -300,22 +300,25 @@ public class AuthenticationProviderService {
|
|||||||
|
|
||||||
// Bind using credentials associated with AuthenticatedUser
|
// Bind using credentials associated with AuthenticatedUser
|
||||||
Credentials credentials = authenticatedUser.getCredentials();
|
Credentials credentials = authenticatedUser.getCredentials();
|
||||||
Dn bindDn = ((LDAPAuthenticatedUser) authenticatedUser).getBindDn();
|
if (authenticatedUser instanceof LDAPAuthenticatedUser) {
|
||||||
LdapNetworkConnection ldapConnection = ldapService.bindAs(bindDn, credentials.getPassword());
|
Dn bindDn = ((LDAPAuthenticatedUser) authenticatedUser).getBindDn();
|
||||||
|
LdapNetworkConnection ldapConnection = ldapService.bindAs(bindDn, credentials.getPassword());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// Build user context by querying LDAP
|
// Build user context by querying LDAP
|
||||||
LDAPUserContext userContext = userContextProvider.get();
|
LDAPUserContext userContext = userContextProvider.get();
|
||||||
userContext.init(authenticatedUser, ldapConnection);
|
userContext.init(authenticatedUser, ldapConnection);
|
||||||
return userContext;
|
return userContext;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always disconnect
|
||||||
|
finally {
|
||||||
|
ldapService.disconnect(ldapConnection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
// Always disconnect
|
|
||||||
finally {
|
|
||||||
ldapService.disconnect(ldapConnection);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user