Server side:
public override Task OnConnected() { var connectionId = Context.ConnectionId; var user = Context.User.Identity.Name; // Context.User is NULL
Client
var connection = new HubConnection(); connection.Headers.Add("username", "maria"); var myHub = connection.CreateHubProxy("MyHub");
Server
string username = Context.Headers.Get("username"); Console.WriteLine("New client connection - " + username);