Replacement for OAuth2FeignRequestInterceptor from spring-cloud-security?
See original GitHub issueIs your feature request related to a problem? Please describe.
For my Feign Clients I need to add an RequestInterceptor which enhances the requests with an OAuth Bearer Token. I still use the OAuth2FeignRequestInterceptor. But it simply states @deprecated will move to Spring Cloud Openfeign in next major release
I need quite it’s features as the oAuth provider Auth0 requires a non standard attribute “audience” - so I configure the interceptor with customized versions of DefaultOAuth2ClientContext, DefaultAccessTokenRequest, DefaultRequestEnhancer, ClientCredentialsAccessTokenProvider (which themselves all get @Deprecated - but the Migration Guide doesn’t really help me yet)
Describe the solution you’d like A 1:1 replacement for the OAuth2FeignRequestInterceptor or an equivalent which can handle additional attributes in the token request needed for Auth0 (“audience”).
Describe alternatives you’ve considered I stay with the deprecated OAuth2FeignRequestInterceptor and ignore all the Warnings in the logs and IDE 👎
Additional context There is also a question on StackOverflow addressing this issue from somebody else - but no answers or ideas yet.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:9 (2 by maintainers)
Top Related StackOverflow Question
@spencergibb this issue was not resolved: the OAuth2FeignRequestInterceptor class was moved to spring-cloud-openfeign, but the dependent classes like OAuth2ClientContext & OAuth2ProtectedResourceDetails have been deprecated and are now missing in spring security 5.x
I can not distill from above comments and stack overflow what is a valid approach bassing on spring security 5. I am missing integration/migration guides for feign like this one https://github.com/spring-projects/spring-security/wiki/OAuth-2.0-Migration-Guide where Feign unfortunately is not handled. @spencergibb please give advice