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

HTTP response should be 401 instead of 200 when accessing reporting API with wrong AUTH TOKEN #17310

Closed
heurteph-ei opened this issue Mar 5, 2021 · 3 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Milestone

Comments

@heurteph-ei
Copy link

Step to reproduce on the online demo server

Call https://demo.matomo.cloud/index.php?module=API&method=API.getMatomoVersion&token_auth=TOKEN_AUTH (yes, the authentication token is wrong, this is wanted)

Expected Behavior

If an error occurs, the HTTP response code should not be 2xx, but 4xx (in case of request error, in my case I am not authenticated so the HTTP error code should be 404) or 5xx (in case of server error or misconfiguration)

Current Behavior

image
I am not authenticated, I receive an error message, but the HTTP response is 200: OK "everything seems good"

Possible Solution

In case of error message (error result), never use HTTP 200, but at least HTTP 400 or HTTP 500

@heurteph-ei heurteph-ei added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Mar 5, 2021
@diosmosis diosmosis added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Mar 7, 2021
@diosmosis
Copy link
Member

Hi @heurteph-ei, you're right, thanks for the bug report!

@tsteur tsteur added this to the 5.0.0 milestone Mar 7, 2021
@tsteur
Copy link
Member

tsteur commented Mar 7, 2021

Just fyi this might affect various monitors and could break BC. So I'm putting this for now into Matomo 5 where we can consider doing this.

@justinvelluppillai
Copy link
Contributor

Closing as duplicate of #18055

@justinvelluppillai justinvelluppillai added the duplicate For issues that already existed in our issue tracker and were reported previously. label Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

4 participants