use of org.xdi.ldap.model.LdapDummyEntry in project oxAuth by GluuFederation.
the class BaseAuthFilterService method loadEntryDN.
public String loadEntryDN(LdapEntryManager p_manager, AuthenticationFilterWithParameters authenticationFilterWithParameters, Map<String, String> normalizedAttributeValues) {
final String filter = buildFilter(authenticationFilterWithParameters, normalizedAttributeValues);
Filter ldapFilter;
try {
ldapFilter = Filter.create(filter);
} catch (LDAPException ex) {
log.error("Failed to create Ldap filter: '{}'", ex, filter);
return null;
}
List<LdapDummyEntry> foundEntries = p_manager.findEntries(authenticationFilterWithParameters.getAuthenticationFilter().getBaseDn(), LdapDummyEntry.class, new String[0], ldapFilter);
if (foundEntries.size() > 1) {
log.error("Found more than one entry by filter: '{}'. Entries:\n", ldapFilter, foundEntries);
return null;
}
if (!(foundEntries.size() == 1)) {
return null;
}
return foundEntries.get(0).getDn();
}
use of org.xdi.ldap.model.LdapDummyEntry in project oxAuth by GluuFederation.
the class InumGenerator method contains.
public boolean contains(String inum, IdType type) {
final String baseDn = baseDn(type);
try {
final Filter filter = Filter.create(String.format("inum=%s", inum));
final List<LdapDummyEntry> entries = ldapEntryManager.findEntries(baseDn, LdapDummyEntry.class, filter);
return entries != null && !entries.isEmpty();
} catch (LDAPException e) {
log.error(e.getMessage(), e);
}
return false;
}
Aggregations