好像你忘了注册你的 ImpersonationHandler 在DI容器中(确实很容易忘记):
ImpersonationHandler
services.AddSingleton<IAuthorizationHandler, ImpersonationHandler>();
Asp.net从容器中解析所有这些处理程序并尝试匹配特定要求。由于没有注册这样的处理程序 - 没有设置 context.Succeed 整个授权失败。
context.Succeed