public void ProcessRequest(HttpContext context) { //Call for Logout if (current.Request.Url.ToString().IndexOf("logout.sauth") > -1) { SocialAuthUser.Disconnect(); } //Call for login (likely from HTML clients) with provider in parameter "p" else if (HttpContext.Current.Request.RawUrl.ToLower().Contains("login.sauth")) { string returnUrl = ""; if (current.Request["returnUrl"] != null) { returnUrl = current.Request["returnUrl"]; } if (current.Request["p"] != null) { SocialAuthUser.Connect((PROVIDER_TYPE)Enum.Parse(typeof(PROVIDER_TYPE), HttpContext.Current.Request["p"].ToUpper()), returnURL: returnUrl); } } //call to display login Form else if (HttpContext.Current.Request.RawUrl.ToLower().Contains("loginform.sauth")) { RenderHtml(); HttpContext.Current.Response.End(); } //call to process response received from Providers else if (HttpContext.Current.Request.RawUrl.ToLower().Contains("validate.sauth")) { SocialAuthUser.LoginCallback(HttpContext.Current.Request.Url.ToString()); } }