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 MultifactorAuthenticationProperties.Azure 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;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class CasSupportActionsAcceptableUsagePolicyLdapConfiguration method acceptableUsagePolicyRepository.
@RefreshScope
@Bean
public AcceptableUsagePolicyRepository acceptableUsagePolicyRepository() {
final AcceptableUsagePolicyProperties.Ldap ldap = casProperties.getAcceptableUsagePolicy().getLdap();
final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
final LdapAcceptableUsagePolicyRepository r = new LdapAcceptableUsagePolicyRepository(ticketRegistrySupport, connectionFactory, ldap.getUserFilter(), ldap.getBaseDn());
r.setAupAttributeName(casProperties.getAcceptableUsagePolicy().getAupAttributeName());
return r;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class DuoSecurityAuthenticationEventExecutionPlanConfiguration method duoMultifactorAuthenticationProvider.
@Bean
@RefreshScope
public VariegatedMultifactorAuthenticationProvider duoMultifactorAuthenticationProvider() {
final DefaultVariegatedMultifactorAuthenticationProvider provider = new DefaultVariegatedMultifactorAuthenticationProvider();
casProperties.getAuthn().getMfa().getDuo().stream().filter(duo -> StringUtils.isNotBlank(duo.getDuoApiHost()) && StringUtils.isNotBlank(duo.getDuoIntegrationKey()) && StringUtils.isNotBlank(duo.getDuoSecretKey()) && StringUtils.isNotBlank(duo.getDuoApplicationKey())).forEach(duo -> {
final BasicDuoAuthenticationService s = new BasicDuoAuthenticationService(duo, httpClient);
final DefaultDuoMultifactorAuthenticationProvider pWeb = new DefaultDuoMultifactorAuthenticationProvider(s);
pWeb.setGlobalFailureMode(casProperties.getAuthn().getMfa().getGlobalFailureMode());
pWeb.setBypassEvaluator(new DefaultMultifactorAuthenticationProviderBypass(duo.getBypass()));
pWeb.setOrder(duo.getRank());
pWeb.setId(duo.getId());
provider.addProvider(pWeb);
});
if (provider.getProviders().isEmpty()) {
throw new IllegalArgumentException("At least one Duo instance must be defined");
}
return provider;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class DuoSecurityAuthenticationEventExecutionPlanConfiguration method duoAuthenticationHandler.
@RefreshScope
@Bean
public AuthenticationHandler duoAuthenticationHandler() {
final DuoAuthenticationHandler h;
final List<MultifactorAuthenticationProperties.Duo> duos = casProperties.getAuthn().getMfa().getDuo();
if (!duos.isEmpty()) {
final String name = duos.get(0).getName();
if (duos.size() > 1) {
LOGGER.debug("Multiple Duo Security providers are available; Duo authentication handler is named after [{}]", name);
}
h = new DuoAuthenticationHandler(name, servicesManager, duoPrincipalFactory(), duoMultifactorAuthenticationProvider());
} else {
h = new DuoAuthenticationHandler("", servicesManager, duoPrincipalFactory(), duoMultifactorAuthenticationProvider());
throw new BeanCreationException("No configuration/settings could be found for Duo Security. Review settings and ensure the correct syntax is used");
}
return h;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class GoogleAuthenticatorAuthenticationEventExecutionPlanConfiguration method googleAuthenticatorAuthenticationProvider.
@Bean
@RefreshScope
public MultifactorAuthenticationProvider googleAuthenticatorAuthenticationProvider() {
final MultifactorAuthenticationProperties.GAuth gauth = casProperties.getAuthn().getMfa().getGauth();
final GoogleAuthenticatorMultifactorAuthenticationProvider p = new GoogleAuthenticatorMultifactorAuthenticationProvider();
p.setBypassEvaluator(googleBypassEvaluator());
p.setGlobalFailureMode(casProperties.getAuthn().getMfa().getGlobalFailureMode());
p.setOrder(gauth.getRank());
p.setId(gauth.getId());
return p;
}
Aggregations