Search in sources :

Example 1 with ClasspathResourceMetadataResolver

use of org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.ClasspathResourceMetadataResolver in project cas by apereo.

the class SamlIdPMetadataConfiguration method samlRegisteredServiceMetadataResolvers.

@ConditionalOnMissingBean(name = "samlRegisteredServiceMetadataResolvers")
@Bean
public SamlRegisteredServiceMetadataResolutionPlan samlRegisteredServiceMetadataResolvers() {
    final DefaultSamlRegisteredServiceMetadataResolutionPlan plan = new DefaultSamlRegisteredServiceMetadataResolutionPlan();
    final SamlIdPProperties samlIdp = casProperties.getAuthn().getSamlIdp();
    plan.registerMetadataResolver(new DynamicMetadataResolver(samlIdp, openSamlConfigBean, httpClient));
    plan.registerMetadataResolver(new FileSystemResourceMetadataResolver(samlIdp, openSamlConfigBean));
    plan.registerMetadataResolver(new UrlResourceMetadataResolver(samlIdp, openSamlConfigBean, httpClient));
    plan.registerMetadataResolver(new ClasspathResourceMetadataResolver(samlIdp, openSamlConfigBean));
    plan.registerMetadataResolver(new GroovyResourceMetadataResolver(samlIdp, openSamlConfigBean));
    final Map<String, SamlRegisteredServiceMetadataResolutionPlanConfigurator> configurers = this.applicationContext.getBeansOfType(SamlRegisteredServiceMetadataResolutionPlanConfigurator.class, false, true);
    configurers.values().forEach(c -> {
        final String name = StringUtils.removePattern(c.getClass().getSimpleName(), "\\$.+");
        LOGGER.debug("Configuring saml metadata resolution plan [{}]", name);
        c.configureMetadataResolutionPlan(plan);
    });
    return plan;
}
Also used : ClasspathResourceMetadataResolver(org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.ClasspathResourceMetadataResolver) GroovyResourceMetadataResolver(org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.GroovyResourceMetadataResolver) SamlIdPProperties(org.apereo.cas.configuration.model.support.saml.idp.SamlIdPProperties) UrlResourceMetadataResolver(org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.UrlResourceMetadataResolver) DefaultSamlRegisteredServiceMetadataResolutionPlan(org.apereo.cas.support.saml.services.idp.metadata.plan.DefaultSamlRegisteredServiceMetadataResolutionPlan) SamlRegisteredServiceMetadataResolutionPlanConfigurator(org.apereo.cas.support.saml.services.idp.metadata.plan.SamlRegisteredServiceMetadataResolutionPlanConfigurator) FileSystemResourceMetadataResolver(org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.FileSystemResourceMetadataResolver) DynamicMetadataResolver(org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.DynamicMetadataResolver) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) OpenSamlConfigBean(org.apereo.cas.support.saml.OpenSamlConfigBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

SamlIdPProperties (org.apereo.cas.configuration.model.support.saml.idp.SamlIdPProperties)1 OpenSamlConfigBean (org.apereo.cas.support.saml.OpenSamlConfigBean)1 ClasspathResourceMetadataResolver (org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.ClasspathResourceMetadataResolver)1 DynamicMetadataResolver (org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.DynamicMetadataResolver)1 FileSystemResourceMetadataResolver (org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.FileSystemResourceMetadataResolver)1 GroovyResourceMetadataResolver (org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.GroovyResourceMetadataResolver)1 UrlResourceMetadataResolver (org.apereo.cas.support.saml.services.idp.metadata.cache.resolver.UrlResourceMetadataResolver)1 DefaultSamlRegisteredServiceMetadataResolutionPlan (org.apereo.cas.support.saml.services.idp.metadata.plan.DefaultSamlRegisteredServiceMetadataResolutionPlan)1 SamlRegisteredServiceMetadataResolutionPlanConfigurator (org.apereo.cas.support.saml.services.idp.metadata.plan.SamlRegisteredServiceMetadataResolutionPlanConfigurator)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1