# Custom Security Extension and Realm Work for Kibana Login

**URL:** <https://discuss.elastic.co/t/custom-security-extension-and-realm-work-for-kibana-login/216116>\
**Category:** Kibana\
**Created:** [January 22, 2020, 6:15pm UTC](https://discuss.elastic.co/t/custom-security-extension-and-realm-work-for-kibana-login/216116 "2020-01-22T18:15:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![YanbangLiuUiPath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yanbangliuuipath/32/60975_2.png) [@YanbangLiuUiPath](https://discuss.elastic.co/u/YanbangLiuUiPath)\
**Post date:** [January 22, 2020, 6:15pm UTC](https://discuss.elastic.co/t/custom-security-extension-and-realm-work-for-kibana-login/216116/1 "2020-01-22T18:15:46Z")

</div>

I created my custom security plugin following [this post](https://www.elastic.co/blog/how-to-develop-your-own-security-extensions-and-custom-realms-for-elasticsearch). It is working for elasticsearch and I can use the custom headers to authenticate using localhost:9200/\_security/\_authenticate

Now, what if I want to sign-in to Kibana using the same custom headers? Is that doable, and how?

Note: I have tried curl "localhost:5601" (and variations) with my custom headers and I'm only getting the login page.

---

<div class="post-metadata">

**Author:** ![rudolf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rudolf/32/51200_2.png) [@rudolf](https://discuss.elastic.co/u/rudolf)\
**Post date:** [February 11, 2020, 11:14am UTC](https://discuss.elastic.co/t/custom-security-extension-and-realm-work-for-kibana-login/216116/2 "2020-02-11T11:14:46Z")

</div>

Hi Yanbang Liu,

It looks like your custom security plugin uses token based authentication. To enable that for Kibana you can set `xpack.security.authc.providers: [token]` see [https://www.elastic.co/guide/en/kibana/current/kibana-authentication.html#token-authentication](https://www.elastic.co/guide/en/kibana/current/kibana-authentication.html#token-authentication)

---

<div class="post-metadata">

**Author:** ![virgilp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/virgilp/32/49291_2.png) [@virgilp](https://discuss.elastic.co/u/virgilp)\
**Post date:** [February 11, 2020, 3:24pm UTC](https://discuss.elastic.co/t/custom-security-extension-and-realm-work-for-kibana-login/216116/3 "2020-02-11T15:24:37Z")

</div>

That doesn't work for login, which is in practice what you need for Kibana (API calls are far less infrequent than Elasticsearch). The token authentication provider performs login using user/pass credentials.  
I do not believe this to be possible right now (\*) - see also [Authentication provider in Kibana](https://discuss.elastic.co/t/authentication-provider-in-kibana/218725)

(\*) At least, not easily. One can do it with legacy plugins if xpack security is disabled; It may also be possibly by a mix of legacy & new platform code, but I don't believe it can be done in a new-platform plugin. Please do let me know if I'm wrong about that.

---

<div class="post-metadata">

**Author:** ![YanbangLiuUiPath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yanbangliuuipath/32/60975_2.png) [@YanbangLiuUiPath](https://discuss.elastic.co/u/YanbangLiuUiPath)\
**Post date:** [February 11, 2020, 7:12pm UTC](https://discuss.elastic.co/t/custom-security-extension-and-realm-work-for-kibana-login/216116/4 "2020-02-11T19:12:21Z")

</div>

Hi Rudolf,

Thank you for replying. I have already figured this out. Still appreciated.

---

<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 10, 2020, 7:12pm UTC](https://discuss.elastic.co/t/custom-security-extension-and-realm-work-for-kibana-login/216116/5 "2020-03-10T19:12:25Z")

</div>

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