Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-20254

camel-http - pre-emptive authentication breaks basic auth

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.2.0
    • 4.0.4, 4.4.0
    • camel-http
    • None
    • Unknown

    Description

      Background:

      When setting setAuthenticationPreemptiveon to true on an http endpoint, basic authentication ceases to work

       

      Error:

       

      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]

       

      httpEndpoint.setAuthMethod("Basic");
      httpEndpoint.setAuthUsername("admin");
      httpEndpoint.setAuthPassword("admin");
      /* enable or disable this line and the program works/does not work */		httpEndpoint.setAuthenticationPreemptive(true);
       

       

       

      I attach a sample project with run instructions and a small shell python web server with basic auth configured.

      Attachments

        1. camel-auth-example.zip
          6 kB
          Billy Jaime Beltran

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              chrysophylax Billy Jaime Beltran
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: