# How to pass username and password using transport client

**URL:** <https://discuss.elastic.co/t/how-to-pass-username-and-password-using-transport-client/117938>\
**Category:** Elasticsearch\
**Created:** [February 1, 2018, 6:23am UTC](https://discuss.elastic.co/t/how-to-pass-username-and-password-using-transport-client/117938 "2018-02-01T06:23:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajit](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@ajit](https://discuss.elastic.co/u/ajit)\
**Post date:** [February 1, 2018, 6:23am UTC](https://discuss.elastic.co/t/how-to-pass-username-and-password-using-transport-client/117938/1 "2018-02-01T06:23:31Z")

</div>

Hi,  
I am using search guard on elasticsearch. In my java code i have used Transport client. But I am not able to access index. Exception is  
ElasticsearchSecurityException[No user found for indices:data/read/search].

I want to provide username and password with client. Please provide solution to pass username and password.

---

<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 1, 2018, 6:23am UTC](https://discuss.elastic.co/t/how-to-pass-username-and-password-using-transport-client/117938/2 "2018-03-01T06:23:33Z")

</div>

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