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

前端 未结 7 1578
灰色年华
灰色年华 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();
    

提交回复
热议问题