@Override
    public AcceptableUsagePolicyStatus verify(final RequestContext requestContext) throws Throwable {
        var status = super.verify(requestContext);
        if (status.isDenied()) {
            val principal = WebUtils.getAuthentication(requestContext).getPrincipal();
            HttpResponse response = null;
            try {
                val rest = aupProperties.getRest();
                val url = StringUtils.appendIfMissing(rest.getUrl(), "/").concat("status");
                val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);

                val parameters = CollectionUtils.<String, String>wrap(
                    "username", principal.getId(),
                    "locale", request.getLocale().toString());
                val service = WebUtils.getService(requestContext);
                FunctionUtils.doIfNotNull(service, __ -> parameters.put("service", service.getId()));

                val exec = HttpExecutionRequest.builder()
                    .basicAuthPassword(rest.getBasicAuthPassword())
                    .basicAuthUsername(rest.getBasicAuthUsername())
                    .method(HttpMethod.GET)
                    .url(url)
                    .httpClient(this.httpClient)
                    .parameters(parameters)
                    .headers(rest.getHeaders())
                    .build();
                response = HttpUtils.execute(exec);
                val statusCode = response.getCode();
                LOGGER.debug("AUP status request returned with response code [{}]", statusCode);
                if (HttpStatus.valueOf(statusCode).is2xxSuccessful()) {
                    return AcceptableUsagePolicyStatus.accepted(principal);
                }
            } catch (final Exception e) {
                LoggingUtils.error(LOGGER, e);
            } finally {
                HttpUtils.close(response);
            }
            return AcceptableUsagePolicyStatus.denied(principal);
        }
        return status;
    }
This is {@link RestAcceptableUsagePolicyRepository}.
Examines the principal attribute collection to determine if
the policy has been accepted, and if not, allows for a configurable
way so that user's choice can later be remembered and saved back via REST.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-aup-rest/src/main/java/org/apereo/cas/aup/RestAcceptableUsagePolicyRepository.java