best-plumber-65600
06/27/2025, 4:09 AMbrief-egg-61061
06/27/2025, 4:09 AMbrief-egg-61061
06/27/2025, 4:09 AMjson "email": { "type": "string", "format": "email", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "email" } } } }, "phone_number": { "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) Therefore, Ory Kratos supports sending login codes using email and phone number as identifiers, but not username. If you need to use usernames, you would need to use the password strategy instead, not the code/OTP strategy.best-plumber-65600
06/27/2025, 4:11 AMbrief-egg-61061
06/27/2025, 4:12 AMbrief-egg-61061
06/27/2025, 4:12 AMjson "email": { "type": "string", "format": "email", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "email" } } } }, "phone_number": { "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) The documentation does not mention support for sending login codes using a custom identity field such as customerId. The "via" property is only shown with "email" and "sms" as valid options. There is no information about using other channels or custom fields for code delivery. In summary: I'm sorry, but the knowledge sources do not provide information about sending login codes using a custom identity field like customerId. Only email and phone number are documented as supported identifiers for code-based login flows.