Add RestTemplate overloads to ClientRegistrations methods#19011
Closed
vpelikh wants to merge 1 commit intospring-projects:mainfrom
Closed
Add RestTemplate overloads to ClientRegistrations methods#19011vpelikh wants to merge 1 commit intospring-projects:mainfrom
vpelikh wants to merge 1 commit intospring-projects:mainfrom
Conversation
Signed-off-by: Vasily Pelikh <2010720+vpelikh@users.noreply.github.com>
Author
|
Hey @jgrandja! Can you check this one? |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces overloaded methods in
ClientRegistrationsthat accept a customRestTemplate:fromOidcIssuerLocation(RestTemplate restTemplate, String issuer)fromIssuerLocation(RestTemplate restTemplate, String issuer)Fixes #16833 #16920
Motivation
Currently, the discovery endpoints (OIDC and OAuth2) are called using a static
RestTemplatewith fixed connection/read timeouts. This limits customization for users who need to:By providing overloads that accept a
RestTemplate, users can now inject their own configured instance while reusing the existing discovery logic.Changes
fromOidcIssuerLocation(String)andfromIssuerLocation(String)) delegate to the new overloads using the default staticRestTemplate.oidc(...),oidcRfc8414(...),oauth(...)andgetRfc8414Builder(...)methods were updated to accept aRestTemplateparameter; the existing static supplier-based approach remains unchanged.RestTemplateor empty issuer handlingImpact
RestTemplatefor discovery requests.Testing
MockWebServerto simulate various discovery endpoints and responses.Please review and let me know if any additional changes are needed.