shaozi / ldap-authentication

🔐🔐🔐 A simple Nodejs Async LDAP authentication library
BSD 2-Clause "Simplified" License
109 stars 28 forks source link

thumbnailPhoto #36

Closed SoloEgo closed 2 years ago

SoloEgo commented 2 years ago

Hi, ive tried to get user thumbnailPhoto, but in response i get "����\x00\x10JFIF\x00\x01\x01\x01\x00\x00\x00\x00��\...", its a bit weird... How i can get base64 string or somthig like this?

shaozi commented 2 years ago

It probably is a binary string. you can try btoa(s)

fabiang commented 2 years ago

thumbnailPhoto is binary, so a simple base64encode() should be enough. Note that those thumbnails are usually stored as JPEG (image/jpeg), but I would recommend using an MIME library to get the correct MIME type for the binary string.

SoloEgo commented 2 years ago

Yep, added check attribute in function in index.js and it work properly, many thanks