在将应用程序将后端部署到多个AWS EC2实例时,使用Laravel Sanctum对水疗中心的用户进行身份验证会引起问题?
Laravel Sanctum 是用于水疗中心(单页应用程序),移动应用程序和简单令牌的API的身份验证系统。
在为水疗中心身份验证用户时,Sanctum不会使用任何形式的令牌。相反,Sanctum使用Laravel的基于Cookie的会话身份验证服务。
我有一个由前端(SPA)和后端(Laravel API)组成的应用程序。该后端部署到多个AWS EC2实例中,并使用负载平衡器来处理这些EC2实例中传入流量的分布。
现在,如果我使用Laravel Sanctum对水疗中心的用户进行身份验证,这不是因为我将后端部署到多个AWS EC2实例而引起问题吗?
我的意思是,如果用户通过EC2实例编号1进行身份验证,例如,当他向后端发送另一个请求时,该请求由LOAD BALANCER发送到EC2实例编号2,例如,此实例将如何知道用户已经对用户进行身份验证,而不是在他登录时为他发出会话的那些?
Laravel Sanctum is an authentication system for SPAs (single page applications), mobile applications, and simple token-based APIs.
When authenticating users for SPAs, Sanctum does not use tokens of any kind. Instead, Sanctum uses Laravel's built-in cookie-based session authentication services.
I have an application that consists of a frontend (SPA) and a backend (Laravel API). That backend is deployed to multiple AWS EC2 instances and uses a load balancer to handle distributing the incoming traffic across these EC2 instances.
Now, if I use Laravel Sanctum to authenticate the users of a SPA, isn't that going to cause an issue because I deploy the backend to multiple AWS EC2 instances?
I mean, if the user has been authenticated through the EC2 instance number 1 for example, when he sends another request to the backend, and that request is sent by the load balancer to the EC2 instance number 2 for example, how this instance will know that the user is authenticated already while it is not the one that issued a session for him when he logged-in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论