Skip to content

Instantly share code, notes, and snippets.

@legal90
Last active May 11, 2016 17:40
Show Gist options
  • Save legal90/5c21ff764a5b5ec46febf983cb57d518 to your computer and use it in GitHub Desktop.
Save legal90/5c21ff764a5b5ec46febf983cb57d518 to your computer and use it in GitHub Desktop.
Vault renews a token at the first time only
# Create a new token
$ vault token-create -orphan -policy "default" -ttl 2000000s
Key Value
token 40b09a00-083b-faec-6520-39daedb62003
token_accessor 1eb62684-c263-85b8-78d7-d233f095988d
token_duration 2000000
token_renewable true
token_policies [default]
# Try to renew it
$ vault token-renew 40b09a00-083b-faec-6520-39daedb62003
Key Value
token 40b09a00-083b-faec-6520-39daedb62003
token_accessor 1eb62684-c263-85b8-78d7-d233f095988d
token_duration 2591982
token_renewable true
token_policies [default]
# Wait a bit and try to renew it again
$ vault token-renew 40b09a00-083b-faec-6520-39daedb62003
Key Value
token 40b09a00-083b-faec-6520-39daedb62003
token_accessor 1eb62684-c263-85b8-78d7-d233f095988d
token_duration 2591966
token_renewable true
token_policies [default]
# 'token_duration' has not been increased!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment