You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2018/07/19 13:53:00 UTC
[jira] [Assigned] (CAMEL-12642) No support for http4 feature
authenticationPreemptive in pollEnrich
[ https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-12642:
-----------------------------------
Assignee: Ramu
> No support for http4 feature authenticationPreemptive in pollEnrich
> -------------------------------------------------------------------
>
> Key: CAMEL-12642
> URL: https://issues.apache.org/jira/browse/CAMEL-12642
> Project: Camel
> Issue Type: New Feature
> Components: camel-http4
> Affects Versions: 2.23.0
> Reporter: Frank Olschewski
> Assignee: Ramu
> Priority: Major
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
> "&authUsername=user&authPassword=passwd"){code}
> In Class /org/apache/camel/component/http4/HttpPollingConsumer.java:79 you see the following code:
> {code:java}
> HttpResponse response = httpClient.execute(method, httpClientContext);{code}
> The setup for authenticationPreemptive is missing.
> You can see what to do in org.apache.camel.component.http4.HttpProducer#executeMethod:
> {code:java}
> pprotected HttpResponse executeMethod(HttpUriRequest httpRequest) throws IOException {
> HttpContext localContext = new BasicHttpContext();
> if (getEndpoint().isAuthenticationPreemptive()) {
> BasicScheme basicAuth = new BasicScheme();
> localContext.setAttribute("preemptive-auth", basicAuth);
> }
> if (httpContext != null) {
> localContext = new BasicHttpContext(httpContext);
> }
> return httpClient.execute(httpRequest, localContext);
> }{code}
> In org.apache.camel.component.http4.HttpPollingConsumer#doReceive getEndpoint().isAuthenticationPreemptive() returns the correct value, so there is nothing against implementing this feature here as well.
> The problem behind the scene ist that the context attribute "preemptive-auth" is missing.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)