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

Grafana returns invalid API key if Authorization header is set #4

Open
jeznag opened this issue May 1, 2020 · 4 comments
Open

Grafana returns invalid API key if Authorization header is set #4

jeznag opened this issue May 1, 2020 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@jeznag
Copy link

jeznag commented May 1, 2020

{
  "message": "Invalid API key"
}

It seems to work if I remove the Authorization header

	r.Header.Del("Authorization")

as a quick win, I'd suggest changing the README to suggest not using Authorization as the header.

@jeznag
Copy link
Author

jeznag commented May 4, 2020

I think actually headers don't make sense because when Grafana requests assets (JS/CSS files), it will not pass the headers. Cookies are the only viable option.

@Sytten
Copy link
Contributor

Sytten commented May 8, 2020

Your right we don't use the header part so I dont think I tested it properly. Maybe we could change the authorization header to something custom (and configurable)?
We could exclude the static path form the check too what do you think?

@jeznag
Copy link
Author

jeznag commented May 9, 2020

Excluding static assets from the check could work. I think cookies is fine though. It works perfectly if you understand how to use it :) I am writing a blog post to help because I found it quite confusing. https://docs.google.com/document/d/1mk9nMoJA3rWYzsGUY1kLQkyAo5zEewGGWnv_GxJQSgs/edit?usp=sharing

@Sytten
Copy link
Contributor

Sytten commented May 9, 2020

Great to hear that, let me know when you publish it so I can link it here. I will see what I can do about the header next week. But yeah if you don't modify the frontend part of grafana, the only way to make it work is with cookies.

@Sytten Sytten added the documentation Improvements or additions to documentation label May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Development

No branches or pull requests

2 participants