Influx datasource with "Forward OAuth Identity" not working with Alert queries

We have configured an Influx datasource with the “Forward OAuth Identity” flag checked.
This is working well for normal queries, but Alert-related queries are failing with 401 (unauthorized).
It seems that the token is not being forwarded for these queries.
Is this expected to work automatically, or is there some other configuration required?

Grafana 7.1.2

1 Like

Hi, I am from the same company as @banjaxed, solving the same issue mentioned above.

We have InfluxDB datasource, but with custom data endpoint (because of our database structure - we have more databases so the query from grafana is translated by the endpoint and then the proper database is queried again). Alerts are not working for us (401 - unauthorized).

But when we setup InfluxDB datasource directly to one of the databases, alerts are working as expected. We use Oauth forwarding in our custom endpoint setup.

I investigated queries and HTTP request/reponses and found differences in cookies in response and there is one of tokens (from gravitee API which makes endpoint) missing in non working setup. Do you think is it possible to setup our custom endpoint to work with alerts? (because it is InfluxDB where alerts should be supported). Are there any documented requirements for query endpoint to support alerts? (note that the datasource works for normal data queries but not for alerts). Or do we need to write our own backend plugin to support alerts, because our custom endpoint for influxDB is more like custom datasource?