How to read Organizations from InfluxDB v2.0

Hello all,

I develop an application which first should read available Organizations, and based on the choose of the Organization it should list all available buckets. With generated token (read all) I’m able to read all information. With generated token (only read organisations) the json for /orgs is empty.

Another point is, that if I switch the influxdb instance there is not that token available which I would use for getting buckets and organizations.
The best solution for me would be to have a user and a password which I could recreate at another instance. Currently authentication doesn’t work with Basic Authentication.

This works:
QNetworkRequest request=QNetworkRequest(QUrl(QString(“http://%1:%2/api/v2/orgs”).arg(ipAdress.toString()).arg(port),QUrl::TolerantMode));
request.setRawHeader(“Authorization”,QByteArray("Token ").append(token));

This doesn’t work:
QNetworkRequest request=QNetworkRequest(QUrl(QString(“http://%1:%2/api/v2/orgs”).arg(ipAdress.toString()).arg(port),QUrl::TolerantMode));
request.setRawHeader(“Authorization”,QByteArray(“Basic “).append(username).append(”:”).append(password));

Hello @S_Pfeiffer,

With generated token (only read organisations) the json for /orgs is empty.

This part seems like a bug. Can you please file an issue here:

I’d also recommend creating a feature request there for a cross-organizational authentication token creation. I understand the need you have for it.

I’m sorry I can’t be of much help.