Search in sources :

Example 56 with RefreshScope

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

the class CasWebflowContextConfiguration method localeChangeInterceptor.

@RefreshScope
@Bean
public LocaleChangeInterceptor localeChangeInterceptor() {
    final LocaleChangeInterceptor bean = new LocaleChangeInterceptor();
    bean.setParamName(this.casProperties.getLocale().getParamName());
    return bean;
}
Also used : LocaleChangeInterceptor(org.springframework.web.servlet.i18n.LocaleChangeInterceptor) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 57 with RefreshScope

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

the class CasWebflowContextConfiguration method logoutHandlerAdapter.

@RefreshScope
@Bean
public HandlerAdapter logoutHandlerAdapter() {
    final FlowHandlerAdapter handler = new CasFlowHandlerAdapter(CasWebflowConfigurer.FLOW_ID_LOGOUT);
    handler.setFlowExecutor(logoutFlowExecutor());
    handler.setFlowUrlHandler(logoutFlowUrlHandler());
    return handler;
}
Also used : CasFlowHandlerAdapter(org.apereo.cas.web.flow.CasFlowHandlerAdapter) FlowHandlerAdapter(org.springframework.webflow.mvc.servlet.FlowHandlerAdapter) CasFlowHandlerAdapter(org.apereo.cas.web.flow.CasFlowHandlerAdapter) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 58 with RefreshScope

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

the class CasAcceptableUsagePolicyLdapConfiguration method acceptableUsagePolicyRepository.

@RefreshScope
@Bean
public AcceptableUsagePolicyRepository acceptableUsagePolicyRepository() {
    final AcceptableUsagePolicyProperties.Ldap ldap = casProperties.getAcceptableUsagePolicy().getLdap();
    final ConnectionFactory connectionFactory = LdapUtils.newLdaptivePooledConnectionFactory(ldap);
    return new LdapAcceptableUsagePolicyRepository(ticketRegistrySupport, casProperties.getAcceptableUsagePolicy().getAupAttributeName(), connectionFactory, ldap.getSearchFilter(), ldap.getBaseDn());
}
Also used : ConnectionFactory(org.ldaptive.ConnectionFactory) LdapAcceptableUsagePolicyRepository(org.apereo.cas.aup.LdapAcceptableUsagePolicyRepository) AcceptableUsagePolicyProperties(org.apereo.cas.configuration.model.support.aup.AcceptableUsagePolicyProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 59 with RefreshScope

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

the class CasAcceptableUsagePolicyMongoDbConfiguration method mongoAcceptableUsagePolicyTemplate.

@RefreshScope
@Bean
public MongoTemplate mongoAcceptableUsagePolicyTemplate() {
    final AcceptableUsagePolicyProperties.MongoDb mongo = casProperties.getAcceptableUsagePolicy().getMongo();
    final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
    final MongoTemplate mongoTemplate = factory.buildMongoTemplate(mongo);
    factory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
    return mongoTemplate;
}
Also used : MongoDbConnectionFactory(org.apereo.cas.mongo.MongoDbConnectionFactory) MongoTemplate(org.springframework.data.mongodb.core.MongoTemplate) AcceptableUsagePolicyProperties(org.apereo.cas.configuration.model.support.aup.AcceptableUsagePolicyProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 60 with RefreshScope

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

the class AzureAuthenticatorAuthenticationEventExecutionPlanConfiguration method azureAuthenticatorAuthenticationProvider.

@Bean
@RefreshScope
public MultifactorAuthenticationProvider azureAuthenticatorAuthenticationProvider() {
    final AzureMultifactorProperties azure = casProperties.getAuthn().getMfa().getAzure();
    final AzureAuthenticatorMultifactorAuthenticationProvider p = new AzureAuthenticatorMultifactorAuthenticationProvider();
    p.setBypassEvaluator(azureBypassEvaluator());
    p.setGlobalFailureMode(casProperties.getAuthn().getMfa().getGlobalFailureMode());
    p.setOrder(azure.getRank());
    p.setId(azure.getId());
    return p;
}
Also used : AzureAuthenticatorMultifactorAuthenticationProvider(org.apereo.cas.adaptors.azure.AzureAuthenticatorMultifactorAuthenticationProvider) AzureMultifactorProperties(org.apereo.cas.configuration.model.support.mfa.AzureMultifactorProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) 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