I have followed all the steps mentioned in <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Hangfire-Integration">https://aspnetboilerplate.com/Pages/Doc ... ntegration</a> for hangfire integration in .Net Core solution.
When I goto projectUrl/hangfire, I see the error: This page isn’t working If the problem continues, contact the site owner. HTTP ERROR 401
How can I view this page, with Authorization enabled?
8 Answer(s)
-
0
By default: Log in to the system and the current user has the "AppPermissions.Pages_Administration_HangfireDashboard" permission.
Which project are you using in the HangfireDashboard? XXX.MVC or XXX.Host?
-
0
Hi @malming, I'm using the Web.Host project.
If I comment the permission section, I am able to view the hangfire dashboard. But I have no idea how to access the dashboard with the authentication enabled.
-
0
This is my practice, for reference only. Use razor pages to write a simple login function page. Then use cookie authorization. Now you can access the hangfire page that requires authorization.
Simple code:
public async Task<ActionResult> OnGet() { using (var uow = _unitOfWorkManager.Begin()) { var loginResult = await _logInManager.LoginAsync("admin", "qq1234", "Default"); if (loginResult.Result == AbpLoginResultType.Success) { await _signInManager.SignInAsync(loginResult.User, true); } uow.Complete(); return Page(); } }
-
0
Hi,
The docs explain how to authorize HangFire Dashboard; <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Hangfire-Integration#dashboard-authorization">https://aspnetboilerplate.com/Pages/Doc ... horization</a>
See the related posts; <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1245">https://github.com/aspnetboilerplate/as ... ssues/1245</a> <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1971">https://github.com/aspnetboilerplate/as ... ssues/1971</a>
-
0
<cite>alper: </cite> Hi,
The docs explain how to authorize HangFire Dashboard; <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Hangfire-Integration#dashboard-authorization">https://aspnetboilerplate.com/Pages/Doc ... horization</a>
See the related posts; <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1245">https://github.com/aspnetboilerplate/as ... ssues/1245</a> <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1971">https://github.com/aspnetboilerplate/as ... ssues/1971</a>
Hi @alper,
I am using Hangfire in Web.Host solution not the MVC project. I am able to access the hangfire dashboard when I comment the hangfire authorization filter. But I cannot find a good way to access the hangfire dashboard when Authorization filter is added.
I believe this should be an inbuilt feature in AspNetZero template.
-
0
aspnet-core, angular; 5.4.1 Everyone seems to suggest that displaying the Hangfire dashboard is easy but I have not yet found a way to do it using the aspnet-core/angular project. I understand that the dashboard requires cookies and all the solutions for adding cookies to authentication seem like overkill. The method outline by Caskia at [https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1971]) seemed to suggest a way forward but the code outlined is deprecated. I do not want to use authentication and the following two lines of code:
app.UseHangfireDashboard("/hangfire"); app.UseHangfireServer();
when placed in the Web.Host project simply redirect me back to the fallback route (<a class="postlink" href="http://localhost:4200/app/notifications">http://localhost:4200/app/notifications</a>) when the route <a class="postlink" href="http://localhost:4200/hangfire">http://localhost:4200/hangfire</a> is entered directly into the browser.
Can anyone help with some sample code please?
-
0
We will work on that with this issue <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/1457">https://github.com/aspnetzero/aspnet-ze ... ssues/1457</a>. Currently I don't know how to do this in Angular right now. You can use @maliming's suggestion as a temporary solution.
-
0
Thanks @ismcagdas. I will follow the issue.