use of org.jasypt.exceptions.EncryptionOperationNotPossibleException in project simba-os by cegeka.
the class DatabaseLoginModule 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) {
debug("Authentication failed");
throw new FailedLoginException(getUsername());
}
if (validCredentials) {
debug("Authentication succeeded");
return true;
}
debug("Authentication failed");
throw new FailedLoginException(getUsername());
}
use of org.jasypt.exceptions.EncryptionOperationNotPossibleException 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