我在同一个JBoss服务器的两个节点中部署了两个war文件。我想从Java类访问REST服务。但它正在抛出一个HttpClientErrorException: 401 Unauthorized
。应用程序使用Kerberos进行保护,因此用户在访问此页面时已经过Kerberos身份验证。有没有办法访问此REST服务?
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();