Skip to content

SignalR client(js) connectionId is always 0, how to match client connectionId with server side connectionId? #8108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
halter73 opened this issue Mar 1, 2019 · 6 comments
Labels
area-signalr Includes: SignalR clients and servers

Comments

@halter73
Copy link
Member

halter73 commented Mar 1, 2019

From @handsomeyao77 on Tuesday, 26 February 2019 02:05:20

Expected behavior

Actual behavior

Steps to reproduce

Copied from original issue: SignalR/SignalR#4318

@halter73
Copy link
Member Author

halter73 commented Mar 1, 2019

From @halter73 on Tuesday, 26 February 2019 02:33:21

Can you provide the code you are using to read the connection id?

@halter73
Copy link
Member Author

halter73 commented Mar 1, 2019

From @handsomeyao77 on Tuesday, 26 February 2019 02:39:44

image

image

Print connection object, the id is 2 now, confused...

@halter73
Copy link
Member Author

halter73 commented Mar 1, 2019

The new SignalR clients don't expose their connection IDs via public properties. We will consider changing this in 3.0. For now, you can return the caller's connection ID from a hub method as a workaround.

@shunyh
Copy link

shunyh commented Mar 4, 2019

Great! thank you.

@halter73 halter73 added this to the 3.0.0-preview5 milestone Mar 4, 2019
@halter73
Copy link
Member Author

halter73 commented Mar 4, 2019

We probably want to add a note to our docs that it's easy to impersonate a client given their connection id.

@analogrelay
Copy link
Contributor

#8681 will fix this.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

No branches or pull requests

4 participants