HTTP 403 error remote

In Global.asax
HangfireBootstrapper.Instance.Start();

in Startup
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
app.UseHangfireServer();
app.UseHangfireDashboard();
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[] { new NoAuthorizationFilter() }
});

    }

public class NoAuthorizationFilter : IDashboardAuthorizationFilter
{
   
    public NoAuthorizationFilter( )
    {
       
    }

    public bool Authorize ( DashboardContext dashboardContext)
    {
        return true;
    }
  }

On development computer I can access dashboard no mater what I have set up as Authorization. After I publish and access it remotely I get a 403 error.

You have UseHangfireDashboard() line twice, and the first one is without the authorization filters specified. Seems like a copy-paste issue.

I have same issue in .net core service app. I don’t have a copy-paste code, but I face same 403 error on my remote - did anyone figure out how to fix it?

1 Like

i am also facing same problem. Working well on local machine but return error trying to access dashbaord on remote server and unable to create background job when trying to enqeue task

1 Like

I have same issue in .Net Core and dont have dublicate UseHangfireDashboard() . Is there anyone to solved this issue before?

1 Like

Same problem. Our ASP.NET application is running on two servers behind a load balancer. The dashboard shows the error:
**Unable to refresh the statistics:** the server responded with 403 (Forbidden). Try reloading the page manually, or wait for automatic reload that will happen in a minute.

When deployed on an environment with one server, we do not get the error.

1 Like

Same for me, any News where this is coming from or how to avoid?

Same here. Im stuck. It is weird that this isn’t addressed by the supplier

You need also implement AsyncAuthorization

			app.UseHangfireDashboard("/hangfire", new DashboardOptions
			{
				Authorization = new[] { new HangfireAuthorizationFilter() },
				AsyncAuthorization = new[] { new HangfireAsyncAuthorizationFilter() },
			});
1 Like

After I removed the first empty app.UseHangfireDashboard();, it started to work.

I am guessing that your NoAuthorizationFilter() just returns true? Are you securing the dashboard via other means?