<@U04UQ68083H> Using ory kratos self-hosted, why i...
# ory-copilot
a
@chilly-king-10285 Using ory kratos self-hosted, why is my login identifier case sensitive? How can I make it case insensitive?
b
A message from kapa.ai
According to the knowledge sources, Ory Kratos actually does lowercase all
password
identifiers, including email addresses. As stated in the documentation: > It's important to understand that Ory Identities lowercases all
password
identifiers and therefore email addresses. Characters
+
or
.
which have special meaning for some email providers such as Gmail aren't normalized: > -
userNAME
is equal to
username
> -
<mailto:user@gmail.com|user@gmail.com>
is equal to
<mailto:USER@gmail.com|USER@gmail.com>
> -
<mailto:user+test@gmail.com|user+test@gmail.com>
is NOT equal to
<mailto:user@gmail.com|user@gmail.com>
> -
<mailto:user.test@gmail.com|user.test@gmail.com>
is NOT equal to
<mailto:usertest@gmail.com|usertest@gmail.com>
[Customize identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#choosing-between-username-email-and-phone-number) If you're experiencing case sensitivity with your login identifiers, it might be due to one of these reasons: 1. You might be using a different credential method than
password
(like
code
or
webauthn
) 2. There could be an issue with your identity schema configuration To ensure case insensitivity for your login identifiers, make sure you're using the
password
credential method and that your identity schema is properly configured with the
identifier: true
property for the fields you want to use as login identifiers. For example, here's how to configure an email field as a case-insensitive login identifier:
Copy code
json {   "properties": {     "traits": {       "properties": {         "email": {           "type": "string",           "format": "email",           "<http://ory.sh/kratos|ory.sh/kratos>": {             "credentials": {               "password": {                 "identifier": true               }             }           }         }       }     }   } }
If you're still experiencing issues with case sensitivity after confirming your configuration, it might be worth checking for any custom hooks or actions that might be affecting the login process, or opening an issue on the [Ory Kratos GitHub repository](https://github.com/ory/kratos/).
a
@chilly-king-10285 This is what my config looks like, can you tell me what's wrong?
Copy code
"<http://ory.sh/kratos|ory.sh/kratos>": {
                    "credentials": {
                      "password": {
                        "identifier": true
                      },
                      "totp": {
                        "account_name": true
                      },
                      "webauthn": {
                        "identifier": true
                      }
                    },
                    "verification": {
                      "via": "email"
                    },
                    "recovery": {
                      "via": "email"
                    }
                  }
b
A message from kapa.ai
I can see an issue with your configuration. The problem is in the format of the namespace key. The correct format should be
"<http://ory.sh/kratos|ory.sh/kratos>"
(as a plain string), but your configuration has it as
"<http://ory.sh/kratos|ory.sh/kratos>"
which appears to be a malformed URL or Markdown-style link. Here's how your configuration should look:
Copy code
json "<http://ory.sh/kratos|ory.sh/kratos>": {   "credentials": {     "password": {       "identifier": true     },     "totp": {       "account_name": true     },     "webauthn": {       "identifier": true     }   },   "verification": {     "via": "email"   },   "recovery": {     "via": "email"   } }
The namespace key needs to be exactly
"<http://ory.sh/kratos|ory.sh/kratos>"
for Ory Kratos to properly recognize and process your identity schema extensions. This incorrect format is likely why your login identifier is behaving in a case-sensitive manner, as Kratos isn't properly applying the case normalization that happens with correctly configured password identifiers. [Customize identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#password-login-identifier) shows examples of the correct format for these schema extensions.