@Override
    public boolean authorizeRequest(final RegisteredServiceAccessStrategyRequest request) {
        return Unchecked.supplier(() -> {
            val exec = HttpExecutionRequest.builder()
                .method(HttpMethod.valueOf(this.method))
                .url(SpringExpressionLanguageValueResolver.getInstance().resolve(endpointUrl))
                .headers(headers)
                .parameters(CollectionUtils.wrap("username", request.getPrincipalId()))
                .entity(MAPPER.writeValueAsString(request))
                .build();
            val response = HttpUtils.execute(exec);
            val currentCodes = StringUtils.commaDelimitedListToSet(this.acceptableResponseCodes);
            return response != null && currentCodes.contains(String.valueOf(response.getCode()));
        }).get();
    }
This is {@link RemoteEndpointServiceAccessStrategy} that reaches out
to a remote endpoint, passing the CAS principal id to determine if access is allowed.
If the status code returned in the final response is not accepted by the policy here,
access shall be denied.

@author Misagh Moayyed
@since 5.0.0
core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/RemoteEndpointServiceAccessStrategy.java