Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How my web api handle multiple clients?

$
0
0

Hi

I have a problem that i have a camera device and i built a web application to it. it consists of an angular app and asp.net core web api and a normal c# .net core desktop app that the client will install to control the camera in his machine. this camera takes face image and process it and send a code to web api with the info to authenticate the user.

the problem is as follows:

1 - When i used static variables in web api so the c# .net core app can speak to angular app and vice versa through this static variables in web api it couldn't handle multiple users as if one user change this static variable the changes appears in the other users which in turn control their cameras and i want the only user who change the variable sees it and only control his camera.

2 - I tried to use sessions but the problem that if the angular app sets the session and if the c# .net core app try to get this session it always be null as if there is no session being set

3 - The closest approch to use a dictionary for a user who enters the website and store the variable in this dictionary but i don't know how to get a unique info for the user so i can put it in the dictionary and sync it with the c# .net core desktop app.

4 - Some suggested to authenticate the user and i will get the info of this user as JWT token the problem is happening at authentication the authentication should happen with the camera.

5 - When a user open the angular and web api in the browser if there is other users running the destop app and this user click on open camera in the browser it opens the camera on all other users which is a big problem i want this user to open the camera on his machine only.

Hint: the angular app and web api will be on one application on the server and the c# .net core desktop app will be on the client machine to control his camera so how to sync between the desktop application in this user machine and the angular app and web api he accesses through the browser.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>