Security API available through Java transport client?

Hi,

Is there a way to manage native users and roles using the Java transport client API? I'm using version 5.5.0.

Thanks,

Aaron

You should be able to use org.elasticsearch.xpack.security.client.SecurityClient for that.

Alternatively, you can simply use the request and response layer directly. Something like:

TransportClient client = buildClient();
PutUserRequestBuilder builder = new PutUserRequestBuilder(client);
builder.username("adesouza")
       .roles("kibana_user", "developer")
       .password(new char[]{ 's', 'e', 'c', 'r', 'e', 't', '1', '2', '3' });
ActionListener<PutUserResponse> listener = ActionListener.wrap( this::handleSuccess, this::handleFailure );
builder.execute(listener);

Thanks @TimV, don't know how I missed that!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.