问题标签 [ldapjs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
408 浏览

node.js - Query results are not sorted using ldap.js framework in node.js server

I tried to query 'LDAP server users' with my node.js server. here is my codes what i tried with 'Ldapjs framework'

And the result is like this.

enter image description here

When I set attributes items in opts array, the results are sorted as what I set. But with no attributes, no sorted items.

The first user's result is starting "type" : "uid". these items seem ascending sorted. But second and thrid are decending sorted. these are starting with "type":"telephoneNumber"

0 投票
0 回答
915 浏览

javascript - ldapjs Uncaught TypeError: net.connect is not a function in client.js

我曾经使用npm install ldapjs这个库。和简单的绑定代码:

这是一个反应应用程序,我运行该应用程序。我在控制台中遇到了这个错误

当我调用该login()函数时,什么都没有返回。我能做什么?

0 投票
1 回答
63 浏览

node.js - 如何根据先前中间件的响应使用 Express POST 运行函数

我对 MEAN.io 很陌生

在 Function(authDN) 下方编写 & 可以正常运行,如下所示。

当我直接运行该功能时,我在控制台中得到了正确的响应

authDN('myuserName', 'myPassword', output);

但是我想用router.post运行函数并运行函数 (authDN) ,所以每当进行 POST 调用时,我想根据返回的响应显示响应authDN,并且我想将userNT,passwordpostData函数传递给authDN以及

有人可以帮我解决这个问题吗

0 投票
1 回答
327 浏览

node.js - Subpackage is not included in my npm module

I have an npm module called 'ldap-pool'. This package depends on 'ldapjs' and also '@types/ldapjs', but for some reason when I install 'ldap-pool' into another project, the '@types/ldapjs' package is not being installed. The above is the problem.

the package.json file for 'ldap-pool' is like so:

When I install ldap-pool in another project, I see:

enter image description here

if I hover over the red squiggly, I see:

enter image description here

Does anyone know why the ldapjs typings are not being included when I run

npm install

?

0 投票
1 回答
1948 浏览

node.js - 如何使用 Nodejs 从 Azure AD 连接和查找用户

我正在尝试使用 nodejs 从 azure 活动目录中查找用户。我正在使用Node-ActiveDirectory来完成这项任务。首先,我尝试按照上面链接中的示例连接到 Azure 活动目录。我使用过的示例代码如下。

但它给出了以下错误。这段代码有什么问题?

0 投票
0 回答
4106 浏览

node.js - nodejs ldap身份验证失败

我正在使用 activedirectory npm 包对企业中的 activedirectory 进行身份验证。发现身份验证问题,而我之前在其他软件中已经多次这样做了。

当我运行这个 nodejs 脚本时,我收到以下错误:

错误:{“lde_message”:“80090308:LdapErr:DSID-0C09042F,注释:AcceptSecurityContext 错误,数据 52e,v2580\u0000”,“lde_dn”:null}

可以肯定地说,我不知道我在做什么。

但我知道 searchAttribute 应该是 'sAMAccountName' - 我如何把它放在配置中?

我也知道,当我用它的 DN 替换“sss”的用户名时,即

,它完美地验证。

我在 MongoDB 上成功启用 LDAP 时使用了 usertodnmapping。

但我似乎无法在 activedirectory 包中找到它的等价物。你能帮我吗?

我也不介意使用 ldapjs。我也没有取得太大的成功。我只想使用用户名进行身份验证,并获取用户名的组成员身份。

0 投票
1 回答
2091 浏览

javascript - LDAP,列出组我是使用通配符的成员?

所以我在 ExpressJS 中编写了一个应用程序后端,它使用 LDAP 对我们的域进行身份验证。我有3个广告组。

  • Foo_bar
  • Foo_bert

如何询问 LDAP“任何以 Foo* 开头的组,我是哪些组的成员?” 响应尽可能简单。

使用 javascript ldapjs 语法的奖励积分,但不是必需的。

我以前从未真正使用过 LDAP,我的第一印象是它相当挑剔

0 投票
2 回答
431 浏览

javascript - 要在函数外访问的 ldapjs client.search 结果

我在 nodejs 中使用 ldapjs 库。我想在函数之外访问 client.search 的结果。这是我的代码

我尝试在搜索中返回项目。还是不打印。有什么建议么?

0 投票
1 回答
1226 浏览

javascript - ActiveDirectory 中的 ThumbnailPhoto 返回错误

我首先要提一下,我不是 LDAP 专家。

我需要的是从我公司的 ldap 中获取一些信息,包括用户照片。我的问题是,在我获得所需的所有信息后,它thumbnailPhoto 似乎以某种方式损坏。我将展示一个示例: \ufffdPNG\r\n\u001a\n\u0000\u0000\u0000\rIHDR\u0000\u0000\u0000\ufffd\u0000\u0000\u0000\u ...

当我尝试将它应用到我的前端客户端并且无法从返回的缓冲区中制作图像时,我首先注意到了这一点。另外,当我在 LDAP 中查看返回的照片大小几乎是两倍时。

我检查了照片保存在 LDAP 中的方式是否有问题,复制粘贴到转换器中,一切都很好。

我将给出一个代码片段,说明如何使用名为activedirectory的库从 LDAP 获取信息:

我已经为此苦苦挣扎了一段时间,但我不明白会发生什么。我对此的唯一信息是在这个链接上,它告诉“ldapjs 不知道缩略图真的是二进制的”,但那是在 2013 年。

我会很感激一些帮助,或者至少我可以在 node 中使用 express 的任何其他方法或库。

目前该应用程序使用:

提前致谢。

0 投票
1 回答
77 浏览

node.js - 在我的 node.js 服务中获取错误为“错误:发送后无法设置标头”

下面是我的代码,

在这里,当我打印条目时,它会显示正确的结果,但不会发送响应。我可以将错误视为“错误:发送后无法设置标头”。以下是完整的错误:

如何解决此错误?