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
$ export INFLUX_TOKEN="apiv3_..."
$ export INFLUX_BASIC=$(echo -n "ignored:$INFLUX_TOKEN" | base64 -w 0)
$ curl -H "Authorization: Basic $INFLUX_BASIC" -X POST "http://localhost:8181/write?db=test" --data-binary "mymeas,mytag1=sometag value=0.56 $(date +%s%N)"
{"error":"Authorization header was malformed and should be in the form 'Authorization: Bearer <token>'"}
For completeness, all other cases seem to already be supported for v2 /api/v2/write and v1 /write:
# write (v2) - works with Bearer
$ export INFLUX_TOKEN="<token from 'influxdb3 create'>"
$ curl -H "Authorization: Bearer $INFLUX_TOKEN" -X POST "http://localhost:8181/api/v2/write?bucket=test" --data-binary "mymeas,mytag1=sometag value=0.51 $(date +%s%N)"
# write (v2) - works with Token
$ curl -H "Authorization: Token $INFLUX_TOKEN" -X POST "http://localhost:8181/api/v2/write?bucket=test" --data-binary "mymeas,mytag1=sometag value=0.52 $(date +%s%N)"
# write (v1) - works with Bearer
$ curl -H "Authorization: Bearer $INFLUX_TOKEN" -X POST "http://localhost:8181/write?db=test" --data-binary "mymeas,mytag1=sometag value=0.53 $(date +%s%N)"
# write (v1) - works with Token
$ curl -H "Authorization: Token $INFLUX_TOKEN" -X POST "http://localhost:8181/write?db=test" --data-binary "mymeas,mytag1=sometag value=0.54 $(date +%s%N)"
# write (v1) - works with username/password URL params
$ curl -X POST "http://localhost:8181/write?db=test&u=ignored&p=$INFLUX_TOKEN" --data-binary "mymeas,mytag1=sometag value=0.55 $(date +%s%N)"
The text was updated successfully, but these errors were encountered:
Basic auth is supported in 1.x: https://docs.influxdata.com/influxdb/v1/administration/authentication_and_authorization/#authenticate-with-basic-authentication. Since Core and Enterprise don't have users, they should support basic auth like other non-1.products where the password is the token string and the username is ignored (can be anything).
Telegraf uses Basic authentication when specifying username and password in the v1 influxdb output plugin: https://github.com/influxdata/telegraf/blob/master/plugins/outputs/influxdb/http.go#L503
Steps to reproduce:
On the server:
On the client:
For completeness, all other cases seem to already be supported for v2 /api/v2/write and v1 /write:
The text was updated successfully, but these errors were encountered: