Register and Login by Phone Number in Core Identity


Is it possible to don't use Email to register and login in core identity?

Users just register by mobile number and login by SMS verification.

Ruard van Elburg

One possible way is to setup identity as two factor authentication. Instead of email use username to store the mobile number. To do this set RequireUniqueEmail = false in ApplicationUserManager.Create.

You'll need to add your own code to retrieve the number and validate it. Make sure it always has the same format as it should match the username.

In the code where the username is verified skip the password check (since password is null), but do check the number. Send an SMS with code and continue with the flow.

You can add your own logic to create and verify the code and how long it is valid.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at


Login to comment


TOP Ranking