private String getHeadlessChallenge(String username)
      throws IOException {

    CloseableHttpClient httpClient = HttpClientBuilder.create().build(); //Use this instead
    String encodedPassword = null;

    try {
      logger.debug("Azkaban URL is " + _azkabanUrl);
      logger.debug("Username  " + username);
      String userUrl = _azkabanUrl + "/restli/liuser?action=headlessChallenge";
      HttpPost request = new HttpPost(userUrl);
      StringEntity params = new StringEntity("{\"username\":\"" + username + "\"}");
      request.addHeader("content-type", "application/json");
      request.setEntity(params);
      HttpResponse response = httpClient.execute(request);
      logger.debug("Response is " + response);
      String responseString = EntityUtils.toString(response.getEntity());
      JSONObject jobject = new JSONObject(responseString);
      encodedPassword = jobject.getString("value");
    } catch (Exception ex) {
      throw new RuntimeException("Unexpected exception in decoding headless account " + ex.toString());
    } finally {
      httpClient.close();
      return encodedPassword;
    }
  }
@param username The username of the user
@return Encoded password of the user
@throws IOException private String getHeadlessChallenge(String username) throws IOException {
app/com/linkedin/drelephant/clients/azkaban/AzkabanWorkflowClient.java