Comments (3)
You stated in your report that the modify request works with a standard LDAP server implementation, but fails to work with a non-standard LDAP server implementation. Please consult with the maintainers of the non-standard LDAP server implementation about why their server does not follow the specifications.
from node-ldapjs.
But it is strange, if I use ldapjs 2.3.3 with this code it works great with Microsoft Active Directory (Server 2019 objectversion 88) to add and delete members even if the groupname includes non ascii characters.
const mod: ldap.Attribute = { 'member', ['cn=Turanga Leela,ou=people,dc=planetexpress,dc=com'] }
const change = new ldap.Change({
operation: 'add',
modification: mod
});
// const mod: ldap.Attribute = {'member', ['cn=Turanga Leela,ou=people,dc=planetexpress,dc=com'] }
// const change = new ldap.Change({
// operation: 'delete',
// modification: mod
// });
client.modify('cn=möte,ou=people,dc=planetexpress,dc=com', change, (err) => {
console.log("Finnished", err)
});
If I try to run the same code with ldapjs 3.0.5 it fails with error "modification must be an Attribute".
If I change the code to
const mod: ldap.Attribute = { type : 'member', values : ['cn=Turanga Leela,ou=people,dc=planetexpress,dc=com'] }
const mod: ldap.Attribute = { type : 'member', values : ['cn=Turanga Leela,ou=people,dc=planetexpress,dc=com'] }
const change = new ldap.Change({
operation: 'add',
modification: mod
});
// const mod: ldap.Attribute = { type : 'member', values : ['cn=Turanga Leela,ou=people,dc=planetexpress,dc=com'] }
// const change = new ldap.Change({
// operation: 'delete',
// modification: mod
// });
client.modify('cn=möte,ou=people,dc=planetexpress,dc=com', change, (err) => {
console.log("Finnished", err)
});
I am back to the error that the object is not found if the groupname includes an non ascii character (but it works fine if the groupname contains only ascii characters).
from node-ldapjs.
if I use ldapjs 2.3.3 with this code it works great with Microsoft Active Directory (Server 2019 objectversion 88) to add and delete members even if the groupname includes non ascii characters
It's likely that 2.3.3 is sending UTF-8 characters unencoded. I would start by inspecting the messages sent "across the wire" with Wireshark to verify that this is true. If it is true, I point you to #860 (comment):
DN strings are defined by rfc-editor.org/rfc/rfc4514. Specifically rfc-editor.org/rfc/rfc4514#section-2.3 links to rfc-editor.org/rfc/rfc4512 to explain how AttributeType and AttributeValue strings can be represented. The relevant section is rfc-editor.org/rfc/rfc4512#section-2.5. Specifically, this section defines the components as being oids, which are defined in rfc-editor.org/rfc/rfc4512#section-1.4 as:
oid = descr / numericoid
descr = keystring
keystring = leadkeychar *keychar
leadkeychar = ALPHA
keychar = ALPHA / DIGIT / HYPHEN
ALPHA = %x41-5A / %x61-7A ; "A"-"Z" / "a"-"z"
DIGIT = %x30 / LDIGIT ; "0"-"9"
HYPHEN = %x2D ; hyphen ("-")In short: the LDAP spec only allows for ASCII characters in DN strings. You may need to use a numericoid.
Further, https://www.rfc-editor.org/rfc/rfc4514#section-3 denotes the set of character code sequences that must be escaped via the SUTF1
definition.
const mod: ldap.Attribute = { 'member', ['cn=Turanga Leela,ou=people,dc=planetexpress,dc=com'] }
This is not valid JavaScript. You are missing the property names in the object. Your change "works" because you have added those property names, thus fixing the syntax error.
from node-ldapjs.
Related Issues (20)
- Unable to match DN in [email protected] version HOT 4
- replace operation --> modification must be an Attribute HOT 1
- ldapmodify works, but ldapjs client.modify() does't work as expected and return No Such Object HOT 5
- Unable to use attributes: 'member;range=0-1499' in ldapjs search HOT 3
- Support for SyncRequestControl HOT 1
- Not able to set password after user created HOT 3
- LDAP search return empty array for every subsequent search after the first search. HOT 1
- VError: Parser error for undefined:undefined: options.value must be a Buffer or Object HOT 18
- Support unicode DN HOT 8
- How can I obtain information indicating "Password Expired"? HOT 1
- Obtaining search entry attribute value by key HOT 1
- Invalidate Error
- 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
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.