etyp / meteor-accounts-ldap

A Meteor package for logging in and creating users with LDAP credentials
MIT License
39 stars 23 forks source link

server crashes with NoSuchObjectError #20

Open jedwards1211 opened 8 years ago

jedwards1211 commented 8 years ago

I just added typ:accounts-ldap today. Obviously I must have misconfigured something, but it shouldn't ever crash the server:

W20160626-14:13:47.015(-5)? (STDERR) 
W20160626-14:13:47.016(-5)? (STDERR) /Users/andy/.meteor/packages/typ_ldapjs/.0.7.3.15oxhc9++os+web.browser+web.cordova/npm/node_modules/ldapjs/lib/client/client.js:867
W20160626-14:13:47.016(-5)? (STDERR)           return _done('error', errors.getError(msg));
W20160626-14:13:47.016(-5)? (STDERR)                                        ^
W20160626-14:13:47.016(-5)? (STDERR) NoSuchObjectError: No Such Object
W20160626-14:13:47.016(-5)? (STDERR)     at messageCallback (/Users/andy/.meteor/packages/typ_ldapjs/.0.7.3.15oxhc9++os+web.browser+web.cordova/npm/node_modules/ldapjs/lib/client/client.js:867:40)
W20160626-14:13:47.016(-5)? (STDERR)     at Parser.onMessage (/Users/andy/.meteor/packages/typ_ldapjs/.0.7.3.15oxhc9++os+web.browser+web.cordova/npm/node_modules/ldapjs/lib/client/client.js:199:12)
W20160626-14:13:47.017(-5)? (STDERR)     at Parser.emit (events.js:95:17)
W20160626-14:13:47.017(-5)? (STDERR)     at Parser.write (/Users/andy/.meteor/packages/typ_ldapjs/.0.7.3.15oxhc9++os+web.browser+web.cordova/npm/node_modules/ldapjs/lib/messages/parser.js:105:8)
W20160626-14:13:47.017(-5)? (STDERR)     at Socket.onData (/Users/andy/.meteor/packages/typ_ldapjs/.0.7.3.15oxhc9++os+web.browser+web.cordova/npm/node_modules/ldapjs/lib/client/client.js:155:24)
W20160626-14:13:47.017(-5)? (STDERR)     at Socket.emit (events.js:95:17)
W20160626-14:13:47.017(-5)? (STDERR)     at Socket.<anonymous> (_stream_readable.js:765:14)
W20160626-14:13:47.018(-5)? (STDERR)     at Socket.emit (events.js:92:17)
W20160626-14:13:47.018(-5)? (STDERR)     at emitReadable_ (_stream_readable.js:427:10)
W20160626-14:13:47.018(-5)? (STDERR)     at emitReadable (_stream_readable.js:423:5)
=> Exited with code: 1

In my server bootstrap:

LDAP_DEFAULTS.url = process.env.LDAP_URL
console.log('LDAP_DEFAULTS.url: ', LDAP_DEFAULTS.url)
LDAP_DEFAULTS.port = process.env.LDAP_PORT || 389
LDAP_DEFAULTS.searchResultsProfileMap = [
  {
    resultKey: 'cn',
    profileProperty: 'name'
  }, {
    resultKey: 'tn',
    profileProperty: 'phoneNumber'
  }
]
LDAP_DEFAULTS.base = process.env.LDAP_BASE

Client login code:

  Meteor.loginWithLDAP(
    username, password,
    {
      dn: "uid=" + username + ",ou=users,dc=REDACTED,dc=REDACTED",
      search: "(objectclass=*)"
    },
    callback
  )