Search in sources :

Example 86 with RefreshScope

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

the class CoreWsSecuritySecurityTokenServiceConfiguration method transportService.

@RefreshScope
@Bean
public StaticService transportService() {
    final StaticService s = new StaticService();
    s.setEndpoints(CollectionUtils.wrap(".*"));
    return s;
}
Also used : StaticService(org.apache.cxf.sts.service.StaticService) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) STSPropertiesMBean(org.apache.cxf.sts.STSPropertiesMBean) ServletRegistrationBean(org.springframework.boot.web.servlet.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 87 with RefreshScope

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

the class CoreWsSecuritySecurityTokenServiceConfiguration method transportSTSProperties.

@RefreshScope
@ConditionalOnMissingBean(name = "transportSTSProperties")
@Bean
public STSPropertiesMBean transportSTSProperties() {
    final WsFederationProperties.SecurityTokenService wsfed = casProperties.getAuthn().getWsfedIdp().getSts();
    final WsFederationProperties.IdentityProvider idp = casProperties.getAuthn().getWsfedIdp().getIdp();
    final StaticSTSProperties s = new StaticSTSProperties();
    s.setIssuer(getClass().getSimpleName());
    s.setRealmParser(new UriRealmParser(realms()));
    s.setSignatureCryptoProperties(CryptoUtils.getSecurityProperties(wsfed.getSigningKeystoreFile(), wsfed.getSigningKeystorePassword()));
    s.setEncryptionCryptoProperties(CryptoUtils.getSecurityProperties(wsfed.getEncryptionKeystoreFile(), wsfed.getEncryptionKeystorePassword()));
    final Relationship rel = new Relationship();
    rel.setType(Relationship.FED_TYPE_IDENTITY);
    rel.setSourceRealm(idp.getRealmName());
    rel.setTargetRealm(idp.getRealmName());
    s.setRelationships(CollectionUtils.wrap(rel));
    return s;
}
Also used : WsFederationProperties(org.apereo.cas.configuration.model.support.wsfed.WsFederationProperties) Relationship(org.apache.cxf.sts.token.realm.Relationship) UriRealmParser(org.apereo.cas.support.realm.UriRealmParser) StaticSTSProperties(org.apache.cxf.sts.StaticSTSProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) STSPropertiesMBean(org.apache.cxf.sts.STSPropertiesMBean) ServletRegistrationBean(org.springframework.boot.web.servlet.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 88 with RefreshScope

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

the class WsFederationAuthenticationConfiguration method wsFederationHelper.

@Bean
@RefreshScope
public WsFederationHelper wsFederationHelper() {
    final WsFederationHelper h = new WsFederationHelper();
    h.setConfigBean(this.configBean);
    return h;
}
Also used : WsFederationHelper(org.apereo.cas.support.wsfederation.WsFederationHelper) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) OpenSamlConfigBean(org.apereo.cas.support.saml.OpenSamlConfigBean) Bean(org.springframework.context.annotation.Bean)

Example 89 with RefreshScope

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

the class WsFedAuthenticationEventExecutionPlanConfiguration method wsFedConfig.

@Bean
@RefreshScope
public WsFederationConfiguration wsFedConfig() {
    final WsFederationConfiguration config = new WsFederationConfiguration();
    final WsFederationDelegationProperties wsfed = casProperties.getAuthn().getWsfed();
    config.setAttributesType(WsFederationConfiguration.WsFedPrincipalResolutionAttributesType.valueOf(wsfed.getAttributesType()));
    config.setIdentityAttribute(wsfed.getIdentityAttribute());
    config.setIdentityProviderIdentifier(wsfed.getIdentityProviderIdentifier());
    config.setIdentityProviderUrl(wsfed.getIdentityProviderUrl());
    config.setTolerance(wsfed.getTolerance());
    config.setRelyingPartyIdentifier(wsfed.getRelyingPartyIdentifier());
    org.springframework.util.StringUtils.commaDelimitedListToSet(wsfed.getSigningCertificateResources()).forEach(s -> config.getSigningCertificateResources().add(this.resourceLoader.getResource(s)));
    org.springframework.util.StringUtils.commaDelimitedListToSet(wsfed.getEncryptionPrivateKey()).forEach(s -> config.setEncryptionPrivateKey(this.resourceLoader.getResource(s)));
    org.springframework.util.StringUtils.commaDelimitedListToSet(wsfed.getEncryptionCertificate()).forEach(s -> config.setEncryptionCertificate(this.resourceLoader.getResource(s)));
    config.setEncryptionPrivateKeyPassword(wsfed.getEncryptionPrivateKeyPassword());
    config.setAttributeMutator(this.attributeMutator);
    return config;
}
Also used : WsFederationDelegationProperties(org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties) WsFederationConfiguration(org.apereo.cas.support.wsfederation.WsFederationConfiguration) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 90 with RefreshScope

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

the class ElectronicFenceConfiguration method multifactorAuthenticationContingencyPlan.

@ConditionalOnMissingBean(name = "multifactorAuthenticationContingencyPlan")
@Bean
@RefreshScope
public AuthenticationRiskContingencyPlan multifactorAuthenticationContingencyPlan() {
    final MultifactorAuthenticationContingencyPlan b = new MultifactorAuthenticationContingencyPlan();
    configureContingencyPlan(b);
    return b;
}
Also used : MultifactorAuthenticationContingencyPlan(org.apereo.cas.impl.plans.MultifactorAuthenticationContingencyPlan) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) 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