This might give you some direction http://blogs.iis.net/ksingla/archive/2006/08/23/sample-forms-authentication-test-in-c.aspx Let us know the solution if you resolve this issue...
On Tue, Sep 8, 2009 at 9:33 PM, B-Dub <[email protected]> wrote: > > I have a problem that has been baffling me for several days now and > could use some help. > > Here is the summary: I have a asp.net page, "Int1.aspx" that needs to > redirect the user to an external page, "Ext1.html." Ext1.html needs > to finish loading and write a client-side cookie that authenticates > that user on the external site. Once Ext1.html is finished loading > and writing the cookie, then Int1.aspx needs to detect this and do > another redirect to a second external page, "Ext2.html" > > Use Case: > - On internal site, user clicks on an article link that points to an > external partner site > - The user is automatically authenticated on the external website in > the background > - The external article loads and page does not include a login form > (User has done this all in one click) > > > Here is some sample code that I have written that tries to accomplish > this. > > string redirectLinkExt1 = "https://externalsite.com/ > seamless/Ext1.html"; > string redirectArticleLinkExt2 = "http://externalsite.com/ > Ext2.html"; > > try > { > > Response.Redirect(redirectLinkExt1 , false); > > switch (Response.StatusCode) > { > > case 302: > > Response.Redirect(redirectArticleLinkExt2 , > false); > > break; > > default: > break; > } > } > > finally > { > > } > > The obvious problem I am running into is that when I redirect to > redirectArticleLinkExt2 (Ext2.html) the first external page > (Ext1.html) has not had time to load and write the cookie on the > client. So, by the time Ext2.html is loaded the page is loaded but > the user is not authenticated. > > How can I achieve this "wait until cookie is written" behavior? Keep > in mind that the external site is not one that I have any control > over, but is a partner site. Thanks in advance for any ideas. >
