首页 > 解决方案 > 在 Spring Boot 中通过 NTLM 和 Feign Client 进行身份验证

问题描述

我正在尝试使用 Feign Client 通过 NTLM 进行身份验证。

不幸的是,我有一个错误:

feign.FeignException $ Unauthorized: [401 Unauthorized] during [GET] to [url]

@FeignClient(name = "ntmlClient", url = "url", configuration = FeignClientConfiguration.class)
public interface NtmlClient {

@GetMapping(consumes = "application/json", produces = "application/json")
ResponseEntity<Aup> get();
}


@Configuration
public class FeignClientConfiguration {


@Bean
public BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
    return new BasicAuthRequestInterceptor("admin", "admin");
}

有什么提示吗?Feign Client 可以用于 NTLM 身份验证吗?

标签: springspring-bootntlmspring-cloud-feign

解决方案


推荐阅读