# Authentication with JWT and FallBack on Basic

**URL:** <https://discuss.elastic.co/t/authentication-with-jwt-and-fallback-on-basic/131038>\
**Category:** Elasticsearch\
**Created:** [May 8, 2018, 4:24pm UTC](https://discuss.elastic.co/t/authentication-with-jwt-and-fallback-on-basic/131038 "2018-05-08T16:24:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_mni](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_mni](https://discuss.elastic.co/u/_mni)\
**Post date:** [May 8, 2018, 4:24pm UTC](https://discuss.elastic.co/t/authentication-with-jwt-and-fallback-on-basic/131038/1 "2018-05-08T16:24:31Z")

</div>

Hi,

I am investigating a use case where my users could provide auth params and ES should first try doing a JWT auth; if that fails, it should fall back on Basic auth.

I have read through that this might be possible using custom realms in X-Pack but would like to get some input from the community on where should I start to achieve this.

Thanks!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 8, 2018, 10:00pm UTC](https://discuss.elastic.co/t/authentication-with-jwt-and-fallback-on-basic/131038/2 "2018-05-08T22:00:34Z")

</div>

I'll move this to X-Pack and see if some of the team that work on the Security functionality can provide some comments around the custom realms.

---

<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:** [June 5, 2018, 10:00pm UTC](https://discuss.elastic.co/t/authentication-with-jwt-and-fallback-on-basic/131038/3 "2018-06-05T22:00:37Z")

</div>

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