i try to use SignalR in MVC Application. It works well but i get the following Error in the Chrome console
WebSocket connection to 'ws://localhost:18245/signalr/connect?transport=webSockets&clientProtocol=1.4&connectionToken=bNDGLnbSQThqY%2FSjo1bt
8%2FL45Xs22BDs2VcY8O7HIkJdDaUJ4ftIc54av%2BELjr27ekHUiTYWgFMfG6o7RaZwhf
fpXavzWQ1jvkaxGm5rI%2BWtK7j0g1eQC2aOYP366WmRQLXCiYJfsm4EbwX6T8n2Aw
%3D%3D&connectionData=%5B%7B%22name%22%3A%22importerhub%
22%7D%5D&tid=9' failed: HTTP Authentication failed; no valid credentials available
The funny thing is that the jquery method i call from the Controller over the Hub works fine.
jQuery:
$(function () {
// Initialize the connection to the server
var importerHub = $.connection.importerHub;
// Preparing a client side function
// called sendMessage that will be called from the server side
importerHub.client.sendMessage = function (message) {
showOrUpdateSuccessMessage(message);
};
$.connection.hub.start();
});
Controller:
var hubContext = GlobalHost.ConnectionManager.GetHubContext<ImporterHub>();
hubContext.Clients.All.sendMessage("All operations complete");
I use .Net v4.5.1, SignalR v2.1.2.0 and IIS 8.5 with Windows Authentication.
How can I fix this error?