Muhammad Faisal
Muhammad Faisal

Reputation: 155

Authentication on SignalR

we have three projects

  1. Angular JS => for front end
  2. Asp.net Soap Web Service (.asmx ) => server code to support angular JS project.
  3. ASP.NET MVC Project => we implement SignalR on this project for socket communication.

now i want to implement authentication on 3rd project. we already implement token based authentication on 2nd project so i was thinking is it safe to pass just token on 3rd project and then validate it on 3rd project by calling a web service (2nd project ) method ? other approach is we generate two different token for each project on login ? what is the best way ?

Upvotes: 0

Views: 250

Answers (1)

Kiril1512
Kiril1512

Reputation: 3611

It's safe and maybe easier to you to use the second solution token to authenticate user to call your SignalR hub. If you are going to target users with signalR that are same as your project n#2, there is no need to create a separate authentication. If you diferenciate the users in the project n#3 than yes, you would need to create another token for that.

You can read more about SignalR authentication and authorization in this microsoft documentation.

Upvotes: 1

Related Questions