public static SamlIdentityProviderEntityParser fromClient(final SAML2Client client) {
        LOGGER.trace("Initializing SAML2 identity provider [{}]", client.getName());
        client.init();
        val entities = determineEntityDescriptors(client)
            .stream()
            .filter(EntityDescriptor::isValid)
            .map(entityDescriptor -> {
                val entity = new SamlIdentityProviderEntity();
                entity.setEntityID(entityDescriptor.getEntityID());

                val idpSSODescriptor = entityDescriptor.getIDPSSODescriptor(SAMLConstants.SAML20P_NS);
                Optional.ofNullable(idpSSODescriptor)
                    .map(IDPSSODescriptor::getExtensions)
                    .map(ext -> ext.getUnknownXMLObjects(UIInfo.DEFAULT_ELEMENT_NAME))
                    .stream()
                    .flatMap(List::stream)
                    .map(UIInfo.class::cast)
                    .forEach(uiInfo -> {
                        uiInfo.getDisplayNames().forEach(value ->
                            entity.getDisplayNames().add(SamlIdentityProviderBasicEntity.builder().lang(value.getXMLLang()).value(value.getValue()).build()));
                        uiInfo.getDescriptions().forEach(value ->
                            entity.getDescriptions().add(SamlIdentityProviderBasicEntity.builder().lang(value.getXMLLang()).value(value.getValue()).build()));
                        uiInfo.getKeywords().forEach(value ->
                            entity.getKeywords().add(SamlIdentityProviderBasicEntity.builder().lang(value.getXMLLang())
                                .value(org.springframework.util.StringUtils.collectionToCommaDelimitedString(value.getKeywords())).build()));
                        uiInfo.getInformationURLs().forEach(value ->
                            entity.getInformationUrls().add(SamlIdentityProviderBasicEntity.builder().lang(value.getXMLLang()).value(value.getURI()).build()));
                        uiInfo.getPrivacyStatementURLs().forEach(value ->
                            entity.getPrivacyStatementUrls().add(SamlIdentityProviderBasicEntity.builder().lang(value.getXMLLang()).value(value.getURI()).build()));
                        uiInfo.getLogos().forEach(value ->
                            entity.getLogos().add(SamlIdentityProviderLogoEntity.builder().lang(value.getXMLLang())
                                .value(value.getURI()).width(value.getWidth()).height(value.getHeight()).build()));
                    });

                if (entity.getDisplayNames().isEmpty()) {
                    val clientDisplayName = client.getCustomProperties().containsKey(ClientCustomPropertyConstants.CLIENT_CUSTOM_PROPERTY_DISPLAY_NAME)
                        ? client.getCustomProperties().get(ClientCustomPropertyConstants.CLIENT_CUSTOM_PROPERTY_DISPLAY_NAME).toString()
                        : client.getName();
                    entity.getDisplayNames().add(SamlIdentityProviderBasicEntity.builder()
                        .lang(Locale.ENGLISH.toLanguageTag()).value(clientDisplayName).build());
                }
                LOGGER.trace("Found SAML2 identity provider [{}]", entity);
                return entity;
            })
            .toList();

        return new SamlIdentityProviderEntityParser(entities);
    }
Import from saml identity provider.

@param client the client
@return the saml identity provider entity parser
support/cas-server-support-saml-idp-discovery/src/main/java/org/apereo/cas/entity/SamlIdentityProviderEntityParser.java