-
Notifications
You must be signed in to change notification settings - Fork 6k
Make OAuth2AccessToken converters public #7815
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
Make OAuth2AccessToken converters public #7815
Conversation
aab6ba7
to
0f39261
Compare
0f39261
to
cce2868
Compare
Nice idea, @nkonev, but I think that it would be better if we could make fewer changes to the public API. What if instead, you changed OAuth2AccessTokenResponseConverter responseConverter = ...;
OAuth2AccessTokenResponseHttpMessageConverter messageConverter = new ...;
messageConverter.setTokenResponseConverter(map -> {
map.put(TOKEN_TYPE, BEARER);
return responseConverter.convert(map);
}); Please see this commit to get a draft idea of what the resulting application code would look like. |
@jzheaux Thanks. My initial point was that provide better support for vk.com. |
cce2868
to
4bbb5e2
Compare
@jzheaux I did public inner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @nkonev!
I've left some feedback inline.
Also, would you be able to add some tests for these now-public classes?
Finally, will you please make the commit message 50 characters or less?
...ework/security/oauth2/core/http/converter/OAuth2AccessTokenResponseHttpMessageConverter.java
Show resolved
Hide resolved
...ework/security/oauth2/core/http/converter/OAuth2AccessTokenResponseHttpMessageConverter.java
Outdated
Show resolved
Hide resolved
...ework/security/oauth2/core/http/converter/OAuth2AccessTokenResponseHttpMessageConverter.java
Outdated
Show resolved
Hide resolved
4bbb5e2
to
87ba5cb
Compare
87ba5cb
to
e6321e2
Compare
@jzheaux done |
I want to use Spring Security with vk.com OAuth2 provider, but it doesn't respond tokenType json field in

token-uri: https://oauth.vk.com/access_token
. Here is documentation. If it displayed in Russian, you can switch language at bottom right corner.Just check chapter 4, it contains response example
It doesn't contains
token_type
field.So currently I get following exception.
It was working in org.springframework.security.oauth:spring-security-oauth2:2.3.5.RELEASE.
I think it is ok to give opportunity to configure default non-null tokenType to be able to use Spring Security with more non-typical OAuth2 providers like vk.com.
Here is my config