@Override
    public Map<String, List<Object>> resolveConsentableAttributesFrom(
        final Authentication authentication,
        final Service service,
        final RegisteredService registeredService) throws Throwable {
        LOGGER.debug("Retrieving consentable attributes for [{}]", registeredService);
        val policy = registeredService.getAttributeReleasePolicy();
        if (policy != null) {
            val context = RegisteredServiceAttributeReleasePolicyContext.builder()
                .registeredService(registeredService)
                .service(service)
                .principal(authentication.getPrincipal())
                .applicationContext(applicationContext)
                .build();
            val consentableAttributes = policy.getConsentableAttributes(context);
            consentableAttributes.entrySet().removeIf(entry -> {
                val excludedAttributes = casProperties.getConsent().getCore().getExcludedAttributes();
                return excludedAttributes.contains(entry.getKey());
            });
            return consentableAttributes;
        }
        return new LinkedHashMap<>();
    }
This is {@link DefaultConsentEngine}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-consent-core/src/main/java/org/apereo/cas/consent/DefaultConsentEngine.java