I have a hub in which the client makes a server call every 5 seconds to check if they have any new tasks to do. I know I can get the hub to get the connection ID, but how can I make it get the User Identity / user ID when they make the call? or will the client have to pass that value in?
Asked
Active
Viewed 351 times
0
-
Possible duplicate of [signalR - getting username](https://stackoverflow.com/questions/12130590/signalr-getting-username) – Nkosi Jul 29 '18 at 14:40
1 Answers
0
Getting the user is pretty easy out of the box. If you want to get any more information though, you'll need to come up with a solution to handle it yourself.
You can get the user identity by using this in your hub.
string name = User.Identity.Name;
or VB version
Dim name = User.Identity.Name

misteroptimist
- 482
- 1
- 4
- 16