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();