Thanks Francis. Very well explained.
With your help I am able to create a token with a role as below:
1) vault write /auth/token/roles/myrole1 allowed_policies="myReadPolicy"
2) vault token-create -role myrole1
3) C:\Users\njain>vault token-lookup 12e83550-afaa-30f0-784c-5c23b38e9097
Key Value
accessor 16977dd4-800b-dba1-cce4-e29cf91b354f
creation_time 1.465474451e+09
creation_ttl 3.1536e+07
display_name token
id 12e83550-afaa-30f0-784c-5c23b38e9097
meta <nil>
num_uses 0
orphan false
path auth/token/create/myrole1
policies [default myReadPolicy]
role myrole1
ttl 3.1535971e+07
4) vault token-renew 12e83550-afaa-30f0-784c-5c23b38e9097 87600h
Key Value
token 12e83550-afaa-30f0-784c-5c23b38e9097
token_accessor 16977dd4-800b-dba1-cce4-e29cf91b354f
token_duration 157679838
token_renewable true
token_policies [default myReadPolicy]
my vault configuration is as below:
default_lease_ttl="8760h"
max_lease_ttl="43800h"
If you see above, renewal does not make the ttl equivalent to 87600h. It is making ttl only to max_lease_ttl (157680000 s), which means it is obeying the rule to limit max allowed ttl to max_lease_ttl setting.
How exactly is periodic token(with no expiration) created? Am I missing something fundamental?
Thanks.
Niks