我正在尝试配置一个请求拦截器,该拦截器基本上使用在请求中发送的相同授权令牌,并将其注入到伪装客户端中。
到目前为止,我做到了:
@Bean
public OAuth2RestTemplate customOauth2RestTemplate() {
OAuth2RestTemplate template = new OAuth2RestTemplate(customOauth2RemoteResource(),
new DefaultOAuth2ClientContext());
return template;
}
但是不起作用...
我不知道如何在不创建新的或不需要新信息的情况下告诉使用上下文中相同的令牌吗?