Search in sources :

Example 41 with RefreshScope

use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.

the class SurrogateLdapAuthenticationConfiguration method surrogateAuthenticationService.

@RefreshScope
@Bean
public SurrogateAuthenticationService surrogateAuthenticationService() {
    final SurrogateAuthenticationProperties su = casProperties.getAuthn().getSurrogate();
    LOGGER.debug("Using LDAP [{}] with baseDn [{}] to locate surrogate accounts", su.getLdap().getLdapUrl(), su.getLdap().getBaseDn());
    final ConnectionFactory factory = LdapUtils.newLdaptivePooledConnectionFactory(su.getLdap());
    return new SurrogateLdapAuthenticationService(factory, su.getLdap(), servicesManager);
}
Also used : ConnectionFactory(org.ldaptive.ConnectionFactory) SurrogateAuthenticationProperties(org.apereo.cas.configuration.model.support.surrogate.SurrogateAuthenticationProperties) SurrogateLdapAuthenticationService(org.apereo.cas.authentication.surrogate.SurrogateLdapAuthenticationService) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 42 with RefreshScope

use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.

the class OidcConfiguration method oidcAuthenticationContextWebflowEventResolver.

@Autowired
@RefreshScope
@Bean
public CasWebflowEventResolver oidcAuthenticationContextWebflowEventResolver(@Qualifier("defaultAuthenticationSystemSupport") final AuthenticationSystemSupport authenticationSystemSupport) {
    final CasWebflowEventResolver r = new OidcAuthenticationContextWebflowEventEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator, authenticationRequestServiceSelectionStrategies, multifactorAuthenticationProviderSelector);
    this.initialAuthenticationAttemptWebflowEventResolver.addDelegate(r);
    return r;
}
Also used : CasWebflowEventResolver(org.apereo.cas.web.flow.resolver.CasWebflowEventResolver) OidcAuthenticationContextWebflowEventEventResolver(org.apereo.cas.oidc.web.flow.OidcAuthenticationContextWebflowEventEventResolver) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 43 with RefreshScope

use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.

the class CouchbaseServiceRegistryConfiguration method serviceRegistryCouchbaseClientFactory.

/**
 * Service registry couchbase client factory couchbase client factory.
 *
 * @return the couchbase client factory
 */
@RefreshScope
@Bean
public CouchbaseClientFactory serviceRegistryCouchbaseClientFactory() {
    final CouchbaseServiceRegistryProperties couchbase = casProperties.getServiceRegistry().getCouchbase();
    final Set<String> nodes = StringUtils.commaDelimitedListToSet(couchbase.getNodeSet());
    return new CouchbaseClientFactory(nodes, couchbase.getBucket(), couchbase.getPassword(), Beans.newDuration(couchbase.getTimeout()).toMillis(), CouchbaseServiceRegistry.UTIL_DOCUMENT, CouchbaseServiceRegistry.ALL_VIEWS);
}
Also used : CouchbaseServiceRegistryProperties(org.apereo.cas.configuration.model.support.couchbase.serviceregistry.CouchbaseServiceRegistryProperties) CouchbaseClientFactory(org.apereo.cas.couchbase.core.CouchbaseClientFactory) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 44 with RefreshScope

use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.

the class CouchbaseTicketRegistryConfiguration method ticketRegistry.

@Autowired
@RefreshScope
@Bean
public TicketRegistry ticketRegistry(@Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) {
    final CouchbaseTicketRegistryProperties couchbase = casProperties.getTicket().getRegistry().getCouchbase();
    final CouchbaseTicketRegistry c = new CouchbaseTicketRegistry(ticketCatalog, ticketRegistryCouchbaseClientFactory());
    c.setCipherExecutor(CoreTicketUtils.newTicketRegistryCipherExecutor(couchbase.getCrypto(), "couchbase"));
    return c;
}
Also used : CouchbaseTicketRegistryProperties(org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties) CouchbaseTicketRegistry(org.apereo.cas.ticket.registry.CouchbaseTicketRegistry) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean)

Example 45 with RefreshScope

use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.

the class CouchbaseTicketRegistryConfiguration method ticketRegistryCouchbaseClientFactory.

@RefreshScope
@Bean
public CouchbaseClientFactory ticketRegistryCouchbaseClientFactory() {
    final CouchbaseTicketRegistryProperties cb = casProperties.getTicket().getRegistry().getCouchbase();
    final Set<String> nodes = StringUtils.commaDelimitedListToSet(cb.getNodeSet());
    return new CouchbaseClientFactory(nodes, cb.getBucket(), cb.getPassword(), Beans.newDuration(cb.getTimeout()).toMillis(), CouchbaseTicketRegistry.UTIL_DOCUMENT, CouchbaseTicketRegistry.ALL_VIEWS);
}
Also used : CouchbaseTicketRegistryProperties(org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties) CouchbaseClientFactory(org.apereo.cas.couchbase.core.CouchbaseClientFactory) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Aggregations

RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)167 Bean (org.springframework.context.annotation.Bean)167 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)114 Autowired (org.springframework.beans.factory.annotation.Autowired)20 ArrayList (java.util.ArrayList)15 STSPropertiesMBean (org.apache.cxf.sts.STSPropertiesMBean)11 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)11 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)8 EncryptionJwtSigningJwtCryptographyProperties (org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties)8 EnableConfigurationProperties (org.springframework.boot.context.properties.EnableConfigurationProperties)8 List (java.util.List)7 SneakyThrows (lombok.SneakyThrows)7 IPersonAttributeDao (org.apereo.services.persondir.IPersonAttributeDao)7 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)7 ConnectionFactory (org.ldaptive.ConnectionFactory)6 Resource (org.springframework.core.io.Resource)5 Properties (java.util.Properties)4 GrouperPrincipalAttributesProperties (org.apereo.cas.configuration.model.core.authentication.GrouperPrincipalAttributesProperties)4 PrincipalAttributesProperties (org.apereo.cas.configuration.model.core.authentication.PrincipalAttributesProperties)4 IgniteProperties (org.apereo.cas.configuration.model.support.ignite.IgniteProperties)4