@Override
    protected List<String> determineRequestedAttributeDefinitions(final RegisteredServiceAttributeReleasePolicyContext context) {
        val definitions = new ArrayList<String>();
        getSamlAuthnRequest(context).ifPresent(authnRequest -> {
            if (authnRequest.getExtensions() != null) {
                authnRequest.getExtensions().getUnknownXMLObjects()
                    .stream()
                    .filter(RequestedAttribute.class::isInstance)
                    .map(RequestedAttribute.class::cast)
                    .forEach(attr -> {
                        val name = this.useFriendlyName ? attr.getFriendlyName() : attr.getName();
                        LOGGER.debug("Found requested attribute [{}] in metadata for [{}]", name, context.getRegisteredService().getName());
                        definitions.add(name);
                    });
            }
        });
        return definitions;
    }
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