61 event.event(EventType.UPDATE_PASSWORD);
63 UserCredentialModel cred = UserCredentialModel.password(update.getCurrentPassword());
66 return ErrorResponse.error(Messages.INVALID_PASSWORD_EXISTING, Response.Status.BAD_REQUEST);
69 if (update.getNewPassword() == null) {
70 return ErrorResponse.error(Messages.INVALID_PASSWORD_EXISTING, Response.Status.BAD_REQUEST);
73 String confirmation = update.getConfirmation();
74 if ((confirmation != null) && !update.getNewPassword().equals(confirmation)) {
75 return ErrorResponse.error(Messages.NOTMATCH_PASSWORD, Response.Status.BAD_REQUEST);
80 }
catch (ModelException e) {
81 return ErrorResponse.error(e.getMessage(), e.getParameters(), Response.Status.BAD_REQUEST);
84 return Response.ok().build();
Definition: AbstractOAuthClient.java:18
UserCredentialManager userCredentialManager()
final RealmModel realm
Definition: AccountCredentialResource.java:30
boolean isValid(RealmModel realm, UserModel user, List< CredentialInput > inputs)
void updateCredential(RealmModel realm, UserModel user, CredentialInput input)
Definition: Errors.java:23
final UserModel user
Definition: AccountCredentialResource.java:29
final KeycloakSession session
Definition: AccountCredentialResource.java:27
String INVALID_USER_CREDENTIALS
Definition: Errors.java:39