I have recently updated my Blazor project to latest preview version (3.2.0-preview1) and I am implementing the newly provided SignalR functionality for Client Side Blazor apps.
However, I have ran into an issue when using SignalR with auth.
Following this documentation (or this) I have configured my SignalR Client to use the AccessTokenProvider.
I would expect this to send the access_token as a query param (since the web-sockets do not support Headers), but this is not happening.
For anyone else who might read this and want a temporary work-around, thanks to @szmalec from the Blazor gitter chat. You can do something like the following:
.WithUrl(NavigationManager.ToAbsoluteUri("/chatHub?access_token=XXXX"))
But please be aware, this should only be temporary until the issue is fixed, as this method does not support WithAutomaticReconnect().
I have recently updated my Blazor project to latest preview version (3.2.0-preview1) and I am implementing the newly provided SignalR functionality for Client Side Blazor apps.
However, I have ran into an issue when using SignalR with auth.
Following this documentation (or this) I have configured my SignalR Client to use the
AccessTokenProvider.I would expect this to send the
access_tokenas a query param (since the web-sockets do not support Headers), but this is not happening.For anyone else who might read this and want a temporary work-around, thanks to @szmalec from the Blazor gitter chat. You can do something like the following:
.WithUrl(NavigationManager.ToAbsoluteUri("/chatHub?access_token=XXXX"))But please be aware, this should only be temporary until the issue is fixed, as this method does not support
WithAutomaticReconnect().