Skip to content

Differentiate between HTTP 401 and 403 responses #24

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

Open
ikattey opened this issue Oct 19, 2024 · 1 comment
Open

Differentiate between HTTP 401 and 403 responses #24

ikattey opened this issue Oct 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ikattey
Copy link

ikattey commented Oct 19, 2024

The current implementation does not differentiate between HTTP 401 Unauthorized and HTTP 403 Forbidden responses.

At the moment, a HTTP 401 response is returned during request validation – regardless of whether the issue is related to authentication (missing / invalid credentials) or authorisation (missing required permissions / scopes).

This does not align with standard HTTP response code usage and could be improved.

Expected Behaviour

It should be possible to differentiate error responses based on the nature of the security failure:

  • HTTP 401 Unauthorized should be returned for missing or invalid authentication credentials.
  • HTTP 403 Forbidden should be returned for authenticated users lacking the necessary permissions or scopes.
@jamietanna
Copy link
Member

Very much agreed - with #35 it'll make it easier to control this, but we should see if we can make it even easier / out-of-the-box

@jamietanna jamietanna added the bug Something isn't working label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants