This project is read-only.

Windows Authentication

Jan 11 at 3:41 PM
Edited Jan 12 at 7:43 PM
Can WebSocket4Net be configured to use windows authentication?
We have a WPF application that needs to connection secured by windows auth(client requirement).

I am assuming in the constructor I have to send a custom header and send the default credentials through.
So I added this and tried sending the value I pulled from a different web request to the same service that worked and I get an unauthorized.

KeyValuePair<string, string> ("Authorization", "Negotiate ?????What goes here?????") or is
there a different way to do this.

I used the example located in this issue to try and get it working.

With WebClients you just set UserDefaultCredentials = true;
WCF you configure the client/server bindings.

I've testing out our Websocket service using the following code and it connects and authenticates with windows auth:
ClientWebSocket socket = new ClientWebSocket();
socket.Options.UseDefaultCredentials = true;
await socket.ConnectAsync(new Uri("wss://"), CancellationToken.None);

Websocket4net always receives a 401 unauthorized response back.