@Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @ConditionalOnMissingBean(name = "delegatedSaml2ClientJdbcMetadataCustomizer")
    public DelegatedClientFactoryCustomizer delegatedSaml2ClientJdbcMetadataCustomizer(
        final CasConfigurationProperties casProperties) {
        return client -> {
            if (client instanceof final SAML2Client saml2Client) {
                val configuration = saml2Client.getConfiguration();
                casProperties.getAuthn().getPac4j().getSaml()
                    .stream()
                    .map(saml -> saml.getMetadata().getServiceProvider().getJdbc())
                    .filter(saml -> StringUtils.isNotBlank(saml.getUrl()) && StringUtils.isNotBlank(saml.getTableName()))
                    .forEach(saml -> {
                        val datasource = JpaBeans.newDataSource(saml);
                        val metadataGenerator = new SAML2JdbcMetadataGenerator(new JdbcTemplate(datasource), configuration.getServiceProviderEntityId());
                        metadataGenerator.setTableName(saml.getTableName());
                        configuration.setServiceProviderMetadataResource(ResourceUtils.NULL_RESOURCE);
                        configuration.setMetadataGenerator(metadataGenerator);
                    });
            }
        };
    }
This is {@link DelegatedAuthenticationSaml2JdbcConfiguration}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-pac4j-saml/src/main/java/org/apereo/cas/config/DelegatedAuthenticationSaml2JdbcConfiguration.java