use of org.simbasecurity.core.service.CredentialService in project simba-os by cegeka.
the class FallbackDatabaseLoginModule method verifyLoginData.
@Override
protected boolean verifyLoginData() throws FailedLoginException {
CredentialService credentialService = GlobalContext.locate(CredentialService.class);
debug("Verifying credentials for user: " + getUsername());
boolean validCredentials = false;
try {
validCredentials = credentialService.checkCredentials(getUsername(), getPassword());
} catch (EncryptionOperationNotPossibleException legacyPasswordException) {
validCredentials = verifyWithSHA1Encryptor(credentialService);
}
if (validCredentials) {
debug("Authentication succeeded");
return true;
}
debug("Authentication failed");
throw new FailedLoginException(getUsername());
}
Aggregations