SharePoint: How to fix CKS Live ID logout

Last month I wrote about how to add SharePoint users for Live ID accounts on Community Kit for SharePoint. Another problem we found was that logout didn’t worked as expected. When logging out form Live ID we can see error on Live ID site stating that logout from our system failed.

I found a solution for this problem and it is very easy fix to apply.

  1. Open liveauth-handler.aspx.cs.
  2. Move to Render method.
  3. Paste the following code after first if.


    else if (Request.QueryString["action"] == "clearcookie")
    {
        Response.Cookies.Remove(
    FormsAuthentication
    .FormsCookieName);
       
    var gif = "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAIBTAA7"
    ;

       
    Page
    .Response.Clear();
       
    Page
    .Response.ClearHeaders();
       
    Page.Response.ContentType = "image/gif"
    ;
       
    Page.Response.BinaryWrite(Convert
    .FromBase64String(gif));
       
    Page
    .Response.Flush();
       
    Page.Response.End();
    }

  4. Save handler file, compile the project and deploy compiled DLL to GAC.

I hope it helps somebody.


Leave a Reply

Your email address will not be published. Required fields are marked *