@ConditionalOnMissingBean(name = "mongoDbSamlMetadataResolverTemplate")
    @Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public MongoOperations mongoDbSamlMetadataResolverTemplate(
        final CasConfigurationProperties casProperties,
        @Qualifier(CasSSLContext.BEAN_NAME)
        final CasSSLContext casSslContext) {
        val mongo = casProperties.getAuthn().getSamlIdp().getMetadata().getMongo();
        val factory = new MongoDbConnectionFactory(casSslContext.getSslContext());
        val mongoTemplate = factory.buildMongoTemplate(mongo);
        MongoDbConnectionFactory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
        return mongoTemplate;
    }
This is {@link SamlIdPMongoDbIdPMetadataConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-saml-idp-metadata-mongo/src/main/java/org/apereo/cas/config/SamlIdPMongoDbRegisteredServiceMetadataConfiguration.java