use of org.xdi.util.properties.FileConfiguration in project oxAuth by GluuFederation.
the class ConfigurationFactory method loadCryptoConfigurationSalt.
public void loadCryptoConfigurationSalt() {
try {
FileConfiguration cryptoConfiguration = createFileConfiguration(saltFilePath, true);
this.cryptoConfigurationSalt = cryptoConfiguration.getString("encodeSalt");
} catch (Exception ex) {
log.error("Failed to load configuration from {}", ex, saltFilePath);
throw new ConfigurationException("Failed to load configuration from " + saltFilePath, ex);
}
}
use of org.xdi.util.properties.FileConfiguration in project oxTrust by GluuFederation.
the class ManagePersonAuthenticationAction method testLdapConnection.
public String testLdapConnection() {
try {
FileConfiguration configuration = new FileConfiguration(ConfigurationFactory.LDAP_PROPERTIES_FILE);
if (!configuration.isLoaded()) {
configuration = new FileConfiguration(ConfigurationFactory.LDAP_DEFAULT_PROPERTIES_FILE);
}
Properties properties = configuration.getProperties();
properties.setProperty("bindDN", this.ldapConfig.getBindDN());
properties.setProperty("bindPassword", this.ldapConfig.getBindPassword());
properties.setProperty("servers", buildServersString(this.ldapConfig.getServers()));
properties.setProperty("useSSL", Boolean.toString(this.ldapConfig.isUseSSL()));
LDAPConnectionProvider connectionProvider = new LDAPConnectionProvider(PropertiesDecrypter.decryptProperties(properties, configurationFactory.getCryptoConfigurationSalt()));
if (connectionProvider.isConnected()) {
connectionProvider.closeConnectionPool();
return OxTrustConstants.RESULT_SUCCESS;
}
connectionProvider.closeConnectionPool();
return OxTrustConstants.RESULT_FAILURE;
} catch (Exception ex) {
log.error("Could not connect to LDAP", ex);
return OxTrustConstants.RESULT_FAILURE;
}
}
use of org.xdi.util.properties.FileConfiguration in project oxTrust by GluuFederation.
the class Configuration method loadLdapConfiguration.
private FileConfiguration loadLdapConfiguration() {
String ldapConfigurationFileName = getLdapConfigurationFileName();
FileConfiguration fileConfiguration = loadLdapConfiguration(ldapConfigurationFileName, false);
if (fileConfiguration == null) {
ldapConfigurationFileName = getDefaultLdapConfigurationFileName();
fileConfiguration = loadLdapConfiguration(ldapConfigurationFileName, true);
}
return fileConfiguration;
}
use of org.xdi.util.properties.FileConfiguration in project oxTrust by GluuFederation.
the class PassportService method getConfigurationDn.
private String getConfigurationDn() {
FileConfiguration fc = configurationFactory.getLdapConfiguration();
String configurationDn = fc.getString("oxpassport_ConfigurationEntryDN");
return configurationDn;
}
use of org.xdi.util.properties.FileConfiguration in project oxAuth by GluuFederation.
the class Manual method init.
@BeforeClass
public void init() {
final FileConfiguration fileConfiguration = new FileConfiguration(LDAP_FILE_PATH);
final Properties props = PropertiesDecrypter.decryptProperties(fileConfiguration.getProperties(), "passoword");
final LDAPConnectionProvider connectionProvider = new LDAPConnectionProvider(props);
MANAGER = new LdapEntryManager(new OperationsFacade(connectionProvider));
}
Aggregations