2022-12-19 18:43:46 +01:00
|
|
|
# Authentication
|
|
|
|
|
|
2023-01-04 19:14:47 +01:00
|
|
|
Long-lived tokens can be generated to perform actions on behalf of your user account:
|
|
|
|
|
|
2023-08-23 12:27:57 +03:00
|
|
|
```shell
|
2023-01-04 19:14:47 +01:00
|
|
|
coder tokens create
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You can use tokens with the Coder's REST API using the `Coder-Session-Token` HTTP header.
|
|
|
|
|
|
2023-02-01 17:05:45 -03:00
|
|
|
```console
|
2023-01-04 19:14:47 +01:00
|
|
|
curl 'http://coder-server:8080/api/v2/workspaces' \
|
|
|
|
|
-H 'Coder-Session-Token: *****'
|
|
|
|
|
```
|