use of org.gluu.site.ldap.LDAPConnectionProvider 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));
}
use of org.gluu.site.ldap.LDAPConnectionProvider in project oxCore by GluuFederation.
the class LdapSampleEntryManager method createLdapEntryManager.
public LdapEntryManager createLdapEntryManager() {
Properties connectionProperties = getSampleConnectionProperties();
LDAPConnectionProvider connectionProvider = createConnectionProvider(connectionProperties);
Properties bindConnectionProperties = prepareBindConnectionProperties(connectionProperties);
LDAPConnectionProvider bindConnectionProvider = createBindConnectionProvider(bindConnectionProperties, connectionProperties);
LdapEntryManager ldapEntryManager = new LdapEntryManager(new OperationsFacade(connectionProvider, bindConnectionProvider));
log.debug("Created LdapEntryManager: " + ldapEntryManager);
return ldapEntryManager;
}
use of org.gluu.site.ldap.LDAPConnectionProvider in project oxTrust by GluuFederation.
the class CacheRefreshTimer method prepareLdapServerConnection.
private LdapServerConnection prepareLdapServerConnection(CacheRefreshConfiguration cacheRefreshConfiguration, GluuLdapConfiguration ldapConfiguration, boolean useLocalConnection) {
String ldapConfig = ldapConfiguration.getConfigId();
if (useLocalConnection) {
return new LdapServerConnection(ldapConfig, ldapEntryManager, getBaseDNs(ldapConfiguration));
}
Properties ldapProperties = toLdapProperties(ldapConfiguration);
LDAPConnectionProvider ldapConnectionProvider = new LDAPConnectionProvider(encryptionService.decryptProperties(ldapProperties));
if (!ldapConnectionProvider.isConnected()) {
log.error("Failed to connect to LDAP server using configuration {}", ldapConfig);
return null;
}
return new LdapServerConnection(ldapConfig, ldapConnectionProvider, getBaseDNs(ldapConfiguration));
}
Aggregations