@Override
    public boolean changeInternal(final PasswordChangeRequest bean) {
        val rest = casProperties.getAuthn().getPm().getRest();
        if (StringUtils.isBlank(rest.getEndpointUrlChange())) {
            return false;
        }

        val body = new HashMap<>();
        body.put(rest.getFieldNameUser(), bean.getUsername());
        body.put(rest.getFieldNamePassword(), bean.toPassword());
        if (bean.getCurrentPassword() != null) {
            body.put(rest.getFieldNamePasswordOld(), bean.toCurrentPassword());
        }
        val entity = new HttpEntity<>(body);
        val result = restTemplate.exchange(rest.getEndpointUrlChange(), HttpMethod.POST, entity, Boolean.class);
        return result.getStatusCode().value() == HttpStatus.OK.value() && result.hasBody()
            && Objects.requireNonNull(result.getBody());
    }
This is {@link RestPasswordManagementService}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-pm-rest/src/main/java/org/apereo/cas/pm/rest/RestPasswordManagementService.java