Make user info response status check error only#9336
Closed
BenjaminFaal wants to merge 2 commits into
Closed
Conversation
This would otherwise fail on anything in the 2xx range thats not 200 OK. For example when i use the user-info-uri: https://vl.api.np.km.playstation.net/vl/api/v1/mobile/users/me/info it returns 201 Created (dont ask me why Sony chose that). Anyway i think this status check will still cover most cases by checking if its a 2xx status. Also this just works in the non reactive version: org.springframework.security.oauth2.client.userinfo.DefaultOAuth2UserService because it try catches the request.
jgrandja
reviewed
Jan 19, 2021
Collaborator
jgrandja
left a comment
There was a problem hiding this comment.
@BenjaminFaal I don't feel we can accept this PR based on a non-compliant provider. Have you reported this to Sony?
Contributor
Author
|
Hmm thats a valid point i always thought 2xx was considered success. You are right that Sony should fix this but the nonreactive version: org.springframework.security.oauth2.client.userinfo.DefaultOAuth2UserService just works because it only try-catches the RestClientException and UnknownContentTypeException exceptions which a 201 does not cause. |
Contributor
Author
Collaborator
|
Thanks for the PR @BenjaminFaal ! This is now in master and I'll have this backported as well. |
This was referenced Jan 25, 2021
jgrandja
pushed a commit
that referenced
this pull request
Jan 25, 2021
jgrandja
pushed a commit
that referenced
this pull request
Jan 25, 2021
jgrandja
pushed a commit
that referenced
this pull request
Jan 25, 2021
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 would otherwise fail on anything in the 2xx range thats not 200 OK. For example when i use the user-info-uri: https://vl.api.np.km.playstation.net/vl/api/v1/mobile/users/me/info it returns 201 Created (dont ask me why Sony chose that). Anyway i think this status check will still cover most cases by checking if its a 2xx status.
Also this just works in the non reactive version: org.springframework.security.oauth2.client.userinfo.DefaultOAuth2UserService because it try catches the request.