补充一下:
我看quickstart中说:
loginUrl 未授权的用户被重定向到的登录 URL。它可以在同一台计算机上或在远程计算机上。如果它在远程计算机上,两台计算机需要对 decryptionkey 属性使用相同的值。可是怎么使Server-A和Server-B的decryptionkey相同啊?

解决方案 »

  1.   

    decryptionkey在machine.config中设置。但是能不能远程定向,没有试过。
      

  2.   

    照quickstart上说的,应该是可以,不过我发现ReturnURL返回的并不是站点的绝对路径。
      

  3.   

    验证成功后,不要使用RedirectFromLoginPage方法重定向
    应该使用SetAuthCookie设置好Cookie,然后使用Page.Redirect自己重定向到Server-B
      

  4.   

    something is funny here, as you might know, the forms-based authentication writes a cookie to the client side, let's analyze what happens when an unauthenticated user visits your page:C->Server-B, since the user is not authenticated, C is redirected to Server-A. The user enters some information, and is authenticated, a cookie is written to the client side with the domain name of "Server-A". Then it is redirected to the original Server-B's page, but since the cookie has a domain name of "Server-A", it is not sent to the Server-B. Server-B thinks the user is still not authenticated, so it redirects the page back to Server-A. This time, the cookie is sent back to the Server-A because it comes from Server-A. Server A says, hey, this user is authenticated, so a page from Server-A will be served, and the page is somehow the default.aspx....Solution? try to write the cookie with a domain name of "Server-B"
      

  5.   

    there are some holes in my analysis, if it goes as I analyzed, you should get an infinite loop. So I guess the URL passed to Server-A is not an absolute URL, but a relative URL. So you need to override the authentication code on Server-A to not only write a cookie with domain name of "Server-B", but also redirect it back to Server-B