Arnold Oscar
Arnold Oscar

Reputation: 9

Unable to fetch search results from OpenLdap

I am trying to fetch all results from OpenLDAP for the below search query, but I get zero results.

My Java and Spring Boot code:

LdapQuery query = query().base("cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org")
    .where("objectClass").is("\*");
    
List<String> results = ldapTemplate.search(query, (Attributes attrs) -> attrs.toString());

Below I have posted the screenshot of my OpenLDAP structure:

OpenLdap Screenshot

I have tried many different combinations for fetching results, but none have returned any results.

Posted below are some of the queries that I have tried:

.base("cn=Devices,cn=DICOM Configuration")

or

.base("cn=Devices")

When I try the below query, it throws an error "No Such Object":

.base("dc=dcm4che,dc=org") 

As per the screenshot, "dc=dcm4che,dc=org" is the base, and the above query should work.

Upvotes: 0

Views: 41

Answers (0)

Related Questions