Influxdb 2.0.5 influxql not working on grafana

Using influxdb 2.0.5 and Grafana 7.4.3
I’m not able make the connection work no matter what I do.

I keep getting InfluxDB Error: Forbidden .

My configurations are:

URL : influx.dns
This dns works, also tried with direct ip.

Access : Server

Header : Authorization Value : Token mytoken

Token was generated by login into the influx UI with the admin user.
I generated a token with de description admin

Database : mydb

I got the DB name by doing the command:

influx v1 dbrp create \
  --bucket-id bucketID \
  --db grafana \
  --rp grafana \

user : admin
Password : pass

I got this user and pass by running the command:

influx v1 auth create \
  --read-bucket mybucketid \
  --write-bucket mybucketid \
  --username admin

HTTP Method : GET

I can query the DB using the api like this and it works:

curl --get http://localhost:8086/query?db=example-db \
  --header "Authorization: Token YourAuthToken" \
  --data-urlencode "q=SELECT used_percent FROM example-db.example-rp.example-measurement WHERE host=host1"

Those configurations are the suggested ones in the documentation.
I also tried to brute force several combinations trying to find what could be wrong and nothing worked.

@AndreR have you tried configuring Grafana to instead use basic auth? i.e. the equivalent of this curl command:

curl --get http://localhost:8086/query?db=example-db \
  --user admin:pass \
  --data-urlencode "q=SELECT used_percent FROM example-db.example-rp.example-measurement WHERE host=host1"

Just an update.

The problem was solved.
Grafana was blocking the communication with the influx server.
I had to whitelist the server on the grafana configurations file.

For some reason influx doesn’t need to be whitelisted but influxql needs it.

You anyone else gets 403 Forbidden I recommend trying out the whitelist configuration.