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

API key authorization not working - getting 401 error #11715

Closed
subbaray opened this issue Apr 24, 2018 · 5 comments
Closed

API key authorization not working - getting 401 error #11715

subbaray opened this issue Apr 24, 2018 · 5 comments
Labels
needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc

Comments

@subbaray
Copy link

curl -H "Authorization: Bearer XXXXXXXXXXXXXXXXX" https://grafana.xxxx.com/api/dashboards/home"

I have created API key as admin in main org and got the above curl command provided during api key creation. But still it is not working.

@daniellee daniellee added the needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc label Apr 26, 2018
@daniellee
Copy link
Contributor

This works for me on my machine - you will need to provide more details for us to able to reproduce this.

  • you have an extra double quote at the end, is that just a typo?
  • any errors in the grafana server log?
  • any non-default settings in the config?
  • do you have multiple orgs?

@subbaray
Copy link
Author

subbaray commented May 7, 2018

Thanks. Please my responses for your questions.

  1. Yes. that is typo
  2. Grafana server log, I don't have access to check that.
  3. it has basic authentication disabled and rest are default
  4. yes. multiple orgs. But I used the main org to generate the API key as admin.

Below is the error.

<title>401 Unauthorized</title>

Unauthorized

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.


Server/2.4.29 (Unix) OpenSSL/1.0.2n mod_auth_kerb/5.4 Server at grafana.XXXX.com Port 443

@subbaray
Copy link
Author

subbaray commented May 7, 2018

Grafana version is v4.6.3

@daniellee
Copy link
Contributor

Not really sure how to help you - this is too little information to see what the problem is. Is it impossible to see the Grafana server logs?

Do any other api calls work? (Like the search endpoint)

@torkelo
Copy link
Member

torkelo commented Aug 16, 2018

closing due to lack of information to help / troubleshoot

@torkelo torkelo closed this as completed Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc
Projects
None yet
Development

No branches or pull requests

3 participants