Describe the bug
Using spring-cloud-openfeign-core-4.3.0.jar, if the application.yml configuration provides
spring:
security:
oauth2:
client:
registration:
fancy:
client-id: jane.appeo
client-secret: ${env:SUPER_SECRET}
provider: fancy-authserver
authorization-grant-type: client_credentials
provider:
fancy-authserver:
token-uri: http://localhost:9999
cloud:
openfeign:
oauth2:
enabled: true
clientRegistrationId: fancy
When the configuration spring.cloud.openfeign.oauth2.clientRegistrationId is set with CamelCase it is matched correctly, but when using spring.cloud.openfeign.oauth2.client-registration-id with dash-case the identifier is not matched when creating the OAuth2AccessTokenInterceptor at FeignAutoConfiguration#defaultOAuth2AccessTokenInterceptor.
Sample
This was found debugging some kind of test. I will try provide later a full test with the situation