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

Support for API Tokens when Basic Auth is not enabled. #196

Closed
tamirshaul opened this issue Jan 3, 2022 · 1 comment
Closed

Support for API Tokens when Basic Auth is not enabled. #196

tamirshaul opened this issue Jan 3, 2022 · 1 comment

Comments

@tamirshaul
Copy link

Current implementation is sending the API-Token as a Basic authorization password with the special username api_key:

?curl http://api_key:eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk@localhost:3000/api/org

When Basic Auth is not enabled, this method doesn't work resulting with this issue:

?curl http://api_key:eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk@localhost:3000/api/org
Bad Request: Not allowed.

Resolution:
Make API-Token authentication with the Authorization header, like this (from the docs):

GET http://your.grafana.com/api/dashboards/db/mydash HTTP/1.1
Accept: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

with curl:

?curl -H "Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk" http://your.grafana.com/api/dashboards/db/mydash
@PatMis16
Copy link
Contributor

PatMis16 commented Jan 5, 2022

@tamirshaul
I am happy to inform you, that the changes are merged in the main branch.

See: 978538c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants