Click here to Skip to main content
15,945,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I need to create Short Code (6 digit) 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.


What I have tried:

I have tried using GenerateEmailConfirmationToken method
Updated 30-Apr-16 23:20pm

1 solution

Use your own IUserTokenProvider[^] implementation to handle those tokens, and create six char long one, when purpose is 'Confirmation'...
Share this answer
sagar wasule 1-May-16 6:11am    
Thanks Kornfeld. Could you please help me with how to integrate this custom Token Provider with the actual implementation
Kornfeld Eliyahu Peter 1-May-16 6:24am    
In your project (in IdentityConfig.cs) there is a line like this:
manager.UserTokenProvider = new DataProtectorTokenProvider<applicationuser>(dataProtectionProvider.Create("ASP.NET Identity"));
Replace DataProtectorTokenProvider with your class...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900