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 开发者_如何学JAVAapp1. 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.
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.
精彩评论