Can we create roles and users using JAVA api

Can we create roles and users for kibana using Java API ?

Is there any link for documentation of such api?

I have X-pack enabled.

Hello ,
oh I assume you are referring creating roles and users via https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html ?

unfortunately, i haven't done so using that client to know if it's possible or not. Usually, those language clients end up calling the actual APIs. Just out of curiosity are you using Java API client ?

Another easier way would be to use Security APIs to create users and roles:
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api.html

Thanks
Rashmi

Hi Rashmi,

I am looking for security operation or user/roles management using java api.

So, you can get a handle to the java api client via https://www.elastic.co/guide/en/x-pack/current/java-clients.html#security-client

beyond that, you will have to read the source here: https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/client/SecurityClient.java#L235

Cheers
Rashmi

Hi Rashmi,
Thank you. I was looking for SecurityClient.java only.

1 Like

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