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

🐞 [BUG] - Metrics Basic Auth #3

Closed
3 tasks done
kutovoys opened this issue Jan 11, 2025 · 1 comment
Closed
3 tasks done

🐞 [BUG] - Metrics Basic Auth #3

kutovoys opened this issue Jan 11, 2025 · 1 comment
Assignees
Labels
backend Request related to Backend. bug Something isn't working

Comments

@kutovoys
Copy link

Integrity requirements

  • I provided the complete config and logs, rather than just providing the truncated parts based on my own judgment.
  • I searched issues and did not find any similar issues.
  • The problem can be successfully reproduced in the latest release

Description

When accessing metrics via /api/metrics endpoint, instead of prompting for Basic Auth credentials, the server returns a 401 Unauthorized error in JSON format:

{
    "message": "Unauthorized",
    "statusCode": 401
}

Current behavior:

  • Direct browser access to /api/metrics returns 401 JSON response
  • No Basic Auth prompt appears in browser
  • Browser doesn't show authentication dialog

Expected behavior:

  • Browser should prompt for Basic Auth credentials
  • After successful authentication, metrics should be accessible

Environment:

  • Custom metrics credentials are configured in .env:
    ### PROMETHEUS ###
    METRICS_USER=xxx
    METRICS_PASS=xxxxxxx
    

Additional information:

  • The endpoint works correctly when accessed via Postman with Basic Auth credentials
  • The issue appears to be with how the authentication challenge is handled in the browser context

Reproduction Method

  1. Configure custom metrics credentials in .env file
  2. Start the application
  3. Try to access /api/metrics endpoint directly in browser
  4. Observe 401 JSON response instead of Basic Auth prompt
  5. Verify that the same endpoint works with Basic Auth in Postman
@kutovoys kutovoys added the bug Something isn't working label Jan 11, 2025
@kastov kastov added the backend Request related to Backend. label Jan 11, 2025
@kastov
Copy link
Contributor

kastov commented Jan 11, 2025

Fixed in 0.4.26.

@kastov kastov closed this as completed Jan 11, 2025
@kastov kastov self-assigned this Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Request related to Backend. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants