@Override
    protected Map<String, List<Object>> getAttributesForSamlRegisteredService(
        final Map<String, List<Object>> attributes,
        final SamlRegisteredServiceCachingMetadataResolver resolver,
        final SamlRegisteredServiceMetadataAdaptor facade,
        final EntityDescriptor entityDescriptor,
        final RegisteredServiceAttributeReleasePolicyContext context) {
        val releaseAttributes = new HashMap<String, List<Object>>();
        getSamlAuthnRequest(context).ifPresent(authnRequest -> {
            if (authnRequest.getExtensions() != null) {
                authnRequest.getExtensions().getUnknownXMLObjects()
                    .stream()
                    .filter(RequestedAttribute.class::isInstance)
                    .map(RequestedAttribute.class::cast)
                    .filter(attr -> {
                        val name = this.useFriendlyName ? attr.getFriendlyName() : attr.getName();
                        LOGGER.debug("Checking for requested attribute [{}] in metadata for [{}]", name, context.getRegisteredService().getName());
                        return attributes.containsKey(name);
                    })
                    .forEach(attr -> {
                        val name = this.useFriendlyName ? attr.getFriendlyName() : attr.getName();
                        LOGGER.debug("Found requested attribute [{}] in metadata for [{}]", name, context.getRegisteredService().getName());
                        releaseAttributes.put(name, attributes.get(name));
                    });
            }
        });
        return authorizeReleaseOfAllowedAttributes(context, releaseAttributes);
    }
This is {@link AuthnRequestRequestedAttributesAttributeReleasePolicy}.

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