use of org.apereo.cas.authentication.metadata.BasicCredentialMetaData in project cas by apereo.
the class TestOneTimePasswordAuthenticationHandler method authenticate.
@Override
public AuthenticationHandlerExecutionResult authenticate(final Credential credential) throws GeneralSecurityException {
val otp = (OneTimePasswordCredential) credential;
val valueOnRecord = credentialMap.get(otp.getId());
if (otp.getPassword().equals(valueOnRecord)) {
return new DefaultAuthenticationHandlerExecutionResult(this, new BasicCredentialMetaData(otp), getPrincipalFactory().createPrincipal(otp.getId()));
}
throw new FailedLoginException();
}
Aggregations