private String getAttributeFriendlyName(final SamlProfileBuilderContext context, final String name) {
        if (context.getRegisteredService().getAttributeFriendlyNames().containsKey(name)) {
            return context.getRegisteredService().getAttributeFriendlyNames().get(name);
        }
        return attributeDefinitionStore.getAttributeDefinitionsBy(SamlIdPAttributeDefinition.class)
            .filter(defn -> StringUtils.equalsIgnoreCase(name, defn.getKey())
                            || StringUtils.equalsIgnoreCase(name, defn.getName())
                            || StringUtils.equalsIgnoreCase(name, defn.getUrn()))
            .findFirst()
            .map(SamlIdPAttributeDefinition::getFriendlyName)
            .filter(StringUtils::isNotBlank)
            .stream()
            .findFirst()
            .or(() -> {
                val globalFriendlyNames = casProperties.getAuthn().getSamlIdp().getCore().getAttributeFriendlyNames();
                val friendlyNames = new HashMap<>(CollectionUtils.convertDirectedListToMap(globalFriendlyNames));
                return Optional.ofNullable(friendlyNames.get(name));
            })
            .orElse(name);
    }
This is {@link SamlProfileSamlAttributeStatementBuilder}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/attr/SamlProfileSamlAttributeStatementBuilder.java