asp.net - 使用表单例份验证的单点登录

标签 asp.net authentication forms-authentication single-sign-on

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

例如

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

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

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

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

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

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

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

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

除了拥有相同的机器 key ,我还尝试添加相同的 <authentication><authorisation>元素

知道我可能会错过什么吗?

最佳答案

web.config 的表单部分也需要相同。

Quote from - Forms Authentication Across Applications

To configure forms authentication across applications, you set attributes of the forms and machineKey sections of the Web.config file to the same values for all applications that are participating in shared forms authentication.

The following example shows the Authentication section of a Web.config file. Unless otherwise noted, the name, protection, path, validationKey, validation, decryptionKey, and decryption attributes must be identical across all applications. Similarly, the encryption and validation key values and the encryption scheme and validation scheme used for authentication tickets (cookie data) must be the same. If the settings do not match, authentication tickets cannot be shared.

关于asp.net - 使用表单例份验证的单点登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2453677/

相关文章:

jakarta-ee - Java Web 应用程序 : Using a custom realm

ios - Swift 错误 - ADAL 库

javascript - 让我们通过ajax请求进行聊天验证

c# - 执行我的 javascript 后页面重新加载,我不希望它这样做

c# - MVC 3 将模型项传递给@Html.ActionLink 文本?

javascript - ASP.NET RegisterClientScriptBlock、RegisterStartupScript 问题

asp.net - 不重复显示背景图像

asp.net-mvc - 表单例份验证 + ASP.NET MVC 绝对 ReturnURL

java - 嵌入式 Jetty - 以编程方式添加基于表单的身份验证

c# - ASP.NET - 如果角色授权失败则重定向到错误页面