vt-middleware / ldaptive

A simple, extensible Java API for interacting with LDAP servers
56 stars 26 forks source link

Not all user attributes are returned #195

Closed alexantonica closed 3 years ago

alexantonica commented 3 years ago

I'm trying to retrieve all user attributes regardless of them being populated or not in the AD. From what i can see it should return all of them ,which are around 50+ but i'm only getting around 20.

            SearchRequest searchReq = new SearchRequest();
            searchReq.setSearchEntryHandlers(new ObjectSidHandler(), new ObjectGuidHandler());
            searchReq.setBaseDn(ldapConfiguration.getBaseDN());
            searchReq.setSearchFilter(new SearchFilter("(objectClass=user)"));
            searchReq.setReturnAttributes(ReturnAttributes.ALL.value());
            Response<SearchResult> searchResultResponse = searchOp.execute(searchReq);

I'm using 1.2.4 version

Am i missing something?

dfish3r commented 3 years ago

You may need to bind as a certain principal in order to read all those attributes. Are you configuring a BindConnectionInitializer?

alexantonica commented 3 years ago

You may need to bind as a certain principal in order to read all those attributes. Are you configuring a BindConnectionInitializer?

Hi @dfish3r thank you for the reply. Yes, i'm using the BindConnectionInitializer with admin credentials

dfish3r commented 3 years ago

You may want to put the org.ldaptive.provider package in TRACE to confirm what results are coming back from the directory.

If you could post the results of the same search using ldapsearch to confirm which attributes are coming back, that would also be helpful.

dfish3r commented 3 years ago

Any update on this issue?

alexantonica commented 3 years ago

Sorry didn't have time to try what you suggested.Please give ma a couple more days.

dfish3r commented 3 years ago

Closing this for now. Feel free to reopen when you have time to investigate.