Apache Camel HTTPS4基本身份验证

问题描述:

Camel-Http4是否支持基本身份验证?

Does Camel-Http4 supports Basic Authentication?

关注此帖和其他帖子
使用Https基本身份验证的Camel http4下载文件

I我正在使用骆驼2.17.3版本。使用camel-http4组件。路由将 https4 多部分请求发送到REST端点。 REST服务位于siteminder之后。有信任库/ ketstore / cert所有设置,它工作正常,只是发送基本身份验证导致麻烦。

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.

使用邮递员我能够使用基本身份验证调用REST服务。但是,来自camel路由的所有调用都会失败,并且会收到HTTP错误403.

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. 为HttpConfiguration添加了基本身份验证 - 得到HTTP错误401

  2. 在路由中添加了Authorization标头,如上面链接所述 - 得到HTTP错误403

  3. 并添加了方法,用户,传递给HTTP_Query - 403明文密码在siteminder日志中可见,这不好,所以放弃尝试此选项。

请通过一些工作示例帮助解决此问题并解释原因。

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

是骆驼丢掉http标头?

Is camel dropping http headers?

我现在还在考虑是否应该考虑使用其他可用组件netty / jetty / cxf?但我更喜欢让HTTPs4工作:)

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

谢谢

通过一个工作示例帮助其他人,以下是我如何得到它...

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

1)检查站点管理员策略并确保用户拥有对服务的正确权限。
2)传递用户/密码作为查询参数是不安全的(至少在我的情况下不是这样)明文密码在site-minder中公开。
3)设置标题(授权)
apache-camel-basic-http-auth

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