SignalR uses the ASP.NET Core authentication and identity system. Learn how connections can be authenticated and how users and connections are related.
- [Instructor] For authentication and security, SignalR takes advantage of being built on top of ASP.NET Core. It reuses the authentication and identity system from ASP.NET Core, and applies it at the connection level. When requests are sent to a hub, they pass through the ASP.NET Core middleware pipeline. Any authentication middleware you've added to the pipeline can add identity information to the request, just like every other ASP.NET Core request. For example, the same cookie authentication middleware you use for your web projects will authenticate SignalR requests, as well.
If a user is logged in, their identity information will be available in the hub. The same user can have multiple connections to the hub. For example, I might be logged into an app in a browser, but also on my phone. These connections are kept separate, but are both associated with the same user. The hub can send messages to all the connections for a particular user.
- Comparing SignalR to WebSockets
- How SignalR works
- Adding a SignalR hub
- Handling hub and client connection events
- Adding connections to groups
- Adding persistence
- Adding user authentication