If you have changed the AddDefaultIdentity in the Startup.cs file to AddIdentity and you receive a
An unhandled exception occurred while processing the request.
NotSupportedException: No IUserTwoFactorTokenProvider<TUser> named ‘Default’ is registered.
Microsoft.AspNetCore.Identity.UserManager<TUser>.GenerateUserTokenAsync(TUser user, string tokenProvider, string purpose)
error when registering a user, there is a easy fix. You need to a add a AddDefaultTokenProviders() when adding identity() to services.
public void ConfigureServices(IServiceCollection services)
{
………………
services.AddIdentity<User, UserRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
…………………….
1 Comment
Thanks, working