用户身份验证在多个Web服务器在蔚蓝 [英] User Authentication over multiple Webservers in azure

查看:158
本文介绍了用户身份验证在多个Web服务器在蔚蓝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有它运行在Azure中的多个Web服务器(这是所有虚拟机,而不是Azure的网站)。

I have an ASP.NET Application which runs an multiple Web Servers in Azure (these are all virtual machines and not Azure Websites).

如果一个用户登录自己(当前窗体身份验证),一切都很好,但是如果他点击了一个链接,他可能会被重定向到会话cookie没有设置服务器组中的另一台服务器。

If a user logs himself in (currently forms authentication) everything is fine but if he clicks on a link he might get redirected to another server in the server group where the session cookie is not set.

怎么可能在蔚蓝的解决,使用户登录在所有机器上还是有办法给用户的绑定到特定的服务器,这样他就不会在服务器之间跳?

How could that be solved in azure so that a user is logged in on all machines or is there a way to "bind" a user to a specific server so that he won't jump between the servers?

感谢您的帮助!
代谢

Thanks for your help! metabolic

推荐答案

您必须更改会话状态保存在外部持久性解决方案,如SQL Server或Redis的,而不是InProc方式(这意味着在内存中),这是你现在的设置。做的步骤描述这里为SQL Server。那么,如果有人在不同的服务器上结束,他仍然会作为会话将从持久性解决方案中加载验证。

You have to change the session state to be saved in an external persistence solution, like SQL Server or Redis, instead of InProc (which means in memory) which is the setting you have now. The steps to do that are described here for SQL Server. Then if someone ends up in a different server, he'll still be authenticated as the session will be loaded from the persistence solution.

这篇关于用户身份验证在多个Web服务器在蔚蓝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆