I am trying to integrate Hangfire into my ASP.NET Core Web API project for background processing. While basic setup works with memory storage, I need to configure it with SQL Server storage and restrict access to the dashboard.
Setting Up Hangfire Services
Here is my current setup in Program.cs:
// Add Hangfire services to DI container
builder.Services.AddHangfire(config =>
config.UseSqlServerStorage(builder.Configuration.GetConnectionString("HangfireConnection")));
// Add the processing server
builder.Services.AddHangfireServer();Restricting Dashboard Access
By default, the Hangfire dashboard is only accessible locally. How can I implement a custom IDashboardAuthorizationFilter to ensure only authorized admin users can view the dashboard in production?
- What is the recommended approach to extract authenticated claims inside the authorization filter?
- Are there performance implications when using SQL Server for high-frequency recurring jobs?
Can you answer this question?
Write Answer0 Answers