1
votes

I have a big problem with signalr.

Consider this code:

   for (int i = 0; i < 1000000000; i++)
        {
            var hubConnection = new HubConnection("http://localhost:7171/signalr/hubs");
            IHubProxy stockTickerHubProxy = hubConnection.CreateHubProxy("baseHub");
            hubConnection.Start();
            stockTickerHubProxy.On("push", (z) =>
            {

                Console.ForegroundColor = ConsoleColor.Blue;
                Console.WriteLine(i);
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine(z);

            });
        }

If you run this code against pusher, it will shut it down. So I want to neutralize the effects of such attacks against my pusher service. I want to authenticate my client written in JavaScript and also secure my pusher server against such attacks and unauthorized attempts. Any help is appreciated.

I read these article and I have not found them useful in my scenarios .

http://www.asp.net/signalr/overview/signalr-20/security/hub-authorizationhttp://www.asp.net/signalr/overview/signalr-20/security/hub-authorization http://www.asp.net/signalr/overview/signalr-20/security/persistent-connection-authorization http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-net-client https://github.com/gustavo-armenta/CookieAuthenticationSample

1

1 Answers

0
votes

Perhaps my example code at the provided link will help you on Authentication with SignalR.

https://github.com/louislewis2/AngularJSAuthentication

While the client application is written using AngularJs. The server side code is all C#, and should make sense. In the example I am using token authentication.

Regards

Louis