use of net.phonefactor.pfsdk.PFAuth in project cas by apereo.
the class AzureAuthenticatorAuthenticationEventExecutionPlanConfiguration method azureAuthenticatorInstance.
@Bean
public PFAuth azureAuthenticatorInstance() {
try {
final MultifactorAuthenticationProperties.Azure 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;
} catch (final Exception e) {
throw new BeanCreationException(e.getMessage(), e);
}
}
Aggregations