I'm trying to set up authorization by using policies because for some reason the ClaimsPrinciple doesn't work, so I'm trying this.

My current problem is that `service` is returning as null. I've tried `UserManager<IdentityUser> UserManager = new UserManager<IdentityUser>();`, however it gives me an error.

```
public class AdminRequirementHandler : AuthorizationHandler<AdminRequirement>
{
    public bool Check = false;
    IServiceProvider service { get; set; }
    protected override async Task HandleRequirementAsync(
                                      AuthorizationHandlerContext context, 
                                      AdminRequirement requirement)
    {
        var CurrentEmail = context.User.Identity.Name;
        string RoleName = requirement.ToString();
        await GetData(CurrentEmail, RoleName);
    }

    private async Task GetData(string CurrentEmail, string RoleName)
    {
        var UserManager = service.GetRequiredService<UserManager<IdentityUser>>();
        var user = await UserManager.FindByNameAsync(CurrentEmail);
        if (user != null)
        {
            var adminCheck = await UserManager.IsInRoleAsync(user, RoleName);
            if (adminCheck == true)
            {
                Check = true;
            }
            else
            {
                return;
            }
        }
    }
}

```

Any ideas on how to fix it?