Class CreateTokenRequestBuilder

java.lang.Object
org.elasticsearch.action.ActionRequestBuilder<CreateTokenRequest,CreateTokenResponse>
org.elasticsearch.xpack.core.security.action.token.CreateTokenRequestBuilder
All Implemented Interfaces:
RequestBuilder<CreateTokenRequest,CreateTokenResponse>

public final class CreateTokenRequestBuilder extends ActionRequestBuilder<CreateTokenRequest,CreateTokenResponse>
Request builder used to populate a CreateTokenRequest
  • Constructor Details

  • Method Details

    • setGrantType

      public CreateTokenRequestBuilder setGrantType(String grantType)
      Specifies the grant type for this request. Currently only password is supported
    • setUsername

      public CreateTokenRequestBuilder setUsername(@Nullable String username)
      Set the username to be used for authentication with a password grant
    • setPassword

      public CreateTokenRequestBuilder setPassword(@Nullable SecureString password)
      Set the password credentials associated with the user. These credentials will be used for authentication and the resulting token will be for this user
    • setScope

      public CreateTokenRequestBuilder setScope(@Nullable String scope)
      Set the scope of the access token. A null scope implies the default scope. If the requested scope differs from the scope of the token, the token's scope will be returned in the response
    • setRefreshToken

      public CreateTokenRequestBuilder setRefreshToken(@Nullable String refreshToken)