LDAP连接在osx上有效,但在ubuntu上无效

时间:2018-08-06 09:35:08

标签: javascript linux ubuntu authentication ldap

im当前正在使用ldap数据库进行网站认证。 当即时通讯使用我的Mac时,它似乎可以正常工作,并且即时获取正确的响应。 当我切换到ubuntu时,它不起作用,我只是得到了我无法连接到ldap数据库的错误。

我的代码如下:

config = {
            url: config.ldap.url,
            bindDN: config.ldap.adminDn,
            bindCredentials: config.ldap.adminPassword,
            searchBase: config.ldap.searchBase,
            searchFilter: config.ldap.searchFilter,
            reconnect: true
        }

        app.post('/login', (req, res, next) => {
            const {username, password} = req.body

            const auth = new LdapAuth(config)
            auth.authenticate(username, password, (err: any, user: any) => {
                if (err) console.log(err)
                else console.log(user)
            })
        })
    }

我也尝试通过jxplorer连接到ldap。再次适用于我的Mac,但不适用于我的ubuntu机器。

我尝试过: https://www.npmjs.com/package/ldapauthhttps://www.npmjs.com/package/ldapauth-fork

并结合护照:https://github.com/vesse/passport-ldapauth

0 个答案:

没有答案
相关问题