AspNetCore.Docs
AspNetCore.Docs copied to clipboard
SignalR `[Authorize]` does not work at class level
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.