Bootstrap FreeKB - Hashicorp Vault - Lookup Token using REST API
Hashicorp Vault - Lookup Token using REST API

Updated:   |  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 Buy Me A Coffee



Comments


Add a Comment


Please enter d26d7e in the box below so that we can be sure you are a human.