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 查询?


- addEventListener 在 IE 11 中不起作用 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01