RocketChat / Rocket.Chat.js.SDK

Utility for apps and bots to interact with Rocket.Chat via DDP and/or API
MIT License
136 stars 94 forks source link

Login with LDAP unavailable #20

Open waglik opened 6 years ago

waglik commented 6 years ago

Hi

When I try to log in with ldap flag set to true app crashes :

const { driver } = require('@rocket.chat/sdk');

  const runbot = async () => {

    const conn = await driver.connect( { host: HOST, useSsl: SSL})

    myuserid = await driver.login({username: USER, password: PASS, ldap:true});

fails with error message :

(node:7576) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: exports.asteroid.loginWithLDAP is not a function

timkinnane commented 6 years ago

I've just pushed an update that ignores the LDAP settings. This isn't a fix that allows logging in with LDAP, but it at least prevents throwing due to the missing method call.

Here's what need to happen to resolve this.

  1. need a way to test instances with LDAP logins
  2. either change login credentials or add a new method to login with LDAP when ROCKETCHAT_AUTH=ldap
  3. add unit tests for LDAP login, using utils to somehow enable LDAP login in the local instance before + disable after

Would love to do more but my afternoon got chewed up by other bugs thrown from core changes.

@joserenan - can you consider this in your DDP updates. Does your replacement do anything to allow logging in with LDAP?

timkinnane commented 6 years ago

Update on this issue. The "TypeError" is resolved because the LDAP login logic has been removed for now (it never would have worked anyway).

I tried setting up a local LDAP server with ldapjs, to be used by unit tests attempting to pass whatever attributes are required in the ddp login method for ldap.

Unfortunately I don't know enough about the LDAP login requirements to either A) setup the LDAP server appropriately, B) configure Rocket.Chat to work with it, or C) define the methods to use it in the SDK.

If anyone actually implementing LDAP can find out some or all of those answers, please comment.

waglik commented 4 years ago

Hi. Is there an update on this? Any chance it will work in the future?