@Override
    public boolean changeInternal(final @NonNull PasswordChangeRequest bean) {
        if (StringUtils.isBlank(bean.toPassword())) {
            LOGGER.error("Password cannot be blank");
            return false;
        }
        if (!StringUtils.equals(bean.toPassword(), bean.toConfirmedPassword())) {
            LOGGER.error("Password does not match and cannot be confirmed");
            return false;
        }
        val account = jsonBackedAccounts.getOrDefault(bean.getUsername(), null);
        if (account == null) {
            LOGGER.error("User account [{}] cannot be found", bean.getUsername());
            return false;
        }
        account.setPassword(bean.toPassword());
        jsonBackedAccounts.put(bean.getUsername(), account);
        return writeAccountToJsonResource();
    }
This is {@link JsonResourcePasswordManagementService}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-pm-core/src/main/java/org/apereo/cas/pm/impl/JsonResourcePasswordManagementService.java