Only try LDAP bind if user authenticated with LDAP.
@@ -300,6 +300,7 @@ public class AuthenticationProviderService {
// Bind using credentials associated with AuthenticatedUser
Credentials credentials = authenticatedUser.getCredentials();
+ if (authenticatedUser instanceof LDAPAuthenticatedUser) {
Dn bindDn = ((LDAPAuthenticatedUser) authenticatedUser).getBindDn();
LdapNetworkConnection ldapConnection = ldapService.bindAs(bindDn, credentials.getPassword());
@@ -316,6 +317,8 @@ public class AuthenticationProviderService {
finally {
ldapService.disconnect(ldapConnection);
}
+ }
+ return null;
}
