use of org.xdi.model.ldap.GluuLdapConfiguration in project oxAuth by GluuFederation.
the class AppInitializer method loadLdapAuthConfigs.
private List<GluuLdapConfiguration> loadLdapAuthConfigs(LdapEntryManager localLdapEntryManager) {
List<GluuLdapConfiguration> ldapAuthConfigs = new ArrayList<GluuLdapConfiguration>();
List<oxIDPAuthConf> ldapIdpAuthConfigs = loadLdapIdpAuthConfigs(localLdapEntryManager);
if (ldapIdpAuthConfigs == null) {
return ldapAuthConfigs;
}
for (oxIDPAuthConf ldapIdpAuthConfig : ldapIdpAuthConfigs) {
GluuLdapConfiguration ldapAuthConfig = loadLdapAuthConfig(ldapIdpAuthConfig);
if ((ldapAuthConfig != null) && ldapAuthConfig.isEnabled()) {
ldapAuthConfigs.add(ldapAuthConfig);
}
}
return ldapAuthConfigs;
}
use of org.xdi.model.ldap.GluuLdapConfiguration in project oxTrust by GluuFederation.
the class ConfigureCacheRefreshAction method validateLists.
private boolean validateLists() {
boolean result = true;
for (GluuLdapConfiguration sourceConfig : this.cacheRefreshConfiguration.getSourceConfigs()) {
result &= validateList(sourceConfig, "Source", true);
}
result &= validateList(this.cacheRefreshConfiguration.getInumConfig(), "Inum", true);
if (CacheRefreshUpdateMethod.VDS.equals(cacheRefreshConfiguration.getUpdateMethod())) {
result &= validateList(this.cacheRefreshConfiguration.getTargetConfig(), "Target", false);
}
result &= validateList(this.cacheRefreshConfiguration.getKeyAttributes(), "Key attribute");
result &= validateList(this.cacheRefreshConfiguration.getKeyObjectClasses(), "Object class");
result &= validateList(this.cacheRefreshConfiguration.getSourceAttributes(), "Source attribute");
return result;
}
use of org.xdi.model.ldap.GluuLdapConfiguration in project oxAuth by GluuFederation.
the class AppInitializer method createAuthConnectionProviders.
private void createAuthConnectionProviders(List<GluuLdapConfiguration> newLdapAuthConfigs) {
// Backup current references to objects to allow shutdown properly
List<GluuLdapConfiguration> oldLdapAuthConfigs = ldapAuthConfigInstance.get();
List<LdapConnectionService> tmpAuthConnectionProviders = new ArrayList<LdapConnectionService>();
List<LdapConnectionService> tmpAuthBindConnectionProviders = new ArrayList<LdapConnectionService>();
// Prepare connection providers per LDAP authentication configuration
for (GluuLdapConfiguration ldapAuthConfig : newLdapAuthConfigs) {
LdapConnectionProviders ldapConnectionProviders = createAuthConnectionProviders(ldapAuthConfig);
tmpAuthConnectionProviders.add(ldapConnectionProviders.getConnectionProvider());
tmpAuthBindConnectionProviders.add(ldapConnectionProviders.getConnectionBindProvider());
}
this.ldapAuthConfigs = newLdapAuthConfigs;
this.authConnectionProviders = tmpAuthConnectionProviders;
this.authBindConnectionProviders = tmpAuthBindConnectionProviders;
ldapAuthConfigInstance.destroy(oldLdapAuthConfigs);
}
use of org.xdi.model.ldap.GluuLdapConfiguration in project oxAuth by GluuFederation.
the class AppInitializer method reloadConfiguration.
private void reloadConfiguration() {
LdapEntryManager localLdapEntryManager = ldapEntryManagerInstance.get();
log.trace("Attempting to use {}: {}", LDAP_ENTRY_MANAGER_NAME, localLdapEntryManager.getLdapOperationService());
List<GluuLdapConfiguration> newLdapAuthConfigs = loadLdapAuthConfigs(localLdapEntryManager);
if (!this.ldapAuthConfigs.equals(newLdapAuthConfigs)) {
recreateLdapAuthEntryManagers(newLdapAuthConfigs);
event.select(ReloadAuthScript.Literal.INSTANCE).fire(ExternalAuthenticationService.MODIFIED_INTERNAL_TYPES_EVENT_TYPE);
setDefaultAuthenticationMethod(localLdapEntryManager);
}
}
use of org.xdi.model.ldap.GluuLdapConfiguration in project oxTrust by GluuFederation.
the class ManagePersonAuthenticationAction method updateAuthConf.
public boolean updateAuthConf(GluuAppliance appliance) {
try {
String configId = null;
List<OxIDPAuthConf> idpConf = new ArrayList<OxIDPAuthConf>();
for (GluuLdapConfiguration ldapConfig : this.sourceConfigs) {
if (idpConf.isEmpty()) {
configId = ldapConfig.getConfigId();
}
if (ldapConfig.isUseAnonymousBind()) {
ldapConfig.setBindDN(null);
}
OxIDPAuthConf ldapConfigIdpAuthConf = new OxIDPAuthConf();
ldapConfig.setConfigId(configId);
ldapConfig.updateStringsLists();
ldapConfigIdpAuthConf.setType("auth");
ldapConfigIdpAuthConf.setVersion(ldapConfigIdpAuthConf.getVersion() + 1);
ldapConfigIdpAuthConf.setName(configId);
ldapConfigIdpAuthConf.setEnabled(ldapConfig.isEnabled());
ldapConfigIdpAuthConf.setConfig(objectToJson(ldapConfig));
idpConf.add(ldapConfigIdpAuthConf);
}
appliance.setOxIDPAuthentication(idpConf);
} catch (Exception ex) {
log.error("An Error occured ", ex);
return false;
}
return true;
}
Aggregations