-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Revisit condition to create a OAuth2RestTemplate #5202
Comments
Actually there are 2 conditions: one on the To narrow the condition we would need to detect any intention by the user to have an The |
I can't find the discussion now, but I'm sure we talked about it the other day, so this is what I remember: Spring Cloud stopped creating |
* Removes the OAuth2RestTemplate bean (user should define his own) * Adds @userinfo qualifier for the template that is needed by the UserInfoTokenServices Still for discussion: * How to prevent the user app blowing up when he needs to autowire a RestTemplate and spring-boot-test wants to add a one as well (the github sample in this change shows that you can create a @primary one to work around that) * Do we need to further abstract the user info rest template. Most of the time the user won't care about it and it doesn't need to be a @bean. Perhaps it could be provided by a @bean that has an explicit factory contract? See spring-projectsgh-5507, spring-projectsgh-5202
I went ahead and removed the 2 lines bean definition. If a user needs that infrastructure, they can create it easily in their own config. When #5507 is implemented we should revisit this change to provide something similar for |
The doc currently states:
That's actually inaccurate. The mere presence of
security.oauth2.client.*
is enough to create the template. If you have those settings on the side in case you want to test OAuth, you can easily become in a situation where OAuth is "half-configured".Also, the documentation should clearly explain the impacts of having such template as it is flagged
@Primary
and would replace any vanillaRestTemplate
that was configured by the user.The text was updated successfully, but these errors were encountered: