I've stumbled on this issue and this might be more of a configuration problem on my end but it's been a week and I wasn't able to solve this.
The scenario is; on my Client API startup.cs I have the
services.AddIdentity<TUser,TRole>().AddEntityFrameworkStores<context>();
Initially I don't have any problem at first, my nightmare started when I decided on adding and using policy(ies) and using UserManager
in my ApiController using [Authorize(Policy = "GivenPolicy")]
work if I remove the services.AddIdentity
..... code.
Of course I can live with that but one of my API controller need is for me to use the UserManager
which will not resolve if I don't have the services.AddIdentity().AddEntityFrameworkStores()
.
I hope someone can help me on resolving this issue. TIA.