creamy-bear-51329
10/24/2024, 4:20 AMbrief-egg-61061
10/24/2024, 4:20 AMbrief-egg-61061
10/24/2024, 4:21 AMbash ory patch identity-config --project ${project_id} --add '/courier/channels=[{"id":"sms","request_config":{"method":"PUT","body":"<base64://ZnVuY3Rpb24oY3R4KSB7DQpjdHg6IGN0eCwNCn0>=","url":"<https://webhook.site/#!/view/859c1c2c-c4d5-4058-aec4-53f37929c5c1>"}}]'
[Source](https://www.ory.sh/docs/kratos/passwordless/one-time-code#enable-sms-one-time-code-otp) 2. Customize your identity schema to specify that the field is used as the "ID" when using passwordless one-time code login via SMS: json { "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms", } } } }
[Source](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier) 3. Configure the SMS template for the registration_code
in your Ory Identities configuration: yaml courier: templates: registration_code: valid: sms: body: plaintext: "<base64://WW91ciByZWdpc3RyYXRpb24gY29kZSBpczoge3sgLlJlZ2lzdHJhdGlvbkNvZGUgfX0>="
[Source](https://www.ory.sh/docs/kratos/emails-sms/sending-sms#templates) 4. Update the Ory Identities configuration using the file you worked with: bash ory update identity-config --project <project-id> --workspace <workspace-id> --file updated_config.yaml
[Source](https://www.ory.sh/docs/kratos/emails-sms/sending-sms#templates) 5. After the UI shows you that a code has been sent, check out the webhook target which will now show in response to the SMS being sent. [Source](https://www.ory.sh/docs/kratos/passwordless/one-time-code#enable-sms-one-time-code-otp) Please note that the base64 strings in the examples are placeholders and should be replaced with your actual content.