0
votes

I have been creating a Proxy service using service chaining mechanism. 1. First I make a call to an endpoint, get the result and send the result to a sequence. 2. In the sequence, I have a data mapper and then a property to specify the username and password to a secure endpoint and then send mediator to call an endpoint.

However, I have been getting the following error: HTTPSender Unable to sendViaPost to url[endpoint Url] org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized, With the description as "This request requires HTTP authentication"

The solution I have tried: 1. Tried adding a property "FORCE_HTTP_1.0" to true before making a call to the endpoint. But nothing seems to work. Any help would be appreciated.

Thanks in advance.

1
How did you set username and password? How does endpoint expect them?Bee
Add a property Mediator and then set the username and password using base64 encoding. Refer this link: docs.wso2.com/display/ESB470/…Renuka Hosamani
So you're saying it didn't work?Bee
I had added the Username-password in the property but did not realize that the name of the property had to be "Authorization" only. I had given some other name and that's why it wasn't workingRenuka Hosamani
Glad you could resolve it.Bee

1 Answers

0
votes

If your backend requires Basic authentication, set the following property before your backend call.

Mmh seems like it's not possible to paste Code from my iPhone. Hope the link works.

https://docs.wso2.com/display/ESB470/Enabling+HTTP+Basic+Authentication+through+a+Proxy+Server

Just set the property "Proxy-Authorization"