@Override
    protected List<String> determineRequestedAttributeDefinitions(final RegisteredServiceAttributeReleasePolicyContext context) {
        val entityId = getEntityIdFromRequest(context);
        val facade = determineServiceProviderMetadataFacade(context, entityId);
        return facade
            .map(SamlRegisteredServiceMetadataAdaptor::getSsoDescriptor)
            .map(sso -> sso.getAttributeConsumingServices()
                .stream()
                .map(svc -> svc.getRequestedAttributes().stream()
                    .map(attr -> this.useFriendlyName ? attr.getFriendlyName() : attr.getName())
                    .collect(Collectors.toList()))
                .flatMap(List::stream)
                .sorted()
                .distinct()
                .collect(Collectors.toList()))
            .orElseGet(ArrayList::new);
    }
This is {@link MetadataRequestedAttributesAttributeReleasePolicy}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/services/MetadataRequestedAttributesAttributeReleasePolicy.java