[Feature Request] Service account auth for Grafana widget #1299
Replies: 2 comments 1 reply
-
Good idéal. My Grafana widget does't work since my LDAP migration. Service account is more secure. |
Beta Was this translation helpful? Give feedback.
-
I took a stab at this, since it looked simple, and with the detailed instructions provided by @davepgreene above it certainly was. I would submit a PR but the issue is most of the data the widget uses is from /api/admin/stats , which I discovered doesn't support tokens -
Until Grafana adds a token with the ability to have server wide permissions, I don't see a way of getting this to work as is. |
Beta Was this translation helpful? Give feedback.
-
Description
The Grafana widget only allows you to authenticate via basic auth (i.e. a username/password). It would be really nice if you could update the widget to also support service accounts that authenticate by sending the service account's token as a
Bearer
token rather than basic auth.The change should be simple. It would involve updating the grafana widget proxy handler to use the
credentialedProxyHandler
and add a conditional in this block that checks for the presence of akey
in thewidget
object and sets theAuthorization
header toBearer <key>
. In the event that ausername
andpassword
are provided it could fall back to using the base64 encodedBasic
auth that's provided from thegenericProxyHandler
.Other
No response
Beta Was this translation helpful? Give feedback.
All reactions