简体   繁体   中英

AWS Load Balancer

I have created WebApi in Mvc .net , where i am using Microsoft.OWIN for authentication and access token generation and hosting my APIs in AWS.

Now , as am using load balancer to distribute the traffic , so AWS automatically generates multiple instance of the EC2 instance that means multiple servers , so when and where the Login Api is called , the request goes to one main server and generated the Token and in Claims Identity , we are storing UserID of that Logged IN User , but when another APIs are called simultaneously to multiple instances randomly, then that UserID which is stored while login in Claims Identity is not accessible from other randomly generated servers.

So, I dont know whether it Owin issue or AWS load Balancer issue , is there functionality in AWS or OWIN , so that UserID will be accessible from multiple server?

and I can't remove OWIN from my API.

You need to have a central session store, something like Redis or a central DB. I have seen both used by different applications and I am sure there are other methods available to act as a central point for all sessions.

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