webclient的ntlm身份验证

vvppvyoh  于 2021-07-15  发布在  Java
关注(0)|答案(0)|浏览(199)

如何使用SpringWebClient实现ntlm身份验证?我所能找到的只是以阻塞的方式使用restemplate。

CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(AuthScope.ANY, new NTCredentials(user, password, "source-host-name", "domain-name"));

CloseableHttpClient httpClient = HttpClients.custom()
                                            .setDefaultCredentialsProvider(credsProvider)
                                            .build();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);

RestTemplate restTemplate = new RestTemplate(requestFactory);

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题