# Authentication provider in Kibana

**URL:** <https://discuss.elastic.co/t/authentication-provider-in-kibana/218725>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [February 11, 2020, 7:38am UTC](https://discuss.elastic.co/t/authentication-provider-in-kibana/218725 "2020-02-11T07:38:08Z")\
**Posts on this page:** 4\
**Page:** 1

<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, 7:38am UTC](https://discuss.elastic.co/t/authentication-provider-in-kibana/218725/1 "2020-02-11T07:38:08Z")

</div>

Kibana code seems to go to great lengths to prevent the creation of a custom authentication provider (via a 3rd party plugin)

- The existing "providers" map is a hard-coded `const` in code
- Code checks that any used provider actually exists in the const map
- You can't get your hands on the sessionProviderFactory; you can't create another one
- There is an authentication handler, but only one can be registered (and it is registered by the internal security plugin).

Is this something that Elastic wants to prevent third-party developers from doing? What is the reasoning behind that? It's strange since one _can_ do a third-party authentication provider in Elasticsearch, and it works fine... but it seems to be effectively impossible to use it for creating a Kibana session. Not without patching the Kibana source code itself, anyway.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [February 11, 2020, 6:15pm UTC](https://discuss.elastic.co/t/authentication-provider-in-kibana/218725/2 "2020-02-11T18:15:16Z")

</div>

Hey @virgilp, the authentication provider code within Kibana has been going through rather drastic changes in recent versions, and we didn't consider it stable enough to expose to third-party plugins. We're tracking the request to add this in [https://github.com/elastic/kibana/issues/18190](https://github.com/elastic/kibana/issues/18190).

Do you already have a realm written for Elasticsearch? If you can elaborate upon its internal mechanics, we might be able to provide a work-around which wouldn't require a custom authentication provider in Kibana itself.

---

<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, 8:03pm UTC](https://discuss.elastic.co/t/authentication-provider-in-kibana/218725/3 "2020-02-11T20:03:46Z")

</div>

The authentication realm in Elastic is fairly basic - it works by reading a signed jwt token from a custom header. Based on the claims there the user is assigned to a special role name and there's a custom role provider that sets permissions based on the role naming convention.

---

<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, 8:03pm UTC](https://discuss.elastic.co/t/authentication-provider-in-kibana/218725/4 "2020-03-10T20:03:51Z")

</div>

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