@Override
    public Map<String, List<Object>> getConsentableAttributes(final RegisteredServiceAttributeReleasePolicyContext context) {
        val merger = CoreAuthenticationUtils.getAttributeMerger(mergingPolicy);
        val attributes = new HashMap<String, List<Object>>();
        policies
            .stream()
            .filter(Objects::nonNull)
            .filter(policy -> policy.getActivationCriteria() == null || policy.getActivationCriteria().shouldActivate(context))
            .sorted(AnnotationAwareOrderComparator.INSTANCE)
            .forEach(Unchecked.consumer(policy -> {
                LOGGER.trace("Fetching consentable attributes from policy [{}] for principal [{}]",
                    policy.getName(), context.getPrincipal().getId());
                val policyAttributes = policy.getConsentableAttributes(context);
                merger.mergeAttributes(attributes, policyAttributes);
                LOGGER.trace("Attributes that remain, after the merge with consentable attribute policy results, are [{}]", attributes);
            }));
        return attributes;
    }
This is {@link ChainingAttributeReleasePolicy}.

@author Misagh Moayyed
@since 5.1.0
core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/services/ChainingAttributeReleasePolicy.java