简体   繁体   English

ASP.NET MVC中域和子域之间的会话传输

[英]Session transfer between domain and sub domain in asp.net MVC

Here is an article described how to share the authentication cookie between the domain and the sub domain: ASP.NET MVC - cross sub domain authentication/membership 这里是一篇文章,介绍了如何在域和子域之间共享身份验证cookie: ASP.NET MVC-跨子域身份验证/成员身份

What I want is to switch users between domains. 我想要的是在域之间切换用户。 For example there are two asp_membership database for the two domains. 例如,两个域有两个asp_membership数据库。 (The sub domain will run in a virtual directory.) Now if user A1 log in to the main domain then while browsing the sub domain user A1 should be automatically authenticated. (子域将在虚拟目录中运行。)现在,如果用户A1登录到主域,则在浏览子域时,应自动对用户A1进行身份验证。 Provided users with the same name exists in both the databases. 两个数据库中都存在提供相同名称的用户。

There are many solutions out there. 有很多解决方案。 But the easier solution is to use the same machine key for the two sites and same hashing algorithm for asp.net membership managements. 但是更简单的解决方案是对两个站点使用相同的机器密钥,对asp.net成员资格管理使用相同的哈希算法。 That will do the trick. 这样就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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