-
Notifications
You must be signed in to change notification settings - Fork 448
Paging events not firing as expected #385
Comments
I'm losing hope as the sample ldapjs-search app doesn't appear to be able to handles paging either: node .\ldapjs-search -b "dc=mydomain,dc=com" -s "sub" -D "CN=myaccount,DC=mydomain,DC=com" -w "mypass" -i -u "ldap://server.mydomain.com" -g 200 "(samaccountname=mygroup)" member This too returns just the range 0-1499 and that's it. This happens with or without the -g (paging) option. So if the sample code can't seem to page, pretty sure I'm hosed. |
Is this project still alive? No commits since December 2015, and my report of a search result paging not functioning (even using the provided demo application) hasn't even gained a comment in 22 days. |
@sinfloodmusic, Seems that the owners doesn't care about this project anymore. About your Issue, take a look at the Issue #362. It seem you ran into the very same problem as me few months ago. |
@Xotl, Thanks. It appears that this project has been abandoned - which is a total bummer. I did run into your issue, with the documentation not matching. That burned at least an hour or two - scratching my head wondering what was going on. I did eventually resolve that, and the issue I have now (paging) is even encountered by the example code they provide, so there appears to be an underlying paging bug when it comes to "range" returns. Not insurmountable, I did find that the activedirectory library just uses some lower layer controls to get around it, but it's very hard to read. I have a workaround in the meantime, when I get time I guess I'll just do what they are doing. |
Any alternate for node-ldapjs ? |
I haven't found one - but if you do find one please post here. My workaround just shells out to powershell, runs the AD cmdlets which write to stdout, then my nodejs picks it up from there. It's quite a bit slower, but at the moment I don't need the speed that "native" will get me. That may change as my requirements change. The bummer is that sticks me to running this on a Windows box and I'd rather run this on linux. |
So first you need to use paged instead of paging in the options.
the cb basically tells it to carry on. however you need to check if cb because for the last batch there will be no cb available because it is the end and no more pages will come after that. |
@terryxsq I did not have any luck with your suggestion as cb is undefined the first time the function is called. |
I think this has been sufficiently answered. If not, feel free to re-open. |
Please include a minimal reproducible example |
Hello,
Not having any luck with the ldap paging against Active Directory. I think I've fought through the paging/paged documentation mismatch (Issue 321 appears to have been closed too soon) but can't seem to get ldapjs to fire off all of the paging events, or handle ranged/paged results correctly.
Here's my code. It works _perfectly_ when I have a group with 20 members. But if I request a group with 5200 or so members (and it should start paging) I get a single searchEntry event called with a range of data, then one "page" event (with empty results), and then an "end" event. Pages 1500-2999, 3000-4499, 4500-5200 do not appear to be coming in.
When I query a 5200 member group, I get a single searchEntry event with an object like this:
entry: {"dn":"CN=MyGroupName,DC=domain,DC=com","controls":[],"cn":"MyGroupName"
,"member":[],"member;range=0-1499":["USERDN1","USERDN2","USERDN3","USERDN4", ...... ]}
It's a ranged object so assuming there's some paging to be done... But the next event to fire is the page event, which seems to have empty data, then the "end" event and it's all done.
Can someone point out what I'm doing wrong here? I see that the activedirectory library, which leverages ldapjs, is able to handle paged results, but looks like it's doing this at a lower-layer and using a PagedResultControl rather than depending on these "page" events.
I can't find any examples in this repo or the interwebs that has working paging code, I'm assuming I'm doing something wrong, but I've tried "paging" and "paged" and it's just not working.
Thanks for having a look!
The text was updated successfully, but these errors were encountered: