One Star

[resolved] Basic HTTP authentication in a route

Hi
I need to call a HTTP server that requires basic authentication.
In my cHTTP component, I tried the inline method (that works well in a web browser) with URI "http://username:userpwd@site.com"

I also tried the camel method, that is, set "http://site.com" in URI and set "authUsername" and "authPassword" in Advanced Settings

But in both cases I get a 401 error from the server. 
Thanks for any help.
Loko
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] Basic HTTP authentication in a route

Thank you Sabrina, it works , I was missing "authMethod" (I thought it would default to "Basic") and put all this in basic setting instead of advanced.
Before closing this thread, could you please tell me when to put some Camel parameter in "basic view" of a component, and when in "advanced settings" ?
6 REPLIES
Moderator

Re: [resolved] Basic HTTP authentication in a route

Hi Loko,
Could you please indicate what's build version you are using?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Basic HTTP authentication in a route

Hi Sabrina
Yes, we use Talend Open Studio 6.3.0
Employee

Re: [resolved] Basic HTTP authentication in a route

Hi
There are several ways to set user/pwd basic auth for cHttp component.
1) add "authMethod","authUsername", "authPassword" into Parameters (from Basic setting view)
2) add http header "Authorization" into Headers (from Advanced setting view)
For details please find http://camel.apache.org/http.html
If still no luck, you can try using "cCXFRS" component with "Use Authentication" -> "Http Basic"
Regards.
One Star

Re: [resolved] Basic HTTP authentication in a route

Thank you Sabrina, it works , I was missing "authMethod" (I thought it would default to "Basic") and put all this in basic setting instead of advanced.
Before closing this thread, could you please tell me when to put some Camel parameter in "basic view" of a component, and when in "advanced settings" ?
Employee

Re: [resolved] Basic HTTP authentication in a route

It depends, for certain camel component. In case of cHttp component, the Basic setting view is for camel parameter, the Advanced setting view is for HTTP header. if you want to set a HTTP header but camel parameters not covered, you should use the Advanced view.
Regards
Xilai
One Star

Re: [resolved] Basic HTTP authentication in a route

Thank you Xilai