@Override
    public AcceptableUsagePolicyStatus verify(final RequestContext requestContext) throws Throwable {
        var status = super.verify(requestContext);
        if (status.isDenied()) {
            val principal = WebUtils.getAuthentication(requestContext).getPrincipal();
            return aupProperties.getLdap()
                .stream()
                .sorted(Comparator.comparing(LdapAcceptableUsagePolicyProperties::getName))
                .map(Unchecked.function(ldap -> searchLdapForId(ldap, principal.getId())))
                .filter(Optional::isPresent)
                .findFirst()
                .filter(Optional::isPresent)
                .map(result -> result.get().getMiddle().getEntry())
                .map(entry -> {
                    val attribute = entry.getAttribute(aupProperties.getCore().getAupAttributeName());
                    return attribute != null && attribute.getStringValues()
                        .stream()
                        .anyMatch(value -> value.equalsIgnoreCase(getAcceptedAttributeValue()));
                })
                .map(result -> new AcceptableUsagePolicyStatus(TriStateBoolean.fromBoolean(result), status.getPrincipal()))
                .orElseGet(() -> AcceptableUsagePolicyStatus.denied(status.getPrincipal()));
        }
        return status;
    }
This is {@link LdapAcceptableUsagePolicyRepository}.
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 into
the LDAP instance.

@author Misagh Moayyed
@since 4.2
support/cas-server-support-aup-ldap/src/main/java/org/apereo/cas/aup/LdapAcceptableUsagePolicyRepository.java