ES + SHIELD - 1 node (everythig is local)
admin account (realm)
SHIELD : trial version
curl -u jpv -XGET 'http://localhost:9200/' works fine
http://localhost:9200/ in browser (chrome) works fine (ask user/passw dialog)
with elasticsearch.js (nodejs/iojs and in browser/js app ) :
var es = require('elasticsearch');
var client = new es.Client({
host: 'http://localhost:9200',
auth : "admin:admin",
log: 'trace'
});
client.count(function(err,resp,sta) {
console.log(err,resp); // **got 401 !!! AuthenticationException[missing authentication token for REST **!
})
Please notice in the browser (javascript app) : no Authorization headers like
Authorization:Basic blablablabla=
Something wrong somewhere ?
Update
WTF ? for EACH query, adding parameters:
size : 100,
body : { .....},
headers: {
Authorization: "Basic anB2Omtlcm5pc2k=" //base64 user:pwd
}
WORKS FINE. But it's a absurd !!!!!!!