How to implement Windows Live ID actions using ASP.NET AJAX

OK, so I'm working on ASP.NET using AJAX and the Windows Live ID SDK. I successfully received it for authentication through Live, however ...

The Windows Live ID specification indicates that I have to look for the headers for the login, logout, and clearcookie requests. Recommended code examples include Response.Redirect, which doesn't seem to work when your page uses UpdatePanels extensively:

loginCookie = new HttpCookie(strLoginCookie); loginCookie.Expires = DateTime.Now.AddYears(-10); Response.Cookies.Add(loginCookie); Response.Redirect("default.aspx"); Response.End(); 

In addition, for the clearcookie Action, I write directly in response:

 public WindowsLiveLogin wll = new WindowsLiveLogin(key1, key2); loginCookie = new HttpCookie(strLoginCookie); loginCookie.Expires = DateTime.Now.AddYears(-10); Response.Cookies.Add(loginCookie); string type; byte[] content; wll.GetClearCookieResponse(out type, out content); Response.ContentType = type; Response.OutputStream.Write(content, 0, content.Length); 

As a result, the answer does not recognize it, and the Windows Live logout function expires, regardless of whether they are executed using my logout button (logout) or the logout function of Windows Live (clearcookie action). How can this be done using static UpdatePanels and other AJAX controls in the markup?

I used this in a previous AJAX project. I decided that I do not have logout functions, which, of course, can be bypassed by clearing one cookie. Please tell me a more elegant way!

+4
source share

All Articles