# How to make username case insensitive? (The default Basic Authentication via Internal Native Realm)

**URL:** <https://discuss.elastic.co/t/how-to-make-username-case-insensitive-the-default-basic-authentication-via-internal-native-realm/380175>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security, user-experience\
**Created:** [July 16, 2025, 12:08pm UTC](https://discuss.elastic.co/t/how-to-make-username-case-insensitive-the-default-basic-authentication-via-internal-native-realm/380175 "2025-07-16T12:08:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chouben](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@chouben](https://discuss.elastic.co/u/chouben)\
**Post date:** [July 16, 2025, 12:08pm UTC](https://discuss.elastic.co/t/how-to-make-username-case-insensitive-the-default-basic-authentication-via-internal-native-realm/380175/1 "2025-07-16T12:08:38Z")

</div>

Hi

I would like to make my usernames case insensitive, but can't seem to find the config to achieve it.  
E.g. "Christof" is working, but "christof" is not (Difference: capital C)

I found the documentation about authentication:

> **[Native user authentication | Elastic Docs](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/native)**
>
> The easiest way to manage and authenticate users is with the internal native realm. You can use Elasticsearch REST APIs or Kibana to add and remove users,...

Neither an answer on Kibana side:

> **[Authentication in Kibana | Elastic Docs](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/kibana-authentication#basic-authentication)**
>
> After you configure an authentication method in Elasticsearch, you can configure an authentication mechanism to log in to Kibana. Kibana supports the...

Neither do the API docs state the username is case sensitive:

> **[Create or update users
 | Elasticsearch API documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-user)**
>
> All methods and paths for this operation:
> PUT
> /\_security/user/{username}
> 
> 
> POST
> /\_security/user/{username...

However while Googling Gemini proposed below solution:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/8/385e95e1c3496b0ca8f8b0f0f8ee55cd23593744.png)  
With search condition:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/d/9d4c0c9c312bb28f03474ed34e03b245e01acd84.png)

In general the AI solution seems ok, but I have 2 concerns:

1. I need to start tampering with default Elastic indices, so any upgrade might break this solution.
2. The solution also specifies a specific search option ("case\_insensitive": true) which I have no control over

So does anyone have an idea if I can make my usernames case insensitive? And how to achieve it?

Thanks!  
Christof

---

<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:** [July 18, 2025, 4:27am UTC](https://discuss.elastic.co/t/how-to-make-username-case-insensitive-the-default-basic-authentication-via-internal-native-realm/380175/2 "2025-07-18T04:27:49Z")

</div>

There is no option to do this in Elasticsearch.

---

<div class="post-metadata">

**Author:** ![chouben](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@chouben](https://discuss.elastic.co/u/chouben)\
**Post date:** [July 18, 2025, 5:49am UTC](https://discuss.elastic.co/t/how-to-make-username-case-insensitive-the-default-basic-authentication-via-internal-native-realm/380175/3 "2025-07-18T05:49:34Z")

</div>

Ok, thanks!
