Skip to content

Commit eb3f66c

Browse files
committed
refactor(WSConnector): do not authenticate in WS connector
do not authenticate in WS connector as we are setting auth headers in Authenticate()
1 parent dd30d6d commit eb3f66c

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

Authentication/Authenticator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ public class Authenticator
4848
public static string ErrorMessageReqFailed = "Error while fetching access token from token service: ";
4949

5050
public string Url { get; set; }
51-
public string Username { get; private set; }
52-
public string Password { get; private set; }
5351

5452
/// <summary>
5553
/// Returns the authentication type associated with the Authenticator instance.

Connection/WSConnector.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,6 @@ private void SendMessages()
438438
ws = new WebSocket(URL);
439439
if (Headers != null)
440440
ws.CustomHeaders = Headers;
441-
if (Authentication != null)
442-
ws.SetCredentials(Authentication.Username, Authentication.Password, true);
443441
ws.OnOpen += OnWSOpen;
444442
ws.OnClose += OnWSClose;
445443
ws.OnError += OnWSError;
@@ -535,12 +533,6 @@ private async Task SendMessagesAsync()
535533
{
536534
MessageWebSocket webSocket = new MessageWebSocket();
537535

538-
if (Authentication != null)
539-
{
540-
PasswordCredential credential = new PasswordCredential(Authentication.Url, Authentication.Username, Authentication.Password);
541-
webSocket.Control.ServerCredential = credential;
542-
}
543-
544536
webSocket.MessageReceived += WebSocket_MessageReceived;
545537
webSocket.Closed += WebSocket_Closed;
546538

0 commit comments

Comments
 (0)