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
Copy file name to clipboardExpand all lines: content/shared/v3-enterprise-get-started/_index.md
+37-29Lines changed: 37 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -234,19 +234,19 @@ _During the beta period, licenses are valid until May 7, 2025._
234
234
235
235
### Authentication and authorization
236
236
237
-
{{% product-name %}} uses token-based authentication and authorization which is enabled by default when you start the server.
238
-
With authentication enabled, you must provide an _admin token_ or _database token_ to access the server.
239
-
240
-
-**admin token**: Grants access to all CLI actions and API endpoints.
241
-
_ **database token**: Scoped to a specific database and grant access to write and query data in that database.
242
-
Creating a database token requires an admin token.
243
-
244
237
After you have [started the server](#start-influxdb), you can create and manage tokens using the `influxdb3` CLI or the HTTP API.
238
+
{{% product-name %}} uses token-based authentication and authorization which is enabled by default when you start the server.
239
+
With authentication enabled, you must provide a token to access server actions.
240
+
{{% product-name %}} supports the following types of tokens:
245
241
246
-
When you create a token InfluxDB 3 returns a token string in clear text
247
-
that you can use to authenticate CLI commands (using ) and API requests.
242
+
-**admin token**: Grants access to all CLI actions and API endpoints. A server can have one admin token.
243
+
-**resource tokens**: Fine-grained permissions tokens that grant read and write access to specific resources (databases and system information endpoints) on the server.
248
244
245
+
- Database tokens are scoped to a specific database and grant access to write and query data in that database. You can create multiple resource tokens for different databases
246
+
- System tokens grant read access to system information and metrics for the server
249
247
248
+
When you create a token, InfluxDB 3 returns a token string in clear text
249
+
that you use to authenticate CLI commands and API requests.
250
250
Securely store your token, as you won't be able to retrieve it later.
251
251
252
252
To have the `influxdb3` CLI use your admin token automatically, assign it to the
@@ -264,24 +264,16 @@ To have the `influxdb3` CLI use your admin token automatically, assign it to the
264
264
To create an admin token, use the `influxdb3 create token` subcommand and pass the `--admin` flag--for example:
265
265
266
266
```bash
267
-
influxdb3 create token --admin \
267
+
influxdb3 create token --admin \
268
268
--host http://{{< influxdb/host >}}
269
269
```
270
270
271
271
The command returns a token string that you can use to authenticate CLI commands and API requests.
272
272
Securely store your token, as you won't be able to retrieve it later.
273
273
274
-
To have the `influxdb3` CLI use your admin token automatically, assign it to the
275
-
`INFLUXDB3_AUTH_TOKEN` environment variable.
276
-
277
274
After you have created an admin token, you can use it to create database tokens and system tokens.
278
275
279
-
> [!Important]
280
-
>
281
-
> #### Securely store your tokens
282
-
>
283
-
> For security, InfluxDB only lets you view tokens when you create them.
284
-
> InfluxDB 3 stores a hash of the token in the catalog, so you can't retrieve the token after it is created.
276
+
For more information, see how to [Manage admin tokens](/influxdb3/version/admin/tokens/admin/).
285
277
286
278
#### Create a database token
287
279
@@ -293,8 +285,8 @@ To create a database token, use the `influxdb3 create token` subcommand and pass
293
285
-`--expiry` option with the token expiration time as a [duration](/influxdb3/enterprise/reference/glossary/#duration).
294
286
If an expiration isn't set, the token does not expire until revoked.
295
287
-`--token` option with the admin token to use for authentication
296
-
- Token permissions (read and write) in the `RESOURCE_TYPE:RESOURCE_NAMES:ACTIONS` format--for example:
297
-
- db:mydb:read,write
288
+
- Token permissions as a string literal in the `RESOURCE_TYPE:RESOURCE_NAMES:ACTIONS` format--for example:
289
+
-`"db:mydb:read,write"`
298
290
-`db:`: The `db` resource type, which specifies the token is for a database.
299
291
-`mydb`: The name of the database to grant permissions to. This part supports the `*` wildcard, which grants permissions to all databases.
300
292
-`read,write`: The permissions to grant to the token.
@@ -332,23 +324,39 @@ To create a system token, use the `influxdb3 create token` subcommand and pass t
332
324
If an expiration isn't set, the token does not expire until revoked.
333
325
-`--token` option with the admin token to use for authentication
334
326
-`--host` option with the server host
335
-
- Token permissions (read) in the `RESOURCE_TYPE:RESOURCE_NAMES:ACTIONS` format--for example:
336
-
- system:*:read
337
-
-`db:`: The `db` resource type, which specifies the token is for a database.
338
-
-`mydb`: The name of the database to grant permissions to. This part supports the `*` wildcard, which grants permissions to all databases.
339
-
-`read,write`: The permissions to grant to the token.
327
+
- Token permissions as a string literal in the `RESOURCE_TYPE:RESOURCE_NAMES:ACTIONS` format--for example:
328
+
-`"system:health:read"` or `"system:*:read"`
329
+
-`system:`: The `system` resource type, which specifies the token is for a database.
330
+
-`health`: The system resource (endpoint) to grant permissions to. This part supports the `*` wildcard, which grants permissions to all databases.
331
+
-`read`: Grant read permission to system information resources.
332
+
333
+
The following example shows how to create a system token that expires in 1 year and has read permissions for all system endpoints on the server:
340
334
335
+
```bash
336
+
influxdb3 create token \
337
+
--permission \
338
+
--expiry 1y \
339
+
--token ADMIN_TOKEN \
340
+
--host http://{{< influxdb/host >}} \
341
+
--name "rw all system endpoints" \
342
+
"system:*:read"
343
+
```
341
344
345
+
For more information, see how to [Manage resource tokens](/influxdb3/version/admin/tokens/resource/).
342
346
343
347
#### Use tokens to authorize CLI commands and API requests
344
348
345
349
- To authenticate `influxdb3` CLI commands, use the `--token` option or assign your
346
350
token to the `INFLUXDB3_AUTH_TOKEN` environment variable for `influxdb3` to use it automatically.
347
-
- To authenticate HTTP API requests, include `Bearer <TOKEN>` in the `Authorization` header--for example:
351
+
- To authenticate HTTP API requests, include `Bearer <TOKEN>` in the `Authorization` header value--for example:
0 commit comments