use of org.apereo.cas.adaptors.duo.authn.DuoAuthenticationHandler 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;
}
Aggregations