if (!validationResponse.isValid()) {
throw new InvalidConfigurationException(validationResponse);
}
// its valid, now we need to deal with getting the users
LdapUserListResponse result = new LdapUserListResponse();
try {
// get the users
SortedSet<LdapUser> ldapUsers = ldapConnectionTester.testUserAndGroupMapping(
buildDefaultLdapContextFactory(ldapServer.getId(), ldapServer.getConnectionInfo()),
LdapConnectionUtils.getLdapAuthConfiguration(ldapServer),
20
);
// now add them to the result
for (LdapUser ldapUser : ldapUsers) {
result.getData().add(this.toDto(ldapUser));
}
}
catch (MalformedURLException e) {
getLogger().debug("LDAP Realm is not configured correctly: " + e.getMessage(), e);