private RedirectState GetRedirectStateDirect() { RedirectState redirectState = new SocialLogin.RedirectState(); var qs = System.Web.HttpContext.Current.Request.QueryString; if (qs["appName"] == null) { throw new AdfsException("Could not find the app name"); } redirectState.AppName = qs["appName"].ToString(); if (qs["returnAddress"] == null) { throw new AdfsException("Could not find the return address"); } redirectState.ReturnAddress = qs["returnAddress"]; if (qs["activity"] == null) { throw new AdfsException("Could not find the activity"); } redirectState.Activity = qs["activity"]; if (qs["parameters"] == null) { throw new AdfsException("Could not find the parameters"); } redirectState.Parameters = qs["parameters"]; redirectState.UseHashRouting = true; if (qs["useHashRouting"].ToLower() == "false") { redirectState.UseHashRouting = false; } redirectState.SignupIfNotSignedIn = true; redirectState.Email = null; return(redirectState); }
private RedirectState GetRedirectStateFromState() { var qs = System.Web.HttpContext.Current.Request.QueryString; RedirectState redirectState = new SocialLogin.RedirectState(); if (qs["state"] == null) { throw new AdfsException("Could not find the state"); } string[] state = qs["state"].Split('&'); redirectState.UseHashRouting = true; foreach (string keyValue in state) { string[] keyValueArray = keyValue.Split('='); if (keyValueArray.Length == 2) { string key = keyValueArray[0]; string value = keyValueArray[1]; if (key == "appName") { redirectState.AppName = value; } if (key == "returnAddress") { redirectState.ReturnAddress = System.Web.HttpContext.Current.Server.UrlDecode(value); } if (key == "useHashRouting" && value.ToLower() == "false") { redirectState.UseHashRouting = false; } if (key == "activity") { redirectState.Activity = value; } if (key == "parameters") { redirectState.Parameters = value; } } } if (redirectState.AppName == null) { throw new AdfsException("Could not find the app name"); } redirectState.SignupIfNotSignedIn = true; redirectState.Email = null; return(redirectState); }