@Override
    public boolean isAllowedProxyCallbackUrl(final RegisteredService registeredService, final URL pgtUrl) {
        HttpResponse response = null;
        try (val writer = new StringWriter()) {
            MAPPER.writer(new MinimalPrettyPrinter()).writeValue(writer, registeredService);
            val exec = HttpExecutionRequest.builder()
                .method(HttpMethod.GET)
                .headers(headers)
                .url(SpringExpressionLanguageValueResolver.getInstance().resolve(endpoint))
                .entity(writer.toString())
                .parameters(CollectionUtils.wrap("pgtUrl", pgtUrl.toExternalForm()))
                .headers(CollectionUtils.wrap(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE))
                .build();
            response = HttpUtils.execute(exec);
            return HttpStatus.valueOf(response.getCode()).is2xxSuccessful();
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        } finally {
            HttpUtils.close(response);
        }
        return false;
    }
A proxy policy that only allows proxying to pgt urls
via a REST endpoint.

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