Issue Details (XML | Word | Printable)

Key: MULE-3851
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Sigurd Knippenberg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Mule

Basic authentication on outbound endpoints is not working with basic outbound-endpoint

Created: 17/Oct/08 01:53 PM   Updated: 21/Oct/08 10:16 PM
Component/s: Core: Transports
Affects Version/s: 2.1.0
Fix Version/s: 2.1.x Backlog

Time Tracking:
Not Specified

Environment:
Mule 2.1.0
Mac OS X 10.5.5
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

Labels:
User impact: Medium
Configuration:
<service name="authenticate">
<inbound>
<inbound-endpoint address="vm://authenticate" remoteSync="true"
synchronous="true" />
</inbound>
<outbound>
<pass-through-router>
<outbound-endpoint
address="http://myuserid:mypassword@somehost.example.com/myservice"
remoteSync="true" />
</pass-through-router>
</outbound>
</service>


 Description  « Hide
When using the following:
<outbound>
<pass-through-router>
<outbound-endpoint
address="http://myuserid:mypassword@somehost.example.com/myservice"
remoteSync="true" />
</pass-through-router>
</outbound>

Mule 2.1.0 does not use the user id and password specified in the address attribute. As a result, if the somehost.example.com enforces basic authentication, it results in a HTTP 401 error.

I got it to work when I add the following line to the org.mule.transport.http.HttpClientMessageDispatcher.doDispatch() method:
connector.setupClientAuthorization(event, httpMethod, client, endpoint);

After the change, the method looks like this:
protected void doDispatch(MuleEvent event) throws Exception
{
HttpMethod httpMethod = getMethod(event);
connector.setupClientAuthorization(event, httpMethod, client, endpoint);
try
{
execute(event, httpMethod);

if (httpMethod.getStatusCode() >= ERROR_STATUS_CODE_RANGE_START)

{ logger.error(httpMethod.getResponseBodyAsString()); throw new DispatchException(event.getMessage(), event.getEndpoint(), new Exception( "Http call returned a status of: " + httpMethod.getStatusCode() + " " + httpMethod.getStatusText())); }

}
finally

{ httpMethod.releaseConnection(); }

}

Now it is adding basic authentication credentials to the request to the somehost.example.com server, and it is working fine.



 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.