若沒有hangfir面板的過濾器IDashboardAuthorizationFilter,在打開/hangfire路徑時請求會返回401未授權。
需要添加類繼承IDashboardAuthorizationFilter過濾器類
public class CustomerHangfireDashboardFilter : IDashboardAuthorizationFilter { public bool Authorize([NotNull] DashboardContext context) { return true; } }
並且在StartUp註冊使用 app.UseHangfireDashboard("/hangfire", new DashboardOptions { //hangfire 身份驗證過濾器 Authorization = new[] { new CustomerHangfireDashboardFilter() }, });