# Java Client integration with Jetty Plugin

**URL:** <https://discuss.elastic.co/t/java-client-integration-with-jetty-plugin/19711>\
**Category:** Elasticsearch\
**Created:** [September 10, 2014, 10:52am UTC](https://discuss.elastic.co/t/java-client-integration-with-jetty-plugin/19711 "2014-09-10T10:52:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mihir\_M](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Mihir\_M](https://discuss.elastic.co/u/Mihir_M)\
**Post date:** [September 10, 2014, 10:52am UTC](https://discuss.elastic.co/t/java-client-integration-with-jetty-plugin/19711/1 "2014-09-10T10:52:17Z")

</div>

Hi

I am using Elasticsearch version 1.2.1. I was looking for ways to secure access to Elasticsearch when I found the Jetty plugin. It lets me create users based on roles and is satisfying my requirements.  
However it only restricts HTTP requests.

I was using Java Transport client for talking to Elasticsearch and since it uses Transport layer protocol while connecting to ES at 9300, the Jetty plugin has no effect on it.

So as an alternative to the Transport Client I have tried using the Jest Client. But I have not found any API for sending authentication credentials while inserting data or reading or when creating a client.

Is there a way in which I can pass authentication credentials in the Jest client while sending requests?  
If Jest Client does not support this, are there any alternative clients which will allow me to do so?

Any help on this would be appreciated.

Regards  
Mihir

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [September 11, 2014, 7:29am UTC](https://discuss.elastic.co/t/java-client-integration-with-jetty-plugin/19711/2 "2014-09-11T07:29:46Z")

</div>

There are so much authentication layers out there. I do not see much sense  
in reinventing the wheel.

You should run ES cluster in private subnets only where nobody has access  
to the machines, except your frontend service which is open to the web  
(HTTP port 80/443). Such a frontend service can be an nginx reverse proxy,  
Java EE container, whatever. The authentication has to take place there, at  
the frontend only, not in the low level ES API, where it simply does not  
fit the purpose.

Jörg

On Wed, Sep 10, 2014 at 12:52 PM, Mihir M [mihirsm90@gmail.com](mailto:mihirsm90@gmail.com) wrote:

> Hi
> 
> I am using Elasticsearch version 1.2.1. I was looking for ways to secure  
> access to Elasticsearch when I found the Jetty plugin. It lets me create  
> users based on roles and is satisfying my requirements.  
> However it only restricts HTTP requests.
> 
> I was using Java Transport client for talking to Elasticsearch and since it  
> uses Transport layer protocol while connecting to ES at 9300, the Jetty  
> plugin has no effect on it.
> 
> So as an alternative to the Transport Client I have tried using the Jest  
> Client. But I have not found any API for sending authentication credentials  
> while inserting data or reading or when creating a client.
> 
> Is there a way in which I can pass authentication credentials in the Jest  
> client while sending requests?  
> If Jest Client does not support this, are there any alternative clients  
> which will allow me to do so?
> 
> Any help on this would be appreciated.
> 
> Regards  
> Mihir
> 
> * * *
> 
> ## Regards
> 
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Java-Client-integration-with-Jetty-Plugin-tp4063253.html](http://elasticsearch-users.115913.n3.nabble.com/Java-Client-integration-with-Jetty-Plugin-tp4063253.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1410346337441-4063253.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1410346337441-4063253.post%40n3.nabble.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEsaWbpCBAhOOu44vVLoMa0GWEtNSV-FAWKk1GFGn9UmA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEsaWbpCBAhOOu44vVLoMa0GWEtNSV-FAWKk1GFGn9UmA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:03am UTC](https://discuss.elastic.co/t/java-client-integration-with-jetty-plugin/19711/3 "2017-07-06T01:03:08Z")

</div>


