【问题标题】:Is there a way to make xdmp:ldap-search() function to use appserver external LDAP configuration有没有办法让 xdmp:ldap-search() 函数使用 appserver 外部 LDAP 配置
【发布时间】:2017-10-23 13:30:25
【问题描述】:

对于我的应用程序,我使用应用程序级别的身份验证,对于某些用户,我想从活动目录中获取一些信息。

我已经使用我为我们的活动目录创建的“外部证券”配置设置了一个 http 服务器。

我尝试使用如下函数:

let $res := xdmp:ldap-search( "(mail=abc@def.com)",  <options xmlns="xdmp:ldap">
                        <use-appserver-config>true</use-appserver-config>
                    </options> )

不幸的是,虽然它应该返回任何东西,但它并没有返回任何东西,也没有给出任何错误消息。但是,如果我像下面那样明确指定用户名、密码、ldap 服务器等,它就可以工作(好吧,在大多数情况下,如果响应不包含重音字符):

let $res := xdmp:ldap-search( "(mail=abc@def.com)"
                    ,  <options xmlns="xdmp:ldap">
                        <username>{ $config:ldap-connection-username }</username>
                        <password>{ $config:ldap-connection-password }</password>
                        <server-uri>{ $config:ldap-connection-server }</server-uri>
                        <search-base>{ $config:ldap-connection-search-base }</search-base>
                    </options>)

显然,选项 true 没有按我的预期工作。但是,它也被考虑在内,因为如果我将其设置为 false,则会返回错误。

我确定我在管理页面上为配置的 ldap 服务器设置的值与上面工作示例中使用的值相同。

这是一个错误吗?或者,我错过了什么?

非常感谢, K.

【问题讨论】:

  • 你好。您能否解释一下您在哪里运行上述两组代码的测试?直接查询控制台还是应用服务器?如果是查询控制台,请确认您正在相应的应用服务器上下文中运行代码。
  • @DavidEnnis,感谢收看。是的,我在 qconsole 上进行了测试(在第二种情况下用硬编码字符串替换了变量),并在我为其配置了外部安全性的应用服务器下运行。

标签: marklogic marklogic-9


【解决方案1】:

这看起来是特定于在应用服务器上下文下在 QConsole 中运行的。指定 &lt;use-appserver-config&gt;true&lt;/use-appserver-config&gt; 会导致没有调用 AD 服务器并且结果序列为空。直接在 AppServer 下运行确实会返回预期的结果,我将为此创建一个错误报告。

【讨论】:

    猜你喜欢
    • 2011-04-27
    • 1970-01-01
    • 2017-12-28
    • 2023-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多