-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Protocol Error on ldap.add #105
Comments
I have the same error, trying to add a person.... i have no problem for bind, search and everything execpt adding a user with this :
Someone fix it ? or know from here the probleme become ? |
solved!, just remove the [ ] from your call to ldap.add("cn=test,ou=users,dc=exemple,dc=com", [attrs],...) and it will work. Otherwise you create a list of a list ;) |
check out the tests that comes with in the library, they are pretty helpful when someone wants to get how to use the functions. |
I get Protocol Error when I add user but successful in binding to admin. Please let me know what did I missed. Here is my code:
var LDAP = require('ldap-client');
var ldap = new LDAP({ uri: 'ldap://192.168.1.250' // optional function to call when disconnect occurs }, function(err) { ldap.bind({ binddn: 'cn=admin,dc=sample,dc=com', password: 'p1n0yak0m3' }, function(err, data){ if(err) { console.log(err); }else{ console.log("success binding"); } }); });
var attrs = [ { attr: 'gidNumber', vals: [ '501' ] }, { attr: 'objectClass', vals: [ 'posixAccount', 'top', 'inetOrgPerson' ] }, { attr: 'uidNumber', vals: [ '1000' ] }, { attr: 'userPassword', vals: [ 'password' ] }, { attr: 'homeDirectory', vals: [ '/home/fsmith' ] }, { attr: 'cn', vals: [ 'fred smith' ] }, { attr: 'sn', vals: [ 'smith' ] }, { attr: 'loginShell', vals: ['/bin/bash'] }, { attr: 'dn', vals: ['cn=fred smith,cn=Investor,ou=arcana,dc=sample,dc=com'] } ];
ldap.add('cn=fred smith,cn=Investor,ou=arcana,dc=sample,dc=com', [attrs], function(err){ if(err) { console.log(err); }else{ console.log("Success!"); } });
The text was updated successfully, but these errors were encountered: