@Override
    public void update(final Principal principal, final Map<String, Object> attributes) {
        HttpResponse response = null;
        try {
            val headers = CollectionUtils.<String, String>wrap(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
            headers.putAll(properties.getHeaders());
            val exec = HttpExecutionRequest.builder()
                .method(HttpMethod.PUT)
                .headers(headers)
                .entity(JsonUtils.render(MAPPER, Map.of("principal", principal, "attributes", attributes)))
                .url(properties.getUrl())
                .basicAuthPassword(properties.getBasicAuthPassword())
                .basicAuthUsername(properties.getBasicAuthUsername())
                .build();
            response = HttpUtils.execute(exec);
            Assert.isTrue(HttpStatus.valueOf(response.getCode()).is2xxSuccessful(), "Unable to update principal");
        } finally {
            HttpUtils.close(response);
        }
    }
This is {@link RestfulCasSimpleMultifactorAuthenticationService}.

@author Misagh Moayyed
@since 6.6.0
support/cas-server-support-simple-mfa-core/src/main/java/org/apereo/cas/mfa/simple/validation/RestfulCasSimpleMultifactorAuthenticationService.java