我可以创建一个OAuth2FeignRequestInterceptor来使用请求中使用的相同承载令牌吗?

时间:2019-02-21 14:55:39

标签: java spring oauth feign

我正在尝试配置一个请求拦截器,该拦截器基本上使用在请求中发送的相同授权令牌,并将其注入到伪装客户端中。

到目前为止,我做到了:

@Bean
public OAuth2RestTemplate customOauth2RestTemplate() {
  OAuth2RestTemplate template = new OAuth2RestTemplate(customOauth2RemoteResource(),
      new DefaultOAuth2ClientContext());
  return template;
}

但是不起作用...

我不知道如何在不创建新的或不需要新信息的情况下告诉使用上下文中相同的令牌吗?

0 个答案:

没有答案