User327441648 posted
I'm hosting my signalR in IIS, and I have a .net client that resides in the same website. I'm using windows authentication so credentials are set this way:
hubConnection.Credentials = CredentialCache.DefaultCredentials;
This all work when I run the site locally, but it would give me a 401 error when deployed on a server:
SignalR: myhub.DoStuff failed to execute. Error: StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Server: Microsoft-IIS/8.5
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
X-Powered-By: ASP.NET
Date: Thu, 20 Apr 2017 19:40:41 GMT
Content-Length: 1293
Content-Type: text/html
}
I see the above error in the browser developer tool and it happens when this line is run:
hubConnection.Start().Wait();
I'm pretty sure the credential itself is right, because when I run the site locally, and put in the hub url that's deployed on the server, and pass in a credential for that server, I am able to start the hubConnection.
So what could be something that's preventing the SignalR .Net client from authenticating on a server, but not locally?