Add ability to send a message to a "user"#2401

Labels

Milestone

Assignee

3 participants

This feature will give the user what we had prior to SignalR 1.0 (IConnectionIdGenerator) without risking security (allowing the user to change the connection id). We give the user a way to specify what the userId is based on an IRequest via IUserIdProvider:

publicinterfaceIUserIdProvider
{
stringGetUserId(IRequestrequest);
}

By default there will be an implementation that uses the user's IPrincipal.Identity.Name as the user name.

In hubs, you'll be able to send messages to these users via a new API:

Tested feature doing the customer scenario where a website has basic authentication, there are many users authenticated, and a message is sent to one user who has multiple connections. Message is sent to the multiple connections of the user.