# Example of X-pack Custom Realm in 7.x

**URL:** https://discuss.elastic.co/t/example-of-x-pack-custom-realm-in-7-x/184789
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [June 7, 2019, 4:34pm UTC](https://discuss.elastic.co/t/example-of-x-pack-custom-realm-in-7-x/184789 "2019-06-07T16:34:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ashbrooker](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@ashbrooker](https://discuss.elastic.co/u/ashbrooker)
#### Post date: [June 7, 2019, 4:34pm UTC](https://discuss.elastic.co/t/example-of-x-pack-custom-realm-in-7-x/184789/1 "2019-06-07T16:34:54Z")

</div>

We're upgrading ES from 6.2 to 7.1. We have built x-pack custom realm for authentication. Is there any example, in JAVA, available that shows how to create custom realm?  
This file hasn't been updated since Dec 2018.... [https://github.com/elastic/elasticsearch/blob/v7.1.0/x-pack/docs/en/security/authentication/custom-realm.asciidoc](https://github.com/elastic/elasticsearch/blob/v7.1.0/x-pack/docs/en/security/authentication/custom-realm.asciidoc)  
Also, this one [https://github.com/elastic/shield-custom-realm-example](https://github.com/elastic/shield-custom-realm-example) only covers upto 6.2.2 version.  
TIA.

---

<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: [June 8, 2019, 6:10am UTC](https://discuss.elastic.co/t/example-of-x-pack-custom-realm-in-7-x/184789/2 "2019-06-08T06:10:20Z")

</div>

Did you read the README on the shield custom realm? It has a link to a maintained example in the Elasticsearch repository.

---

<div class="post-metadata">

### Author: ![ashbrooker](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@ashbrooker](https://discuss.elastic.co/u/ashbrooker)
#### Post date: [June 10, 2019, 2:14pm UTC](https://discuss.elastic.co/t/example-of-x-pack-custom-realm-in-7-x/184789/3 "2019-06-10T14:14:50Z")

</div>

Yes I did. The maintained example covers upto 6.6. In 7.x and above, the “type” setting does not exist any more, and the realm type is part of the configuration key. I am looking for example of how to configure and use that.

---

<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: [June 11, 2019, 1:21am UTC](https://discuss.elastic.co/t/example-of-x-pack-custom-realm-in-7-x/184789/4 "2019-06-11T01:21:19Z")

</div>

> [@ashbrooker](#):
>
> The maintained example covers upto 6.6

The link in the README takes you to the main Elasticsearch repository, which has branches for all recent versions, [including 7.1](https://github.com/elastic/elasticsearch/tree/7.1/x-pack/qa/security-example-spi-extension).

---

<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: [July 9, 2019, 1:21am UTC](https://discuss.elastic.co/t/example-of-x-pack-custom-realm-in-7-x/184789/5 "2019-07-09T01:21:32Z")

</div>

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