Example on using ldap authentication for apache http client to make rest api calls

71 views
Skip to first unread message

Rajesh Kohir

unread,
Apr 25, 2016, 4:23:13 AM4/25/16
to jBPM Usage
Hi,
Can any one give example on how to configure apache http client to use ldap authentication instead of Basic authentication.
For basic authentication,following is the code.

HttpClient client = HttpClientBuilder.create().build();
HttpGet get = new HttpGet(get_taskStatus_url);
String authData = userName + ":" + userName;
String encoded = new sun.misc.BASE64Encoder().encode(authData
.getBytes());
get.setHeader("Content-Type", "application/xml");
get.setHeader("Authorization", "Basic " + encoded);
get.setHeader("ACCEPT", "application/xml");

HttpResponse cgResponse = client.execute(get);

what changes i need to make in oder to make ldap authentication instead of basic authentication.

Any help is greatly appreciated.

thanks
Rajesh Kohir
Reply all
Reply to author
Forward
0 new messages