使用两台不同的机器进行表单身份验证
假设我在两台不同的计算机上有 2 个名为“app1”和“app2”的应用程序,并且我想使用通用表单身份验证。
app2 中有一个名为 CElaunch.aspx 的表单,我想在 app1 中使用此页面。由于某种原因,我们无法直接导航到此页面,因为它转发到 app1 中的登录页面。似乎并没有意识到我们已经通过了身份验证。
App2 web.config 文件
< authentication mode="Forms" >
< forms loginUrl="http://slx75pc/SlxClientSC73/Login.aspx" domain="configengine.com" protection="All" timeout="30"
name=".SLXAUTH" path="/" defaultUrl="default.aspx" requireSSL="false" slidingExpiration="true"
cookieless="UseDeviceProfile" enableCrossAppRedirects="true" / >
< / authentication >
< machineKey
validationKey="key"
decryptionKey="key"
validation="SHA1"
/ >
< authorization >
< deny users="?" / >
< / authorization >
App1 web.config
<authentication mode="Forms">
< forms loginUrl="http://slx75pc/SlxClientSC73/Login.aspx" domain="configengine.com" protection="All" timeout="30"
name=".SLXAUTH" path="/" defaultUrl="default.aspx" requireSSL="false" slidingExpiration="true"
cookieless="UseDeviceProfile" enableCrossAppRedirects="true" / >
< / authentication >
< machineKey
validationKey="key"
decryptionKey="key"
validation="SHA1"
/ >
< authorization >
< deny users="?" / >
< / authorization >
当我从 app1 导航 CElauncvh.aspx 页面时,它没有显示我想要的页面。它重定向到登录页面。
Suppose I have 2 applications called "app1" and "app2" on two different machines and I want to use common form authentication.
There is one form called CElaunch.aspx in app2 and I want to use this page in app1. We can't navigate to this page directly for some reason as it forwards to the login page which is in app1. It does not seem to pick up that we have already been authenticated.
App2 web.config file
< authentication mode="Forms" >
< forms loginUrl="http://slx75pc/SlxClientSC73/Login.aspx" domain="configengine.com" protection="All" timeout="30"
name=".SLXAUTH" path="/" defaultUrl="default.aspx" requireSSL="false" slidingExpiration="true"
cookieless="UseDeviceProfile" enableCrossAppRedirects="true" / >
< / authentication >
< machineKey
validationKey="key"
decryptionKey="key"
validation="SHA1"
/ >
< authorization >
< deny users="?" / >
< / authorization >
App1 web.config
<authentication mode="Forms">
< forms loginUrl="http://slx75pc/SlxClientSC73/Login.aspx" domain="configengine.com" protection="All" timeout="30"
name=".SLXAUTH" path="/" defaultUrl="default.aspx" requireSSL="false" slidingExpiration="true"
cookieless="UseDeviceProfile" enableCrossAppRedirects="true" / >
< / authentication >
< machineKey
validationKey="key"
decryptionKey="key"
validation="SHA1"
/ >
< authorization >
< deny users="?" / >
< / authorization >
When I navigate the CElauncvh.aspx page from app1 then it is not displaying the page which I want. It redirects to Login page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读 http://msdn.microsoft.com/en-us/ Library/eb0zx8fc.aspx 看看你进展如何。听起来您的问题可能是没有在两个站点的
Web.config
文件中设置匹配的machineKey
部分。Have a read of http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx and see how you go. It sounds like your problem may be not setting a matching
machineKey
section in the two sites'Web.config
files.