-
Notifications
You must be signed in to change notification settings - Fork 824
Open
Labels
Description
Multiple registration ids
In some environments it is required to support targeting multiple Oauth2 servers. The current solution for non-load-balanced feign clients only provide a single client-registration-id with the property spring.cloud.openfeign.oauth2.client-registration-id, so this is not possible.
Proposed solution
Add a new configuration: spring.cloud.openfeign.oauth2.client-registration-ids which should be a Map<String, String> mapping feign clients by name to a registration id. The default should still be spring.cloud.openfeign.oauth2.client-registration-id so there are no backward compatibility issues.
Other alternatives considered
- Using load-balanced clients
- Downsides
- A new
spring.security.oauth2.client.registrationandspring.security.oauth2.client.providermust be provided per each client if the clients use discrete names - Using the same name makes it difficult to do ad-hoc switching of hostname for a single client
- The logs do not show the actual URL called, which makes debugging much more difficult
- A new
- Downsides
- Make a local custom
OAuth2AccessTokenInterceptor
Reactions are currently unavailable