use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class MongoDbYubiKeyConfiguration method mongoYubiKeyTemplate.
@RefreshScope
@Bean
public MongoTemplate mongoYubiKeyTemplate() {
final YubiKeyMultifactorProperties.MongoDb mongo = casProperties.getAuthn().getMfa().getYubikey().getMongo();
final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
final MongoTemplate mongoTemplate = factory.buildMongoTemplate(mongo);
factory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
return mongoTemplate;
}
Aggregations