JsonReaderException When Making a Connection to a SignalR Hub During Debugging...
I am attempting to add a protected SignalR hub to a Blazor project that uses Entra ID as the identity provider. Essentially, I am trying to combine the relevant parts from the sample SignalR Blazor app (here) with the sample Entra ID Blazor app (here).
If I leave off the Authorize attribute from both the ChatHub class and the Chat razor page, everything works as expected. Once I add these attributes, I get a JsonReaderException with the message "'<' is an invalid start of a value. LineNumber: 2 | BytePositionInLine: 0." on the line that calls the StartAsync method on the HubConnection instance. This only seems to happen during debugging and, once it happens, if I navigate back to the root page and then back to the chat page, the exception is not thrown, at least from what I observed.
You're in the wrong repo: this is for old-school SignalR for .NET Framework 4.8; if you're using Blazor then you want the repo for SignalR-for-ASP.NET-Core.