// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IGlobalConfiguration hangfire, IOptions <HangfireOption> hangfireOption) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } hangfire.UseConsole(); hangfire.UseHangfireHttpJob(); var filter = new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions { // Require secure connection for dashboard RequireSsl = false, SslRedirect = false, // Case sensitive login checking LoginCaseSensitive = true, // Users Users = hangfireOption.Value.Users.Select(d => new BasicAuthAuthorizationUser { Login = d.UserName, PasswordClear = d.Password }) }); app.UseHangfireServer(new BackgroundJobServerOptions { ServerName = "ERP background job", }); app.UseHangfireDashboard("", new DashboardOptions { Authorization = new[] { filter } }); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }