I can see that there is an option in HubConnection to pass parameters through url request from client. Is there any way to pass specific token through http headers from JS o
With the js client, I don't think the header is supported but it must go via the querysting instead.
For the javascript client that is not the generated js proxy, you can add extra information to the querystring like this:
var connection = $.hubConnection("http://localhost:3306/signalr");
connection.qs = "somekey=somevalue";
var hubProxy = connection.createHubProxy('hubname');
Messages such as ping, negotiate, abort, connect will now include this querystring value.
It's possible to send the header if you affect the ajax global setup. I have observed it making to the server but have not tested that it makes it in every case you might need.
$.ajaxSetup({
beforeSend: function (xhr)
{
xhr.setRequestHeader("Authorization","Token token=\"abcdef\"");
}
});