GrafanaimplicithighCluster of 13 signals
Card #3518 · Grafana

Difficulty passing OAuth2/Bearer tokens in custom datasource plugins

Developers are struggling to pass authentication tokens (OAuth2, Bearer, or Azure AD) from the Grafana login process to the backend API of custom datasource plugins. Many find that the 'With Credentials' option is insufficient and that there is no clear, generic way to inject the user's authorization header into outgoing requests.

GrafanaUpdated 2d ago0.24
Pain score
0.24/ 1.00 · weighted product of four components
Reach1.00
distinct authors (log-normalized)
Recency1.00
freshness decay, half-life months
Engagement0.86
upvotes + comments, normalized
Monetization0.50
willingness-to-pay cues in evidence
§ Evidence — 4 verified quotes
I do not understand how I can set the Authorization header of each api query with the token we get during the grafana authentication process.
Forum·@jackybourgeois··source ↗
the Authorization header that was returned to Grafana during the log-in phase is not passed on in the request, and so the data platform bounces the request with a 401 Unauthorized message.
Forum·@redhatter··source ↗
How do I get at that Bearer token so that I can provide it to the back-end server?
Forum·@redhatter··source ↗
Since there is no token option in the datasource configuration, I tried to provision my datasource with a yaml file in which I use the bearer info in the basicAuth key.
Forum·@br0mz··source ↗

Comments are a Pro feature — join the conversation, share what you've shipped, hear what others are building.

Upgrade to Pro