[SignalR] UserIdentifier (#7423)

I realized we don't mention how to see the user's identifier anywhere. Adding a small blurb for it.
pull/7425/head
BrennanConroy 2018-07-02 18:32:23 -07:00 committed by Scott Addie
parent 2dcf8a4cea
commit 0e5d9dcfc6
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ SignalR allows messages to be sent to all connections associated with a specific
## Users in SignalR ## 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: 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: