Is your feature request related to a problem? Please describe.
Without auto configuration that enables load balanced AccessTokenProvider I need to :
a) Skip autoconfiguration and use my own custom OAuth2FeignRequestInterceptor
or
b) Post process autoconfigured OAuth2FeignRequestInterceptor in order to provide load-balanced AccessTokenProvider
Describe the solution you'd like
org.springframework.cloud.loadbalancer.security.OAuth2LoadBalancerClientAutoConfiguration contains logic allowing to inject LoadBalancerInterceptor into Oauth2RestTemplate on specific configuration property flag.
Maybe it would be possible to extend FeignAutoconfiguration with possibility to configure its AccessTokenProvider to use LoadBalancerInterceptor/RetryLoadBalancerInterceptor in similar way ?
e.g:
1) property like : feign.oauth2.load-balanced.enabled would trigger injecting LoadBalancerInterceptor into OAuth2FeignRequestInterceptor.accessTokenProvider
Describe alternatives you've considered
Additional context If this is confirmed as good proposal - I could develop this and create a PR if You want.
Comment From: OlgaMaciaszek
Hello, @voytech, thanks for submitting the issue. Makes sense. Feel free to provide a PR.
Comment From: voytech
Hello, @voytech, thanks for submitting the issue. Makes sense. Feel free to provide a PR.
Thanks, I will submit PR for discussion/approval soon.
Comment From: OlgaMaciaszek
Done.