i am trying to make SignalR work using ASP.NET Identity. The code is very simple, where we create a new MVC5 Web Application, enable Google Account External, login with google account and make request to the Hub recognize the user by calling:
Context.User.Identity
Anyway, this is always returning null and it seems the client proxy is not able to send the external cookie.
The only workaround is doing the same steps as stated here:
http://gobbe.net/2013/06/13/use-the-asp-net-membership-in-a-signalr-chat-with-an-asp-net-mvc-4-application/
The workaround works, but I would prefer to use another solution. I also checked https://github.com/gustavo-armenta/CookieAuthenticationSample but this is not using external authentication.
Do you have any other ideas on how the Hub can recognize the external authentication schema of ASP.NET Identity?
Thanks
Ok. After hours of searching I went to jabbr online support and davidfowl helped out. The problem was the ordering of the calls on the Startup class. I had:
app.MapSignalR();
ConfigureAuth(app);
instead of:
ConfigureAuth(app);
app.MapSignalR();
Thanks David.
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