use of org.apereo.cas.configuration.model.support.mfa.DuoSecurityMultifactorProperties in project cas by apereo.
the class DuoSecurityAuthenticationEventExecutionPlanConfiguration method duoAuthenticationHandler.
@RefreshScope
@Bean
public AuthenticationHandler duoAuthenticationHandler() {
final List<DuoSecurityMultifactorProperties> duos = casProperties.getAuthn().getMfa().getDuo();
if (duos.isEmpty()) {
throw new BeanCreationException("No configuration/settings could be found for Duo Security. Review settings and ensure the correct syntax is used");
}
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);
}
final DuoAuthenticationHandler h = new DuoAuthenticationHandler(name, servicesManager, duoPrincipalFactory(), duoMultifactorAuthenticationProvider());
return h;
}
Aggregations