How to execute an LDAP query using JavaScript?

trying to create a sidebar gadget with the ldap request function, but could not find very good or any useful documentation on this. im, who does not have much experience with javascript, and knows little about how ldap requests work, so any information will be useful in general.

information:

  • host: abcde
  • port: 389
  • ou: people
  • o: x_y_z
  • c: us

first fragment:

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;

another snippet:

 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);
+7
source share
5 answers

As long as you want to run your JavaScript in a web browser, you are limited to the HTTP protocol and the domain from which your script was loaded.

Thus, communication with the LDAP server will be impossible from the JavaScript mechanism of web browsers.

JavaScript, , . LDAP - .

+8

--, HTTP- LDAP, LDAP . , .

+5

, 1 . ldap . LDAP:// . "" . ping, , .

+1

Can anyone help with Java script code to connect to LDAP to do the search. My LDAP server is accessible via ping

0
source

All Articles