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 2023/12/20 11:58:00 UTC

[jira] [Resolved] (CAMEL-20254) camel-http - pre-emptive authentication breaks basic auth

     [ https://issues.apache.org/jira/browse/CAMEL-20254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-20254.
---------------------------------
    Fix Version/s: 4.0.4
       Resolution: Fixed

> camel-http - pre-emptive authentication breaks basic auth
> ---------------------------------------------------------
>
>                 Key: CAMEL-20254
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20254
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 4.2.0
>            Reporter: Billy Jaime Beltran
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.0.4, 4.4.0
>
>         Attachments: camel-auth-example.zip
>
>
> Background:
> When setting setAuthenticationPreemptiveon to true on an http endpoint, basic authentication ceases to work
>  
> Error:
>  
> {noformat}
> org.apache.hc.client5.http.ClientProtocolException: No credentials for preemptive authentication
>         at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:173) ~[httpclient5-5.2.1.jar:5.2.1]
>         at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245) ~[httpclient5-5.2.1.jar:5.2.1]
>         at org.apache.camel.component.http.HttpProducer.executeMethod(HttpProducer.java:487) ~[camel-http-4.2.0.jar:4.2.0]
>         at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:269) ~[camel-http-4.2.0.jar:4.2.0]
>         at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:65) [camel-support-4.2.0.jar:4.2.0]{noformat}
>  
> {code:java}
> httpEndpoint.setAuthMethod("Basic");
> httpEndpoint.setAuthUsername("admin");
> httpEndpoint.setAuthPassword("admin");
> /* enable or disable this line and the program works/does not work */		httpEndpoint.setAuthenticationPreemptive(true);
>  {code}
>  
>  
> I attach a sample project with run instructions and a small shell python web server with basic auth configured.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)