I am trying to implement a custom authorization requirement, but it seems like context.User.Identity does not contain any data so the ClaimsPrincipal User.
I added service and policy like this
services.AddAuthorization(config => { config.AddPolicy("Test", policyBuilder => { policyBuilder.UserRequireCustomClaim(0); }); }); services.AddScoped<IAuthorizationHandler, TestHandler>();
my requirement, builder and handler are also set. How should I fix this problem in ASP.NET Core 3.0?
I found my problem after a good rest and reviewing my code, i just extended my IdentityUser but didnt send it to base;
so context couldnt be represented inside the handler. Problem solved...