• <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 的转换

        Ldapsearch to ldapjs conversion(ldapsearch 到 ldapjs 的转换)
        <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 的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  quot;Status Code:200 OK (from ServiceWorker)quot; in Chrome Network DevTools?(“状态码:200 OK(来自 ServiceWorker)在 Chrome 网络开发工具中?)
                  How to set a header for a HTTP GET request, and trigger file download?(如何为 HTTP GET 请求设置标头并触发文件下载?)
                  Adding custom HTTP headers using JavaScript(使用 JavaScript 添加自定义 HTTP 标头)
                  SQL Query DocumentDB in Azure Functions by an integer not working(通过整数在 Azure Functions 中 SQL 查询 DocumentDB 不起作用)
                  Azure Functions [JavaScript / Node.js] - HTTP call, good practices(Azure Functions [JavaScript/Node.js] - HTTP 调用,良好实践)
                  Azure Functions - Import Custom Node Module(Azure Functions - 导入自定义节点模块)

                          <tbody id='lclq0'></tbody>

                          • <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'>

                          • <legend id='lclq0'><style id='lclq0'><dir id='lclq0'><q id='lclq0'></q></dir></style></legend>

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