Invalidate a token
- DELETE /_security/oauth2/token
The access tokens returned by the get token API have a finite period of time for which they are valid.
After that time period, they can no longer be used.
The time period is defined by the xpack.security.authc.token.timeout setting.
The refresh tokens returned by the get token API are only valid for 24 hours. They can also be used exactly once. If you want to invalidate one or more access or refresh tokens immediately, use this invalidate token API.
While all parameters are optional, at least one of them is required.
More specifically, either one of token or refresh_token parameters is required.
If none of these two are specified, then realm_name and/or username need to be specified.
Request body
Responses
-
error_countnumberrequired -
The number of errors that were encountered when invalidating the tokens.
-
error_detailsobject[] -
Details about the errors. This field is not present in the response when
error_countis0. -
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byobject -
Same fields as
error_details -
root_causeobject[] -
Same fields as
error_details -
suppressedobject[] -
Same fields as
error_details