From 0e5d9dcfc673966d757076242cfc150a9c80b450 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Mon, 2 Jul 2018 18:32:23 -0700 Subject: [PATCH] [SignalR] UserIdentifier (#7423) I realized we don't mention how to see the user's identifier anywhere. Adding a small blurb for it. --- aspnetcore/signalr/groups.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/signalr/groups.md b/aspnetcore/signalr/groups.md index f64ded01e3..ddc573e4b0 100644 --- a/aspnetcore/signalr/groups.md +++ b/aspnetcore/signalr/groups.md @@ -19,7 +19,7 @@ SignalR allows messages to be sent to all connections associated with a specific ## Users in SignalR -SignalR allows you to send messages to all connections associated with a specific user. By default SignalR uses the `ClaimTypes.NameIdentifier` from the `ClaimsPrincipal` associated with the connection as the user identifier. A single user can have multiple connections to a SignalR application. For example, a user could be connected on their desktop as well as their phone. Each device has a separate SignalR connection, but they are all associated with the same user. If a message is sent to the user, all of the connections associated with that user will receive the message. +SignalR allows you to send messages to all connections associated with a specific user. By default, SignalR uses the `ClaimTypes.NameIdentifier` from the `ClaimsPrincipal` associated with the connection as the user identifier. A single user can have multiple connections to a SignalR app. For example, a user could be connected on their desktop as well as their phone. Each device has a separate SignalR connection, but they're all associated with the same user. If a message is sent to the user, all of the connections associated with that user receive the message. The user identifier for a connection can be accessed by the `Context.UserIdentifier` property in your hub. Send a message to a specific user by passing the user identifier to the `User` function in your hub method as shown in the following example: