Update this simple example for 8.0.0 release

Check my question on Stackoverflow
https://stackoverflow.com/questions/59040133/keycloak-example-the-method-getvalue-is-undefined-for-the-type-usercredentia?answertab=oldest#tab-top
This commit is contained in:
Defoncesko 2019-11-26 09:26:28 +01:00 committed by Stian Thorgersen
parent 3a962b4d7a
commit cf7a35b1dd

View file

@ -111,12 +111,11 @@ Next let's look at the method implementations for `CredentialInputValidator`.
@Override
public boolean isValid(RealmModel realm, UserModel user, CredentialInput input) {
if (!supportsCredentialType(input.getType()) || !(input instanceof UserCredentialModel)) return false;
if (!supportsCredentialType(input.getType())) return false;
UserCredentialModel cred = (UserCredentialModel)input;
String password = properties.getProperty(user.getUsername());
if (password == null) return false;
return password.equals(cred.getValue());
return password.equals(input.getChallengeResponse());
}
----