use of org.opensaml.saml.metadata.resolver.impl.ResourceBackedMetadataResolver in project cas by apereo.
the class SamlIdPConfiguration method casSamlIdPMetadataResolver.
@Bean
public MetadataResolver casSamlIdPMetadataResolver() {
try {
final SamlIdPProperties idp = casProperties.getAuthn().getSamlIdp();
final ResourceBackedMetadataResolver resolver = new ResourceBackedMetadataResolver(ResourceHelper.of(new FileSystemResource(idp.getMetadata().getMetadataFile())));
resolver.setParserPool(this.openSamlConfigBean.getParserPool());
resolver.setFailFastInitialization(idp.getMetadata().isFailFast());
resolver.setRequireValidMetadata(idp.getMetadata().isRequireValidMetadata());
resolver.setId(idp.getEntityId());
resolver.initialize();
return resolver;
} catch (final Exception e) {
throw new BeanCreationException(e.getMessage(), e);
}
}
use of org.opensaml.saml.metadata.resolver.impl.ResourceBackedMetadataResolver in project cas by apereo.
the class ChainingMetadataResolverCacheLoader method resolveFileSystemBasedMetadataResource.
private void resolveFileSystemBasedMetadataResource(final SamlRegisteredService service, final List<MetadataResolver> metadataResolvers, final AbstractResource metadataResource) throws Exception {
final File metadataFile = metadataResource.getFile();
final AbstractMetadataResolver metadataResolver;
if (metadataFile.isDirectory()) {
metadataResolver = new LocalDynamicMetadataResolver(new FilesystemLoadSaveManager<>(metadataFile, configBean.getParserPool()));
} else {
metadataResolver = new ResourceBackedMetadataResolver(ResourceHelper.of(metadataResource));
}
buildSingleMetadataResolver(metadataResolver, service);
metadataResolvers.add(metadataResolver);
}
Aggregations