Federico Mariani created CAMEL-27017:
----------------------------------------

             Summary: camel-http - endpoint options authMethod=Bearer and 
authBearerToken never send the token, and authMethod=NTLM is ignored without 
authDomain
                 Key: CAMEL-27017
                 URL: https://issues.apache.org/jira/browse/CAMEL-27017
             Project: Camel
          Issue Type: Bug
          Components: camel-http
            Reporter: Federico Mariani


The endpoint options {{authMethod=Bearer}} and {{authBearerToken}} are not 
used. The endpoint reads only {{authUsername}} and {{authPassword}}; the bearer 
token is read only from the {{httpConfiguration}} of the component. A server 
that answers 401 with {{WWW-Authenticate: Bearer}} gets no token, and the 
exchange fails with 401.

{code:java}
from("direct:start")
    .to("http://localhost:8080/secure?authMethod=Bearer&authBearerToken=abc";); 
// 401, no Authorization header sent
{code}

With {{authenticationPreemptive=true}} the request does not leave the client: 
it fails with {{IllegalStateException: Bearer token is null}}. The preemptive 
handler caches a new {{BearerScheme}} without its token. This also happens when 
the token is set in the {{httpConfiguration}} of the component.

{{authMethod=NTLM}} is ignored unless {{authDomain}} is set: the endpoint 
registers plain username/password credentials and does not add the NTLM scheme, 
so an NTLM challenge is not answered. On the component, {{httpConfiguration}} 
with {{authMethod=NTLM}} is not used at all.

{code:java}
.to("http://localhost:8080/ntlm?authMethod=NTLM&authUsername=u&authPassword=p";);
 // no NTLM message sent
{code}

Expected: the endpoint sends the bearer token when the server asks for it, and 
with the first request when {{authenticationPreemptive=true}}, as the component 
configuration does. {{authMethod=NTLM}} uses NTLM with or without 
{{authDomain}}. The credentials stay scoped to the endpoint host.

_Claude Code on behalf of Federico Mariani_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to