Getting 401 error when connecting from ElasticSearch-SQL if authentication is enabled

I am connecting to ElasticSearch from ElasticSearch-SQL with authentication enabled.

These are my CORS setting in ElasticSearch

http.cors.enabled: true
http.cors.allow-credentials: true
http.cors.allow-origin: "/.*/"
http.cors.allow-headers: WWW-Authenticate,X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization

In ElasticSearch-SQL page i am putting http://username:password@localhost:9200/ and getting this error

{  
   "error":{  
      "root_cause":[  
         {  
            "type":"security_exception",
            "reason":"missing authentication token for REST request [/_sql/_explain]",
            "header":{  
               "WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""
            }
         }
      ],
      "type":"security_exception",
      "reason":"missing authentication token for REST request [/_sql/_explain]",
      "header":{  
         "WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""
      }
   },
   "status":401
}

if tried from browser it is working fine using the below URL

http://username:password@localhost:9200/_sql?sql=select * from myindex limit 10

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