spring-projects / spring-projects/spring-security
Adjust ClientRegistrations to allow to inject own instance of RestTemplate, ideally to use RestClient instead of ResTemplate
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Expected Behavior
ClientRegistrations should provide ability to inject own instance of RestTemplate, ideally if it would be RestClient, instead of RestTemplate.
Current Behavior
Right now org.springframework.security.oauth2.client.registration.ClientRegistrations creates instance of RestTemplate and doesn't provide any ability to replace it with another instance.
Context
In some cases it is needed to use RestTemplate with disabled SSL check. Also it would be great to be able to use RestClient instead of RestTemplate, so it can be defined in declarative way with https://github.com/ch4mpy/spring-addons library.
More context with alternative solutions can be found in comment https://github.com/ch4mpy/spring-addons/issues/254#issuecomment-2756709068.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ClientRegistrations class and trace where it creates its RestTemplate. Compare the requested injection of a caller-provided RestTemplate with the possibility of using RestClient, then define what the public API and existing OAuth client-registration behavior should be when either option is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100