Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OAuth2 documentation: Correct OAuth2ClientHttpRequestInterceptor usage #16172

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

harpreets789
Copy link
Contributor

@harpreets789 harpreets789 commented Nov 26, 2024

The code example in the "Access Protected Resources for the Current User" -> "Configure RestClient with ClientHttpRequestInterceptor" section was incorrect. Updated the example to use the correct OAuth2ClientHttpRequestInterceptor constructor and added a call to setClientRegistrationIdResolver. This ensures accurate usage of the API.

Closes gh-16165.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 26, 2024
@harpreets789
Copy link
Contributor Author

The sample code in the documentation has been corrected by instantiating the OAuth2ClientHttpRequestInterceptor with only the authorizedClientManager and setting the clientRegistrationIdResolver separately using the setClientRegistrationIdResolver() method.

Fixing the previous incorrect constructor usage in both the Java and Kotlin code samples.

@sjohnr sjohnr self-assigned this Nov 26, 2024
@sjohnr sjohnr added in: docs An issue in Documentation or samples type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 26, 2024
@sjohnr sjohnr added this to the 6.4.2 milestone Nov 26, 2024
@sjohnr sjohnr merged commit f5eccf7 into spring-projects:main Nov 26, 2024
6 checks passed
@sjohnr
Copy link
Member

sjohnr commented Nov 26, 2024

Thanks @harpreets789, this is now merged into main!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Code example in documentation is incorrect
3 participants