vesse / node-ldapauth-fork

Simple node.js module to authenticate against an LDAP server
Other
127 stars 79 forks source link

includeRaw removed in v6.0.0 #108

Closed RedShift1 closed 5 months ago

RedShift1 commented 5 months ago

The includeRaw option has been removed in v6.0.0 (commit: https://github.com/vesse/node-ldapauth-fork/commit/101ffc421d5a1e36a11d1ef77c86cb3fe78e5988#diff-39a396f1208eb7b4c5c5d47a20f51bebc2d07a5a44b0bedfb4215c16d2eb93ec) and thus it's now impossible to get the binary data (for example objectGUID). Can the function be restored?

vesse commented 5 months ago

Yes that was due to it being removed from the underlying ldapjs library. I have no access to binary serving LDAP server so cannot really guess how it should be done, but https://github.com/ldapjs/node-ldapjs/releases/tag/v3.0.0 release notes "Known Breaking Changes" section has a comment related to how binaries should be fetched.

PR is welcome if getting binary attributes is something that needs to be fixed for this library.

RedShift1 commented 5 months ago

Ah I see, I got it to work again by appending ;binary to the searchAttributes, like so now:

searchAttributes: ['mail', 'displayName', 'objectGUID;binary']

The search result object then contains a base64 encoded objectGUID;binary attribute.