use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class ElectronicFenceWebflowConfiguration method riskAwareAuthenticationWebflowEventResolver.
@ConditionalOnMissingBean(name = "riskAwareAuthenticationWebflowEventResolver")
@Bean
@Autowired
@RefreshScope
public CasWebflowEventResolver riskAwareAuthenticationWebflowEventResolver(@Qualifier("defaultAuthenticationSystemSupport") final AuthenticationSystemSupport authenticationSystemSupport) {
final CasWebflowEventResolver r = new RiskAwareAuthenticationWebflowEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator, authenticationRequestServiceSelectionStrategies, multifactorAuthenticationProviderSelector, authenticationRiskEvaluator, authenticationRiskMitigator, casProperties);
this.initialAuthenticationAttemptWebflowEventResolver.addDelegate(r, 0);
return r;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class CasCoreWebConfiguration method messageSource.
@RefreshScope
@Bean
public HierarchicalMessageSource messageSource(@Qualifier("casCommonMessages") final Properties casCommonMessages) {
final CasReloadableMessageBundle bean = new CasReloadableMessageBundle();
final MessageBundleProperties mb = casProperties.getMessageBundle();
bean.setDefaultEncoding(mb.getEncoding());
bean.setCacheSeconds(mb.getCacheSeconds());
bean.setFallbackToSystemLocale(mb.isFallbackSystemLocale());
bean.setUseCodeAsDefaultMessage(mb.isUseCodeMessage());
bean.setBasenames(mb.getBaseNames().toArray(new String[] {}));
bean.setCommonMessages(casCommonMessages);
return bean;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class CasCoreWebflowConfiguration method initialAuthenticationAttemptWebflowEventResolver.
@ConditionalOnMissingBean(name = "initialAuthenticationAttemptWebflowEventResolver")
@Bean
@RefreshScope
public CasDelegatingWebflowEventResolver initialAuthenticationAttemptWebflowEventResolver() {
final InitialAuthenticationAttemptWebflowEventResolver r = new InitialAuthenticationAttemptWebflowEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator, authenticationRequestServiceSelectionStrategies, multifactorAuthenticationProviderSelector, registeredServiceAccessStrategyEnforcer);
r.addDelegate(adaptiveAuthenticationPolicyWebflowEventResolver());
r.addDelegate(timedAuthenticationPolicyWebflowEventResolver());
r.addDelegate(globalAuthenticationPolicyWebflowEventResolver());
r.addDelegate(requestParameterAuthenticationPolicyWebflowEventResolver());
r.addDelegate(requestHeaderAuthenticationPolicyWebflowEventResolver());
r.addDelegate(requestSessionAttributeAuthenticationPolicyWebflowEventResolver());
r.addDelegate(restEndpointAuthenticationPolicyWebflowEventResolver());
r.addDelegate(groovyScriptAuthenticationPolicyWebflowEventResolver());
r.addDelegate(registeredServicePrincipalAttributeAuthenticationPolicyWebflowEventResolver());
r.addDelegate(predicatedPrincipalAttributeMultifactorAuthenticationPolicyEventResolver());
r.addDelegate(principalAttributeAuthenticationPolicyWebflowEventResolver());
r.addDelegate(authenticationAttributeAuthenticationPolicyWebflowEventResolver());
r.addDelegate(registeredServiceAuthenticationPolicyWebflowEventResolver());
r.setSelectiveResolver(selectiveAuthenticationProviderWebflowEventResolver());
return r;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class CasCoreWebflowConfiguration method webflowCipherExecutor.
@Bean
@RefreshScope
public CipherExecutor webflowCipherExecutor() {
final WebflowProperties webflow = casProperties.getWebflow();
final EncryptionRandomizedSigningJwtCryptographyProperties crypto = webflow.getCrypto();
boolean enabled = crypto.isEnabled();
if (!enabled && (StringUtils.isNotBlank(crypto.getEncryption().getKey())) && StringUtils.isNotBlank(crypto.getSigning().getKey())) {
LOGGER.warn("Webflow encryption/signing is not enabled explicitly in the configuration, yet signing/encryption keys " + "are defined for operations. CAS will proceed to enable the webflow encryption/signing functionality.");
enabled = true;
}
if (enabled) {
return new WebflowConversationStateCipherExecutor(crypto.getEncryption().getKey(), crypto.getSigning().getKey(), crypto.getAlg(), crypto.getSigning().getKeySize(), crypto.getEncryption().getKeySize());
}
LOGGER.warn("Webflow encryption/signing is turned off. This " + "MAY NOT be safe in a production environment. Consider using other choices to handle encryption, " + "signing and verification of webflow state.");
return CipherExecutor.noOp();
}
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();
}
Aggregations