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

Controllers not allowed returning bad request instead of 401 or 403 #132

Closed
Brend-Smits opened this issue May 20, 2020 · 3 comments · Fixed by #133
Closed

Controllers not allowed returning bad request instead of 401 or 403 #132

Brend-Smits opened this issue May 20, 2020 · 3 comments · Fixed by #133

Comments

@Brend-Smits
Copy link
Member

If a person is not allowed to perform a certain action because they don't have permission. It should not be returning Bad Request. It should return a 401 Unauthorized instead.

The coding guidelines should also be updated to reflect this change.

@StijnGroenen
Copy link
Member

It should return 401 Unauthorized if the user is not authenticated / signed in.
If the user is authenticated / signed in but it does not have the right permissions to perform an action it should return 403 Forbidden.

@wotwot563
Copy link

its debatable as seen in the rfc https://tools.ietf.org/html/rfc7235#section-3.1 its both possible, but my preference also goes out to 403

@Brend-Smits
Copy link
Member Author

Forbidden would be a good option if it allowed to ship a body. We can not describe to the user why they were forbidden.
With Unauthorized we can tell the user why the request was not allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants