Q:

Mule ESB and basic authentication

I wrote a flow accepting JSON, now I want to add http authentication.  I want to accept HTTP basic authentication uid and pw.
So I am starting with a Hellow World program first, as follows:
<?xml version="1.0" encoding="UTF-8"?>
<mule version="EE-3.5.0" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
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">
    <flow doc:name="HelloWorldFlow1" name="HelloWorldFlow1">
        <http:inbound-endpoint doc:description="This endpoint receives an HTTP message." doc:name="HTTP" exchange-pattern="request-response" host="localhost" port="8081"/>
        <set-payload doc:description="This processor sets the payload of the message to the string 'Hello World'." doc:name="Set Payload" value="Hello World"/>
    </flow>
</mule>

And I test with the following program:
C:\curl>curl -H "Content-Type: application/json" -u uida:pw -d {"first":"Steven"
} http://localhost:8081
Hello World
C:\curl>

This works, as there is no basic auth configured within th eflow, so it ignores the "-u uid:pw" I sent on the curl command
Now I change the flow as follows ( I put 'uid' in the 'Http Settings->User' field, and 'pw' in the 'Http Seetings->Password' field on the GUI
<?xml version="1.0" encoding="UTF-8"?>
<mule version="EE-3.5.0" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
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">
    <flow doc:name="HelloWorldFlow1" name="HelloWorldFlow1">
        <http:inbound-endpoint doc:description="This endpoint receives an HTTP message." doc:name="HTTP" exchange-pattern="request-response" host="localhost" port="8081" password="pw" user="uid"/>
        <set-payload doc:description="This processor sets the payload of the message to the string 'Hello World'." doc:name="Set Payload" value="Hello World"/>
    </flow>
</mule>

Now when I test I get the following:
C:\curl>curl -H "Content-Type: application/json" -u uida:pw -d {"first":"Steven"
} http://localhost:8081
Cannot bind to address "http://127.0.0.1:8081/" No component registered on that
endpoint

I have done this repeatedly, but I get the same response.
Is there another field that I should have set?  Any ideas on how I can resolve this?
Thanks

A:

The user and password attributes are ineffective on inbound HTTP endpoints, they only work on outbound.
Mule uses Spring Security for authentication. This is detailed in the user guide: http://www.mulesoft.org/documentation/display/current/Configuring+the+Spring+Security+Manager , including an example of the http-security-filter that you need to put in the HTTP inbound endpoint.

