Apache Camel HTTPS4 Basic Authentication

2020-08-09 07:03发布

问题:

Does Camel-Http4 supports Basic Authentication?

Followed this and other posts Camel http4 download file using Basic authentication over Https

I am using camel 2.17.3 version. using camel-http4 component. The route sends a https4 multipart request to a REST endpoint . The REST service is behind the siteminder. Have truststore/ketstore/cert all setup and it works fine, just sending basic auth is causing trouble.

Using postman i was able to call REST services with basic auth. However, all the calls from camel route fails and get HTTP error 403.

I tried below options to get it working:

  1. Added basic auth to the HttpConfiguration - got HTTP error 401
  2. Added "Authorization" header to the route, as mentioned in the above link - got HTTP error 403
  3. and Added method,user,pass to HTTP_Query - 403 also clear text password is visible in the siteminder logs, this is not good, so dropped trying this option.

please help resolve this issue with some working example and explain the cause.

Is camel dropping http headers?

also i now thinking should I consider using other available components netty/jetty/cxf?? But I prefer getting HTTPs4 working :)

thanks

回答1:

To help others with an working example, here is how I got it...

1) Check the site-minder policy and also ensure the user have correct permissions for the services. 2) Passing user/password as query parameter isn't safe (at least it wasn't in my case) Clear text password was exposed in site-minder. 3) setting header (Authorization) apache-camel-basic-http-auth