public static String makeCallWithKerberosAuthn(final URI uri, final DefaultHttpClient httpClient, final String user,
final String pass, final int expectedStatusCode) throws IOException, URISyntaxException, PrivilegedActionException,
LoginException {
LOGGER.info("Requesting URI: " + uri);
httpClient.getAuthSchemes().register(AuthPolicy.SPNEGO, new JBossNegotiateSchemeFactory(true));
httpClient.getCredentialsProvider().setCredentials(new AuthScope(null, -1, null), new NullHCCredentials());
final HttpGet httpGet = new HttpGet(uri);
final HttpResponse response = httpClient.execute(httpGet);
int statusCode = response.getStatusLine().getStatusCode();
if (HttpServletResponse.SC_UNAUTHORIZED != statusCode || StringUtils.isEmpty(user)) {