<@U04UQ68083H> my registration self service flow e...
# ory-copilot
b
@chilly-king-10285 my registration self service flow errors with "no identifier found" if I have my identity schema set like this. what would be the problem? { "$id": "https://schemas.ory.sh/presets/kratos/identity.sms.schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Person", "type": "object", "properties": { "traits": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "title": "E-Mail", "ory.sh/kratos": { "credentials": { "password": { "identifier": true }, "webauthn": { "identifier": true }, "totp": { "account_name": true }, "code": { "identifier": true, "via": "email" }, "passkey": { "display_name": true } }, "recovery": { "via": "email" }, "verification": { "via": "email" }, "organizations": { "matcher": "email_domain" } }, "maxLength": 320 }, "phone_number": { "type": "string", "format": "tel", "title": "Phone Number", "ory.sh/kratos": { "credentials": { "password": { "identifier": true }, "webauthn": { "identifier": true }, "totp": { "account_name": true }, "code": { "identifier": true, "via": "sms" }, "passkey": { "display_name": true } }, "recovery": { "via": "sms" }, "verification": { "via": "sms" } }, "maxLength": 320 } }, "required": [ "email", "phone_number" ], "additionalProperties": false } } }
b
A message from kapa.ai
The error "no identifier found" in your registration self-service flow is likely due to how the identity schema is configured regarding identifiers for credential methods. Key points to check: 1. Identifier Marking: For Ory Kratos to recognize a field as a valid identifier for registration (e.g., for password or code login), you must mark the relevant trait(s) with
"identifier": true
under the appropriate credential method in the schema. Your schema does this for both
email
and
phone_number
under
"password"
and
"code"
strategies, which is correct in principle. 2. Field Names and Required Fields: Your schema requires both
"email"
and
"phone_number"
. If either is missing in the registration payload, registration will fail due to missing required fields, but this would not trigger a "no identifier found" error specifically. 3. Schema Key Formatting: The property key for the Ory extension should be
"<http://ory.sh/kratos|ory.sh/kratos>"
, not
"<http://ory.sh/kratos|ory.sh/kratos>"
or similar. Using an incorrect key will cause Ory Kratos to ignore the identifier configuration, resulting in the "no identifier found" error. Correct example:
Copy code
json    "<http://ory.sh/kratos|ory.sh/kratos>": {      "credentials": {        "password": {          "identifier": true        }      }    }
If you use an incorrect key, Kratos will not recognize the identifier, and the registration flow will fail with the error you described. 4. Recovery via SMS Limitation: According to the knowledge sources, Ory Kratos currently only supports
"recovery": { "via": "email" }
and not
"via": "sms"
. If you set recovery via SMS, schema validation will fail, but this typically results in a schema error, not a "no identifier found" error. Still, you should remove or change
"recovery": { "via": "sms" }
to
"recovery": { "via": "email" }
for compatibility reasons, as SMS recovery is not supported at this time [[Github Issue: Recovery via SMS error](https://github.com/ory/kratos/issues/4262)]. Summary of what to fix: - Change all instances of
"<http://ory.sh/kratos|ory.sh/kratos>"
to
"<http://ory.sh/kratos|ory.sh/kratos>"
. - Remove or change
"recovery": { "via": "sms" }
to
"recovery": { "via": "email" }"
for the
phone_number
field. Example (fixed) snippet:
Copy code
json "phone_number": {   "type": "string",   "format": "tel",   "title": "Phone Number",   "<http://ory.sh/kratos|ory.sh/kratos>": {     "credentials": {       "password": {         "identifier": true       },       "webauthn": {         "identifier": true       },       "totp": {         "account_name": true       },       "code": {         "identifier": true,         "via": "sms"       },       "passkey": {         "display_name": true       }     },     "recovery": {       "via": "email"     },     "verification": {       "via": "sms"     }   },   "maxLength": 320 }
Make sure to apply the same fix to the
email
field as well. References: - [Customize identity schema: Identity schema extensions](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#identity-schema-extensions) - [Password login identifier](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#password-login-identifier) - [Github Issue: Recovery via SMS error](https://github.com/ory/kratos/issues/4262) If you correct the property key and avoid unsupported recovery methods, the "no identifier found" error should be resolved.