[英]How to do Single Sign On for multiple MVC 4 web applications on IIS 7.5
I have 2 MVC 4 applications deployed on IIS 7.5. 我在IIS 7.5上部署了2个MVC 4应用程序。 I would like to achieve a single sign on all of them.
我想对所有这些都实现一个单一的标志。 I have following web.config settings in both the applications -
我在两个应用程序中都有以下web.config设置-
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" enableCrossAppRedirects="true" path="/" name=".MVCAuthCookie" timeout="45" defaultUrl="/" slidingExpiration="false" protection="All" cookieless="UseCookies" />
</authentication>
<machineKey
validationKey="C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE"
decryptionKey="8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F"
validation="SHA1" />
<authorization>
<deny users="?" />
</authorization>
When I logged in in the first app and I browse second application in a separate tab, it still takes me to the login page for the second app. 当我登录第一个应用程序并浏览另一个选项卡中的第二个应用程序时,它仍然带我进入第二个应用程序的登录页面。 I can see in fiddler that the MVCAuthcookie is indeed getting passed with the get request for second application.
我可以在提琴手中看到,MVCAuthcookie确实与第二个应用程序的get请求一起传递了。
What am I missing here? 我在这里想念什么?
原来,我需要将机器密钥元素的兼容模式设置为“ Framework20SP2”,如此处所述-http: //msdn.microsoft.com/zh-cn/library/system.web.configuration.machinekeysection.compatibilitymode.aspx ,该问题已解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.