Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 23cd5bbb authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Pull request #122: [EDELIVERY-13839] Fix user password reset - same passsword must not be allowed

Merge in EDELIVERY/smp from bugfix/EDELIVERY-13839-user-management-password-same-password to development

* commit '2e83d0d6':
  [EDELIVERY-13860] Fix DNS tool identifier validation to use default identifier settings.
parents 86e9dbdd 2e83d0d6
No related branches found
No related tags found
No related merge requests found
Pipeline #204779 failed
......@@ -373,6 +373,12 @@ public class CredentialService {
Pattern pattern = configurationService.getPasswordPolicyRexExp();
if (pattern != null && !pattern.matcher(newPassword).matches()) {
LOG.info(SMPLogger.SECURITY_MARKER, "Change/set password failed because it does not match password policy!: [{}]", username);
throw new SMPRuntimeException(ErrorCode.INVALID_REQUEST, "PasswordChange", configurationService.getPasswordPolicyValidationMessage());
}
if (StringUtils.isNotBlank(dbCredential.getValue()) && BCrypt.checkpw(newPassword, dbCredential.getValue())) {
LOG.info(SMPLogger.SECURITY_MARKER, "Change/set password failed because 'new' password match the old password for user: [{}]", username);
throw new SMPRuntimeException(ErrorCode.INVALID_REQUEST, "PasswordChange", configurationService.getPasswordPolicyValidationMessage());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment