Apoc.load.ldap queries from the root of the domain


(Paul Drangeid) #1

When using apoc.load.ldap It is unable to query from the top-level domain.

For example, I have a query to return OU container objects:

call apoc.load.ldap({ldapHost:'edc-dc3.mydomain.com',loginDN:'cn=queryuser,cn=Users,DC=mydomain,DC=com',loginPW:'password'},
{searchBase:'dc=mydomain,dc=com',searchScope:'SCOPE_SUB',
attributes:['cn','description','name'],searchFilter:'(&(objectCategory=organizationalUnit))'})
yield entry

This will return the following error:
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedureapoc.load.ldap: Caused by: java.lang.RuntimeException: Error getting next ldap entry null

However if I select a down-level OU as the searchBase it works fine:
searchBase:'ou=someou,dc=mydomain,dc=com'

This behavior happens with any ldap queries (users, contacts, groups, OUs etc). Am I doing something wrong with the syntax, or is this a limitation of apoc.load.ldap? I thought I'd post here first before posting a bug report, as I tend to be making a habit of screwing up syntax lately! ;)