I need to create short code (6 digits) for Email Confirmation using Asp.Net Identity. Currently, if I use
"GenerateEmailConfirmationTokenAsync"
it provides me with very long code instead of this I want to generate a code which is only 6 digit in length. Is there any way to achieve this how can I extend identity to provide such a feature. any leads towards this will be helpful.
Thanks
Yes you can. Check this SO answer for details.
Basically you have to create a class inheriting
IUserTokenProvider<TUser, TKey>
and implement those two methods:GenerateAsync
andValidateAsync
.There you will write the code to generate and validate your six characther token. The same token will be used everywhere inside the ASP.NET Identity without any other code change.