Sitecore :: Hangfire Dashboard 404

Greetings,

I have OWIN working with Sitecore but I cannot seem to get the dashboard to load. Here is my OWIN Startup class. I was able to confirm OWIN was working by having it write some test string to the response. It was able to work.

One thing worth noting is that Sitecore requires that the default MVC route be removed from the RouteConfig.

public class OwinStartup
    {
        public void Configuration(IAppBuilder app)
        {
            GlobalConfiguration.Configuration.UseSqlServerStorage("connectionStringName");

            app = app.UseHangfireServer();
            app = app.UseHangfireDashboard("/hangfire", new DashboardOptions()
            {
                AuthorizationFilters = new[] { new UnrestrictiveAuthorizationFilter() }
            });
        }
    }

    public class UnrestrictiveAuthorizationFilter : Hangfire.Dashboard.IAuthorizationFilter
    {
        public bool Authorize(IDictionary<string, object> owinEnvironment)
        {
            // In case you need an OWIN context, use the next line,
            // `OwinContext` class is the part of the `Microsoft.Owin` package.
            //var context = new OwinContext(owinEnvironment);

            // Allow all authenticated users to see the Dashboard (potentially dangerous).
            //return context.Authentication.User.Identity.IsAuthenticated;

            return true;
        }
    }

It was my own fault… It dealt with the way I was handling itemnotfoundurl 404 errors in sitecore. :stuck_out_tongue:

Whoops!

Hi @MichaelHorsch ,

Can you explain how did you make it work?

I tried that approach but couldn’t make it work… always got redirected to: /sitecore/service/notfound.aspx

I’ve then installed Sitecore.Owin nuget, which adds an entry in the web.config

and comes with initializeOwinMiddleware pipeline. I register and implement my pipeline, it runs, creates the Hangfire db’s etc. but when i try to access Dashboard i get:

Thanks in advance for any help…