Anonymous - 2016-04-26

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
        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.

Rajesh Kohir