use of org.apereo.cas.consent.MongoDbConsentRepository in project cas by apereo.
the class CasConsentMongoDbConfiguration method consentRepository.
@Bean
public ConsentRepository consentRepository() {
final ConsentProperties.MongoDb mongo = casProperties.getConsent().getMongo();
final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
final MongoTemplate mongoTemplate = factory.buildMongoTemplate(mongo);
factory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
return new MongoDbConsentRepository(mongoTemplate, mongo.getCollection());
}
Aggregations