Closed cakesoft-raghav closed 2 years ago
I am trying to set authorization bearer token using the ClientWebSocketOptions but the header is not showing up on the server side.
ClientWebSocketOptions
Here is the snippet -
socketIO = new SocketIO(connectionUrl) { ClientWebSocketProvider = () => { var clientWebSocket = new DefaultClientWebSocket { ConfigOptions = o => { var options = o as ClientWebSocketOptions; options.SetRequestHeader("Authorization", $"Bearer {bearerToken}"); } }; return clientWebSocket; } };
And here is the socket object I get in io.use on the server
io.use
{ headers: { host: 'localhost:8088' }, time: 'xxxxx', address: '::1', xdomain: false, secure: false, issued: xxxxxx, url: '/socket.io/?EIO=4&transport=polling', query: [Object: null prototype] { EIO: '4', transport: 'polling' }, auth: {} }
Clearly the authorization header is missing.
I am using the latest stable 3.0.1 version of the client
Fixed, please wait for the next release update
https://github.com/doghappy/socket.io-client-csharp#:~:text=set%20it%20to%203-,ExtraHeaders,-null
I am trying to set authorization bearer token using the
ClientWebSocketOptions
but the header is not showing up on the server side.Here is the snippet -
And here is the socket object I get in
io.use
on the serverClearly the authorization header is missing.
I am using the latest stable 3.0.1 version of the client