We are leaving Russia. We are against aggression and war with Ukraine. It is a tragedy for our nations, it is a nightmare

Hangfire Dashboard Not Accessible Remotely

            var app = webHost.Build();

            app.UseRouting();
            app.UseAuthorization();
            app.UseHangfireDashboard("", new DashboardOptions
            {
                IsReadOnlyFunc = _ => true,
                Authorization = new[] { new DashboardAuthorizationFilter() },
                IgnoreAntiforgeryToken = true,
            });

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

Running net 6 console app with webapplication inbuilt. It runs just fine on http://localhost:5000 but not when accessing remotely.

DashboardAuthorizationFilter.cs

    public class DashboardAuthorizationFilter : IDashboardAuthorizationFilter
    {
        public bool Authorize(DashboardContext context)
        {
            return true;
        }
    }

A netstat shows the following:

C:\windows\system32>netstat -aon | find "5000"
  TCP    127.0.0.1:5000         0.0.0.0:0              LISTENING       9392
  TCP    [::1]:5000             [::]:0                 LISTENING       9392

Can anyone indicate what is going wrong?

Hi, I am having the exact same issue. Have you found a solution?

Thanks in advance

Kind regards
Soeren

I have not yet no, sorry. Still only accessible locally.

I have made it work with following

            app.UseHangfireDashboard("/hangfire", new DashboardOptions()
            {
                Authorization = new[] { new DashboardAuthorizationFilter() },
                AsyncAuthorization = new[] { new DashboardAuthorizationFilter() }
            });

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

and this

public class DashboardAuthorizationFilter : IDashboardAuthorizationFilter,  IAuthorizationFilter, IDashboardAsyncAuthorizationFilter
{
    public bool Authorize(DashboardContext context)
    {
        return true;
    }


    public void OnAuthorization(AuthorizationFilterContext context)
    {
        
    }

    public async Task<bool> AuthorizeAsync(DashboardContext context)
    {
        return await Task.Run(() => true);
    }
}