AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

SignalR `[Authorize]` does not work at class level

Open lukedukeus opened this issue 7 months ago • 0 comments

When running this demo, I get this error:

SignalR connection failed Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.

This only happens when the [Authorize] attribute is on the Hub class. If I put the [Authorize] attribute on individual methods, or remove it, the connecting works.

lukedukeus avatar May 05 '25 19:05 lukedukeus