docs-v2/content/enterprise_influxdb/v1/tools/influxd-ctl/token.md

1.1 KiB

title description menu weight
influxd-ctl token The `influxd-ctl token` command generates a signed [JSON Web Token (JWT)](https://jwt.io/).
enterprise_influxdb_v1
parent
influxd-ctl
201

The influxd-ctl token command generates a signed JSON Web Token (JWT).

Usage

influxd-ctl -auth-type jwt -secret <shared secret> token [flags]

{{% note %}}

Requires global flags

influxd-ctl token requires the -auth-type and -secret global flags.

  • Set -auth-type to jwt
  • Use -secret to provide your JWT shared secret {{% /note %}}

Flags

Flag Description
-exp Token expiration duration (default is 1m0s)

{{% caption %}} Also see influxd-ctl global flags. {{% /caption %}}

Examples

Generate a JWT token that expires in 5 minutes
influxd-ctl \
  -auth-type jwt \
  -secret sHaR3dS3cRe7 \
  token -exp 5m