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;
}
Aggregations