rough-kilobyte-98919
08/20/2025, 3:16 AMbrief-egg-61061
08/20/2025, 3:16 AMbrief-egg-61061
08/20/2025, 3:16 AMcredentials
configuration in your identity schema if you want to use phone number login. Specifically, you need to mark the phone number field as an identifier for the password (or code) strategy. This tells Ory Kratos that the phone number should be used as a login identifier. For example, to allow login with a phone number and password, your schema should include: json "phone": { "title": "Phone", "type": "string", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "password": { "identifier": true } } } }
This configuration is required so that Ory knows which field(s) can be used for authentication. Without specifying the credentials
and setting "identifier": true
, the phone number will not be recognized as a valid login identifier by Ory Kratos [Choosing between username, email, and phone number](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#choosing-between-username-email-and-phone-number) [Phone number](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number). If you want to use one-time code (passwordless) login via SMS, you must similarly mark the phone number as the identifier for the code
strategy: json "phone": { "type": "string", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } } } }
[Custom identity schema for one-time code](https://www.ory.sh/docs/kratos/passwordless/one-time-code#custom-identity-schema) In summary: Yes, you must provide the credentials
property in your identity schema and set the phone number as an identifier for the desired authentication method to enable phone number login.