gheeres / node-activedirectory

ActiveDirectory is an Node.js ldapjs client for authN (authentication) and authZ (authorization) for Microsoft Active Directory with range retrieval support for large Active Directory installations.
MIT License
534 stars 146 forks source link

I seem to have issues with images #222

Open lennycode opened 4 years ago

lennycode commented 4 years ago

I'm trying to load images out of active directory. I'm comparing the images that come from other apps, which work. Seems that certain bytes are not matching up. Binary output (image works, outlook):

ÿØÿà JFIF  ` `  ÿÛ C 
byte[] arrOutput = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43 };

Octet Stream from the AD browser: 255 216 255 224 0 16 74 70 73 70 0 1 1 1 0 96 0 96 0 0 255 219 0 67

Raw Binary output from this ActiveDirectory package: (just raw data pushed to the web and saved to a file)

ad.findUser({ attributes: ['thumbnailPhoto', 'givenName', 'sn'] }, username, function (err, user) {...

ýýýý JFIF  ` `  ýý C
byte[] arrOutput = { 0xFD, 0xFD, 0xFD, 0xFD, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xFD, 0xFD, 0x00, 0x43 };
cod3master commented 2 years ago

Have the exactly the same problem, any updates?

lennycode commented 2 years ago

I had so many issues with this library that I ended up creating a .net microservice for auth and it works great. The authentication would sometimes hang with no explanation. Not worth to investigate. As a stopgap I spawned a PS shell in a catch handler, worked great, but that was a bit slow(1-2 sec). Users didn't mind but I did. Even with good escaping I still wasn't comfortable with that solution. The only thing that seemed to work well were the group lookup operations. This library is kind of tumbleweed at this point, may have worked well at one time.