Hangfire dashboard authorization in Azure WorkerRole OR self hosted console application

It is very recent that I have introduced to Hangfire, and I must say it is awesome.

I am working on an application, wherein I am hosting hangfire in Azure worker role. Everything works perfect; the hangfire configuration, job scheduling, dashboard etc. except configuring authorization to hangfire dashboard.

I have added an OwinStartup class where I have configuring hangfire dashboard. I have used my custom implementation of IAuthorizationFilter and an OwinMiddleware as suggested here, anticipating that user should now be prompted to provide credentials while accessing hangfire dashboard. But for no help, and it keep giving me 403 response when trying to access the dashboard. :frowning:

It works perfectly alright if I don’t use authorization filter option while configuring dashboard, but then everyone can access it.

I guess the solution for hangfire dashboard in self hosted applicatino should work as well.

Thanks and regards

I solved it using “Thinktecture.IdentityModel.Owin.BasicAuthentication” library that is available through nuget package.

Please see the below thread for more details -