Skip to content

Commit 05bf659

Browse files
docs: improve token renewal documentation consistency (#29693)
* docs: improve token renewal documentation consistency * Update website/content/docs/commands/token/renew.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/commands/token/renew.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/commands/token/renew.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> --------- Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
1 parent f74fec8 commit 05bf659

1 file changed

Lines changed: 44 additions & 5 deletions

File tree

website/content/docs/commands/token/renew.mdx

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,44 @@ revoked, or if the token has already reached its maximum TTL.
1717

1818
## Examples
1919

20-
Renew a token (this uses the `/auth/token/renew` endpoint and permission):
20+
Create a token first:
2121

2222
```shell-session
23-
$ vault token renew 96ddf4bc-d217-f3ba-f9bd-017055595017
23+
$ vault token create
24+
Key Value
25+
--- -----
26+
token hvs.CAESIJk8P_ieg60yf9c92rl0S5j1mdMh7docAoHVS2q7UQ8bGh4KHGh2cy5uQ3dNQUhvbnFhTWl5cVJpMGxpVDhMZWU
27+
token_accessor ntL634hzE0CtQnyCIqkxSa82
28+
token_duration 768h
29+
token_renewable true
30+
token_policies [default]
31+
```
32+
33+
Renew a token using the token value and the `/auth/token/renew` endpoint:
34+
35+
```shell-session
36+
$ vault token renew hvs.CAESIJk8P_ieg6Oyf9c92rl0S5j1mdMh7docAoHVS2q7UQ8bGh4KHGh2cy5uQ3dNQUhvbnFhTWl5cVJpMGxpVDhMZWU
37+
Key Value
38+
--- -----
39+
token n/a
40+
token_accessor ntL634hzE0CtQnyCIqkxSa82
41+
token_duration 768h
42+
token_renewable true
43+
token_policies [default]
44+
```
45+
46+
Alternatively, renew a token using its accessor value. Renewing with the
47+
accessor vault is is useful when you do not have the actual token:
48+
49+
```shell-session
50+
$ vault token renew -accessor ntL634hzE0CtQnyCIqkxSa82
51+
Key Value
52+
--- -----
53+
token n/a
54+
token_accessor ntL634hzE0CtQnyCIqkxSa82
55+
token_duration 768h
56+
token_renewable true
57+
token_policies [default]
2458
```
2559

2660
Renew the currently authenticated token (this uses the `/auth/token/renew-self`
@@ -33,15 +67,20 @@ $ vault token renew
3367
Renew a token requesting a specific increment value:
3468

3569
```shell-session
36-
$ vault token renew -increment=30m 96ddf4bc-d217-f3ba-f9bd-017055595017
70+
$ vault token renew -increment=30m hvs.CAESIJk8P_ieg6Oyf9c92rl0S5j1mdMh7docAoHVS2q7UQ8bGh4KHGh2cy5uQ3dNQUhvbnFhTWl5cVJpMGxpVDhMZWU
3771
```
3872

3973
Fail if the requested TTL increment cannot be fully fulfilled:
4074

4175
```shell-session
42-
$ vault token renew -increment=30m 96ddf4bc-d217-f3ba-f9bd-017055595017 --fail-if-not-fulfilled || vault login
76+
$ vault token renew -increment=30m hvs.CAESIJk8P_ieg6Oyf9c92rl0S5j1mdMh7docAoHVS2q7UQ8bGh4KHGh2cy5uQ3dNQUhvbnFhTWl5cVJpMGxpVDhMZWU --fail-if-not-fulfilled || vault login
4377
```
4478

79+
You can renew tokens using the token itself or the associated accessor.
80+
The `token_accessor` parameter lets you perform limited operations (like
81+
renewal) without requiring sensitive data so you can manage tokens
82+
without handling the secret token itself.
83+
4584
## Usage
4685

4786
The following flags are available in addition to the [standard set of
@@ -65,4 +104,4 @@ token. When this option is selected, the output will NOT include the token.
65104

66105
- `--fail-if-not-fulfilled` - Fail if the requested TTL increment cannot be
67106
fully fulfilled. Vault allows command chaining and token renewal request
68-
completion with capped duration even if renew request fails.
107+
completion with capped duration even if renew request fails.

0 commit comments

Comments
 (0)