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.
Check out the article about dashboard authentication: http://docs.hangfire.io/en/latest/configuration/configuring-authorization.html
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?
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.
Its giving a 404 not found in fiddler.
Can you paste the code you are using for dashboard configuration here?
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseHangfire(config =>
{
// Basic setup required to process background jobs.
config.UseSqlServerStorage("HangfireDB");
config.UseServer();
});
}
}
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.
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.
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());
Thanks!
I think hangfire by default wants RequireSSL as true. My website is not under SSL, any work around for this?
Hello again -
I am able to set it up without authorization. Will work on authorizing it next. Thanks for your help!!
Regards,
Leon
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.
Same issue here. Being blocked trying to get google content.
Hey Leon,
Could you please share how you were able to set it on the higher environment without Authorization?
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.
My project is in angular and asp.net core. I am also getting this issue on production mode. But dashboard is working fine on my localhost.
I also used IDashboardAuthorizationFilter for filtering. But on my
public bool Authorize(DashboardContext context)
{
}
I am not getting my Cliams here to verify user. and it is redirecting me not working page