如何使用JavaScript进行LDAP查询? [英] How do I do an LDAP query with JavaScript?

查看:174
本文介绍了如何使用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查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆