hashicorp-vaultspring-cloud-vault-configspring-vault

How to know the validity of a vault token that is being used for connecting to vault?


Currently, I am connecting to a corporate vault service where I am using a vault token and passing it through below header in my spring cloud config service where properties of all microservices are kept.

curl -X "GET" "http://localhost:8080/my-client-microservice/dev" -H "X-Config-Token: s.myvaulttoken"

where http://localhost:8080 is my spring cloud config service and s.myvaulttoken is my vault token. This is working absolutely fine.

I want to know the validity of this token. What I have read the documentation that token can be of two type: service or batch. I want to know whether this token can be used infinitely (as root tokens validity is infinite).

enter image description here

Since the client microservices require the vault token, I want to figure out the way to know the validity of a token. Can you guys help me to tell more about this?

I followed this link: https://learn.hashicorp.com/vault/getting-started/authentication


Solution

  • Every non-root token has a time-to-live (TTL) associated with it.

    For example:

    This check is possible through the API as well.