跨域饼干FormsAuthentication [英] Cross Domain Cookies With FormsAuthentication
问题描述
我知道安全风险,并已与企业提出来的,但他们希望有自己的5域共享登录cookie。
I know the security risk associated and have brought it up with the business, but they want to have their 5 domains to share the login cookie.
我们正在使用,并没有计划停止使用ASP.Net成员和配置文件。这可能吗?一个黑客甚至会大大AP preciated。
We are using and have no plan to stop using ASP.Net Membership and Profiles. Is this possible? A hack would even be greatly appreciated.
推荐答案
这是不可能的开箱即用的ASP.NET。
It is not possible with out of the box ASP.NET.
基于表单的认证是基于一个cookie和cookie只能设置到特定的域。
Forms based authentication is based on a cookie and cookies can only be set to a specific domain.
如果你想真正的跨域(不是子域)共享验证,你需要一个单点登录解决方案。
If you want true cross domain (not sub domains) shared authentication, you need a Single Sign On solution.
我滚我自己的,它是相对简单的。其基本原理是,你有哪些握着你的身份验证Cookie(门票)主域。然后您重定向到所有其他域的域。这不是真的pretty,但事件的Microsoft Passport合作的方式。
I've rolled my own and it's relatively simple. The basic principle is that you have a master domain which holds your authentication cookie (ticket). You then redirect to that domain from all other domains. It's not really pretty, but event Microsoft Passport worked that way.
您可以找到很多的在网上的例子,来看看这两个环节:
You can find a lot of examples on the net, take a look at these two links:
这篇关于跨域饼干FormsAuthentication的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!