Make RestTemplate used by ClientRegistrations (Discovery) configurable
See original GitHub issueSummary
spring-security-oauth2-client uses a RestTemplate for openid/oauth Discovery that is not configurable. This is unuseable in scenarios where you need to adjust the RestTemplate. Example: You need to use a proxy and configure auth.
Actual Behavior
ClientRegistrations class uses a RestTemplate for doing OpenId Discovery that is not configurable, since it is not using RestTemplateBuilder or something comparable.
OpenId discovery is done by querying issuerUri + “/.well-known/openid-configuration” (for oidc) or isserUri + “/.well-known/oauth-authorization-server” (for oauth).
Current implementation:
RestTemplate rest = new RestTemplate()
Expected Behavior
ClientRegistrations should use a configurable RestTemplate for doing OpenId Discovery. One should be able to configure the requestFactory, interceptors, errorHandler and so on of that RestTemplate.
Configuration
Version
5.2.0.M3 and 5.1.5.RELEASE
Sample
Related #5607
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:15 (6 by maintainers)
@xenoterracide I took a look at your SO question. You can supply a custom
RestOperations
as follows:Current
Updated
Closing in favour of #8882. Please see ClientRegistrations and provide any additional feedback there.