mcavage/node-ldapjs — Issue #54: InsufficientAccessRightsError with OpenDS2.2.1
Author: jspears
Created: 2012-01-25 20:27:17+00:00
State: open

Thanks for the great library. Having an issue with InsufficientAccessRightsError. I have not tested against
a different LDAP server, but will if you think it would be helpful.

The same query from Apache Directory Studio work. I know this is not a lot to work with, but what the hey.

I am binding to an OpenDS server as "Directory Manager" which I believe is the equivalent to the cn=root

var client = ldap.createClient({
url: 'ldap://127.0.0.1:1389',
reconnect:20
})
client.bind('cn=Directory Manager', 'password', function(err) {
assert.ifError(err);
});

Search works fine but when attempting add/modify/delete I get an

InsufficientAccessRightsError: The entry cn=stuff,dc=somewhere,dc=com cannot be added due to insufficient access rights
at //node_modules/ldapjs/lib/client.js:768:24
at Parser. (///node_modules/ldapjs/lib/client.js:966:12)
at Parser.emit (events.js:67:17)
at Parser.write (/r/node_modules/ldapjs/lib/messages/parser.js:106:10)
at Socket. (/node_modules/ldapjs/lib/client.js:953:14)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:341:14)

The update looks like

client.add('cn=cname,dc=somewhere,dc=com', {
objectclass: 'inetOrgPerson',
cn: 'cname',
givenName: 'GivenName',
sn: 'Surname',
mail: 'something@donotsendmail.com',
telephoneNumber: '111-111-1111' }, function(err) {
if (err) {
console.log('error adding', err, req.body);
}
//do stuff.
});

The OpenDS log says the following..

ADD REQ conn=320 op=2 msgID=3 dn="cn=cname,dc=somewhere,dc=com"
[25/Jan/2012:13:24:46 +0000] ADD RES conn=320 op=2 msgID=3 result=50 message="The entry cn=cname,dc=somewhere,dc=com cannot be added due to insufficient access rights" etime=3
[