Login with Phone Number and Password

  1. User should enter Phone Number (Unique) and Password
  2. User should receive verification code 4 digit via SMS

Is this possible to with define RULE for validate Phone Number format on username instead of email?

** NOT CONSIDER Passwordless Authentication yet

What you describe is multi-factor authentication and not so much related to having a specific requirement for the format of a username. In addition, passwordless authentication is also a different thing because although it provides an option where it involves phones and SMS it would still be just one factor.

If you really need the user to provide two factors (username/password credentials and code delivered through SMS) in order to complete authentication then you should take a look at the reference documentation for multi-factor; have in mind that SMS is supported only for Auth0 Guardian.

In term Auth0 Guardian with SMS, does the sms require for every login or only registration?

Multi-factor authentication will be for each login, or at least for each login every X days; it’s not meant just for registration. If you were intending to do this only once at registration time then this is no longer multi-factor authentication or even authentication related and it’s just a requirement for sign-up to have a verified phone number which is something completely different.

Thanks for clarification.
Do you have example of apply phone numbers format validation on username on hosted page and rules?

Thanks for clarification.
Do you have example of apply phone numbers format validation on username on hosted page and rules?

For verification on hosted login page I’m unsure if this would be something achievable with the default Lock template, but it would definitely be possible to do it if you customized the page. I’m not aware of any examples, however, you can consider the API that Twilio provides for validation which would likely be much simpler to work with than your own validation rules.