use of org.gluu.model.custom.script.CustomScriptType in project oxAuth by GluuFederation.
the class AppInitializer method applicationInitialized.
public void applicationInitialized(@Observes @Initialized(ApplicationScoped.class) Object init) {
log.debug("Initializing application services");
configurationFactory.create();
PersistenceEntryManager localPersistenceEntryManager = persistenceEntryManagerInstance.get();
log.trace("Attempting to use {}: {}", ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME, localPersistenceEntryManager.getOperationService());
GluuConfiguration newConfiguration = loadConfiguration(localPersistenceEntryManager, "oxIDPAuthentication", "oxAuthenticationMode");
this.persistenceAuthConfigs = loadPersistenceAuthConfigs(newConfiguration);
// Initialize python interpreter
pythonService.initPythonInterpreter(configurationFactory.getBaseConfiguration().getString("pythonModulesDir", null));
// Initialize script manager
List<CustomScriptType> supportedCustomScriptTypes = Lists.newArrayList(CustomScriptType.values());
supportedCustomScriptTypes.remove(CustomScriptType.CACHE_REFRESH);
supportedCustomScriptTypes.remove(CustomScriptType.UPDATE_USER);
supportedCustomScriptTypes.remove(CustomScriptType.USER_REGISTRATION);
supportedCustomScriptTypes.remove(CustomScriptType.SCIM);
supportedCustomScriptTypes.remove(CustomScriptType.IDP);
statService.init();
// Start timer
initSchedulerService();
// Schedule timer tasks
metricService.initTimer();
configurationFactory.initTimer();
loggerService.initTimer();
ldapStatusTimer.initTimer();
cleanerTimer.initTimer();
customScriptManager.initTimer(supportedCustomScriptTypes);
keyGeneratorTimer.initTimer();
statTimer.initTimer();
expirationNotificatorTimer.initTimer();
initTimer();
initCibaRequestsProcessor();
// Set default authentication method after
setDefaultAuthenticationMethod(newConfiguration);
// Notify plugins about finish application initialization
eventApplicationInitialized.select(ApplicationInitialized.Literal.APPLICATION).fire(new ApplicationInitializedEvent());
}
use of org.gluu.model.custom.script.CustomScriptType in project oxAuth by GluuFederation.
the class ExternalAuthenticationService method getAuthModesByAcrValues.
public List<String> getAuthModesByAcrValues(List<String> acrValues) {
List<String> authModes = new ArrayList<String>();
for (String acrValue : acrValues) {
if (StringHelper.isNotEmpty(acrValue)) {
String customScriptName = StringHelper.toLowerCase(scriptName(acrValue));
if (customScriptConfigurationsNameMap.containsKey(customScriptName)) {
CustomScriptConfiguration customScriptConfiguration = customScriptConfigurationsNameMap.get(customScriptName);
CustomScript customScript = customScriptConfiguration.getCustomScript();
// Handle internal authentication method
if (customScript.isInternal()) {
authModes.add(scriptName(acrValue));
continue;
}
CustomScriptType customScriptType = customScriptConfiguration.getCustomScript().getScriptType();
BaseExternalType defaultImplementation = customScriptType.getDefaultImplementation();
BaseExternalType pythonImplementation = customScriptConfiguration.getExternalType();
if ((pythonImplementation != null) && (defaultImplementation != pythonImplementation)) {
authModes.add(scriptName(acrValue));
}
}
}
}
return authModes;
}
Aggregations