-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Status codes when authorised but without permission should be 403 #1091
Comments
I like this! I think we could change the behavior on G7. What do you think @bloodbare @vangheem ? |
I like it. In fact, I can't believe we weren't already doing it! I suppose the only potential negative here is exposure(tells you authentication was success but not authorization). I know some APIs these days that only ever hand out 404 and won't give you 401 or 403 to prevent exposing some of that knowledge(private github orgs/repos for example) |
I agree also! |
@vangheem Fairly good point. Would an |
That could work. Something as simple as:
But I'm open to anything that would be proposed. |
Currently, if a user is signed-in and attempts to access content which they do not have permission to access, Guillotina respondes with a status code of 401. My understanding is that this status code is used to indicate that the authentication method is either missing or invalid. I propose that in these situations, the status code should instead be a 403. As noted in the linked MDN docs, this status code indicates that while the authentication method may be valid, the application logic does not allow access to this resource, such as if the user has insufficient rights to the resource.
The text was updated successfully, but these errors were encountered: