From the course: Learning SignalR with ASP.NET Core

Users and authentication

From the course: Learning SignalR with ASP.NET Core

Start my 1-month free trial

Users and authentication

- [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.

Contents