title: How to get params from AuthorizationHandler .NET Core
body: <p>I am using an authorization handler to put custom authorization in my controller in .net core. How can I get the parameters from the controller and use it to the authorization handler?  </p>
  
  <p>In the old .NET I can get the parameters from <code>HttpContext</code> request param like this:</p>
  
  <pre><code>var eventId = filterContext.RequestContext.HttpContext.Request.Params["id"];
  </code></pre>
  
  <p>I am not sure how can I achieved it in .net core</p>
  
  <pre><code>public class HasAdminRoleFromAnySiteRequirement : AuthorizationHandler&lt;HasAdminRoleFromAnySiteRequirement&gt;, IAuthorizationRequirement
  {
      public HasAdminRoleFromAnySiteRequirement()
      {
  
      }
  
      protected override Task HandleRequirementAsync(AuthorizationHandlerContext context,
          HasAdminRoleFromAnySiteRequirement requirement)
      {   
  
      //need to call get param from controller to used in the validation
      // something like this 
      //var eventId = filterContext.RequestContext.HttpContext.Request.Params["id"];
     // I tried the suggestion below but I can't get the parameter from routedata
     // var mvcContext = context.Resource as     Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext;            
  
          return Task.FromResult(0);
      }
  }
  </code></pre>