[ACCEPTED]-signalR - getting username-signalr-hub
Accepted answer
When using SignalR hubs you can use the HubCallerContext.User
property to:
Gets 2 the user that was part of the initial http 1 request.
So try it with:
public Task Join()
{
string username = Context.User.Identity.Name;
//find group based on username
string group = getGroup(username)
return Groups.Add(Context.ConnectionId, group);
}
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.