private static SAML2Configuration createSaml2Configuration(final EntityDescriptor entityDescriptor,
                                                               final SAML2Configuration configuration) {
        val singleConfiguration = configuration.withMetadataGenerator(new SAML2InMemoryMetadataGenerator());
        singleConfiguration.setIdentityProviderEntityId(entityDescriptor.getEntityID());
        singleConfiguration.setIdentityProviderMetadataResolver(new SAML2DelegatingMetadataResolver(entityDescriptor));
        singleConfiguration.setCredentialProvider(configuration.getCredentialProvider());
        return singleConfiguration;
    }
This is {@link DelegatedClientSaml2Builder}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-pac4j-saml/src/main/java/org/apereo/cas/web/saml2/DelegatedClientSaml2Builder.java