Search & Modify with Buffer object
See original GitHub issueHi, Superb library!
Is it possible to add a ignore parsing array option on client.modify and client.search to receive the raw buffer instead of the parsed response, ( in SearchEntry.js ) as it converts everything to a string.
{ scope: 'sub', filter: '(&(sAMAccountName=someAccount))', attributes: ['thumbnailPhoto', 'dn', 'name', 'something...'], noparsing: ['thumbnailPhoto'], }
essentially im trying to get the thumbnailPhoto which is usually a binary photo and then save the photo to file, but as it is already converted to string, some characters gets mangled by the encoding and Im unable to get the correct output.
ldapjs lib has the same issue where object.entries are strings but since it pushes the full object back, the data was still accessable at object.attributes[0].buffers[0];
Buffer.from(object.attributes[0].buffers[0], 'hex').toString('binary');
not totally sure how to send a “modify” replace in binary form, clues?
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (6 by maintainers)
Top GitHub Comments
hmm, it works for me.
so for example doing a search like this with ldapts towards your Active Directory server will give me a list of all objectGUIDs for users
Then converting it to which ever format I want afterwords like this:
So if you want to only see the exact name as in your example of objectGUID you could do something like this:
In this instance the hex matches exactly the hex in Active Directory on all users if you go to the user properties --> attribute editor --> find objectGUID --> look at the hex code.
meaning it is indeed the binary response in the original response.
I can take a look at what ldapjs is doing with the
raw
property, but I won’t be able to test very well it as I don’t have a reproducible ldap server for this issue.