Reputation: 173
I'm using HTTP request in Mule ESB and need to implement HTTP basic auth in it. Now I do this by using explicit authorization header:
<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>
Is there any direct way to enter user and password for basic auth in Mule http:request
?
Upvotes: 0
Views: 2751
Reputation: 11606
There sure is:
<http:request-config name="basicConfig" host="localhost" port="${httpPort}">
<http:basic-authentication username="#[user]" password="#[password]" preemptive="#[preemptive]" />
</http:request-config>
Upvotes: 3