dotnet / dotnet/AspNetCore.Docs
SignalR `[Authorize]` does not work at class level
- Dominant language
- C#
- Stars
- 13.1k
- Forks
- 24.6k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 109
Description
When running [this demo](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/signalr/authn-and-authz/6.0sample/SignalRAuthenticationSample), 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.
Contributor guide
Assessment
This issue has not been assessed yet.