2017-09-08 02:12:42 +00:00
|
|
|
---
|
2020-01-18 00:18:09 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: token lookup - Command
|
2017-09-08 02:12:42 +00:00
|
|
|
description: |-
|
|
|
|
The "token lookup" displays information about a token or accessor. If a TOKEN
|
|
|
|
is not provided, the locally authenticated token is used.
|
|
|
|
---
|
|
|
|
|
|
|
|
# token lookup
|
|
|
|
|
|
|
|
The `token lookup` displays information about a token or accessor. If a TOKEN is
|
|
|
|
not provided, the locally authenticated token is used.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Get information about the locally authenticated token (this uses the
|
|
|
|
`/auth/token/lookup-self` endpoint and permission):
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2017-09-08 02:12:42 +00:00
|
|
|
$ vault token lookup
|
|
|
|
```
|
|
|
|
|
|
|
|
Get information about a particular token (this uses the `/auth/token/lookup`
|
|
|
|
endpoint and permission):
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2017-09-08 02:12:42 +00:00
|
|
|
$ vault token lookup 96ddf4bc-d217-f3ba-f9bd-017055595017
|
|
|
|
```
|
|
|
|
|
|
|
|
Get information about a token via its accessor:
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2017-09-08 02:12:42 +00:00
|
|
|
$ vault token lookup -accessor 9793c9b3-e04a-46f3-e7b8-748d7da248da
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
The following flags are available in addition to the [standard set of
|
2023-01-26 00:12:15 +00:00
|
|
|
flags](/vault/docs/commands) included on all commands.
|
2017-09-08 02:12:42 +00:00
|
|
|
|
2023-07-18 21:07:55 +00:00
|
|
|
### Output options
|
2017-09-08 02:12:42 +00:00
|
|
|
|
|
|
|
- `-format` `(default: "table")` - Print the output in the given format. Valid
|
|
|
|
formats are "table", "json", or "yaml". This can also be specified via the
|
|
|
|
`VAULT_FORMAT` environment variable.
|
|
|
|
|
2023-07-18 21:07:55 +00:00
|
|
|
### Command options
|
2017-09-08 02:12:42 +00:00
|
|
|
|
|
|
|
- `-accessor` `(bool: false)` - Treat the argument as an accessor instead of a
|
|
|
|
token. When this option is selected, the output will NOT include the token.
|