SignalR/SignalR — Issue #211: Add Current User Identity Name to SignalR.Hosting.IRequest
Author: dangreendotnet
Created: 2012-02-28 22:34:31+00:00
State: open

In v3.5 I could make SignalR use the current users identity name for the client id with the following code

public class UserIdClientIdFactory : IClientIdFactory
{
public string CreateClientId(HttpContextBase context)
{
return context.User.Identity.Name;
}
}

I would like the current user identity name added to SignalR.Hosting.IRequest in v4+

public class UserIdClientIdFactory : IConnectionIdFactory
{
public string CreateConnectionId(SignalR.Hosting.IRequest request)
{
return request.User.Name;
}
}