如何在Mule ESB http:request中实现HTTP基本身份验证

时间:2015-07-23 15:18:05

标签: http mule basic-authentication

我在Mule ESB中使用HTTP请求,需要在其中实现HTTP基本身份验证。现在我通过使用显式授权标题来执行此操作:

            <http:request config-ref="HTTP_Request_Configuration" path="/activiti-rest/service/runtime/process-instances" method="POST" doc:name="Request to BPM">
                <http:request-builder>
                    <http:header headerName="Authorization" value="Basic a2VybWl0OnBhc3N3b3JkMQ=="/>
                </http:request-builder>
            </http:request>

在Mule http:request中是否可以直接输入基本身份验证的用户和密码?

1 个答案:

答案 0 :(得分:2)

肯定有:

<http:request-config name="basicConfig" host="localhost" port="${httpPort}">
        <http:basic-authentication username="#[user]" password="#[password]" preemptive="#[preemptive]" />
    </http:request-config>