You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(v2): Explain v1-compatible auth and add a troubleshooting section with a negative example. Putting a bow on #4393. Verified that Kapa.ai knows how to authenticate to v1 endpoints in each version
Copy file name to clipboardExpand all lines: content/shared/influxdb-v2/api-guide/api_intro.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ This section guides you through the most commonly used API methods.
5
5
6
6
For detailed documentation on the entire API, see the [InfluxDB v2 API Reference](/influxdb/version/reference/api/#influxdb-v2-api-documentation).
7
7
8
-
{{% note %}}
9
-
If you need to use InfluxDB {{< current-version >}} with **InfluxDB 1.x** API clients and integrations, see the [1.x compatibility API](/influxdb/version/reference/api/#influxdb-v1-compatibility-api-reference-documentation).
10
-
{{% /note %}}
8
+
> [!Tip]
9
+
> #### Use {{< current-version >}} API with InfluxDB 1.xclients
10
+
> If you need to use InfluxDB {{< current-version >}} with **InfluxDB 1.x** API clients and integrations, see the [1.x compatibility guide](/influxdb/version/reference/api/influxdb-1x/).
Token authentication requires the following credential:
@@ -259,7 +264,44 @@ Replace the following:
259
264
260
265
{{% /show-in %}}
261
266
262
-
##### InfluxQL support
267
+
### Troubleshoot authentication issues
268
+
269
+
#### Unauthorized when using the initial username and password
270
+
271
+
You can't use the InfluxDB 2.x username and password to authenticate with the InfluxDB 1.x compatibility API.
272
+
For example, given the following Docker Compose configuration:
273
+
274
+
```yaml
275
+
# Docker compose example
276
+
influx2:
277
+
image: influxdb:2.4.0
278
+
volumes:
279
+
- ./dev/influxdb2:/var/lib/influxdb2
280
+
ports:
281
+
- "8086:8086"
282
+
environment:
283
+
DOCKER_INFLUXDB_INIT_USERNAME: dev
284
+
DOCKER_INFLUXDB_INIT_PASSWORD: 12345678
285
+
DOCKER_INFLUXDB_INIT_ORG: com.some
286
+
DOCKER_INFLUXDB_INIT_BUCKET: m2_dev
287
+
DOCKER_INFLUXDB_INIT_MODE: setup
288
+
```
289
+
290
+
The following query using the v1 `/query` endpoint and v2 initial username and password returns an `unauthorized` error:
291
+
292
+
```bash
293
+
# Using the initial username and password
294
+
curl --get "http://localhost:8086/query" \
295
+
--data-urlencode "u=dev" \
296
+
--data-urlencode "p=12345678" \
297
+
--data-urlencode "db=m2_dev" \
298
+
--data-urlencode "q=SELECT * FROM default"
299
+
```
300
+
301
+
Instead, [authenticate with a token](#authenticate-with-the-token-scheme) or a [1.x username and password scheme](#authenticate-with-a-username-and-password-scheme).
302
+
303
+
304
+
## InfluxQL support
263
305
264
306
The compatibility API supports InfluxQL, with the following caveats:
0 commit comments