I have created a custom kibana plugin, in that plugin i wanted to get infromation of user which has login with inbuilt API “GET _opendistro/_security/api/account”
@disha27
As you are using node.js client provided by elastic, this intentionally will not have support for opendistro.
Currently there are efforts to add new open source clients for connecting applications to any OpenSearch or Elasticsearch version 7 cluster, see further details here
But as of now, I don’t think there is anything else to offer the functionality you are looking for.
okay, my requirement is to disable custom plugin access for non-admin user. either by hiding it from left panel as like security plugin or disable text fields of all forms available inside plugin.
Is there any other way to check currently login user is admin or not and disable plugin access based on it?
@disha27
You should be able to call rest api _opendistro/_security/api/account from within your plugin using something like http.request, it might be awkward but should work.
I thought of using it this way as the last option. If there is no other way I may use axios to call this API.
but there is issue with this approach.
as elasticsearch API needs username/password, this API will print ouput for the user I have used to access API and not for the user logged in from kibana.