ASP.NET MVC Identity - how to change the format of the generated token in SMS

Using two-factor authentication in ASP.NET MVC / Identity, I have successfully configured UserManager.SmsService.

By default, ASP.NET Identity generates a six-digit long validation token that is sent via SMS. However, our requirement is that instead of an alphanumeric token of 4 characters.

Code is generated using this command:

var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), phoneNumber);

Is there a way to determine the format of the generated code?

+4
source share

Source: https://habr.com/ru/post/1623217/


All Articles