square-napkin-92357
05/28/2025, 7:26 AMbrief-egg-61061
05/28/2025, 7:26 AMbrief-egg-61061
05/28/2025, 7:26 AMcode
method. Example identity schema snippet: json { "traits": { "phone": { "type": "string", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } } } } } }
[See schema example](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number-and-password) --- ### 2. Sign Up a New User 1. Go to your sign-up page (the Ory-hosted UI or your custom UI). 2. Enter the phone number in the registration form. 3. Submit the form. 4. Ory will send a one-time code (OTP) via SMS to the provided phone number. --- ### 3. Enter the OTP 1. Check your SMS inbox for the code sent by Ory. 2. Enter the received OTP in the prompt on the sign-up page. 3. Submit the OTP. 4. If the code is correct, the user account will be created and authenticated. --- ### 4. User Experience - The user will be signed in after successful OTP verification. - If you have enabled verification for the phone number, the number will be marked as verified after this process. --- ### 5. Additional Notes - If you want to test with a mock SMS provider, you can use a service like [webhook.site](https://webhook.site/) to receive the SMS payload for development purposes. - For production, ensure your SMS provider is properly configured in the Ory Console or via the CLI. References: [Enable SMS one-time-code (OTP)](https://www.ory.sh/docs/kratos/passwordless/one-time-code#enable-sms-one-time-code-otp) [Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms) [Customize identity schema](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number-and-password) --- If you need more details on configuring the SMS provider or the identity schema, let me know!square-napkin-92357
05/28/2025, 7:28 AM2. Sign Up a New User
1. Go to your sign-up page (the Ory-hosted UI or your custom UI).
2. Enter the phone number in the registration form.
3. Submit the form.
4. Ory will send a one-time code (OTP) via SMS to the provided phone number.
brief-egg-61061
05/28/2025, 7:28 AMbrief-egg-61061
05/28/2025, 7:29 AMGET /self-service/registration/api
- This endpoint initializes a new registration flow and returns a flow ID and form fields (including the phone number field if your schema is configured for it). - You must call this endpoint first to get the flow ID required for the next step. --- ### 2. Submit the Registration Form API: POST /self-service/registration?flow=<flow-id>
- Submit the registration form with the user's phone number and any other required fields. - The payload should include the phone number as specified in your identity schema. - If the registration method is set to use the code
strategy (OTP via SMS), Ory will send a one-time code to the provided phone number after this step. --- ### 3. Enter and Submit the OTP API: POST /self-service/verification?flow=<flow-id>
- The user receives the OTP via SMS. - The user submits the OTP code using the verification endpoint, referencing the flow ID. - If the code is correct, the registration is completed and the phone number is verified. --- #### Notes - The exact field names and payload structure depend on your identity schema and Ory configuration. - If you are using the Ory-hosted UI, these API calls are handled by the UI. For a custom UI, you need to call these APIs directly. - The knowledge sources do not provide full request/response examples for these endpoints, but the flow described above matches the documented Ory Kratos self-service registration process for passwordless/OTP flows [see API reference](https://www.ory.sh/docs/reference/api). --- If you need more detailed request/response examples or information about additional endpoints, please let me know. The knowledge sources do not provide full API payload examples for this specific flow.