narrow-hospital-35452
10/25/2024, 6:45 AM/self-service/verification
the response node
does not have attributes
phone
Even though on identity schema already have
"phone": {
"type": "string",
"title": "Phone number",
"format": "tel",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"verification": {
"via": "sms"
}
}
}
brief-egg-61061
10/25/2024, 6:45 AMbrief-egg-61061
10/25/2024, 6:45 AMcredentials
section to your phone trait. Here's an example of how it should look: json "phone": { "type": "string", "title": "Phone number", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } }, "verification": { "via": "sms" } } }
This configuration is based on the examples provided in the [identity schema documentation](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number-and-password). 2. Verification Flow Configuration: Ensure that you have properly configured the verification flow in your Ory Kratos configuration. You need to enable the code method and set it to use SMS. Here's an example configuration: yaml selfservice: methods: code: enabled: true flows: verification: use: code enabled: true
You can find more details about this configuration in the [verification flow documentation](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#configuration). 3. SMS Courier Configuration: Make sure you have configured an SMS courier channel with the ID set to sms
. This is crucial for SMS verification to work. You can find more information about this in the [SMS documentation](https://www.ory.sh/docs/kratos/emails-sms/sending-sms). 4. Check Your Implementation: Ensure that you're correctly implementing the verification flow in your application. The verification flow should be initiated by accessing the /self-service/verification/browser
endpoint, not directly hitting /self-service/verification
. If you've confirmed all these steps and are still experiencing issues, it might be helpful to double-check your entire configuration and ensure all necessary components are properly set up. If the problem persists, you may need to reach out to Ory support for further assistance, as there might be some specific configuration or implementation detail that's causing this behavior.narrow-hospital-35452
10/25/2024, 6:51 AM[
{
"type": "input",
"group": "code",
"attributes": {
"name": "email",
"type": "email",
"required": true,
"disabled": false,
"node_type": "input"
},
"messages": [],
"meta": {
"label": {
"id": 1070007,
"text": "Email",
"type": "info"
}
}
},
{
"type": "input",
"group": "code",
"attributes": {
"name": "method",
"type": "submit",
"value": "code",
"disabled": false,
"node_type": "input"
},
"messages": [],
"meta": {
"label": {
"id": 1070009,
"text": "Continue",
"type": "info"
}
}
},
{
"type": "input",
"group": "default",
"attributes": {
"name": "csrf_token",
"type": "hidden",
"value": "H0SP6o5w9RVHcDjrWw0a2gxdnRlRHAk8OW/JiIYMrJl7yeAGSr0/T7dZoPyV/5mbfIycZFfp3kHqc+Gfi8S0Fg==",
"required": true,
"disabled": false,
"node_type": "input"
},
"messages": [],
"meta": {}
}
]
brief-egg-61061
10/25/2024, 6:53 AMbrief-egg-61061
10/25/2024, 6:54 AMnarrow-hospital-35452
10/25/2024, 7:05 AMcourier:
channels:
- id: sms
type: http
request_config:
url: <https://api.twilio.com/2010-04-01/Accounts/AXXXXXXXXXXXXXX/Messages.json> # Adjust your account ID
method: POST
# body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgVG86IGN0eC5yZWNpcGllbnQsCiAgQm9keTogY3R>4LmJvZHksCn0= # see below
body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgcmVjaXBpZW50OiBjdHgucmVjaXBpZW50LAogIHR>lbXBsYXRlX3R5cGU6IGN0eC50ZW1wbGF0ZV90eXBlLAogIHRvOiBpZiAidGVtcGxhdGVfZGF0YSIgaW4gY3R4ICYmICJ0byIgaW4gY3R4LnRlbXBsYXRlX2RhdGEgdGhlbiBjdHgudGVtcGxhdGVfZGF0YS50byBlbHNlIG51bGwsCiAgcmVjb3ZlcnlfY29kZTogaWYgInRlbXBsYXRlX2RhdGEiIGluIGN0eCAmJiAicmVjb3ZlcnlfY29kZSIgaW4gY3R4LnRlbXBsYXRlX2RhdGEgdGhlbiBjdHgudGVtcGxhdGVfZGF0YS5yZWNvdmVyeV9jb2RlIGVsc2UgbnVsbCwKICByZWNvdmVyeV91cmw6IGlmICJ0ZW1wbGF0ZV9kYXRhIiBpbiBjdHggJiYgInJlY292ZXJ5X3VybCIgaW4gY3R4LnRlbXBsYXRlX2RhdGEgdGhlbiBjdHgudGVtcGxhdGVfZGF0YS5yZWNvdmVyeV91cmwgZWxzZSBudWxsLAogIHZlcmlmaWNhdGlvbl91cmw6IGlmICJ0ZW1wbGF0ZV9kYXRhIiBpbiBjdHggJiYgInZlcmlmaWNhdGlvbl91cmwiIGluIGN0eC50ZW1wbGF0ZV9kYXRhIHRoZW4gY3R4LnRlbXBsYXRlX2RhdGEudmVyaWZpY2F0aW9uX3VybCBlbHNlIG51bGwsCiAgdmVyaWZpY2F0aW9uX2NvZGU6IGlmICJ0ZW1wbGF0ZV9kYXRhIiBpbiBjdHggJiYgInZlcmlmaWNhdGlvbl9jb2RlIiBpbiBjdHgudGVtcGxhdGVfZGF0YSB0aGVuIGN0eC50ZW1wbGF0ZV9kYXRhLnZlcmlmaWNhdGlvbl9jb2RlIGVsc2UgbnVsbCwKICBzdWJqZWN0OiBjdHguc3ViamVjdCwKICBib2R5OiBjdHguYm9keQp9Cg==
headers:
Content-Type: application/x-www-form-urlencoded # defaults to application/json
auth:
type: basic_auth # or api_key
config:
user: AXXXXXXX # adjust your credentials
password: XXXX # adjust your credentials
brief-egg-61061
10/25/2024, 7:05 AMbrief-egg-61061
10/25/2024, 7:06 AM<https://api.twilio.com/2010-04-01/Accounts/AXXXXXXXXXXXXXX/Messages.json>
, AXXXXXXXX
, XXXX
) with your actual Twilio account details. Also, the body
field in your configuration is a base64 encoded Jsonnet function. This function is used to generate the body of the HTTP request sent to the SMS gateway. Make sure that this function is correctly formatted and generates a valid request body for your SMS gateway. Here's the decoded version of your function: jsonnet function(ctx) { recipient: ctx.recipient, template_type: ctx.template_type, to: if "template_data" in ctx && "to" in ctx.template_data then <http://ctx.template_data.to|ctx.template_data.to> else null, recovery_code: if "template_data" in ctx && "recovery_code" in ctx.template_data then ctx.template_data.recovery_code else null, recovery_url: if "template_data" in ctx && "recovery_url" in ctx.template_data then ctx.template_data.recovery_url else null, verification_url: if "template_data" in ctx && "verification_url" in ctx.template_data then ctx.template_data.verification_url else null, verification_code: if "template_data" in ctx && "verification_code" in ctx.template_data then ctx.template_data.verification_code else null, subject: ctx.subject, body: ctx.body }
This function takes a context object (ctx
) and returns an object with the SMS message details. The context object includes various fields like recipient
, body
, template_type
, and template_data
. If you're still having issues, please ensure that your identity schema and verification flow are correctly configured to use SMS verification. You can refer to the [identity schema documentation](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number-and-password) and the [verification flow documentation](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#configuration) for more details. If the problem persists, you may need to reach out to Ory support for further assistance.