コード例 #1
0
  private GluuLdapConfiguration fixLdapConfiguration(GluuLdapConfiguration ldapConfig) {
    ldapConfig.updateStringsLists();
    if (ldapConfig.isUseAnonymousBind()) {
      ldapConfig.setBindDN(null);
    }

    return ldapConfig;
  }
コード例 #2
0
  private boolean validateList(
      GluuLdapConfiguration ldapConfig, String configType, boolean validateBaseDNs) {
    boolean result = true;
    if (ldapConfig.getServers().size() == 0) {
      log.error(
          "{0} LDAP configuration '{1}' should contains at least one server",
          configType, ldapConfig.getConfigId());
      facesMessages.add(
          Severity.ERROR,
          "{0} LDAP configuration '{1}' should contains at least one server",
          configType,
          ldapConfig.getConfigId());
      result = false;
    }

    if (validateBaseDNs && (ldapConfig.getBaseDNs().size() == 0)) {
      log.error(
          "{0} LDAP configuration '{1}' should contains at least one Base DN",
          configType, ldapConfig.getConfigId());
      facesMessages.add(
          Severity.ERROR,
          "{0} LDAP configuration '{1}' should contains at least one Base DN",
          configType,
          ldapConfig.getConfigId());
      result = false;
    }

    return result;
  }
コード例 #3
0
 @Override
 public void addLdapConfig(List<GluuLdapConfiguration> ldapConfigList) {
   GluuLdapConfiguration ldapConfiguration = new GluuLdapConfiguration();
   ldapConfiguration.setBindPassword("");
   ldapConfigList.add(ldapConfiguration);
 }