open-consul/website/content/commands/logout.mdx

45 lines
1.1 KiB
Plaintext
Raw Normal View History

---
layout: commands
2020-04-07 18:55:19 +00:00
page_title: 'Commands: Logout'
description: >
2020-04-07 18:55:19 +00:00
The `logout` command will destroy the provided token if it was created from
`consul login`.
---
# Consul Logout
Command: `consul logout`
2022-01-11 13:26:58 +00:00
Corresponding HTTP API Endpoint: [\[POST\] /v1/acl/logout](/api-docs/acl#logout-from-auth-method)
The `logout` command will destroy the provided token if it was created from
`consul login`.
The table below shows this command's [required ACLs](/api#authentication). Configuration of
[blocking queries](/api-docs/features/blocking) and [agent caching](/api-docs/features/caching)
are not supported from commands, but may be from the corresponding HTTP endpoint.
| ACL Required |
| ------------ |
| `none` |
## Usage
Usage: `consul logout [options]`
-> The token to delete should be specified with the `-token` argument, the
`CONSUL_HTTP_TOKEN` environment variable, the `-token-file` argument, or the
`CONSUL_HTTP_TOKEN_FILE` environment variable.
#### API Options
2020-04-07 18:55:19 +00:00
@include 'http_api_options_client.mdx'
### Examples
Logout and delete a login token.
2020-05-19 18:32:38 +00:00
```shell-session
$ consul logout -token-file 'consul.token'
```