title: ASP.NET Core MVC Hangfire custom authentication
body: <p>I managed to work Hangfire on my ASP.NET Core MVC application, and now I am trying to add admin authorization.</p>
  
  <p>I added the following code to the Startup.cs file:</p>
  
  <pre><code>app.UseHangfireDashboard("/hangfire", new DashboardOptions
   {
      Authorization = new[] {new  SecurityHelpers.AdminAuthorization.HangFireAuthorizationFilter() }
   });
  
  app.UseHangfireServer();
  RecurringJob.AddOrUpdate( () =&gt; Debug.WriteLine("Minutely Job"), Cron.Minutely);
  </code></pre>
  
  <p>Now I have a problem with custom authorization filter:</p>
  
  <pre><code>public class HangFireAuthorizationFilter : IDashboardAuthorizationFilter
  {
      public bool Authorize(DashboardContext context)
      {
          return true;
      }
  }
  </code></pre>
  
  <p>There are samples for old configuration with IAutohorizationFilter, and form version 1.6.8 there is a new interface IDashboardAuthorizationFilter, and I can't figure out how to implement it.</p>
  
  <p>My web application uses claims.</p>
  
  <p>thnx</p>