I'm using VS 2013 Express and the standard MVC5 template to create a new clean app. Authentication is enabled and I can log into the site just fine. I can see the user context in my controllers, but when I add Signalr I can't get the Hubs to register that authentication has take place.
Context.User in the hub is null. Using Signalr 2.0.2 and all related OWIN packages.
The resolution to the program was very simple. In my startup class I had the code in the wrong order.
This is what I had when it wasn't working:
app.MapSignalR();
ConfigureAuth(app);
However, this is the correct order to have Signalr work with authentication:
ConfigureAuth(app);
app.MapSignalR();
This may be a no-brainer for most, but I think it's an easy mistake to make.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With