jquery - SignalR MVC 5 Websocket no valid Credentials -


i try use signalr in mvc application. works following error in chrome console

 websocket connection '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 jquery method call controller on hub works fine.

jquery:

 $(function () {             // initialize connection server             var importerhub = $.connection.importerhub;              // preparing client side function             // called sendmessage called 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 , iis 8.5 windows authentication.

how can fix error?

it looks running chrome issue. problem chrome doesn't handle windows authentication websockets.

below initial issue submitted couple years ago reporting chrome did not support form of http authentication:

https://code.google.com/p/chromium/issues/detail?id=123862

that issue has been resolved basic , digest authentication, not windows (ntlm/negotiate) authentication. there issue created less month ago track progress on chrome support windows authentication websockets:

https://code.google.com/p/chromium/issues/detail?id=423609

apparently, issue windows authentication partially fixed in chrome dev channel, if client has authenticated server prior establishing websocket.

the reason can still call sendmessage controller because signalr automatically falls using transport other websockets (i.e. server-sent events or long-polling), when websocket connection fails. chrome handle windows authentication signalr's other transports.

i suggest not changing anything. looks chrome support windows authentication websockets.

the real problem, other error in chrome console, might take longer establish signalr connection in chrome. if that's big issue, can specify transports client should attempt using. on chrome, try serversentevents , longpolling, when chrome does fix issue, won't using best possible transport until change code.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -