【问题标题】:Mule ESB LDAP connector able to bind but fails at lookupMule ESB LDAP 连接器能够绑定但查找失败
【发布时间】:2015-05-08 21:30:32
【问题描述】:

所以我正在尝试创建一个 Mule 流来针对我的 LDAP 进行身份验证。我想绑定通过 PHP 发送 JSON,然后检查它是否绑定。然后它返回绑定用户的值,以便我可以将其存储在会话变量中。

发送 JSON 效果很好,我可以对服务器进行身份验证,因为我尝试使用错误的密码但它不起作用。它绑定成功,但之后无法进行查找。我希望有人可以提供帮助。

这是我的代码:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:ldap="http://www.mulesoft.org/schema/mule/ldap" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/ldap http://www.mulesoft.org/schema/mule/ldap/current/mule-ldap.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
    <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8080" doc:name="HTTP Listener Configuration"/>
    <ldap:config name="ldapConf" url="ldap://address.address.address:389/" doc:name="LDAP">
        <ldap:connection-pooling-profile evictionCheckIntervalMillis="1" minEvictionMillis="1" exhaustedAction="WHEN_EXHAUSTED_WAIT"/>
    </ldap:config>  
    <flow name="loginldapFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/login" doc:name="HTTP">
            <http:response-builder>
                <http:header headerName="content-type" value="text/plain"/>
            </http:response-builder>
        </http:listener>
        <json:json-to-object-transformer doc:name="JSON to Object" returnClass="java.util.Map"/>
        <ldap:bind config-ref="ldapConf" authDn="#[payload.username]@address.addresss" authPassword="#[payload.password]" authentication="simple" doc:name="LDAP"/>
    </flow>
</mule>

这是错误:

INFO  2015-05-07 14:01:05,452 [[loginldap].HTTP_Listener_Configuration.worker.01] org.mule.module.ldap.api.jndi.LDAPJNDIConnection: Binded to ldap://address.address.address:389/ with simple authentication as Mule1@address.address
INFO  2015-05-07 14:01:05,452 [[loginldap].HTTP_Listener_Configuration.worker.01] org.mule.module.ldap.api.jndi.LDAPJNDIConnection: Already binded to ldap://address.address.address:389/ with simple authentication as Mule1@address.address. Closing connection first.
INFO  2015-05-07 14:01:05,452 [[loginldap].HTTP_Listener_Configuration.worker.01] org.mule.module.ldap.api.jndi.LDAPJNDIConnection: Connection Mule1@address.address@ldap://address.address.address:389/ closed.
INFO  2015-05-07 14:01:05,467 [[loginldap].HTTP_Listener_Configuration.worker.01] org.mule.module.ldap.api.jndi.LDAPJNDIConnection: Re-binding to ldap://address.address.address:389/ with simple authentication as Mule1@address.address
INFO  2015-05-07 14:01:05,468 [[loginldap].HTTP_Listener_Configuration.worker.01] org.mule.module.ldap.api.jndi.LDAPJNDIConnection: Binded to ldap://address.address.address:389/ with simple authentication as Mule1@address.address
INFO  2015-05-07 14:01:05,468 [[loginldap].HTTP_Listener_Configuration.worker.01] org.mule.module.ldap.adapters.LDAPConnectorConnectionIdentifierAdapter: Bind was successful for user: Mule1@address.address
WARN  2015-05-07 14:01:05,468 [[loginldap].HTTP_Listener_Configuration.worker.01] org.mule.module.ldap.api.jndi.LDAPJNDIConnection: Lookup failed.
WARN  2015-05-07 14:01:05,468 [[loginldap].HTTP_Listener_Configuration.worker.01] org.mule.module.ldap.adapters.LDAPConnectorConnectionIdentifierAdapter: Cannot retrieve entry for dn: Mule1@address.address
org.mule.module.ldap.api.InvalidAttributeException: Mule1@address.address: [LDAP: error code 34 - 0000208F: NameErr: DSID-03100225, problem 2006 (BAD_NAME), data 8350, best match of:
    'Mule1@address.address'

Caused by: javax.naming.InvalidNameException: Mule1@address.address: [LDAP: error code 34 - 0000208F: NameErr: DSID-03100225, problem 2006 (BAD_NAME), data 8350, best match of:
    'Mule1@address.address'

我查看了错误 34 是什么,但我无法在 Mule 中添加 DN 来绑定。

我也尝试删除连接池配置文件和其他配置,结果相同。

谢谢

【问题讨论】:

    标签: java xml ldap mule


    【解决方案1】:

    错误是 DN 无效。查看上一个问题的答案:javax.naming.InvalidNameException: [LDAP: error code 34 - invalid DN]

    您可以尝试使用工具来探索 LDAP 结构,例如 http://jxplorer.org/,以了解服务器的期望。

    【讨论】:

    • 是的,我知道这是错误,但我不知道如何解决。我尝试在 url 之后添加 dn,但我得到了同样的错误。如果我尝试添加 authDn,我什至无法绑定
    • 我编辑了我的答案,建议使用工具来探索服务器结构。
    猜你喜欢
    • 1970-01-01
    • 2015-03-30
    • 1970-01-01
    • 2016-03-17
    • 1970-01-01
    • 2015-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多