Elasticsearch-php: How do I add login validation

Created on 17 Apr 2018  Â·  3Comments  Â·  Source: elastic/elasticsearch-php

Summary of problem or feature request

Hello guys:

wiki Didn't explain the specific parameters, how should I through login authentication??

Code snippet of problem

       $builder = ClientBuilder::create();
        $builder->setHosts(array ('http://127.0.0.1:9630'));
        $client = $builder->build();
        $params  = array (
            "search_type" => "scan",
            'index'       => 'aires_all',
            'body'        => array (
                "query" => array (
                    "match_all" => array ()
                )
            )
        );
        $indices = $client->search($params);
Elasticsearch\Common\Exceptions\BadRequest400Exception : Unauthorized

System details

  • Operating System
  • PHP Version: PHP 7.1.11
  • ES-PHP client >= 6.0
  • Elasticsearch version6.0

Most helpful comment

Are you wanting to know how to setup HTTP Basic Authorization? There are some docs here:

https://www.elastic.co/guide/en/elasticsearch/client/php-api/6.0/_security.html

All 3 comments

Are you wanting to know how to setup HTTP Basic Authorization? There are some docs here:

https://www.elastic.co/guide/en/elasticsearch/client/php-api/6.0/_security.html

Wow! Thank you for your,This is what I want

Happy to help :) Goodluck!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

approached picture approached  Â·  4Comments

PascalThesing picture PascalThesing  Â·  7Comments

ezimuel picture ezimuel  Â·  6Comments

adoerrES picture adoerrES  Â·  5Comments

dinamic picture dinamic  Â·  5Comments