Skip to content
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

Introspection endpoint responds to invalid requests appropriately #126

Merged
merged 1 commit into from
Nov 25, 2016
Merged

Introspection endpoint responds to invalid requests appropriately #126

merged 1 commit into from
Nov 25, 2016

Conversation

kujenga
Copy link
Contributor

@kujenga kujenga commented Nov 25, 2016

This PR improves the behavior of the OAuth2 Introspection endpoint to respond with a more appropriate error message when the request is invalid. Currently, fosite responds to all requests other than those that are classified as "unauthorized" with an HTTP status code of 200 and body of {"active":"false"}.

While the spec doesn't define what to do in the case of an invalid request (at least not that I could find), I can't think of a reason that one would want to obscure the difference between an invalid request and some other kind of error. It definitely has the potential to be confusing though when one is developing an application! We ran into this case when accidentally using GET instead of POST on this endpoint.

[1] https://tools.ietf.org/html/rfc7662#section-2.3

@aeneasr aeneasr added the feat New feature or request. label Nov 25, 2016
@aeneasr aeneasr added this to the 0.7.0 milestone Nov 25, 2016
@aeneasr aeneasr self-assigned this Nov 25, 2016
@aeneasr aeneasr merged commit 9360f64 into ory:master Nov 25, 2016
@aeneasr
Copy link
Member

aeneasr commented Nov 25, 2016

Yup, that makes sense, thanks!

@kujenga kujenga deleted the introspection-invalid-request-errs branch November 29, 2016 02:59
budougumi0617 added a commit to budougumi0617/fosite that referenced this pull request May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants