rough-kilobyte-98919
08/07/2025, 2:01 AM"credentials": {
"password": {
"identifier": true
}
}
brief-egg-61061
08/07/2025, 2:01 AMbrief-egg-61061
08/07/2025, 2:01 AMidentity.schema.json
, the following setup: json "credentials": { "password": { "identifier": true } }
is used within a field definition (such as email
, username
, or phone
) to tell Ory Kratos that this field should be used as a login identifier for the password authentication flow. In other words, when a user tries to log in with a password, Ory will use the value of this field to identify the user. For example, if you set this under the email
field, users will log in using their email address and password. If you set it under both email
and username
, users can log in with either their email or username and their password. This is part of the Ory schema extension and is required so that Ory knows which fields are valid identifiers for password-based login flows. Here’s an example in context: json "email": { "type": "string", "format": "email", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "password": { "identifier": true } } } }
This configuration is necessary for Ory to recognize which trait(s) should be used as the "username" in the username/password login flow. You can apply this to multiple fields if you want to allow login with more than one identifier (e.g., both email and username) [Customize identity schemas – Password login identifier](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#password-login-identifier) [Login and registration using passwords](https://www.ory.sh/docs/kratos/concepts/credentials/username-email-password).