# X-Pack authentication

**URL:** <https://discuss.elastic.co/t/x-pack-authentication/78519>\
**Category:** Elasticsearch\
**Created:** [March 14, 2017, 1:10pm UTC](https://discuss.elastic.co/t/x-pack-authentication/78519 "2017-03-14T13:10:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![living\_jordi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/living_jordi/32/61363_2.png) [@living\_jordi](https://discuss.elastic.co/u/living_jordi)\
**Post date:** [March 14, 2017, 1:10pm UTC](https://discuss.elastic.co/t/x-pack-authentication/78519/1 "2017-03-14T13:10:31Z")

</div>

I've installed x-pack into my elasticsearch: `curl --user u:p 'localhost:9200/_xpack'`:

```
{
  "build" : {
    "hash" : "e016ba5",
    "date" : "2017-01-24T20:17:08.168Z"
  },
  "license" : {
    "uid" : "a5a93479-cdd1-44c0-8669-78a3ae1cbfeb",
    "type" : "trial",
    "mode" : "trial",
    "status" : "active",
    "expiry_date_in_millis" : 1491567639615
  },
  "features" : {
    "graph" : {
      "description" : "Graph Data Exploration for the Elastic Stack",
      "available" : true,
      "enabled" : false
    },
    "monitoring" : {
      "description" : "Monitoring for the Elastic Stack",
      "available" : true,
      "enabled" : false
    },
    "security" : {
      "description" : "Security for the Elastic Stack",
      "available" : true,
      "enabled" : true
    },
    "watcher" : {
      "description" : "Alerting, Notification and Automation for the Elastic Stack",
      "available" : true,
      "enabled" : false
    }
  },
  "tagline" : "You know, for X"
}

```

This is my code in order to build my client:

```
Settings settings = Settings.builder()
        .put(ElasticsearchApplicationResources.ELASTICSEARCH_PROPERTY_CLUSTER_NAME, this.configurationResources.getElasticsearchCluserName())
    .put("xpack.security.user", "elastic:changeme")
    .build();
	
    List<InetSocketTransportAddress> addresses = ...;
	
    try {
	 this.elasticsearchClient = new PreBuiltTransportClient(settings)
		.addTransportAddresses(addresses.toArray(new InetSocketTransportAddress[addresses.size()]));
    }catch (Exception e)
    {
	System.out.print(e);
    }

```

Currently, I'm getting this message:

> java.lang.IllegalArgumentException: unknown setting [xpack.security.user] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

Any ideas?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 14, 2017, 1:37pm UTC](https://discuss.elastic.co/t/x-pack-authentication/78519/2 "2017-03-14T13:37:22Z")

</div>

Read this: [https://www.elastic.co/guide/en/x-pack/current/java-clients.html](https://www.elastic.co/guide/en/x-pack/current/java-clients.html)

---

<div class="post-metadata">

**Author:** ![living\_jordi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/living_jordi/32/61363_2.png) [@living\_jordi](https://discuss.elastic.co/u/living_jordi)\
**Post date:** [March 14, 2017, 1:51pm UTC](https://discuss.elastic.co/t/x-pack-authentication/78519/3 "2017-03-14T13:51:57Z")

</div>

Thanks @dadoonet.

I've already read this documentation. Nevertheless, I keep failing figure out what's wrong into my code...

Could you suggest me what's wrong?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 14, 2017, 2:04pm UTC](https://discuss.elastic.co/t/x-pack-authentication/78519/4 "2017-03-14T14:04:16Z")

</div>

You are not using the right client.

---

<div class="post-metadata">

**Author:** ![living\_jordi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/living_jordi/32/61363_2.png) [@living\_jordi](https://discuss.elastic.co/u/living_jordi)\
**Post date:** [March 14, 2017, 2:10pm UTC](https://discuss.elastic.co/t/x-pack-authentication/78519/5 "2017-03-14T14:10:52Z")

</div>

Sorry, I've misread the documentation.

I'd like to ask you for another question. Do I need to import both

```
compile group: 'org.elasticsearch.client', name: 'transport', version: '5.2.0'
compile group: 'org.elasticsearch.client', name: 'x-pack-transport', version: '5.2.0'

```

dependencies? Or importing one of them would be enought?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 14, 2017, 3:39pm UTC](https://discuss.elastic.co/t/x-pack-authentication/78519/6 "2017-03-14T15:39:40Z")

</div>

No. The xpack one will bring automatically the other one.

---

<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:** [April 11, 2017, 3:40pm UTC](https://discuss.elastic.co/t/x-pack-authentication/78519/7 "2017-04-11T15:40:32Z")

</div>

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