0

I have a SignalR application.

////Server
public class ChatHub : Hub{
     public override Task OnConnected()
            {
                string name = Context.QueryString["applicationName"].ToString();// Context.User.Identity.Name;

                this.Groups.Add(Context.ConnectionId, name);

                return base.OnConnected();
            }
}

 //// Client
$.connection.hub.url = "http://localhost:40000/signalr";

            $.connection.hub.qs = 'applicationName=app1';
            // Declare a proxy to reference the hub.
            var chat = $.connection.chatHub;

            // Create a function that the hub can call to broadcast messages.
            chat.client.addMessage = function (name, message) {
...
}

This will associate a connection with an application. The problem is that the client can change the parameters and listen to messages for app2.

What all can I do (client / server /both ) to ensure that someone gets assigned to app1 and then stays on app1, ie they can't listen to app2 messages even if they wanted to?

heyNow
  • 866
  • 2
  • 19
  • 42

1 Answers1

0

If you wan't to secure your hubs please read http://www.asp.net/signalr/overview/security/hub-authorization

Stephu
  • 3,236
  • 4
  • 21
  • 33
  • that's fine, i just don't want one group to see another groups messages even though they are both secure – heyNow Sep 22 '16 at 19:41