-
Notifications
You must be signed in to change notification settings - Fork 6k
Register OAuth2AuthorizedClientArgumentResolver for XML Config #8669
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
Comments
Thanks for the report @realulim. The Java configuration registers The issue is that I'll add this to our backlog as an enhancement. |
Thank you for confirming and taking it on. As a workaround, would it be somehow possible to manually configure the OAuth2AuthorizedClientArgumentResolver? |
@realulim I just pushed this enhancement to master. Let me know how it goes. |
I checked out master and did ./gradlew install and ./gradlew build, but the generated jar in build/libs has no classes. Is there a place where binaries could be downloaded, perhaps a nightly build? |
@realulim You'll need to test this against the snapshot repository https://repo.spring.io/snapshot. |
I have tried this with the snapshot repo enabled and for the following gradle dependency:
Perhaps this is the wrong version tag, because the behavior is unchanged to what I see with version 5.3.3.RELEASE. |
@realulim The Spring versioning scheme changed recently - see announcement. Instead of Here is a working sample (xml-config branch) for your reference. |
I am still getting the same exception. My configuration is very similar to the example, only that I am using an external authorisation server and thus need a custom AccessTokenClient. I suppose at this point I need to create a minimal example to reproduce the error.
|
Yes, please put together a minimal sample that reproduces the issue. |
Describe the bug
Normally, when oauth2-login is configured, it is possible to inject @AuthenticationPrincipal and @RegisteredOAuth2AuthorizedClient into controller methods. The former always works, the latter only with Java configuration. With an XML configuration like this:
And controller code like this:
I am getting the following stacktrace:
With the equivalent configuration in Java it works. There might be a problem with the client registrations being an inner bean and somehow not getting managed properly in the OAuth2AuthorizedClientRepository.
The text was updated successfully, but these errors were encountered: