private static List<EntityDescriptor> determineEntityDescriptors(final SAML2Client saml2Client) {
        return FunctionUtils.doUnchecked(() -> {
            val idpMetadataResolver = saml2Client.getIdentityProviderMetadataResolver();
            val metadataResolver = idpMetadataResolver.resolve();
            val providers = metadataResolver.resolve(new CriteriaSet(new EntityRoleCriterion(IDPSSODescriptor.DEFAULT_ELEMENT_NAME)));
            if (Iterables.size(providers) == 1
                && idpMetadataResolver.getEntityDescriptorElement() instanceof final EntityDescriptor entityDescriptor) {
                return List.of(entityDescriptor);
            }
            return List.of(Iterables.toArray(providers, EntityDescriptor.class));
        });
    }
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