logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: Driving me nuts Apache LDAP API: Not all attributes returned
Author
vipulpatel



Joined: 22 Jul 2015
Posts: 2

PostPosted: Thu 23 Jul '15 2:28    Post subject: Driving me nuts Apache LDAP API: Not all attributes returned Reply with quote

Hi,
I have successful connected to Microsoft active directory (over SSL) and get results in the EntryCursor object.

Most of the fields are retrieved however, certain fields/attributes are not returned in search, such as accountExpires.

I have tried specifying explicitly select few attributes in Search scope and also tried not specifying any attributes so that all fields are returned - None worked.

I have tried different APIs and the results are consistent.

Help appreciated.

Vipul
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 23 Jul '15 11:46    Post subject: Reply with quote

Do you try to write your own module? Or do you use mod_ldap?
Back to top
vipulpatel



Joined: 22 Jul 2015
Posts: 2

PostPosted: Fri 24 Jul '15 1:41    Post subject: Reply with quote

I am using my own code and here is the core part of it. Variable cursor returns most but not all attributes:
connection = new LdapNetworkConnection( "server.company.com.au", 3269,true );
connection.bind("cn=ldap_user,OU= Administrators,DC=company,DC=com,DC=au","password");
SearchScope searchScope = SearchScope.SUBTREE;
EntryCursor cursor = connection.search( "DC=company,DC=com,DC=au", "(&(objectClass=user)(sAMAccountName=testuser1))", searchScope);

while (cursor.next()) {
Entry entry = cursor.get();
sb.append(entry);
System.out.println(entry);
}


I am using Apache LDAP api:
import org.apache.directory.ldap.client.api.LdapConnection;
import org.apache.directory.ldap.client.api.LdapConnectionConfig;
import org.apache.directory.ldap.client.api.LdapNetworkConnection;
import org.apache.directory.api.ldap.model.cursor.EntryCursor;
import org.apache.directory.api.ldap.model.entry.Entry;
import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.api.ldap.model.message.SearchScope;


Thanks
Joy
Back to top
covener



Joined: 23 Nov 2008
Posts: 55

PostPosted: Fri 24 Jul '15 15:23    Post subject: Reply with quote

We really only discuss httpd and related code here, not all Apache projects.
Back to top


Reply to topic   Topic: Driving me nuts Apache LDAP API: Not all attributes returned View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner