How to set custom OAuth2RestTemplate or custom OAuth2ProtectedResourceDetails?
<p>I have frontend app with @EnableOAuth2Sso enabled. Also, I'd like to use custom OAuth2ProtectedResourceDetails to inject into all OAuth2RestTemplate beans (particularly to redefine behavior of OAuth2RestTemplate within OAuth2RestOperationsConfiguration).
I just defined my own bean for OAuth2ProtectedResourceDetails but OAuth2RestTemplate still uses the AuthorizationCodeResourceDetails).</p>

<pre><code>@SpringBootApplication(scanBasePackages = {"base.package"})
@EnableOAuth2Sso
@EnableZuulProxy
public class Application extends WebSecurityConfigurerAdapter {

public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
}

@Autowired
private RedirectUriResolver redirectUriResolver;

@Override
public void configure(HttpSecurity http) throws Exception {
    // some http configuration
}

@Bean
public OAuth2ProtectedResourceDetails resource() {
    AuthorizationCodeResourceDetails resource = new CustomAuthorizationCodeResourceDetails(redirectUriResolver);
    return resource;
}
}
</code></pre>

<p>Should I redefine whole OAuth2RestTemplate bean somehow or just this OAuth2ProtectedResourceDetails?</p>