Mule ESB LDAP连接器能够绑定但在查找时失败

时间:2015-05-07 18:05:38

标签: java xml ldap mule

所以我正在尝试创建一个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来绑定。

我还尝试删除连接池配置文件和其他具有相同结果的配置。

由于

1 个答案:

答案 0 :(得分:0)

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

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