Tutorials SignalR & Real-Time .NET Applications

Managing Connection IDs and User Identifiers

On this page

Tracking Individuals

Understanding the difference between a Connection ID and a User ID is vital for building multi-device apps.

1. The Connection ID

Every time a browser tab opens, it gets a unique, temporary ConnectionId. If the user refreshes, they get a new one. Targeting a specific Connection ID is rare; it's mostly used for responding only to the 'Current Caller'.

2. The User ID

A UserId represents the human (or service). One user might have three tabs open, a phone app, and a tablet—all connected. When you call Clients.User(userId).SendAsync(...), SignalR is smart enough to find ALL active connections for that user across all their devices and push the message to all of them.

3. Architect Insight

Q: "How does SignalR know the User ID?"

Architect Answer: "By default, it uses the ClaimTypes.NameIdentifier from the user's claims. If you want to use a different claim (like 'Email' or a custom 'MemberID'), you must implement a custom IUserIdProvider. This is common in enterprise systems that use legacy IDs."

Questions on this lesson 0

Sign in to ask a question or upvote helpful answers.

No questions yet — be the first to ask!

SignalR & Real-Time .NET Applications
Course syllabus
1. SignalR Core
2. Managing Users & Groups
3. Scaling SignalR
4. Advanced Communication
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details