Skip to content

Commit 0950ca4

Browse files
committed
[DOCS] Adjust Invalidate Token REST API docs (#35622)
- Renames API to Invalidate Token - Explicitly calls out the possibility to invalidate refresh tokens via this API
1 parent 84ca8d8 commit 0950ca4

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

x-pack/docs/en/rest-api/security.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ include::security/create-users.asciidoc[]
7777
include::security/delete-app-privileges.asciidoc[]
7878
include::security/delete-role-mappings.asciidoc[]
7979
include::security/delete-roles.asciidoc[]
80-
include::security/delete-tokens.asciidoc[]
8180
include::security/delete-users.asciidoc[]
8281
include::security/disable-users.asciidoc[]
8382
include::security/enable-users.asciidoc[]
@@ -87,4 +86,5 @@ include::security/get-roles.asciidoc[]
8786
include::security/get-tokens.asciidoc[]
8887
include::security/get-users.asciidoc[]
8988
include::security/has-privileges.asciidoc[]
89+
include::security/invalidate-tokens.asciidoc[]
9090
include::security/ssl.asciidoc[]

x-pack/docs/en/rest-api/security/get-tokens.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ period is defined by the `xpack.security.authc.token.timeout` setting. For more
2929
information, see <<token-service-settings>>.
3030

3131
If you want to invalidate a token immediately, you can do so by using the
32-
<<security-api-invalidate-token,delete token API>>.
32+
<<security-api-invalidate-token,invalidate token API>>.
3333

3434

3535
==== Request Body

x-pack/docs/en/rest-api/security/delete-tokens.asciidoc renamed to x-pack/docs/en/rest-api/security/invalidate-tokens.asciidoc

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
[role="xpack"]
22
[[security-api-invalidate-token]]
3-
=== Delete token API
3+
=== Invalidate token API
44

5-
Invalidates a bearer token for access without requiring basic authentication.
5+
Invalidates an access token or a refresh token.
66

77
==== Request
88

99
`DELETE /_xpack/security/oauth2/token`
1010

1111
==== Description
1212

13-
The tokens returned by the <<security-api-get-token,get token API>> have a
13+
The access tokens returned by the <<security-api-get-token,get token API>> have a
1414
finite period of time for which they are valid and after that time period, they
1515
can no longer be used. That time period is defined by the
1616
`xpack.security.authc.token.timeout` setting. For more information, see
1717
<<token-service-settings>>.
1818

19-
If you want to invalidate a token immediately, use this delete token API.
19+
The refresh tokens returned by the <<security-api-get-token,get token API>> are
20+
only valid for 24 hours. They can also be used exactly once.
21+
22+
If you want to invalidate an access or refresh token immediately, use this invalidate token API.
2023

2124

2225
==== Request Body
2326

2427
The following parameters can be specified in the body of a DELETE request and
25-
pertain to deleting a token:
28+
pertain to invalidating a token:
29+
30+
`token` (optional)::
31+
(string) An access token. This parameter cannot be used when `refresh_token` is used.
32+
33+
`refresh_token` (optional)::
34+
(string) A refresh token. This parameter cannot be used when `token` is used.
2635

27-
`token` (required)::
28-
(string) An access token.
36+
NOTE: One of `token` or `refresh_token` parameters is required.
2937

3038
==== Examples
3139

@@ -40,6 +48,17 @@ DELETE /_xpack/security/oauth2/token
4048
--------------------------------------------------
4149
// NOTCONSOLE
4250

51+
whereas the following example invalidates the specified refresh token immediately:
52+
53+
[source,js]
54+
--------------------------------------------------
55+
DELETE /_xpack/security/oauth2/token
56+
{
57+
"refresh_token" : "movUJjPGRRC0PQ7+NW0eag"
58+
}
59+
--------------------------------------------------
60+
// NOTCONSOLE
61+
4362
A successful call returns a JSON structure that indicates whether the token
4463
has already been invalidated.
4564

0 commit comments

Comments
 (0)