How to authenticate to elasticsearch via shield plugin in code part

I want to know is there any way to authenticate to elasticsearch via shield plugin using JSON or php. For example, to connect to mysql database through php we have a function mysqli_connect(). Is there any similar way to authenticate in php or JSON code instead of specifying in the URL?

Are you using the PHP client? See https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/_security.html

1 Like