Hangfire Dashboard


#1

How should we get the dashboard site code and deploy to prod environments? My local debug dashboard works fine but when I push it to higher enviornment it’s lost and gives me a white screen.


#2

Check out the article about dashboard authentication: http://docs.hangfire.io/en/latest/configuration/configuring-authorization.html


#3

Thanks for the response. I have already tried these configuration. My issue is not related to authentication. I am not able to set a Dashboard in higher environment, it displays a white screen. Where as it works fine when I am running it in my local PC within debug mode.

I think my code files do not move as part of deployment which might have been installed by nuget package in local PC and its successfully able to reference it in local but those UI files are not moving to higher environment as part of deployment. Is there a way, I can find out what are the files which are getting invoked during Dashboard UI display?


#4

Can you check the response in Fiddler? If it’s authentication issue, it’ll be 401. If it’s files not being deployed my guess would be 404.


#5

Its giving a 404 not found in fiddler.


#6

Can you paste the code you are using for dashboard configuration here?


#7
public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.UseHangfire(config =>
        {
            // Basic setup required to process background jobs.
            config.UseSqlServerStorage("HangfireDB");
            config.UseServer();
        });
    }
}

#8

Thanks for the response. I have already tried these configuration. My issue is not related to authentication. I am not able to set a Dashboard in higher environment, it displays a white screen. Where as it works fine when I am running it in my local PC within debug mode.

By default, Hangfire Dashboard denies all remote requests to not to produce security holes for production environments. Please configure the authorization as written here to be able to use the dashboard in production.


#9

Thanks for the quick response.

I am not able to figure out what will be user credentials if I use the given configuration. I guess, It leads me to set up more authentication code set-up in my website, which I don’t want to do until I figure out it works in a simple way.

Any ideas or sample how its been set up in a generalized way? Doing the given setting in link does not work, I think there is more stuff to do in it.


#10

There is also non-documented yet authorization filter for basic auth:

As an example, here is the authorization filter allows everyone to access the dashboard:

public class DontUseThisAuthorizationFilter : IAuthorizationFilter
{
     public bool Authorize(IDictionary<string, object> owinEnvironment)
     {
         return true;
     }
}

config.UseAuthorizationFilters(new DontUseThisAuthorizationFilter());

#11

Thanks!

I think hangfire by default wants RequireSSL as true. My website is not under SSL, any work around for this?


#12

Hello again -

I am able to set it up without authorization. Will work on authorizing it next. Thanks for your help!! :smiley:

Regards,
Leon


#13

I have deployed Hangfire to an Azure VM and when i try to access the dashboard from a broswer on the VM i get a blank page.

I havent setup any authorization filters as i wouldnt expect that i need too?

Has anyone else had this issue?

The deployed site on the VM is not using https.

Hangfore itself is working fine, its only the dashboard im not getting.


#14

Same issue here. Being blocked trying to get google content.


#15

Hey Leon,
Could you please share how you were able to set it on the higher environment without Authorization?


#16

The Dashboard is something that bugs me too.

I have a dotnet core web api with an Angular frontend. Authentication is done via api login function and JWT, which fits my needs completely.

The app and api are running in Azure and the dashboard works fine with a general authorization (return true) but for production this is not the way it should be.

I am looking for any examples implementing some kind of dashboard authorization for this specific case because I don’t have any Identity object (not ASP.NET MVC) nor a token, because I call the dashboard directly from a browser with the url.