• <bdo id='6moOp'></bdo><ul id='6moOp'></ul>
    <i id='6moOp'><tr id='6moOp'><dt id='6moOp'><q id='6moOp'><span id='6moOp'><b id='6moOp'><form id='6moOp'><ins id='6moOp'></ins><ul id='6moOp'></ul><sub id='6moOp'></sub></form><legend id='6moOp'></legend><bdo id='6moOp'><pre id='6moOp'><center id='6moOp'></center></pre></bdo></b><th id='6moOp'></th></span></q></dt></tr></i><div id='6moOp'><tfoot id='6moOp'></tfoot><dl id='6moOp'><fieldset id='6moOp'></fieldset></dl></div>

    <small id='6moOp'></small><noframes id='6moOp'>

      <legend id='6moOp'><style id='6moOp'><dir id='6moOp'><q id='6moOp'></q></dir></style></legend>

      <tfoot id='6moOp'></tfoot>

        ldapsearch 到 ldapjs 的转换

        时间:2023-08-01
        <tfoot id='whvdx'></tfoot>

            1. <legend id='whvdx'><style id='whvdx'><dir id='whvdx'><q id='whvdx'></q></dir></style></legend>

              <small id='whvdx'></small><noframes id='whvdx'>

                • <bdo id='whvdx'></bdo><ul id='whvdx'></ul>
                  <i id='whvdx'><tr id='whvdx'><dt id='whvdx'><q id='whvdx'><span id='whvdx'><b id='whvdx'><form id='whvdx'><ins id='whvdx'></ins><ul id='whvdx'></ul><sub id='whvdx'></sub></form><legend id='whvdx'></legend><bdo id='whvdx'><pre id='whvdx'><center id='whvdx'></center></pre></bdo></b><th id='whvdx'></th></span></q></dt></tr></i><div id='whvdx'><tfoot id='whvdx'></tfoot><dl id='whvdx'><fieldset id='whvdx'></fieldset></dl></div>
                    <tbody id='whvdx'></tbody>
                  本文介绍了ldapsearch 到 ldapjs 的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我一直在尝试转换以下 ldapsearch 查询

                  I've been trying to convert the following ldapsearch query

                  ldapsearch -H ldap://ldap.berkeley.edu -x -b 'ou=people,dc=berkeley,dc=edu' objectclass=*
                  

                  到 ldapjs 脚本:

                  var ldap = require('ldapjs');
                  var server = 'ldap://ldap.berkeley.edu';
                  var searchBase = 'ou=people,dc=berkeley,dc=edu';
                  
                  var client = ldap.createClient({
                    url: server
                  });
                  
                  var opts = {
                    filter: '(objectclass=*)'
                  }; 
                  
                  client.search(searchBase, opts, function(err, res) {
                    res.on('searchEntry', function (entry) {
                      console.log(entry.toString());
                    });
                  });
                  

                  ldapsearch 给了我很多结果,但 ldapjs 没有返回任何用户.
                  您可以在 GitHub 上找到解决此问题的一些尝试.

                  The ldapsearch gives me plenty of results but ldapjs doesn't return any users.
                  You can find some attempts of solving this on GitHub.

                  推荐答案

                  ldapjs 搜索范围是从 UMich 代码派生的 OpenLDAP 和 (AFAIK) 最相似的 C 库的倒退".ldapjs 中的默认范围是base",而不是sub".在没有看到任何数据的情况下,您可能需要使该代码看起来像:

                  ldapjs search scopes are "backwards" of OpenLDAP and (AFAIK) most similar C libraries that are derived from the UMich code. The default scope in ldapjs is "base", as opposed to "sub". Without seeing any of your data, you probably need to make that code look like:

                  var opts = {
                    filter: '(objectclass=*)',
                    scope: 'sub'
                  }; 
                  
                  client.search(searchBase, opts, function(err, res) {
                    res.on('searchEntry', function (entry) {
                      console.log(entry.toString());
                    });
                  });
                  

                  这篇关于ldapsearch 到 ldapjs 的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:从活动目录中读取 objectGUID 下一篇:SonarQube 和 Lcov 报告无法解析文件路径

                  相关文章

                      • <bdo id='lclq0'></bdo><ul id='lclq0'></ul>

                      <i id='lclq0'><tr id='lclq0'><dt id='lclq0'><q id='lclq0'><span id='lclq0'><b id='lclq0'><form id='lclq0'><ins id='lclq0'></ins><ul id='lclq0'></ul><sub id='lclq0'></sub></form><legend id='lclq0'></legend><bdo id='lclq0'><pre id='lclq0'><center id='lclq0'></center></pre></bdo></b><th id='lclq0'></th></span></q></dt></tr></i><div id='lclq0'><tfoot id='lclq0'></tfoot><dl id='lclq0'><fieldset id='lclq0'></fieldset></dl></div>

                      <small id='lclq0'></small><noframes id='lclq0'>

                    1. <legend id='lclq0'><style id='lclq0'><dir id='lclq0'><q id='lclq0'></q></dir></style></legend>

                      <tfoot id='lclq0'></tfoot>