简体   繁体   中英

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 ?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM