You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by richardgroote <ri...@gmail.com> on 2015/01/28 12:20:57 UTC

Http 3 Component and Credential delegation

Good day,

When using the HTTP(3) component of Apache Camel it is possible to define a
HttpClientConfigurer to add additional authentication / security. The
HttpClientConfigurer is used when the http client is created.

In our case we'd like to add a kerberos ticket when the http method is
called. Therefore we do not know the credentials when the camel
configuration (spring config) is loaded / created. So just before the http
call is made the credentials should be set on the http client. 

I've tried the HttpClientConfigurer but this one is created when the
HttpProducer is created and at that time i do not know the credentials. 

When the HttpProducer#process is called i know the credentials and can add
them to the client. A possible solution is to override HttpComponent,
HttpEndpoint and HttpProducer but i hope that is a better solution for it.

Does anyone have a better solution to add credentials to the httpclient just
before the http method is executed?

KInd regards,

Richard








--
View this message in context: http://camel.465427.n5.nabble.com/Http-3-Component-and-Credential-delegation-tp5762175.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Http 3 Component and Credential delegation

Posted by richardgroote <ri...@gmail.com>.
Hello,

I've overriden the HttpProducer, HttpEndpoint and parts of the HttpComponent
to support credential delegation on the HTTP Client.

It would be nice if this was standard available in the Http Component.

KInd regards,

Richard



--
View this message in context: http://camel.465427.n5.nabble.com/Http-3-Component-and-Credential-delegation-tp5762175p5762259.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Http 3 Component and Credential delegation

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Current HttpProducer holds the HttpClient as the HttpProducer can be used in multiple thread, it is not safe to change the Credential per exchange processing.
For you case, you need to create the HttpClient per exchange. You may need to override the process method of HttpProducer.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 28, 2015 at 7:24:33 PM, richardgroote (richard.groote@gmail.com) wrote:
> Good day,
>  
> When using the HTTP(3) component of Apache Camel it is possible to define a
> HttpClientConfigurer to add additional authentication / security. The
> HttpClientConfigurer is used when the http client is created.
>  
> In our case we'd like to add a kerberos ticket when the http method is
> called. Therefore we do not know the credentials when the camel
> configuration (spring config) is loaded / created. So just before the http
> call is made the credentials should be set on the http client.
>  
> I've tried the HttpClientConfigurer but this one is created when the
> HttpProducer is created and at that time i do not know the credentials.
>  
> When the HttpProducer#process is called i know the credentials and can add
> them to the client. A possible solution is to override HttpComponent,
> HttpEndpoint and HttpProducer but i hope that is a better solution for it.
>  
> Does anyone have a better solution to add credentials to the httpclient just
> before the http method is executed?
>  
> KInd regards,
>  
> Richard
>  
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Http-3-Component-and-Credential-delegation-tp5762175.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>