Search in sources :

Example 26 with RefreshScope

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

the class CasSecurityContextConfiguration method requiresAuthenticationStatusAdminEndpointsInterceptor.

@RefreshScope
@Bean
public SecurityInterceptor requiresAuthenticationStatusAdminEndpointsInterceptor() {
    final Config cfg = config();
    if (cfg.getClients() == null) {
        return requiresAuthenticationStatusInterceptor();
    }
    final CasAdminPagesSecurityInterceptor interceptor = new CasAdminPagesSecurityInterceptor(cfg, CAS_CLIENT_NAME, "securityHeaders,csrfToken,".concat(getAuthorizerName()));
    return interceptor;
}
Also used : Config(org.pac4j.core.config.Config) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 27 with RefreshScope

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

the class CasWebflowContextConfiguration method builder.

@RefreshScope
@Bean
public FlowBuilderServices builder() {
    final FlowBuilderServicesBuilder builder = new FlowBuilderServicesBuilder(this.applicationContext);
    builder.setViewFactoryCreator(viewFactoryCreator());
    builder.setExpressionParser(expressionParser());
    builder.setDevelopmentMode(casProperties.getWebflow().isRefresh());
    return builder.build();
}
Also used : FlowBuilderServicesBuilder(org.springframework.webflow.config.FlowBuilderServicesBuilder) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) CipherBean(org.cryptacular.bean.CipherBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 28 with RefreshScope

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

the class CasWebflowContextConfiguration method logoutFlowExecutor.

@RefreshScope
@Bean
public FlowExecutor logoutFlowExecutor() {
    final FlowExecutorBuilder builder = new FlowExecutorBuilder(logoutFlowRegistry(), this.applicationContext);
    builder.setAlwaysRedirectOnPause(casProperties.getWebflow().isAlwaysPauseRedirect());
    builder.setRedirectInSameState(casProperties.getWebflow().isRedirectSameState());
    return builder.build();
}
Also used : FlowExecutorBuilder(org.springframework.webflow.config.FlowExecutorBuilder) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) CipherBean(org.cryptacular.bean.CipherBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 29 with RefreshScope

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

the class OpenIdConfiguration method serverManager.

@RefreshScope
@Bean
public ServerManager serverManager() {
    final ServerManager manager = new ServerManager();
    manager.setOPEndpointUrl(casProperties.getServer().getLoginUrl());
    manager.setEnforceRpId(casProperties.getAuthn().getOpenid().isEnforceRpId());
    manager.setSharedAssociations(new InMemoryServerAssociationStore());
    LOGGER.info("Creating openid server manager with OP endpoint [{}]", casProperties.getServer().getLoginUrl());
    return manager;
}
Also used : ServerManager(org.openid4java.server.ServerManager) InMemoryServerAssociationStore(org.openid4java.server.InMemoryServerAssociationStore) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 30 with RefreshScope

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

the class CasRestAuthenticationConfiguration method restAuthenticationHandler.

@Bean
@RefreshScope
public AuthenticationHandler restAuthenticationHandler() {
    final RestAuthenticationProperties rest = casProperties.getAuthn().getRest();
    final RestAuthenticationHandler r = new RestAuthenticationHandler(rest.getName(), restAuthenticationApi());
    r.setPasswordEncoder(Beans.newPasswordEncoder(rest.getPasswordEncoder()));
    return r;
}
Also used : RestAuthenticationHandler(org.apereo.cas.adaptors.rest.RestAuthenticationHandler) RestAuthenticationProperties(org.apereo.cas.configuration.model.support.rest.RestAuthenticationProperties) 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)97 Bean (org.springframework.context.annotation.Bean)97 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)68 STSPropertiesMBean (org.apache.cxf.sts.STSPropertiesMBean)11 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)11 ArrayList (java.util.ArrayList)10 Autowired (org.springframework.beans.factory.annotation.Autowired)6 CipherBean (org.cryptacular.bean.CipherBean)5 MultifactorAuthenticationProperties (org.apereo.cas.configuration.model.support.mfa.MultifactorAuthenticationProperties)4 SpnegoProperties (org.apereo.cas.configuration.model.support.spnego.SpnegoProperties)4 WsFederationProperties (org.apereo.cas.configuration.model.support.wsfed.WsFederationProperties)4 X509Properties (org.apereo.cas.configuration.model.support.x509.X509Properties)4 IPersonAttributeDao (org.apereo.services.persondir.IPersonAttributeDao)4 HashMap (java.util.HashMap)3 List (java.util.List)3 Properties (java.util.Properties)3 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)3 ConnectionFactory (org.ldaptive.ConnectionFactory)3 EnableConfigurationProperties (org.springframework.boot.context.properties.EnableConfigurationProperties)3 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)3