How to read the superuser access token in InfluxDB 2.6.1

I don’t know why they chose to restrict viewing of tokens in the UI. It’s a silly decision since a) recovering them is trivial via the CLI, and b) all subsequently created tokens are automatically scoped to the org-id that they’re created under (which is presumably why backups need the root token).

First make sure you are logged into the UI and switched into the org that you originally setup influxdb with. If you haven’t setup any additional orgs, then just being logged in is sufficient. Then create a new temporary all-access token in the UI, and then copy its value to use in the following command:

influx auth list -t <temporary token>

The root token should be the first one listed, and will have permissions that look like this:

[read:/authorizations write:/authorizations read:/buckets write:/buckets read:/dashboards write:/dashboards read:/orgs write:/orgs read:/sources write:/sources read:/tasks write:/tasks read:/telegrafs write:/telegrafs read:/users write:/users read:/variables write:/variables read:/scrapers write:/scrapers read:/secrets write:/secrets read:/labels write:/labels read:/views write:/views read:/documents write:/documents read:/notificationRules write:/notificationRules read:/notificationEndpoints write:/notificationEndpoints read:/checks write:/checks read:/dbrp write:/dbrp read:/notebooks write:/notebooks read:/annotations write:/annotations read:/remotes write:/remotes read:/replications write:/replications]

While the permissions for any other tokens created afterwards will contain the org-id they’re scoped to.

Then delete the temporary token in the UI to clean up.

1 Like