HTTP 403 error remote

Tags: #<Tag:0x00007fb501faf678>

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