Setting Credentials - 8.0

Talend ESB Service Developer Guide

Version
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend ESB
Talend Runtime
Content
Design and Development
Installation and Upgrade
Last publication date
2023-11-06

The "normal" CXF/JAX-WS method of setting user credentials via the BindingProvider.USERNAME_PROPERTY/PASSWORD_PROPERTY will work with the Async transport as well. However, the HttpAsyncClient library does have some additional capabilities around NTLM that can be leveraged. In order to use that, you need to:

  • Turn on the AutoRedirect and turn off the Chunking for the Conduit. This will allow CXF to cache the response in a manner that will allow the transport to keep resending the request during the authentication negotiation.

  • Force the use of the Async transport even for synchronous calls

    bp.getRequestContext().put("use.async.http.conduit", Boolean.TRUE);
  • Set the property "org.apache.http.auth.Credentials" to an instance of the Credentials. For example:

    Credentials creds = new NTCredentials("username", "pswd", null, "domain");
    bp.getRequestContext().put(Credentials.class.getName(), creds);