Hi -
I have been trying to set the virtual absolute path and security in my startup.cs like the below :
app.UseHangfireDashboard("/BackgroundJobs", new DashboardOptions
{
Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_Host_Hangfire) }
});
app.UseHangfireDashboard("/BackgroundJobs", new DashboardOptions
{
AppPath = VirtualPathUtility.ToAbsolute("~/Application/App")
}
);
The authorization works but the App path doesn't work. It always redirect to the root URL where as I am trying the user to redirect to the dashboard.
Am I doing it right ?
6 Answer(s)
-
0
Hi,
I don't know what AppPath does, but, in general, you shouldn't call UseHangfireDashboard twice. Why don't you write it like that:
app.UseHangfireDashboard("/BackgroundJobs", new DashboardOptions { Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_Host_Hangfire) }, AppPath = VirtualPathUtility.ToAbsolute("~/Application/App") });
-
0
Thanks it worked.
The AppPath is used to navigate back from the Hangfire Dashboard to the application
-
0
Any idea why AbpHangfireAuthorizationFilter is not recognized in my code?
Abp.Hangfire is referenced and added as using.
-
0
Hi,
Which ABP version do you use in your project ? AbpHangfireAuthorizationFilter introduced in ABP 0.11.
-
0
it seems to be version 0.10.3.1 So how to proceed? I'm not a fan of updating the dll's on my production environment. Any other simple way to get this to work? I just need one background job atm. but when I go to /backgroundjobs, it always redirects to the login page.
-
0
You can upgrade to ABP v0.11 if you want to use AbpHangfireAuthorizationFilter. See it's release notes here <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/releases/tag/v0.11.0.0">https://github.com/aspnetboilerplate/as ... /v0.11.0.0</a>.
It's the next version of your version, so you will not have much problems. We can help if you face any problems.