private static List<String> determineEntityIdList(final AbstractSamlSPProperties sp,
                                                      final SamlRegisteredServiceCachingMetadataResolver resolver,
                                                      final SamlRegisteredService service) throws Exception {
        val entityIDList = sp.getEntityIds();
        if (entityIDList.isEmpty()) {

            val criteriaSet = new CriteriaSet();
            criteriaSet.add(new EntityRoleCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME));
            criteriaSet.add(new SatisfyAnyCriterion());
            val metadataResolver = resolver.resolve(service, criteriaSet).getMetadataResolver();

            val resolvers = new ArrayList<MetadataResolver>();
            if (metadataResolver instanceof final ChainingMetadataResolver instance) {
                resolvers.addAll(instance.getResolvers());
            } else {
                resolvers.add(metadataResolver);
            }

            resolvers.stream()
                .filter(AbstractBatchMetadataResolver.class::isInstance)
                .map(r -> ((Iterable<EntityDescriptor>) r).iterator())
                .map(it -> StreamSupport.stream(Spliterators.spliteratorUnknownSize(it, Spliterator.ORDERED), false)
                    .filter(e -> e.getSPSSODescriptor(SAMLConstants.SAML20P_NS) != null)
                    .findFirst())
                .forEach(descriptor -> {
                    if (descriptor.isPresent()) {
                        entityIDList.add(descriptor.get().getEntityID());
                    } else {
                        LOGGER.warn("Skipped registration of [{}] since no entity id could be found", sp.getName());
                    }
                });
        }
        return entityIDList;
    }
New saml service provider registration.
Precedence of services is lowest so generated service can be overridden by non-generated version.

@param sp       the properties
@param resolver the resolver
@return the saml registered service
@throws Exception the exception
support/cas-server-support-saml-sp-integrations/src/main/java/org/apereo/cas/util/SamlSPUtils.java