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;
}
use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class MongoDbWebAuthnConfiguration method mongoWebAuthnTemplate.
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@Bean
public MongoOperations mongoWebAuthnTemplate(final CasConfigurationProperties casProperties, @Qualifier(CasSSLContext.BEAN_NAME) final CasSSLContext casSslContext) {
val mongo = casProperties.getAuthn().getMfa().getWebAuthn().getMongo();
val factory = new MongoDbConnectionFactory(casSslContext.getSslContext());
val mongoTemplate = factory.buildMongoTemplate(mongo);
MongoDbConnectionFactory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
return mongoTemplate;
}
use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class U2FMongoDbConfiguration method u2fDeviceRepository.
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public U2FDeviceRepository u2fDeviceRepository(final CasConfigurationProperties casProperties, @Qualifier("u2fRegistrationRecordCipherExecutor") final CipherExecutor u2fRegistrationRecordCipherExecutor, @Qualifier(CasSSLContext.BEAN_NAME) final CasSSLContext casSslContext) {
val u2f = casProperties.getAuthn().getMfa().getU2f();
val factory = new MongoDbConnectionFactory(casSslContext.getSslContext());
val mongoProps = u2f.getMongo();
val mongoTemplate = factory.buildMongoTemplate(mongoProps);
MongoDbConnectionFactory.createCollection(mongoTemplate, mongoProps.getCollection(), mongoProps.isDropCollection());
final LoadingCache<String, String> requestStorage = Caffeine.newBuilder().expireAfterWrite(u2f.getCore().getExpireRegistrations(), u2f.getCore().getExpireRegistrationsTimeUnit()).build(key -> StringUtils.EMPTY);
return new U2FMongoDbDeviceRepository(requestStorage, mongoTemplate, u2fRegistrationRecordCipherExecutor, casProperties);
}
use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class CasConsentMongoDbConfiguration method consentRepository.
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public ConsentRepository consentRepository(final CasConfigurationProperties casProperties, @Qualifier(CasSSLContext.BEAN_NAME) final CasSSLContext casSslContext) {
val mongo = casProperties.getConsent().getMongo();
val factory = new MongoDbConnectionFactory(casSslContext.getSslContext());
val mongoTemplate = factory.buildMongoTemplate(mongo);
MongoDbConnectionFactory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
return new MongoDbConsentRepository(mongoTemplate, mongo.getCollection());
}
use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class MongoDbPasswordlessAuthenticationConfiguration method mongoDbPasswordlessAuthenticationTemplate.
@ConditionalOnMissingBean(name = "mongoDbPasswordlessAuthenticationTemplate")
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public MongoOperations mongoDbPasswordlessAuthenticationTemplate(final CasConfigurationProperties casProperties, @Qualifier(CasSSLContext.BEAN_NAME) final CasSSLContext casSslContext) {
val mongo = casProperties.getAuthn().getPasswordless().getAccounts().getMongo();
val factory = new MongoDbConnectionFactory(casSslContext.getSslContext());
val mongoTemplate = factory.buildMongoTemplate(mongo);
MongoDbConnectionFactory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
return mongoTemplate;
}
Aggregations