Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager` while attempting to activate 'AuthController'

前端 未结 7 1539
灰色年华
灰色年华 2020-12-05 01:53

I\'m getting this error in Login Controller.

InvalidOperationException: Unable to resolve service for type \'Microsoft.AspNetCore.Identity.UserManager

相关标签:
7条回答
  • 2020-12-05 02:25

    If you're using "IdentityServer" so IdentityServer authenticates the user and authorizes the client.By default, IdentityServer is actually not about user management. But there is some support for asp.net Identity

    So you need add :

    services.AddIdentityServer()
        .AddAspNetIdentity<ApplicationUser>();
    
    0 讨论(0)
提交回复
热议问题