use of org.apereo.cas.configuration.model.support.mfa.AzureMultifactorProperties in project cas by apereo.
the class AzureAuthenticatorAuthenticationEventExecutionPlanConfiguration method azureAuthenticatorAuthenticationProvider.
@Bean
@RefreshScope
public MultifactorAuthenticationProvider azureAuthenticatorAuthenticationProvider() {
final AzureMultifactorProperties 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.apereo.cas.configuration.model.support.mfa.AzureMultifactorProperties in project cas by apereo.
the class AzureAuthenticatorAuthenticationEventExecutionPlanConfiguration method azureAuthenticatorInstance.
@Bean
@SneakyThrows
public PFAuth azureAuthenticatorInstance() {
final AzureMultifactorProperties azure = casProperties.getAuthn().getMfa().getAzure();
final File cfg = new File(azure.getConfigDir());
if (!cfg.exists() || !cfg.isDirectory()) {
throw new FileNotFoundException(cfg.getAbsolutePath() + " does not exist or is not a directory");
}
final PFAuth pf = new PFAuth();
pf.setDebug(true);
pf.setAllowInternationalCalls(azure.isAllowInternationalCalls());
final String dir = StringUtils.appendIfMissing(azure.getConfigDir(), "/");
pf.initialize(dir, azure.getPrivateKeyPassword());
return pf;
}
Aggregations