Fail authenticate if credentialInput is not of type UserCredentialModel

Code fix inside LDAPStorageProvider.java:
return failed result if credential input object is not of expected type

Closes #11191
This commit is contained in:
R0Wi 2021-12-23 16:16:49 +01:00 committed by Marek Posolda
parent 5c1a8d401d
commit cb4a513e24

View file

@ -718,7 +718,7 @@ public class LDAPStorageProvider implements UserStorageProvider,
@Override
public CredentialValidationOutput authenticate(RealmModel realm, CredentialInput cred) {
if (!(cred instanceof UserCredentialModel)) CredentialValidationOutput.failed();
if (!(cred instanceof UserCredentialModel)) return CredentialValidationOutput.failed();
UserCredentialModel credential = (UserCredentialModel)cred;
if (credential.getType().equals(UserCredentialModel.KERBEROS)) {
if (kerberosConfig.isAllowKerberosAuthentication()) {