Skip to content
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

getGroupMembershipForUser callbacks twice on authentication error #216

Open
AlejandroAbad opened this issue Jan 21, 2020 · 0 comments
Open

Comments

@AlejandroAbad
Copy link

Hello,

When calling getGroupMembershipForUser with bad user credentials, I'm getting the callback called twice. Using "activedirectory": "^0.7.2",. Code to reproduce:

const bunyan = require('bunyan')
const ActiveDirectory = require('activedirectory');

const config = {
    url: 'ldap://s2012ad1.domain.es',
    baseDN: 'DC=domain,DC=es',
    username: '[email protected]',
    password: 'ThaPassw',
    log: bunyan.createLogger({name: 'ad-test', level: 'trace'})
}

const ad = new ActiveDirectory(config);
ad.getGroupMembershipForUser(config.username, function (err, groups) {
    console.log('CALLBACK !!!')
});

The output is:

{"name":"ad-test","hostname":"CPD25","pid":10644,"clazz":"Client","ldap_id":"1__ldap://s2012ad1.hefame.es","level":10,"msg":"sending request {\"messageID\":1,\"protocolOp\":\"BindRequest\",\"version\":3,\"name\":\"[email protected]\",\"authenticationType\":\"Simple\",\"credentials\":\"ThaPassw\",\"controls\":[]}","time":"2020-01-21T09:42:49.460Z","v":0}
{"name":"ad-test","hostname":"CPD25","pid":10644,"clazz":"Client","level":10,"msg":"data event: <Buffer 30 84 00 00 00 68 02 01 01 61 84 00 00 00 5f 0a 01 31 04 00 04 58 38 30 30 39 30 33 30 38 3a 20 4c 64 61 70 45 72 72 3a 20 44 53 49 44 2d 30 43 30 39 ... >","time":"2020-01-21T09:42:49.465Z","v":0}
{"name":"ad-test","hostname":"CPD25","pid":10644,"clazz":"Client","level":10,"msg":"parse: data=<Buffer 0a 01 31 04 00 04 58 38 30 30 39 30 33 30 38 3a 20 4c 64 61 70 45 72 72 3a 20 44 53 49 44 2d 30 43 30 39 30 34 32 46 2c 20 63 6f 6d 6d 65 6e 74 3a 20 ... >","time":"2020-01-21T09:42:49.474Z","v":0}
{"name":"ad-test","hostname":"CPD25","pid":10644,"clazz":"Client","level":10,"msg":"Parsing done: {\"messageID\":1,\"protocolOp\":\"LDAPResult\",\"status\":49,\"matchedDN\":\"\",\"errorMessage\":\"80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 52e, v2580\\u0000\",\"referrals\":[],\"controls\":[]}","time":"2020-01-21T09:42:49.475Z","v":0}
{"name":"ad-test","hostname":"CPD25","pid":10644,"clazz":"Client","ldap_id":"1__ldap://s2012ad1.hefame.es","level":10,"msg":"response received","time":"2020-01-21T09:42:49.476Z","v":0}
CALLBACK !!!
{"name":"ad-test","hostname":"CPD25","pid":10644,"clazz":"Client","ldap_id":"1__ldap://s2012ad1.hefame.es","level":20,"msg":"failed to connect after 1 attempts","time":"2020-01-21T09:42:49.487Z","v":0}
CALLBACK !!!

Right now, I'm calling ad.authenticate before calling getGroupMembershipForUser.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant