# Custom Realm Example help

**URL:** <https://discuss.elastic.co/t/custom-realm-example-help/101341>\
**Category:** Elasticsearch\
**Created:** [September 21, 2017, 1:25pm UTC](https://discuss.elastic.co/t/custom-realm-example-help/101341 "2017-09-21T13:25:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adesouza](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@adesouza](https://discuss.elastic.co/u/adesouza)\
**Post date:** [September 21, 2017, 1:25pm UTC](https://discuss.elastic.co/t/custom-realm-example-help/101341/1 "2017-09-21T13:25:49Z")

</div>

Hi,  
I'm trying out the [custom realm example](https://github.com/elastic/shield-custom-realm-example) to try and get an idea of how custom realms work. I have X-Pack installed on Elasticsearch and Kibana. I built the custom realm plugin and installed it on the Elasticsearch node. When I try to log in to Kibana, the authentication seems to work when I use the 'jane' or 'john' users, but there is a call being made to `CustomRealm#token(ThreadContext threadContext)` but the `ThreadContext` has no headers set so I never get past the Kibana login page. Should this work? or is there a step I've missed?  
Thanks,  
Aaron

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [September 25, 2017, 5:02am UTC](https://discuss.elastic.co/t/custom-realm-example-help/101341/2 "2017-09-25T05:02:29Z")

</div>

The example custom realm isn't designed to work out of the box with Kibana.

The example realm uses its own `User` and `Password` headers that Kibana doesn't know how to send.  
The X-Pack features ofr Kibana are designed to work with Basic Authentication using the HTTP standard `Authorization` header.

---

<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:** [October 23, 2017, 5:02am UTC](https://discuss.elastic.co/t/custom-realm-example-help/101341/3 "2017-10-23T05:02:48Z")

</div>

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