Search in sources :

Example 1 with LdapConnectionService

use of org.xdi.service.ldap.LdapConnectionService in project oxAuth by GluuFederation.

the class AppInitializer method createBindConnectionProvider.

private LdapConnectionService createBindConnectionProvider(Properties bindConnectionProperties, Properties connectionProperties) {
    LdapConnectionService bindConnectionProvider = createConnectionProvider(bindConnectionProperties);
    if (ResultCode.INAPPROPRIATE_AUTHENTICATION.equals(bindConnectionProvider.getCreationResultCode())) {
        log.warn("It's not possible to create authentication LDAP connection pool using anonymous bind. Attempting to create it using binDN/bindPassword");
        bindConnectionProvider = createConnectionProvider(connectionProperties);
    }
    return bindConnectionProvider;
}
Also used : LdapConnectionService(org.xdi.service.ldap.LdapConnectionService)

Example 2 with LdapConnectionService

use of org.xdi.service.ldap.LdapConnectionService in project oxTrust by GluuFederation.

the class AppInitializer method createConnectionProvider.

private LdapConnectionService createConnectionProvider(Properties connectionProperties) {
    EncryptionService securityService = encryptionServiceInstance.get();
    LdapConnectionService connectionProvider = new LdapConnectionService(securityService.decryptProperties(connectionProperties));
    return connectionProvider;
}
Also used : LdapConnectionService(org.xdi.service.ldap.LdapConnectionService)

Example 3 with LdapConnectionService

use of org.xdi.service.ldap.LdapConnectionService in project oxAuth by GluuFederation.

the class AppInitializer method createConnectionProvider.

private LdapConnectionService createConnectionProvider(Properties connectionProperties) {
    EncryptionService securityService = encryptionServiceInstance.get();
    LdapConnectionService connectionProvider = new LdapConnectionService(securityService.decryptProperties(connectionProperties));
    return connectionProvider;
}
Also used : LdapConnectionService(org.xdi.service.ldap.LdapConnectionService)

Example 4 with LdapConnectionService

use of org.xdi.service.ldap.LdapConnectionService 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);
}
Also used : ArrayList(java.util.ArrayList) LdapConnectionService(org.xdi.service.ldap.LdapConnectionService) GluuLdapConfiguration(org.xdi.model.ldap.GluuLdapConfiguration)

Example 5 with LdapConnectionService

use of org.xdi.service.ldap.LdapConnectionService in project oxAuth by GluuFederation.

the class AppInitializer method createAuthConnectionProviders.

public LdapConnectionProviders createAuthConnectionProviders(GluuLdapConfiguration ldapAuthConfig) {
    Properties connectionProperties = prepareAuthConnectionProperties(ldapAuthConfig);
    LdapConnectionService connectionProvider = createConnectionProvider(connectionProperties);
    Properties bindConnectionProperties = prepareBindConnectionProperties(connectionProperties);
    LdapConnectionService bindConnectionProvider = createBindConnectionProvider(bindConnectionProperties, connectionProperties);
    return new LdapConnectionProviders(connectionProvider, bindConnectionProvider);
}
Also used : LdapConnectionService(org.xdi.service.ldap.LdapConnectionService) Properties(java.util.Properties)

Aggregations

LdapConnectionService (org.xdi.service.ldap.LdapConnectionService)5 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 GluuLdapConfiguration (org.xdi.model.ldap.GluuLdapConfiguration)1