# Unable to perform login on kibana throught browser javascript api call

**URL:** <https://discuss.elastic.co/t/unable-to-perform-login-on-kibana-throught-browser-javascript-api-call/189345>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [July 8, 2019, 12:36pm UTC](https://discuss.elastic.co/t/unable-to-perform-login-on-kibana-throught-browser-javascript-api-call/189345 "2019-07-08T12:36:28Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [July 8, 2019, 3:00pm UTC](https://discuss.elastic.co/t/unable-to-perform-login-on-kibana-throught-browser-javascript-api-call/189345/6 "2019-07-08T15:00:45Z")

</div>

Got it! This [thread here](https://discuss.elastic.co/t/auto-authenticating-to-iframe-embedded-kibana-dashboard/46091) may be helpful. You can setup a nginx server that adds Authorization headers for a specific user to auto-authenticate requests. This is likely more secure than embedding credentials in your client-side code.

If this a public-facing site, I definitely recommend using credentials for a user with the `kibana_dashboard_only_user` role so they cannot modify any Kibana data.

---

_[View the full topic](https://discuss.elastic.co/t/unable-to-perform-login-on-kibana-throught-browser-javascript-api-call/189345)._
