Hashicorp Vault - Display token details (lookup)

by
Jeremy Canfield |
Updated: June 15 2024
| Hashicorp Vault articles
This assumes you have installed the Hashicorp vault and that the vault is up and running, the vault has been unsealed, and that you have logged into the vault.
The vault token lookup command can be used to display the details of each token.
~]# vault token lookup
Key Value
--- -----
accessor vZerq5v1nd4y07nmddcwLZGp
creation_time 1629974775
creation_ttl 0s
display_name root
entity_id n/a
expire_time <nil>
explicit_max_ttl 0s
id s.7Vq9M9i71j0QHN8w6aIMHKDd
meta <nil>
num_uses 0
orphan true
path auth/token/root
policies [root]
ttl 0s
type service
Or you can lookup a specific token.
~]# vault token lookup s.7Vq9M9i71j0QHN8w6aIMHKDd
Key Value
--- -----
accessor vZerq5v1nd4y07nmddcwLZGp
creation_time 1629974775
creation_ttl 0s
display_name root
entity_id n/a
expire_time <nil>
explicit_max_ttl 0s
id s.7Vq9M9i71j0QHN8w6aIMHKDd
meta <nil>
num_uses 0
orphan true
path auth/token/root
policies [root]
ttl 0s
type service
And here is an example of what could be returned for a token that was issued after an approle login.
~]$ vault token lookup hvs.CAESIIz1mG8eopxydAo3uLlwXtVaIwKnzg6OW8ybmssX5u9ZGh4KHGh2cy5YREtxVmZvNGVQRWtHNW5DRU9lOVVWR0s
Key Value
--- -----
accessor bS4TbUAveIV90tK6UKNoYrky
creation_time 1718713304
creation_ttl 20m
display_name approle
entity_id f16abc13-51c8-a041-a89a-38b2077fa705
expire_time 2024-06-18T12:41:44.909255633Z
explicit_max_ttl 0s
id hvs.CAESIIz1mG8eopxydAo3uLlwXtVaIwKnzg6OW8ybmssX5u9ZGh4KHGh2cy5YREtxVmZvNGVQRWtHNW5DRU9lOVVWR0s
issue_time 2024-06-18T12:21:44.909260991Z
meta map[role_name:my-role]
num_uses 10
orphan true
path auth/approle/login
policies [default]
renewable true
ttl 19m22s
type service
Did you find this article helpful?
If so, consider buying me a coffee over at