creamy-balloon-89079
11/24/2025, 3:30 AMkratosAdminClient.createIdentity({
createIdentityBody: {
schema_id: 'default',
traits: {
phone: phone,
email: email
}
}
})
1. User starts OIDC login (PKCE) (/oauth2/auth?...) → gets login_challenge
2. User gets login UI with login_challenge
3. User submits phone number → OTP code sent to email
4. User verifies OTP code
5. Consent UI + accept
6. /oauth2/token?...
At step 4, I get the error:
"account does not exist or has not setup up sign in with code"
Here are the relevant parts of my configuration:
kratos.yml
...
identity:
default_schema_id: default
schemas:
- id: default
url: file:///etc/config/kratos/identity.schema.json
...
selfservice:
methods:
code:
enabled: true
passwordless_enabled: true
config:
lifespan: 15m
...
identity.schema.json
{
"$id": "<https://example.com/registration.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",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"recovery": {
"via": "email"
},
"verification": {
"via": "email"
}
}
},
"phone": {
"type": "string",
"title": "Phone",
"format": "tel",
"minLength": 3,
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"code": {
"identifier": true,
"via": "email"
}
}
}
}
},
"required": [
"phone",
"email"
],
"additionalProperties": false
}
}
}
Hydra client registration
curl -X POST <http://localhost:4445/admin/clients> \
-H "Content-Type: application/json" \
-d '{
"client_id": "<http://my.client.app|my.client.app>",
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"scope": "openid offline",
"redirect_uris": ["<my.client.app://oauth2redirect>", "<http://localhost:8089/callback>"],
"token_endpoint_auth_method": "none"
}'
Could you help me understand what I might be missing in my setup or configuration? Thanksmagnificent-energy-493
phone trait is not properly configured as a code login identifier.
some quick debugging tips:
• Make sure the trait is named exactly phone in both the schema and when creating the identity. The value must match exactly (including formatting) between registration and login.
• If you changed the schema after starting Kratos, make sure to reload or restart the service.
• Confirm that the code method is enabled and passwordless_enabled: true in your config.
• Make sure the login UI or API is sending the phone value as the identifier for the code login flow.creamy-balloon-89079
11/24/2025, 2:13 PMphone in both the schema and when creating the identity. The value must match exactly (including formatting) between registration and login.
◦ so in my schema it "phone" with a title of "Phone".
◦ Does the title matter?
◦ For the create Part I am going dig even deeper but right now the payload I am passing is { schema_id: 'default', traits: { phone: PHONENUMBER, email: EMAILADDRESS }
• If you changed the schema after starting Kratos, make sure to reload or restart the service.
◦ I am using docker and have double check this to be sure
• Confirm that the code method is enabled and passwordless_enabled: true in your config.
◦ Based on my kratos.yml file those both should be correct with and addition config of lifespan: 15m.
◦ I can share my entire Kratos.yml file if need be to make sure I don't have something conflicting?
• Make sure the login UI or API is sending the phone value as the identifier for the code login flow.
◦ here is the payload I current pass. { flow: flowId, updateLoginFlowBody: { method: 'code', identifier: phone, csrf_token: csrfToken } }creamy-balloon-89079
11/24/2025, 2:23 PM