# Http basic authentication for node client

**URL:** <https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845>\
**Category:** Elasticsearch\
**Created:** [March 1, 2012, 5:47am UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845 "2012-03-01T05:47:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BARNEY](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@BARNEY](https://discuss.elastic.co/u/BARNEY)\
**Post date:** [March 1, 2012, 5:47am UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/1 "2012-03-01T05:47:10Z")

</div>

Hi,  
I would like to use http basic authentication plugin(https://  
[github.com/Asquera/elasticsearch-http-basic.git](http://github.com/Asquera/elasticsearch-http-basic.git)) and i want to know  
the way of connecting running node through java api;  
Below is my code for settings;

Settings s =  
ImmutableSettings.settingsBuilder().put("cluster.name",  
CLUSTER).put("http.enabled",Boolean.FALSE).put("http.basic.enabled",Boolean.TRUE).put("http.basic.user","username").put("http.basic.password","password").build();  
NodeBuilder nBuilder =  
nodeBuilder().settings(s).client(true);  
node = nBuilder.build().start();  
client = node.client();

When I try above lines,getting error as shown below......  
Exception in thread "main"  
org.elasticsearch.common.collect.ComputationException:  
java.lang.NoClassDefFoundError: org/elasticsearch/node/service/  
NodeService

please help me out in this

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 1, 2012, 12:33pm UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/2 "2012-03-01T12:33:53Z")

</div>

That plugin only applies to HTTP.

On Thursday, March 1, 2012 at 7:47 AM, BARNEY wrote:

> Hi,  
> I would like to use http basic authentication plugin(https://  
> [GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git) ([GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git))) and i want to know  
> the way of connecting running node through java api;  
> Below is my code for settings;
> 
> Settings s =  
> ImmutableSettings.settingsBuilder().put("cluster.name ([http://cluster.name](http://cluster.name))",  
> CLUSTER).put("http.enabled",Boolean.FALSE).put("http.basic.enabled",Boolean.TRUE).put("http.basic.user","username").put("http.basic.password","password").build();  
> NodeBuilder nBuilder =  
> nodeBuilder().settings(s).client(true);  
> node = nBuilder.build().start();  
> client = node.client();
> 
> When I try above lines,getting error as shown below......  
> Exception in thread "main"  
> org.elasticsearch.common.collect.ComputationException:  
> java.lang.NoClassDefFoundError: org/elasticsearch/node/service/  
> NodeService
> 
> please help me out in this

---

<div class="post-metadata">

**Author:** ![BARNEY](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@BARNEY](https://discuss.elastic.co/u/BARNEY)\
**Post date:** [March 1, 2012, 12:40pm UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/3 "2012-03-01T12:40:57Z")

</div>

Can you tell me if there is any way to perform authentication for this node  
client which is using optimized binary protocol.

On Thu, Mar 1, 2012 at 6:03 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> That plugin only applies to HTTP.
> 
> On Thursday, March 1, 2012 at 7:47 AM, BARNEY wrote:
> 
> Hi,  
> I would like to use http basic authentication plugin(https://  
> [GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git)) and i want to know  
> the way of connecting running node through java api;  
> Below is my code for settings;
> 
> Settings s =  
> ImmutableSettings.settingsBuilder().put("cluster.name",
> 
> CLUSTER).put("http.enabled",Boolean.FALSE).put("http.basic.enabled",Boolean.TRUE).put("http.basic.user","username").put("http.basic.password","password").build();  
> NodeBuilder nBuilder =  
> nodeBuilder().settings(s).client(true);  
> node = nBuilder.build().start();  
> client = node.client();
> 
> When I try above lines,getting error as shown below......  
> Exception in thread "main"  
> org.elasticsearch.common.collect.ComputationException:  
> java.lang.NoClassDefFoundError: org/elasticsearch/node/service/  
> NodeService
> 
> please help me out in this

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 1, 2012, 12:47pm UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/4 "2012-03-01T12:47:40Z")

</div>

No, there isn't, unless you tunnel it through one you build youserlf.

On Thursday, March 1, 2012 at 2:40 PM, kalyan chowdary wrote:

> Can you tell me if there is any way to perform authentication for this node client which is using optimized binary protocol.
> 
> On Thu, Mar 1, 2012 at 6:03 PM, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> 
> > That plugin only applies to HTTP.
> > 
> > On Thursday, March 1, 2012 at 7:47 AM, BARNEY wrote:
> > 
> > > Hi,  
> > > I would like to use http basic authentication plugin(https://  
> > > [GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git) ([GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git))) and i want to know  
> > > the way of connecting running node through java api;  
> > > Below is my code for settings;
> > > 
> > > Settings s =  
> > > ImmutableSettings.settingsBuilder().put("cluster.name ([http://cluster.name](http://cluster.name))",  
> > > CLUSTER).put("http.enabled",Boolean.FALSE).put("http.basic.enabled",Boolean.TRUE).put("http.basic.user","username").put("http.basic.password","password").build();  
> > > NodeBuilder nBuilder =  
> > > nodeBuilder().settings(s).client(true);  
> > > node = nBuilder.build().start();  
> > > client = node.client();
> > > 
> > > When I try above lines,getting error as shown below......  
> > > Exception in thread "main"  
> > > org.elasticsearch.common.collect.ComputationException:  
> > > java.lang.NoClassDefFoundError: org/elasticsearch/node/service/  
> > > NodeService
> > > 
> > > please help me out in this

---

<div class="post-metadata">

**Author:** ![BARNEY](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@BARNEY](https://discuss.elastic.co/u/BARNEY)\
**Post date:** [March 2, 2012, 4:47am UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/5 "2012-03-02T04:47:07Z")

</div>

Can you tell me the way of creating elasticsearch client which uses http  
protocol in java and performs same operations as node clinet so that I can  
use http basic authentication plugin.

On Thu, Mar 1, 2012 at 6:17 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> No, there isn't, unless you tunnel it through one you build youserlf.
> 
> On Thursday, March 1, 2012 at 2:40 PM, kalyan chowdary wrote:
> 
> Can you tell me if there is any way to perform authentication for this  
> node client which is using optimized binary protocol.
> 
> On Thu, Mar 1, 2012 at 6:03 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> That plugin only applies to HTTP.
> 
> On Thursday, March 1, 2012 at 7:47 AM, BARNEY wrote:
> 
> Hi,  
> I would like to use http basic authentication plugin(https://  
> [GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git)) and i want to know  
> the way of connecting running node through java api;  
> Below is my code for settings;
> 
> Settings s =  
> ImmutableSettings.settingsBuilder().put("cluster.name",
> 
> CLUSTER).put("http.enabled",Boolean.FALSE).put("http.basic.enabled",Boolean.TRUE).put("http.basic.user","username").put("http.basic.password","password").build();  
> NodeBuilder nBuilder =  
> nodeBuilder().settings(s).client(true);  
> node = nBuilder.build().start();  
> client = node.client();
> 
> When I try above lines,getting error as shown below......  
> Exception in thread "main"  
> org.elasticsearch.common.collect.ComputationException:  
> java.lang.NoClassDefFoundError: org/elasticsearch/node/service/  
> NodeService
> 
> please help me out in this

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 3, 2012, 9:52pm UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/6 "2012-03-03T21:52:53Z")

</div>

There ins't a built in client that uses HTTP and provides the same Client interface.

On Friday, March 2, 2012 at 6:47 AM, kalyan chowdary wrote:

> Can you tell me the way of creating elasticsearch client which uses http protocol in java and performs same operations as node clinet so that I can use http basic authentication plugin.
> 
> On Thu, Mar 1, 2012 at 6:17 PM, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> 
> > No, there isn't, unless you tunnel it through one you build youserlf.
> > 
> > On Thursday, March 1, 2012 at 2:40 PM, kalyan chowdary wrote:
> > 
> > > Can you tell me if there is any way to perform authentication for this node client which is using optimized binary protocol.
> > > 
> > > On Thu, Mar 1, 2012 at 6:03 PM, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> > > 
> > > > That plugin only applies to HTTP.
> > > > 
> > > > On Thursday, March 1, 2012 at 7:47 AM, BARNEY wrote:
> > > > 
> > > > > Hi,  
> > > > > I would like to use http basic authentication plugin(https://  
> > > > > [GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git) ([GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git))) and i want to know  
> > > > > the way of connecting running node through java api;  
> > > > > Below is my code for settings;
> > > > > 
> > > > > Settings s =  
> > > > > ImmutableSettings.settingsBuilder().put("cluster.name ([http://cluster.name](http://cluster.name))",  
> > > > > CLUSTER).put("http.enabled",Boolean.FALSE).put("http.basic.enabled",Boolean.TRUE).put("http.basic.user","username").put("http.basic.password","password").build();  
> > > > > NodeBuilder nBuilder =  
> > > > > nodeBuilder().settings(s).client(true);  
> > > > > node = nBuilder.build().start();  
> > > > > client = node.client();
> > > > > 
> > > > > When I try above lines,getting error as shown below......  
> > > > > Exception in thread "main"  
> > > > > org.elasticsearch.common.collect.ComputationException:  
> > > > > java.lang.NoClassDefFoundError: org/elasticsearch/node/service/  
> > > > > NodeService
> > > > > 
> > > > > please help me out in this

---

<div class="post-metadata">

**Author:** ![BARNEY](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@BARNEY](https://discuss.elastic.co/u/BARNEY)\
**Post date:** [March 5, 2012, 9:18am UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/7 "2012-03-05T09:18:51Z")

</div>

Is there any way to insert authentication token and sending it from the  
client side and verifying it on the server side(Elasticsearch)?

On Sun, Mar 4, 2012 at 3:22 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> There ins't a built in client that uses HTTP and provides the same Client  
> interface.
> 
> On Friday, March 2, 2012 at 6:47 AM, kalyan chowdary wrote:
> 
> Can you tell me the way of creating elasticsearch client which uses http  
> protocol in java and performs same operations as node clinet so that I can  
> use http basic authentication plugin.
> 
> On Thu, Mar 1, 2012 at 6:17 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> No, there isn't, unless you tunnel it through one you build youserlf.
> 
> On Thursday, March 1, 2012 at 2:40 PM, kalyan chowdary wrote:
> 
> Can you tell me if there is any way to perform authentication for this  
> node client which is using optimized binary protocol.
> 
> On Thu, Mar 1, 2012 at 6:03 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> That plugin only applies to HTTP.
> 
> On Thursday, March 1, 2012 at 7:47 AM, BARNEY wrote:
> 
> Hi,  
> I would like to use http basic authentication plugin(https://  
> [GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git)) and i want to know  
> the way of connecting running node through java api;  
> Below is my code for settings;
> 
> Settings s =  
> ImmutableSettings.settingsBuilder().put("cluster.name",
> 
> CLUSTER).put("http.enabled",Boolean.FALSE).put("http.basic.enabled",Boolean.TRUE).put("http.basic.user","username").put("http.basic.password","password").build();  
> NodeBuilder nBuilder =  
> nodeBuilder().settings(s).client(true);  
> node = nBuilder.build().start();  
> client = node.client();
> 
> When I try above lines,getting error as shown below......  
> Exception in thread "main"  
> org.elasticsearch.common.collect.ComputationException:  
> java.lang.NoClassDefFoundError: org/elasticsearch/node/service/  
> NodeService
> 
> please help me out in this

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 5, 2012, 3:23pm UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/8 "2012-03-05T15:23:56Z")

</div>

No.

On Monday, March 5, 2012 at 11:18 AM, kalyan chowdary wrote:

> Is there any way to insert authentication token and sending it from the client side and verifying it on the server side(Elasticsearch)?
> 
> On Sun, Mar 4, 2012 at 3:22 AM, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> 
> > There ins't a built in client that uses HTTP and provides the same Client interface.
> > 
> > On Friday, March 2, 2012 at 6:47 AM, kalyan chowdary wrote:
> > 
> > > Can you tell me the way of creating elasticsearch client which uses http protocol in java and performs same operations as node clinet so that I can use http basic authentication plugin.
> > > 
> > > On Thu, Mar 1, 2012 at 6:17 PM, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> > > 
> > > > No, there isn't, unless you tunnel it through one you build youserlf.
> > > > 
> > > > On Thursday, March 1, 2012 at 2:40 PM, kalyan chowdary wrote:
> > > > 
> > > > > Can you tell me if there is any way to perform authentication for this node client which is using optimized binary protocol.
> > > > > 
> > > > > On Thu, Mar 1, 2012 at 6:03 PM, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> > > > > 
> > > > > > That plugin only applies to HTTP.
> > > > > > 
> > > > > > On Thursday, March 1, 2012 at 7:47 AM, BARNEY wrote:
> > > > > > 
> > > > > > > Hi,  
> > > > > > > I would like to use http basic authentication plugin(https://  
> > > > > > > [GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git) ([GitHub - Asquera/elasticsearch-http-basic: HTTP Basic Authentication for Elasticsearch (Discontinued)](http://github.com/Asquera/elasticsearch-http-basic.git))) and i want to know  
> > > > > > > the way of connecting running node through java api;  
> > > > > > > Below is my code for settings;
> > > > > > > 
> > > > > > > Settings s =  
> > > > > > > ImmutableSettings.settingsBuilder().put("cluster.name ([http://cluster.name](http://cluster.name))",  
> > > > > > > CLUSTER).put("http.enabled",Boolean.FALSE).put("http.basic.enabled",Boolean.TRUE).put("http.basic.user","username").put("http.basic.password","password").build();  
> > > > > > > NodeBuilder nBuilder =  
> > > > > > > nodeBuilder().settings(s).client(true);  
> > > > > > > node = nBuilder.build().start();  
> > > > > > > client = node.client();
> > > > > > > 
> > > > > > > When I try above lines,getting error as shown below......  
> > > > > > > Exception in thread "main"  
> > > > > > > org.elasticsearch.common.collect.ComputationException:  
> > > > > > > java.lang.NoClassDefFoundError: org/elasticsearch/node/service/  
> > > > > > > NodeService
> > > > > > > 
> > > > > > > please help me out in this

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:37am UTC](https://discuss.elastic.co/t/http-basic-authentication-for-node-client/6845/9 "2017-07-06T03:37:19Z")

</div>


