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
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" ?
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.
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" ?
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