title: How to Authenticate a SignalR Hub from Jquery
body: <p>My Web API hosts SignalR also and Hub is decorated at class level using [Authorize] attribute.The Web API has implemented Basic Authentication and connections to the Hub routed through Controller action is working fine. My SignalR client is an MVC4 application in a different domain and I would like to connect to the Hub using Javascript / Jquery. As Hub level authentication is enabled, how do i authenticate the connection? My current client code is as follows</p>
  
  <pre><code>$.connection.hub.url = 'http://localhost:53256/signalr';
  var myHub = $.connection.NewHub;
  
  
  // Create a function that the hub can call to broadcast messages.
  myHub.client.addMessage = function (name, message) {
  ...
  }
  $.connection.hub.start().done(function () {
  myHub.server.send($('#displayname').val(), $('#message').val());
  });
  </code></pre>