0

My MVC Website has a form authorization in web.config. Now all the page need to pass the authorization,so that they can be viewed.

But Now I have a console program (C# console program). This program need to send some message to SignalR Hub. But My signalR Hub is in my MVC Website,Now this C# console client can't send message to Signal Hub, Because My MVC Website has Form Authorization.

I want the console client doesn't need to be verified,but the pages in website need to be verified.

What Can I do with the website's web.config file?

How to make the signalr client avoid form authentication?

Community
  • 1
  • 1
elsonwx
  • 1,431
  • 3
  • 16
  • 26
  • possible duplicate of [How to apply security on a folder using web.config file?](http://stackoverflow.com/questions/9810127/how-to-apply-security-on-a-folder-using-web-config-file) – Jon Egerton Jan 06 '15 at 09:49

1 Answers1

0

You can use the same mechanism as for a normal folder, just use <location path="signalr">.

You need to be careful though as this exposes your hub to any non-authenticated call from the web as well. Maybe you'd be better with separate hubs so you can restrict the non-authenticated functionality to a minimum.

For more info on folder level securities see here.

Jon Egerton
  • 40,401
  • 11
  • 97
  • 129