How to fix IUserTwoFactorTokenProvider<TUser> error
I recently experienced the NotSupportedException: No IUserTwoFactorTokenProvider<TUser> named 'Default' is registered error when trying to update a user and generate a password reset token via ASP.NET 5 Identity. This problem likely also exists in ASP.NET Core too.
It turns out that this error is caused by a missing provider for the identity system.
You can fix the problem by making a small change within the ConfigureServices method inside Startup.cs.
I just had to add .AddEntityFrameworkStores<ApplicationDbContext>() and .AddDefaultTokenProviders() to my identity provider.
services.AddIdentity<IdentityUser, IdentityRole>(options => options.SignIn.RequireConfirmedAccount = true)
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
And that's it, an extremely easy fix. You just need to rebuild the solution and try again after making the change.