Skip to content

password prompt on private datasets. #14244

@t-book

Description

@t-book

When a User visits a private dataset an ugly password prompt shows up:

https://stable.demo.geonode.org/catalogue/#/dataset/18150

Image

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions