use of io.jans.as.persistence.model.configuration.GluuConfiguration in project jans by JanssenProject.
the class ApplicationFactory method getSmtpConfiguration.
@Produces
@RequestScoped
public SmtpConfiguration getSmtpConfiguration() {
GluuConfiguration configuration = configurationService.getConfiguration();
SmtpConfiguration smtpConfiguration = configuration.getSmtpConfiguration();
if (smtpConfiguration == null) {
return new SmtpConfiguration();
}
configurationService.decryptSmtpPassword(smtpConfiguration);
return smtpConfiguration;
}
use of io.jans.as.persistence.model.configuration.GluuConfiguration in project jans by JanssenProject.
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, "jansDbAuth", "jansAuthMode");
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 io.jans.as.persistence.model.configuration.GluuConfiguration in project jans by JanssenProject.
the class AppInitializer method loadConfiguration.
private GluuConfiguration loadConfiguration(PersistenceEntryManager localPersistenceEntryManager, String... persistenceReturnAttributes) {
String configurationDn = configurationFactory.getBaseDn().getConfiguration();
if (StringHelper.isEmpty(configurationDn)) {
return null;
}
GluuConfiguration configuration = null;
try {
configuration = localPersistenceEntryManager.find(configurationDn, GluuConfiguration.class, persistenceReturnAttributes);
} catch (BasePersistenceException ex) {
log.error("Failed to load global configuration entry from Ldap", ex);
return null;
}
return configuration;
}
use of io.jans.as.persistence.model.configuration.GluuConfiguration in project jans by JanssenProject.
the class AppInitializer method reloadConfiguration.
private void reloadConfiguration() {
PersistenceEntryManager localPersistenceEntryManager = persistenceEntryManagerInstance.get();
log.trace("Attempting to use {}: {}", ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME, localPersistenceEntryManager.getOperationService());
GluuConfiguration newConfiguration = loadConfiguration(localPersistenceEntryManager, "jansDbAuth", "jansAuthMode");
List<GluuLdapConfiguration> newPersistenceAuthConfigs = loadPersistenceAuthConfigs(newConfiguration);
if (!this.persistenceAuthConfigs.equals(newPersistenceAuthConfigs)) {
recreatePersistenceAuthEntryManagers(newPersistenceAuthConfigs);
this.persistenceAuthConfigs = newPersistenceAuthConfigs;
event.select(ReloadAuthScript.Literal.INSTANCE).fire(ExternalAuthenticationService.MODIFIED_INTERNAL_TYPES_EVENT_TYPE);
}
setDefaultAuthenticationMethod(newConfiguration);
}
use of io.jans.as.persistence.model.configuration.GluuConfiguration in project jans by JanssenProject.
the class LdapCustomAuthenticationConfigurationService method getCustomAuthenticationConfigurations.
public List<CustomAuthenticationConfiguration> getCustomAuthenticationConfigurations() {
GluuConfiguration gluuConfiguration = configurationService.getConfiguration();
List<IDPAuthConf> authConfigurations = gluuConfiguration.getIdpAuthn();
List<CustomAuthenticationConfiguration> customAuthenticationConfigurations = new ArrayList<CustomAuthenticationConfiguration>();
if (authConfigurations == null) {
return customAuthenticationConfigurations;
}
for (IDPAuthConf authConfiguration : authConfigurations) {
if (authConfiguration.getEnabled() && authConfiguration.getType().equalsIgnoreCase("customAuthentication")) {
CustomAuthenticationConfiguration customAuthenticationConfiguration = mapCustomAuthentication(authConfiguration);
customAuthenticationConfigurations.add(customAuthenticationConfiguration);
}
}
return customAuthenticationConfigurations;
}
Aggregations