Use ASP.NET Core SignalR with Blazor: Error Invalid negotiation response received

48 Views Asked by At

I followed the instructions to the T from this link. But I keep getting an error message:

Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Invalid negotiation response received.

System.IO.InvalidDataException: Invalid negotiation response received.
 ---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
  
1

There are 1 best solutions below

0
Obsidian Delta On

It seems that there is an issue with Microsoft.Identity and SignalR working together on a Blazor application. More information can be found here: Blazor Server and SignalR and Azure AD ... It turns out that I just had to add:

[AllowAnonymous()] //TODO: authorize...
    public class SignalrHub : Hub
    {

Hope it helps someone :)