# Java Authenticate using xpack

**URL:** <https://discuss.elastic.co/t/java-authenticate-using-xpack/218971>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [February 12, 2020, 12:11pm UTC](https://discuss.elastic.co/t/java-authenticate-using-xpack/218971 "2020-02-12T12:11:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![examin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/examin/32/70688_2.png) [@examin](https://discuss.elastic.co/u/examin)\
**Post date:** [February 12, 2020, 12:11pm UTC](https://discuss.elastic.co/t/java-authenticate-using-xpack/218971/1 "2020-02-12T12:11:30Z")

</div>

I have POC from old employee for using elasticsearch feature. i am trying to implement it but i hit a problem that POC have authentication code. We have xpack now . Please guide me what i have to add to POC JAVA code to test it with xpack security also.

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [February 12, 2020, 12:38pm UTC](https://discuss.elastic.co/t/java-authenticate-using-xpack/218971/2 "2020-02-12T12:38:11Z")

</div>

Hi there,

See [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.6/java-rest-high-getting-started-initialization.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.6/java-rest-high-getting-started-initialization.html) to get you started with the High Level Rest Client and [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.6/\_basic\_authentication.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.6/_basic_authentication.html) for examples on how to use basic authentication

---

<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:** [March 11, 2020, 12:38pm UTC](https://discuss.elastic.co/t/java-authenticate-using-xpack/218971/3 "2020-03-11T12:38:12Z")

</div>

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