@Override
    public AcceptableUsagePolicyStatus verify(final RequestContext requestContext) throws Throwable {
        var status = super.verify(requestContext);
        if (status.isDenied()) {
            val jdbc = aupProperties.getJdbc();
            val aupColumnName = getAcceptableUsagePolicyColumnName(jdbc);
            val sql = String.format(jdbc.getSqlSelect(), aupColumnName, jdbc.getTableName(), jdbc.getPrincipalIdColumn());
            val principal = WebUtils.getAuthentication(requestContext).getPrincipal();
            val principalId = determinePrincipalId(principal);
            LOGGER.debug("Executing search query [{}] for principal [{}]", sql, principalId);
            return transactionTemplate.execute(action -> {
                val acceptedFlag = jdbcTemplate.queryForObject(sql, String.class, principalId);
                return new AcceptableUsagePolicyStatus(
                    TriStateBoolean.fromBoolean(BooleanUtils.toBoolean(acceptedFlag)), status.getPrincipal());
            });
        }
        return status;
    }
This is {@link JdbcAcceptableUsagePolicyRepository}.
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 jdbc instance.

@author Misagh Moayyed
@since 5.2
support/cas-server-support-aup-jdbc/src/main/java/org/apereo/cas/aup/JdbcAcceptableUsagePolicyRepository.java