使用表单身份验证的单点登录

使用表单身份验证的单点登录

问题描述:

我正在尝试为位于同一域中的 2 个网站设置单点登录

I am trying to set up Single sign on for 2 websites that reside on the same domain

例如

http://mydomain(包含表单身份验证登录页面的*站点)

http://mydomain (top level site that contains a forms-auth login page)

http://mydomain/admin(独立开发的网站,驻留在父网站的虚拟应用程序中)

http://mydomain/admin (seperately developed website residing in a Virtual Application within the parent website)

阅读了一些关于单点登录的文章例如

Have read a few articles on Single Sign on e.g.

http://www.codeproject.com/KB/aspnet/SingleSignon.aspx

http://msdn.microsoft.com/en-us/library/dd577079.aspx

他们似乎认为这只是在每个 web.config 中具有相同 machinekey 部分的一种情况,以便每个应用程序的 cookie 加密和解密都是相同的

And they seem to suggest it is just a case of having the same machinekey section in each web.config so that the cookie encryption and decryption is the same for each application

我已经设置了这个并且我从来没有在子网站(虚拟应用程序)中收到提示输入凭据

I have set this up and I never get prompted for credentials in the sub-website (the virtual application)

我总是在父站点中收到提示.

I always get prompted in the parent site.

除了拥有相同的机器密钥之外,我还尝试添加相同的 元素

In addition to having the same machinekey I've also tried adding the same <authentication> and <authorisation> elements

知道我可能遗漏了什么吗?

Any idea what I could be missing?

我在 httpModules 部分使用了 <clear/>,因为父级中有一些项目在子目录 (/admin)

I had used <clear/> on the httpModules section, as there were items in the parent that did not exist in the bin dir for the child (/admin)

这样做(使用 <clear/> 即)我无意中清除了 web.config 中指定的 FormsAuthentication 模块C:WINDOWSMicrosoft.NETFrameworkv2.0.50727CONFIG

In doing so (using <clear/> that is ) I had inadvertently cleared the FormsAuthentication module specified in the web.config in C:WINDOWSMicrosoft.NETFrameworkv2.0.50727CONFIG

所以我需要将这些明确地重新添加到子 (/admin) 配置中

so i needed to re-add those explicitly to the child (/admin) config