Search in sources :

Example 1 with LdapConfigurationLookup

use of org.gluu.oxtrust.util.LdapConfigurationLookup in project oxTrust by GluuFederation.

the class LdapConfigurationService method oxIDPAuthConfs.

private List<OxIDPAuthConf> oxIDPAuthConfs(List<GluuLdapConfiguration> ldapConfigurations) {
    final LdapConfigurationLookup ldapConfigurationLookup = new LdapConfigurationLookup(findLdapConfigurations());
    List<OxIDPAuthConf> idpConf = new ArrayList<OxIDPAuthConf>();
    for (GluuLdapConfiguration ldapConfig : ldapConfigurations) {
        if (ldapConfigurationLookup.shouldEncryptPassword(ldapConfig)) {
            ldapConfig.setBindPassword(encrypt(ldapConfig.getBindPassword()));
        }
        if (ldapConfig.isUseAnonymousBind()) {
            ldapConfig.setBindDN(null);
        }
        OxIDPAuthConf ldapConfigIdpAuthConf = new OxIDPAuthConf();
        ldapConfig.updateStringsLists();
        ldapConfigIdpAuthConf.setType(AUTH);
        ldapConfigIdpAuthConf.setVersion(ldapConfigIdpAuthConf.getVersion() + 1);
        ldapConfigIdpAuthConf.setName(ldapConfig.getConfigId());
        ldapConfigIdpAuthConf.setEnabled(ldapConfig.isEnabled());
        ldapConfigIdpAuthConf.setConfig(ldapConfig);
        idpConf.add(ldapConfigIdpAuthConf);
    }
    return idpConf;
}
Also used : ArrayList(java.util.ArrayList) OxIDPAuthConf(org.gluu.oxtrust.model.OxIDPAuthConf) GluuLdapConfiguration(org.gluu.model.ldap.GluuLdapConfiguration) LdapConfigurationLookup(org.gluu.oxtrust.util.LdapConfigurationLookup)

Aggregations

ArrayList (java.util.ArrayList)1 GluuLdapConfiguration (org.gluu.model.ldap.GluuLdapConfiguration)1 OxIDPAuthConf (org.gluu.oxtrust.model.OxIDPAuthConf)1 LdapConfigurationLookup (org.gluu.oxtrust.util.LdapConfigurationLookup)1