Thank you for your reply. In the article are the following lines of code:
var provider = new Microsoft.Owin.Security.DataProtection.DpapiDataProtectionProvider("Sample");
UserManager<ApplicationUser> userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>());
userManager.UserTokenProvider = new Microsoft.AspNet.Identity.Owin.DataProtectorTokenProvider<ApplicationUser>(provider.Create("EmailConfirmation"));
Please tell me what "Sample" and "EmailConfirmation" are?
Krutovdl, you should change "Sample" into your application/module name and "EmailConfirmation" for describing what you are doing with the token, whether it is Email Confirmation, Password Reset or something else. The Token provider uses those values to make
the tokens even more unique. Probably "salt" values.
Member
44 Points
73 Posts
"No IUserTokenProvider is registered." When calling UserManager.GeneratePasswordResetToken In OWI...
Apr 14, 2014 07:51 PM|krutovdl|LINK
I tried to generate a password reset token with the following code:
This resulted in the error "No IUserTokenProvider is registered." More details:
[NotSupportedException: No IUserTokenProvider is registered.]
Microsoft.AspNet.Identity.<GenerateUserTokenAsync>d__e9.MoveNext() +287
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
Microsoft.AspNet.Identity.<GeneratePasswordResetTokenAsync>d__4f.MoveNext() +363
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +49
Can anyone explain what is required here?
All-Star
25891 Points
5831 Posts
Re: "No IUserTokenProvider is registered." When calling UserManager.GeneratePasswordResetToken In...
Apr 14, 2014 09:50 PM|markfitzme|LINK
Here's an article at StackOverflow that may have the answer. http://stackoverflow.com/questions/22629936/asp-net-identity-core-2-0-no-iusertokenprovider-is-registered
Member
44 Points
73 Posts
Re: "No IUserTokenProvider is registered." When calling UserManager.GeneratePasswordResetToken In...
Apr 15, 2014 08:08 AM|krutovdl|LINK
Hi Mark,
Thank you for your reply. In the article are the following lines of code:
Please tell me what "Sample" and "EmailConfirmation" are?
None
0 Points
1 Post
Re: "No IUserTokenProvider is registered." When calling UserManager.GeneratePasswordResetToken In...
Jun 18, 2014 03:57 AM|Isaack.Rasmussen|LINK
Krutovdl, you should change "Sample" into your application/module name and "EmailConfirmation" for describing what you are doing with the token, whether it is Email Confirmation, Password Reset or something else. The Token provider uses those values to make the tokens even more unique. Probably "salt" values.