How do I do an LDAP query with JavaScript?(如何使用 JavaScript 进行 LDAP 查询?)
问题描述
我正在尝试制作一个具有 LDAP 查询功能的侧边栏小工具,但找不到非常好的或任何有用的文档.我对 Javascript 的经验并不丰富,对 LDAP 查询的功能知之甚少,因此任何信息都会很有用.
I'm trying to make a sidebar gadget that has an LDAP query function but haven't been able to find very good, or any, useful documentation on the matter. I'm not hugely experienced with Javascript and know little to nothing about how LDAP queries function, so any information at all would be useful.
信息:
- 主持人:a.b.c.d.e
- 端口:389
- ou:人
- o: x_y_z
- c:我们
第一个片段:
var sSearchURL = "ldap://a.b.c.d.e:389/o=x_y_z,c=us";
var URLsuffix = "dc=" + form.SearchData.value;
document.location = sSearchURL URLsuffix;
其他片段:
var ldap = GetObject('LDAP:');
var ad = ldap.OpenDSObject(
'LDAP://a.b.c.d.e:389/o=x_y_z',
'cn=Administrator,ou=People,o=rootname',
'password',
0
);
推荐答案
只要你想在网络浏览器中运行你的 JavaScript,你就受限于 HTTP 协议和你的脚本被加载的域.第一名.
As long as you want to run your JavaScript in a web browser, you are limited to the HTTP protocol and to the domain from which your script was loaded in the first place.
因此,无法从 Web 浏览器 JavaScript 引擎与 LDAP 服务器通信.
So, talking to an LDAP server will not be possible from a web browsers JavaScript engine.
有些 JavaScript 运行时环境限制较少,您可以在其中实现套接字服务器和客户端.对于 LDAP 连接,您必须编写自己的库或找到一些现有的库.
There are JavaScript runtime environments that have less limitations where you can implement socket servers and clients. For LDAP conenctivity you'd have to write your own library or find some existing one.
这篇关于如何使用 JavaScript 进行 LDAP 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 JavaScript 进行 LDAP 查询?


基础教程推荐
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 直接将值设置为滑块 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01