public Set<SamlIdentityProviderEntity> resolveEntities(final HttpServletRequest request, final HttpServletResponse response) {
        val finalEntities = new LinkedHashSet<>(identityProviderEntities);

        if (identityProviders != null) {
            val context = new JEEContext(request, response);
            val allClients = identityProviders.findAllClients(context);
            finalEntities.addAll(allClients
                .stream()
                .filter(SAML2Client.class::isInstance)
                .map(SAML2Client.class::cast)
                .map(SamlIdentityProviderEntityParser::fromClient)
                .map(parser -> parser.resolveEntities(request, response))
                .flatMap(Set::stream)
                .collect(Collectors.toSet()));
        }
        return finalEntities;
    }
Resolve entities set.

@param request  the request
@param response the response
@return the set
support/cas-server-support-saml-idp-discovery/src/main/java/org/apereo/cas/entity/SamlIdentityProviderEntityParser.java