# Send a custom Header to Elasticsearch via Kibana Proxy

**URL:** <https://discuss.elastic.co/t/send-a-custom-header-to-elasticsearch-via-kibana-proxy/97885>\
**Category:** Kibana\
**Created:** [August 22, 2017, 9:33am UTC](https://discuss.elastic.co/t/send-a-custom-header-to-elasticsearch-via-kibana-proxy/97885 "2017-08-22T09:33:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![varundbest](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varundbest/32/48066_2.png) [@varundbest](https://discuss.elastic.co/u/varundbest)\
**Post date:** [August 22, 2017, 9:33am UTC](https://discuss.elastic.co/t/send-a-custom-header-to-elasticsearch-via-kibana-proxy/97885/1 "2017-08-22T09:33:09Z")

</div>

So I am having my own strategy (via Plugin) for Kibana server object to enable SSO. I want the same token to be passed on to all requests to Elasticsearch so my interceptor over there can authenticate the request. Any clean way I can make this happen via Plugin without touching the actual source code?  
Is there something that the server object expose for this?  
Kibana in question: 5.4.1

Edit:-  
I know about :-

> elasticsearch.requestHeadersWhitelist  
> elasticsearch.customHeaders

But I am using Yar (Hapi Library) for token management so will have to add a header that way.

I am adding my own Headers to the request in my HapiJS (Default) Strategy before passing on to next but these requests with path :-  
/.kibana/config/5.4.1  
Keeps on popping up with only 3 headers :-  
[Host, Content-Length, Connection]  
Unless I add a elasticsearch.customHeaders: with my desired Headers (Static, But mine HAVE to be dynamic)

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [August 23, 2017, 12:07am UTC](https://discuss.elastic.co/t/send-a-custom-header-to-elasticsearch-via-kibana-proxy/97885/2 "2017-08-23T00:07:15Z")

</div>

There are not currently any hooks to programmatically add headers to the ES requests. Feel free to open a feature request here: [https://github.com/elastic/kibana/issues/new](https://github.com/elastic/kibana/issues/new)

---

<div class="post-metadata">

**Author:** ![varundbest](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varundbest/32/48066_2.png) [@varundbest](https://discuss.elastic.co/u/varundbest)\
**Post date:** [August 23, 2017, 4:43am UTC](https://discuss.elastic.co/t/send-a-custom-header-to-elasticsearch-via-kibana-proxy/97885/3 "2017-08-23T04:43:08Z")

</div>

But if I'm giving value to :-

> elasticsearch.username:  
> elasticsearch.password:

Then at least that should be regarded in every kibana 'internal' request. Could you tell me more about the requests with raw\_path :-  
/.kibana/config/5.4.1

---

<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:** [September 20, 2017, 4:43am UTC](https://discuss.elastic.co/t/send-a-custom-header-to-elasticsearch-via-kibana-proxy/97885/4 "2017-09-20T04:43:25Z")

</div>

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