1

I have deployed two war files in two nodes in the same JBoss server. I want to access a REST service from a Java class. But it is throwing a HttpClientErrorException: 401 Unauthorized. The application is secured with Kerberos so user is already authenticated by Kerberos when accessing this page. Is there a way to access this REST service?

HttpHeaders httpHeader=new HttpHeaders();
httpHeader.add("Content-Type", "application/json");
HttpEntity<String> headerEntity = new HttpEntity<String>(httpHeader);

ResponseEntity<Map<String,List<String>>> zoneResponse = restTemplate.exchange(
    builder.build().encode().toUri(),  
    HttpMethod.GET,
    headerEntity,
    new ParameterizedTypeReference<Map<String,List<String>>>(){
});
Map<String,List<String>> mapTaskRgMstDt = zoneResponse.getBody();
marcospereira
  • 12,045
  • 3
  • 46
  • 52
Milinda Saranga
  • 205
  • 3
  • 13
  • Good luck: https://issues.apache.org/jira/browse/HTTPCLIENT-1625 – Michael-O Oct 30 '16 at 21:47
  • Also, if you are not faint-hearted and wish to see some cryptic debugging information: `-Dsun.security.spnego.debug=true` plus `-Dsun.security.krb5.debug=true` plus `-Djava.security.debug=gssloginconfig,configfile,configparser,logincontext` – Samson Scharfrichter Nov 02 '16 at 10:36

0 Answers0