# TransportClient with username and password

**URL:** <https://discuss.elastic.co/t/transportclient-with-username-and-password/31968>\
**Category:** Elasticsearch\
**Created:** [October 11, 2015, 1:46pm UTC](https://discuss.elastic.co/t/transportclient-with-username-and-password/31968 "2015-10-11T13:46:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paranoiabla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paranoiabla/32/2160_2.png) [@paranoiabla](https://discuss.elastic.co/u/paranoiabla)\
**Post date:** [October 11, 2015, 1:46pm UTC](https://discuss.elastic.co/t/transportclient-with-username-and-password/31968/1 "2015-10-11T13:46:52Z")

</div>

Hello,

I want to create elasticsearch `TransportClient` with basic authentication. I see that the `TransportClient` uses `InetSocketTransportAddress` but this only accepts `host` and `port`. However the url I have is this: `http://gopivotal:PASSWORD@fili-us-east-1.searchly.com`. Is there any way to specify username and password on the `TransportClient`?

---

<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:** [October 11, 2015, 2:10pm UTC](https://discuss.elastic.co/t/transportclient-with-username-and-password/31968/2 "2015-10-11T14:10:16Z")

</div>

Are you sure this URL is not the REST endpoint ?

If it is you can not use a Transport Client.

---

<div class="post-metadata">

**Author:** ![paranoiabla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paranoiabla/32/2160_2.png) [@paranoiabla](https://discuss.elastic.co/u/paranoiabla)\
**Post date:** [October 11, 2015, 2:24pm UTC](https://discuss.elastic.co/t/transportclient-with-username-and-password/31968/3 "2015-10-11T14:24:38Z")

</div>

OK I see... I found this here a bit too late:  
[http://docs.run.pivotal.io/marketplace/services/searchly.html](http://docs.run.pivotal.io/marketplace/services/searchly.html)

---

<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 5, 2017, 11:45pm UTC](https://discuss.elastic.co/t/transportclient-with-username-and-password/31968/4 "2017-07-05T23:45:28Z")

</div>


