Comments (13)
Howdy,
Yeah, this was already on my list. Generally binary attributes are annotated by name as foo;binary. I was thinking of at least solving that and returning a buffer - would that work?
from node-ldapjs.
I don't think the AD binary attributes follow a naming convention. For example, logonHours and objectGUID are both binary attributes.
So, I think the solution would have to work for all attributes.
from node-ldapjs.
Ok, I'll think about it some and work something in; like I said, it was already on the list.
from node-ldapjs.
Hi Nathan,
If you git pull the latest changes, anything touching an Attribute
now has the following semantics:
- vals is actually an overload. Everything internally is kept as a
Buffer
- If the attribute name ends in
;binary
, then vals will return an array of base64 encoded strings, otherwise, it's the "old" behavior, of being handed as utf8 - If, like AD, you have things like
objectGUID
that are actually binary, but not tagged with a';binary
, you can now access.buffers
as opposed to.vals
and get an array of raw nodeBuffer
objects. The length and order will be the same as.vals
.
I think that should cover everything you need. Before I go publish - let me know if that covers (ideally, if you can test it that would rock :) ).
m
from node-ldapjs.
Great, it looks like receiving binary attributes is working now in my tests.
It still seems to convert them to strings when I try to send them in a response, though.
-Nathan
-----Original Message-----
From: Mark Cavage [mailto:[email protected]]
Sent: Tuesday, October 11, 2011 4:02 PM
To: Rogers, Nathan
Subject: Re: [node-ldapjs] support binary attribute values (#21)
Hi Nathan,
If you git pull the latest changes, anything touching an Attribute
now has the following semantics:
- vals is actually an overload. Everything internally is kept as a
Buffer
- If the attribute name ends in
;binary
, then vals will return an array of base64 encoded strings, otherwise, it's the "old" behavior, of being handed as utf8 - If, like AD, you have things like
objectGUID
that are actually binary, but not tagged with a';binary
, you can now access.buffers
as opposed to.vals
and get an array of raw nodeBuffer
objects. The length and order will be the same as.vals
.
I think that should cover everything you need. Before I go publish - let me know if that covers (ideally, if you can test it that would rock :) ).
m
Reply to this email directly or view it on GitHub:
#21 (comment)
from node-ldapjs.
D'oh! I fixed everything except .toBer(), which was still writing them as a string. Try again :)
from node-ldapjs.
Thanks, that looks good to me.
from node-ldapjs.
Great. in npm as 0.2
from node-ldapjs.
Has anyone managed to get it working with AD? like jpegPhoto attribute?
from node-ldapjs.
Hey. I was struggling with this exact same thing and still can't quite figure it out. Specifically, I want to get objectGUID as a string, but it keeps coming all weird like. I'm not totally sure how to access the .buffer
or .vals
properties you mention above. I'm accessing everything in my search callback like entry.object.objectGUID
and I see there is entry.attributes
array which also contains all the attributes and their buffers, but is the only way to access them looping through that array and stopping at the item with the "type" key that matches the attribute I am looking for?
Thanks for any help.
from node-ldapjs.
Something like entry.raw.objectGUID
might work.
from node-ldapjs.
@gdw2 is correct, the entry.raw
getter allows access to buffer objects which should fit your need.
from node-ldapjs.
It seems AD needs objectGUID encoded in binary when using in a filter. We are currently explicitly converting the guid from string to binary for this, but would like to remove this if its not necessary. Any suggestions?
from node-ldapjs.
Related Issues (20)
- Whitespace in (old) parseFilter causes `Uncaught Error: missing paren`
- Module build failed: UnhandledSchemeError: Reading from "node:util" is not handled by plugins (Unhandled scheme). HOT 4
- SASL / GSSAPI support HOT 3
- Open ssl issue with node 18 HOT 1
- Compatibility Issue Between ldapjs Library and FreeRADIUS HOT 1
- Edited: Ldapjs doesn't work after next.js build HOT 5
- Sharing unescape DN code for helper method
- (node:536) [LDAP_MESSAGE_DEP_001] LdapjsMessageWarning: messageID is deprecated. Use messageId instead. HOT 1
- Missing LDAP Result Codes in errors.js HOT 1
- AttributeFilter not implemented on Server? HOT 3
- What is Naming Violation Error HOT 1
- LDAPJS Server: when searching, I need to request in lowercase attributes in order to get mixed-case attributes HOT 1
- Assistance Needed with LDAPS Connection to Windows Server 2012 R2 AD HOT 2
- TLS 1.3 not supported
- Why does the bind method call fail without throwing exception information? HOT 1
- Parse Error
- Get IP of a request
- problems changing passwords HOT 2
- Problem binding to active directory special characters HOT 1
- res.on("searchEntry") in next.js after build does not return data. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-ldapjs.