Bearer token inside a datasource plugin

Hi everybody.
I’m trying to build a Datasource plugin that should ask an API for some data.
The problem is that my API is behind an AuthMiddlewere that checks the bearer token.
I have 2 questions:

  • Is there a way to give the token to grafana (embedded in a IFRAME) without creating a variable inside the dashboard and send it in the urd of the iframe?
  • On the plugin code, how can I give the token ti the query?
    I’m using the getBackendSrv().datasourceRequest() method but i can’t fit the bearer inside.

How can I do it?

Thanks for the help

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.