V
V
Vadim2015-01-20 09:31:17
ASP.NET
Vadim, 2015-01-20 09:31:17

Authorization for SignalR?

Hello.
I am currently learning C#, ASP.NET MVC, SIgnalR using an example of a not yet complex, but full-fledged application.
At the moment, authorization is used, which is in the MVC 5 template. There were essentially no problems when the application was, say, on domain.loc, when the js page was loaded, the signalr client connected to the server and everything was fine.
Plugging in the following - I decided to take out the main part of the application separately and wrap it in node-webkit. I do not quite understand which authentication method for this case is easier / safer. The client will only go to signalr, I would like to avoid additional http requests if this is possible.
I’m not looking for a ready-made solution right away, I would be very grateful at least for topics for Google or links to articles.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery Abakumov, 2015-01-22
@Valeriy1991

Good afternoon!
Unfortunately, I did not solve such a problem, but I can assume that the authorization logic in the action method that deals with authorization can simply be duplicated into a C # method inside the SignalR hub. This method will accept, for example, string username and string password , and then work with them.
Plus (you probably know) www.asp.net has articles on the SignalR security model and authorization with SignalR:
www.asp.net/signalr/overview/security/introduction...
www.asp.net/signalr/overview /security/hub-authorization
www.asp.net/signalr/overview/security/persistent-c...
It seems to be quite simple... Although I could be wrong.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question