Hashicorp Vault - Lookup Token using REST API

by
Jeremy Canfield |
Updated: July 18 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.
A GET request can be submitted to the /v1/auth/token/lookup-self endpoint to display the details of your token. For example, using cURL.
curl --header "X-Vault-Token: hvs.Qnh8giVRh2QP5eNsrGCrpLeT" --request GET --url http://vault.example.com:8200/v1/auth/token/lookup-self
Something like this should be returned.
{
"auth": null,
"data": {
"accessor": "2EkFiIOqMTM1u08njWO5weQ0",
"creation_time": 1718709782,
"creation_ttl": 0,
"display_name": "root",
"entity_id": "",
"expire_time": null,
"explicit_max_ttl": 0,
"id": "hvs.Qnh8giVRh2QP5eNsrGCrpLeT",
"meta": null,
"num_uses": 0,
"orphan": true,
"path": "auth/token/root",
"policies": [
"root"
],
"ttl": 0,
"type": "service"
},
"lease_duration": 0,
"lease_id": "",
"renewable": false,
"request_id": "51f700d0-29ee-f0d0-8349-0f74e91bc166",
"warnings": null,
"wrap_info": null
}
Did you find this article helpful?
If so, consider buying me a coffee over at