rhythmic-minister-31004
08/29/2024, 7:34 PMchilly-king-10285
08/29/2024, 7:35 PMchilly-king-10285
08/29/2024, 7:35 PMverification
extension. Here's an example of how to define such a trait in the identity schema: json { "$id": "<https://schemas.ory.sh/presets/kratos/quickstart/phone-password/identity.schema.json>", "$schema": "<http://json-schema.org/draft-07/schema#>", "title": "Person", "type": "object", "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "title": "Phone number", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "verification": { "via": "sms" } } } }, "additionalProperties": false } } }
(Source: [Phone number verification](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#phone-number-verification)) Next, you need to configure a courier channel with the ID set to sms
via the CLI. You can do this by adding the configuration for your custom SMTP server to your Ory Identities config file: yaml courier: templates: verification_code: valid: sms: body: plaintext: "<base64://WW91ciB2ZXJpZmljYXRpb24gY29kZSBpczoge3sgLlZlcmlmaWNhdGlvbkNvZGUgfX0>="
(Source: [Templates](https://www.ory.sh/docs/kratos/emails-sms/sending-sms#templates)) Finally, to trigger the verification flow, you need to create a new login flow with the aal
parameter set to aal2
and specify which trait to use for delivering the code to the user. For example, if you have a trait called phone_number
, you'd set via
to phone_number
. (Source: [Integration](https://www.ory.sh/docs/kratos/mfa/mfa-via-sms#integration))