How to configure mobile number + otp based auth alongside email + password #4508
Replies: 1 comment
-
|
Hello @anshbhimani2 Two main things are missing / misplaced in your config: Identity schema is not configured for phone+code login In identity.schema.json, the phone trait must be marked as a code identifier via SMS, otherwise the code method can’t use it. For example:[Identity extensions; Passwordless custom schema] (Keep your existing email trait with password.identifier: true.) SMS delivery must be configured under courier, not under selfservice.methods.code Kratos sends SMS via the courier SMS channel, not via fields like delivery_method or sms: on the code method. You need something like:[Send SMS] And optionally SMS templates for login_code / recovery_code / verification_code if you want to control the SMS body.[Send SMS templates] Optional but often desired: Add a session hook after code registration so users who sign up by phone+OTP are logged in immediately:[Successful registration; Sign in after registration] Let me know if that helps. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have installed ory kratos and hydra stack.
I am able to get jwt tokens and also implement role based access controls.
But now i want a dual login flow where users have a choice to sign up using email id and password or use mobile number + otp to sign up.
The method used for sign up would be same used for sign in.
But i am not able to integrate the mobile number + otp part
here I am attaching my configuration files below
Note: I am not talking about the mfa using sms after email + password.
identity.schema.json
kratos.yml
hydra.yml
quickstart.yml
Beta Was this translation helpful? Give feedback.
All reactions