Return 401 for API requests with invalid Authorization
headers
#3626
Labels
🕹 aspect: interface
Concerns end-users' experience with the software
✨ goal: improvement
Improvement to an existing user-facing feature
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: api
Related to the Django API
Problem
The API automatically downgrades requests with invalid authentication details to an anonymous request. This has two problems:
Description
Requests where
"Authorization" in requests.HEADERS and not request.auth
should be rejected with a 401 response, with an explanation that authentication failed due to invalid credentials.Additional context
Related to this issue to combine anonymous rate limiting from the frontend and API: https://github.com/WordPress/openverse-infrastructure/issues/746
The text was updated successfully, but these errors were encountered: