Java 访问受kerberos保护的rest服务
我在同一JBoss服务器的两个节点中部署了两个war文件。我想从Java类访问REST服务。但是它抛出了一个Java 访问受kerberos保护的rest服务,java,spring,authentication,kerberos,gssapi,Java,Spring,Authentication,Kerberos,Gssapi,我在同一JBoss服务器的两个节点中部署了两个war文件。我想从Java类访问REST服务。但是它抛出了一个HttpClientErrorException:401未经授权的。应用程序由Kerberos保护,因此用户在访问此页面时已通过Kerberos身份验证。有没有办法访问此REST服务 HttpHeaders httpHeader=new HttpHeaders(); httpHeader.add("Content-Type", "application/json"); HttpEntity
HttpClientErrorException:401未经授权的。应用程序由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();
HttpHeaders-httpHeader=新的HttpHeaders();
添加(“内容类型”、“应用程序/json”);
HttpEntity headerEntity=新的HttpEntity(httpHeader);
ResponseEntity zoneResponse=restTemplate.exchange(
builder.build().encode().toUri(),
HttpMethod.GET,
头向性,
新的ParameteredTypeReference(){
});
Map-TaskRGMSTDT=zoneResponse.getBody();
祝你好运:另外,如果你不是胆小鬼,希望看到一些神秘的调试信息:-Dsun.security.spnego.debug=true
plus-Dsun.security.krb5.debug=true
plus-Djava.security.debug=gssloginconconfig,configfile,configparser,logincontext
祝你好运:,如果您不是胆小鬼,希望看到一些神秘的调试信息:-Dsun.security.spnego.debug=true
plus-Dsun.security.krb5.debug=true
plus-Djava.security.debug=gssloginconconfig、configfile、configparser、logincontext