HTTP Basic Auth

时间:2014-04-03 07:57:51

标签: mule esb

我正在尝试连接到MS Dynamics 2013 REST服务,我需要进行NTLM身份验证。我可以使用Apache HTTP Client通过Java Class执行此操作,如下面的代码片段

NTCredentials creds = new NTCredentials("xxx", "yyy", "", "xyz.com");
        httpclient.getCredentialsProvider().setCredentials(AuthScope.ANY, creds);

如您所见,我必须传递用户名,密码和域才能成功连接。我试图通过如下的Mule流程来做到这一点但没有成功。我不知道在哪里通过域我通过传递用户ID属性username@domain.com尝试它但是抛出一条消息无法路由我尝试了域\用户名甚至没有编译

<http:connector name="httpConnector"     doc:name="HTTP-HTTPS" clientSoTimeout="10000" cookieSpec="netscape" receiveBacklog="0" receiveBufferSize="0" sendBufferSize="0" serverSoTimeout="10000" socketSoLinger="0" validateConnections="true"   >
    <spring:property name="proxyNtlmAuthentication" value="true"/>
</http:connector>
<flow name="dynamicscrmFlow1" doc:name="dynamicscrmFlow1">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="5282" doc:name="HTTP"/>
                <not-filter doc:name="Not">
            <http:request-wildcard-filter pattern="*.ico"/>
        </not-filter>
    <logger level="INFO" doc:name="Logger" message="http request #[message.payload]"/>
    <http:outbound-endpoint exchange-pattern="request-response" method="GET"       doc:name="HTTP" contentType="application/json" connector-ref="httpConnector" port="80" host="abcd.com" path="abcde/XRMServices/2011/OrganizationData.svc/AccountSet" password="yyy" user="xxx">
    </http:outbound-endpoint>
</flow>

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

您是否在HTTP连接器配置上设置了proxyNtlmAuthentication="true"