Skip to content

Make user info response status check error only #9336

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

Closed
wants to merge 2 commits into from

Conversation

BenjaminFaal
Copy link
Contributor

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.

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.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 12, 2021
Copy link
Contributor

@jgrandja jgrandja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenjaminFaal I don't feel we can accept this PR based on a non-compliant provider. Have you reported this to Sony?

@jgrandja jgrandja self-assigned this Jan 19, 2021
@jgrandja jgrandja added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 19, 2021
@BenjaminFaal
Copy link
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.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 19, 2021
@jgrandja jgrandja removed the status: feedback-provided Feedback has been provided label Jan 20, 2021
@jgrandja jgrandja added this to the 5.5.0-M2 milestone Jan 20, 2021
@jgrandja jgrandja added the type: bug A general bug label Jan 20, 2021
@BenjaminFaal
Copy link
Contributor Author

@jgrandja done, see c4f6f3f

@BenjaminFaal BenjaminFaal changed the title Make user info response status check accept all 2xx statuses Make user info response status check only fail on HTTP error statuses Jan 20, 2021
@jgrandja jgrandja changed the title Make user info response status check only fail on HTTP error statuses Make user info response status check error only Jan 25, 2021
@jgrandja jgrandja closed this in d85a7cf Jan 25, 2021
@jgrandja
Copy link
Contributor

Thanks for the PR @BenjaminFaal ! This is now in master and I'll have this backported as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants