Check for validity of a token

1,628 views
Skip to first unread message

Niks

unread,
Jan 17, 2017, 6:15:47 AM1/17/17
to Vault
Hi,

I am using Vault for transit backend with a file store for storage backend.

I need to use HTTP api to check if a token is valid or not, before using it to encrypt/decrypt. Is there any rest and point to check this in Vault?
If yes, please also let me know the request body required. 

Thanks.

Niks

Jason Antman

unread,
Jan 17, 2017, 6:36:17 AM1/17/17
to Vault
Niks,

Assuming you have access to the token itself, you can use the /auth/token/lookup-self API endpoint, which will either return 403 if the token is invalid/expired or a response including the token lifetime, policies, etc.

The request is a GET with no body/parameters other than authentication with the token in question. For information on the API endpoint, see https://www.vaultproject.io/docs/auth/token.html

-Jason

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/9d1b46ad-8c2f-46fd-b7da-a4b8ed6f0ee7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Niks

unread,
Jan 23, 2017, 6:05:58 AM1/23/17
to Vault
Great. Thanks Jason. This was exactly what I needed.

Niks
Reply all
Reply to author
Forward
0 new messages