Class InvalidateTokenRequest
- All Implemented Interfaces:
JsonpSerializable
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.
NOTE: 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.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<InvalidateTokenRequest>
Json deserializer forInvalidateTokenRequest
static final Endpoint<InvalidateTokenRequest,
InvalidateTokenResponse, ErrorResponse> Endpoint "security.invalidate_token
". -
Method Summary
Modifier and TypeMethodDescriptionstatic InvalidateTokenRequest
final String
The name of an authentication realm.final String
A refresh token.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
final String
token()
An access token.final String
username()
The username of a user.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forInvalidateTokenRequest
-
_ENDPOINT
public static final Endpoint<InvalidateTokenRequest,InvalidateTokenResponse, _ENDPOINTErrorResponse> Endpoint "security.invalidate_token
".
-
-
Method Details
-
of
public static InvalidateTokenRequest of(Function<InvalidateTokenRequest.Builder, ObjectBuilder<InvalidateTokenRequest>> fn) -
realmName
The name of an authentication realm. This parameter cannot be used with eitherrefresh_token
ortoken
.API name:
realm_name
-
refreshToken
A refresh token. This parameter cannot be used if any ofrefresh_token
,realm_name
, orusername
are used.API name:
refresh_token
-
token
An access token. This parameter cannot be used if any ofrefresh_token
,realm_name
, orusername
are used.API name:
token
-
username
The username of a user. This parameter cannot be used with eitherrefresh_token
ortoken
.API name:
username
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupInvalidateTokenRequestDeserializer
protected static void setupInvalidateTokenRequestDeserializer(ObjectDeserializer<InvalidateTokenRequest.Builder> op)
-