Hi
I'm trialing SecureBridge library.
I have a websocket server (based on c# HttpListener with AuthenticationScheme = AuthenticationSchemes.Negotiate | AuthenticationSchemes.Ntlm
I have a websocket client written on Delphi using WinHTTP with such option:
var Flags:DWORD := WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW;
WinHttpSetOption(hRequest, WINHTTP_OPTION_AUTOLOGON_POLICY, @Flags, SizeOf(Flags));
and then server sends:
HTTP/1.1 401 Unauthorized
Content-Length: 0
Server: Microsoft-HTTPAPI/2.0
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Date: Wed, 23 Aug 2023 12:02:01 GMT
WinHTTP client sends back:
GET / HTTP/1.1
Cache-Control: no-cache
Connection: Upgrade
Pragma: no-cache
Upgrade: websocket
User-Agent: Delphi WebSocket Client
Sec-WebSocket-Key: U2YMRaS9lwvm93o81n5KRQ==\r\n
Sec-WebSocket-Version: 13
Host: sergei.domain.local:8080
Authorization: Negotiate YIIH2wYGKwYBBQUC.........
and so on....
Finally the client passes auth. and I can get its logon on the server:
HttpListenerContext context = listener.GetContext();
Console.WriteLine($"User: {context.User.Identity.Name}");
How can do the same with TScWebSocketClient but with predefined login and password? I set up the TScNetworkCredential (domain, login and password) but always get
"raised exception class HttpException with message 'Unauthorized'."
Thanks in advance.