When a User visits a private dataset an ugly password prompt shows up:
https://stable.demo.geonode.org/catalogue/#/dataset/18150
The frontend attempts to fetch the dataset metadata via:
GET /api/v2/datasets/18150?api_preset=viewer_common&api_preset=dataset_viewer HTTP/1.1
response
401– Unauthorized
WWW-Authenticate | Basic realm="api"
This causes the browser to display a password prompt. When the user logs in, they still receive "Not Authenticated" error, creating a confusing UX.
Observations:
- This also occurs on other metadata endpoints (
/metadata/<id>/)
- While HTTP 401 is technically correct for authentication challenges, it's unnecessary here since the user cannot access the resource regardless of authentication
- The
WWW-Authenticate header triggers the browser's built-in login dialog.
a possible fix:
Return HTTP 403 Forbidden instead of 401. This will:
- Prevent the browser login prompt (no
WWW-Authenticate header)
- Clearly communicate "permission denied" to both users and API clients (e.g., QGIS)
- Improve UX without breaking API compatibility
When a User visits a private dataset an ugly password prompt shows up:
https://stable.demo.geonode.org/catalogue/#/dataset/18150
The frontend attempts to fetch the dataset metadata via:
response
This causes the browser to display a password prompt. When the user logs in, they still receive "Not Authenticated" error, creating a confusing UX.
Observations:
/metadata/<id>/)WWW-Authenticateheader triggers the browser's built-in login dialog.a possible fix:
Return HTTP 403 Forbidden instead of 401. This will:
WWW-Authenticateheader)