use of org.apereo.cas.configuration.model.support.saml.idp.metadata.MongoDbSamlMetadataProperties in project cas by apereo.
the class SamlIdPMongoDbMetadataConfiguration method mongoDbSamlMetadataResolverTemplate.
@ConditionalOnMissingBean(name = "mongoDbSamlMetadataResolverTemplate")
@Bean
public MongoTemplate mongoDbSamlMetadataResolverTemplate() {
final MongoDbSamlMetadataProperties mongo = casProperties.getAuthn().getSamlIdp().getMetadata().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.configuration.model.support.saml.idp.metadata.MongoDbSamlMetadataProperties in project cas by apereo.
the class MongoDbSamlRegisteredServiceMetadataResolverTests method setup.
@Before
public void setup() throws Exception {
final MongoDbSamlMetadataProperties mongo = casProperties.getAuthn().getSamlIdp().getMetadata().getMongo();
final ClassPathResource res = new ClassPathResource("sp-metadata.xml");
final SamlMetadataDocument md = new SamlMetadataDocument();
md.setName("SP");
md.setValue(IOUtils.toString(res.getInputStream(), StandardCharsets.UTF_8));
mongoDbSamlMetadataResolverTemplate.save(md, mongo.getCollection());
}
Aggregations