[
https://issues.apache.org/jira/browse/CAMEL-12764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17307065#comment-17307065
]
Claus Ibsen edited comment on CAMEL-12764 at 3/23/21, 1:52 PM:
---------------------------------------------------------------
If you specify the username and password as query parameters then it works
{code}
from("direct:joes")
.toD("http://localhost:" + localServer.getLocalPort()
+
"/joes?authMethod=Basic&authUsername={{myUsername}}&authPassword={{myPassword}}&authenticationPreemptive=true&throwExceptionOnFailure=false&drink=${header.drink}");
{code}
was (Author: davsclaus):
If you specify the username and password as query parameters then it works
from("direct:joes")
.toD("http://localhost:" + localServer.getLocalPort()
+
"/joes?authMethod=Basic&authUsername={{myUsername}}&authPassword={{myPassword}}&throwExceptionOnFailure=false&drink=${header.drink}");
> camel-http4: basic auth no longer working when used in combination with a
> dynamic to
> ------------------------------------------------------------------------------------
>
> Key: CAMEL-12764
> URL: https://issues.apache.org/jira/browse/CAMEL-12764
> Project: Camel
> Issue Type: Bug
> Components: camel-http4
> Affects Versions: 2.22.0, 2.22.1, 2.23.2, 2.24.1
> Reporter: Pascal Schumacher
> Assignee: Claus Ibsen
> Priority: Major
> Labels: regresion
> Fix For: 3.10.0
>
>
> After upgrading a Spring Boot Project from Camel 2.21.1 to Camel 2.22.0 basic
> authentication of the http4 component stopped working when it is used in
> combination with a dynamic to.
> My (slightly simplified) route:
> {code:java}
> from(inUri)
> .setHeader(Exchange.CONTENT_TYPE,
> constant(MediaType.APPLICATION_JSON_VALUE))
> .setBody(constant("{\"action\":\"signal\"}"))
> .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.PUT))
>
> .toD("http4://{{username}}:{{password}}@{{host}}:{{port}}/executions/${exchangeProperty.my_id}");
> {code}
> When I change the route and remove the dynamic to everything works fine again:
> {code:java}
> from(inUri)
> .setHeader(Exchange.CONTENT_TYPE,
> constant(MediaType.APPLICATION_JSON_VALUE))
> .setBody(constant("{\"action\":\"signal\"}"))
> .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.PUT))
> .setHeader(Exchange.HTTP_PATH, exchangeProperty("my_id"))
> .to("http4://{{username}}:{{password}}@{{host}}:{{port}}/executions/");
> {code}
> Maybe this regression was caused by CAMEL-12462?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)