# Kibana iframe with Token (Authentication purpose)

**URL:** <https://discuss.elastic.co/t/kibana-iframe-with-token-authentication-purpose/207744>\
**Category:** Elasticsearch\
**Created:** [November 13, 2019, 4:24pm UTC](https://discuss.elastic.co/t/kibana-iframe-with-token-authentication-purpose/207744 "2019-11-13T16:24:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [November 15, 2019, 3:46pm UTC](https://discuss.elastic.co/t/kibana-iframe-with-token-authentication-purpose/207744/3 "2019-11-15T15:46:28Z")

</div>

Hello @ikakavas,

As per your comments. i have used token service made a [POST] call to my elastic api "/\_security/oauth2/token" which is running on"9200" to generate tokens and it is successful in getting access token and refresh token. Please may i know the next step to store the token in my browser. I don't think it will work if i set the bearer token in my browser with any "keyname"..

 ![41%20AM](https://us1.discourse-cdn.com/elastic/original/3X/d/a/dac759d614bf3f02a6e5701d6e3b2a4204c37c6e.png)

Also, I have also tried another alternative using this post:

> [@Authenticating to iframe-embedded Kibana dashboard](https://discuss.elastic.co/t/authenticating-to-iframe-embedded-kibana-dashboard/71129/7):
>
> Sorry for the delay, @rupaln and sorry for giving incomplete advice. I was able to get the Kibana server to respond with a cookie header by POSTing to /api/security/v1/login with a JSON request body of { "password": "\<YOURPASSWORD\>", "username": "\<YOURUSERNAME\>" } and the appropriate kbn-version: 5.1.1 header.

If you refer to the screenshot, I was able to get some JSON response. But i am not getting the cookie.

 ![57%20AM](https://us1.discourse-cdn.com/elastic/original/3X/4/6/46a0704ff9eef276e2addd7ea81053c1ebd7de51.png)

Do I need to make any changes in elasticsearch.yaml or kibana.yaml files in order to get the cookie? If i get the cookie. I can store it in my browser. But, Will it work after getting the cookie?  
Please can you provide me a right path in achieving this.

---

_[View the full topic](https://discuss.elastic.co/t/kibana-iframe-with-token-authentication-purpose/207744)._
