@Override
    public Principal createPrincipal(final String id, final Map<String, List<Object>> attributes) throws Throwable {
        HttpResponse response = null;
        try {
            val current = super.createPrincipal(id, attributes);
            val entity = MAPPER.writeValueAsString(current);

            val headers = CollectionUtils.<String, String>wrap(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
            headers.putAll(properties.getHeaders());

            val exec = HttpExecutionRequest.builder()
                .basicAuthPassword(properties.getBasicAuthPassword())
                .basicAuthUsername(properties.getBasicAuthUsername())
                .method(HttpMethod.POST)
                .url(properties.getUrl())
                .entity(entity)
                .headers(headers)
                .build();
            response = HttpUtils.execute(exec);
            if (response != null && response.getCode() == HttpStatus.OK.value()) {
                try (val content = ((HttpEntityContainer) response).getEntity().getContent()) {
                    val result = IOUtils.toString(content, StandardCharsets.UTF_8);
                    LOGGER.debug("Principal factory response received: [{}]", result);
                    return MAPPER.readValue(JsonValue.readHjson(result).toString(), SimplePrincipal.class);
                }
            }
        } catch (final Exception e) {
            throw new IllegalArgumentException(e.getMessage(), e);
        } finally {
            HttpUtils.close(response);
        }
        LOGGER.error("Unable to create principal from REST endpoint [{}] for [{}]", properties.getUrl(), id);
        return null;
    }
This is {@link RestfulPrincipalFactory}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/principal/RestfulPrincipalFactory.java