Base solution for your next web application
Open Closed

[Question] How to enable SMS login for non-core project. #8193


User avatar
0
dev.touchpoint created

Hi, me and my team are using non-core ASP.NET Zero Version 5.6.0 (ASP.NET MVC 5 & AngularJs 1.x).

We are wondering how to enable SMS login.

Thanks, Kenny.


10 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, do you mean sms two factor authentication?

    if not, do you mean phone number sign up/login?

    if so, please see https://github.com/aspnetzero/aspnet-zero-core/issues/1469

  • User Avatar
    0
    dev.touchpoint created

    Hi, yes I meant phone number sign up.

    Sorry for late response.

    Thanks, Kenny.

  • User Avatar
    0
    maliming created
    Support Team

    hi @dev.touchpoint Do you mean to log in by phone number + SMS verification code?

  • User Avatar
    0
    dev.touchpoint created

    Hi, nope.

    What we are trying to achieve is register/sign up by phone number + SMS verification code.

    Sorry for late response.

    Thanks, Kenny.

  • User Avatar
    0
    maliming created
    Support Team

    First of all, you must make sure that the phone number of the same tenant cannot be duplicated. After that you need to implement the verification function of the SMS verification code.

    You can refer to AbpLogInManager to implement your SMS verification code login function. The register method is similar. The focus is on the verification function of the SMS verification code.

  • User Avatar
    0
    dev.touchpoint created

    Hi, our concern is how to implement sending verification code by SMS to user based on the phone number. I don't see any function similar to send verification code from AbpLogInManager.

    Do we need to implement third party framework or ASP.NET has this function?

    Thanks, Kenny.

  • User Avatar
    0
    ryancyq created
    Support Team

    Hi,

    ANZ proivdes SMS verification as one of the 2FA authentications in the aspnetcore version of ANZ.

    The document describes how sms verification flow is at https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Features-Angular-Two-Factor-Authentication#twilio-integration

    You can also look at the code at https://github.com/aspnetzero/aspnet-zero-core/blob/0393b6a49c5d2662c2b8c1ae0a059f4ab3924d40/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Controllers/TokenAuthController.cs#L279 to find out more about how sms verification flow was implemented for aspnetcore.

  • User Avatar
    0
    dev.touchpoint created

    Hi,

    We are using non-core project, any reference for non-core project?

    Thanks, Kenny.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you implement https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Core/Identity/IdentitySmsMessageService.cs and if the user has a phone number and PhoneNumberVerified field on User entity is true, users can use sms two factor authentication.

  • User Avatar
    0
    dev.touchpoint created

    Hi,

    Thanks for the information, I will try and come back here if there is any issue or challenge.

    Thanks, Kenny.