public static bool IsFileHandlerActivationRequest(Microsoft.Owin.IOwinRequest request, out FileHandlerActivationParameters activationParameters) { activationParameters = null; var formTask = request.ReadFormAsync(); formTask.RunSynchronously(); var formData = formTask.Result; if (formData != null && formData.Any()) { // Get from current request's form data activationParameters = new FileHandlerActivationParameters(null); return(true); } else { // If form data does not exist, it must be because of the sign in redirection. // Read the cookie we saved before the redirection in RedirectToIdentityProvider callback in Startup.Auth.cs var persistedRequestData = CookieStorage.Load(request.Cookies); if (null != persistedRequestData) { activationParameters = new FileHandlerActivationParameters(persistedRequestData); return(true); } } return(false); }
public static bool IsFileHandlerActivationRequest(Microsoft.Owin.IOwinRequest request, out FileHandlerActivationParameters activationParameters) { activationParameters = null; var formTask = request.ReadFormAsync(); formTask.RunSynchronously(); var formData = formTask.Result; if (formData != null && formData.Any()) { activationParameters = new FileHandlerActivationParameters(null); return(true); } else { var persistedRequestData = CookieStorage.Load(request.Cookies); if (null != persistedRequestData) { activationParameters = new FileHandlerActivationParameters(persistedRequestData); return(true); } } return(false); }
public static bool IsFileHandlerActivationRequest(this HttpRequest request, out FileHandlerActivationParameters activationParameters) { activationParameters = null; if (request.HasFormContentType) { // Get from current request's form data var nameValueCollection = new NameValueCollection(); foreach (var key in request.Form.Keys) { nameValueCollection.Add(key, request.Form[key]); } activationParameters = new FileHandlerActivationParameters(nameValueCollection); return(true); } else { var persistedRequestData = CookieStorage.Load(request.Cookies); if (null != persistedRequestData) { activationParameters = new FileHandlerActivationParameters(persistedRequestData); return(true); } } return(false); }
public static bool IsFileHandlerActivationRequest(HttpRequestBase request, out FileHandlerActivationParameters activationParameters) { activationParameters = null; if (request.Form != null && request.Form.AllKeys.Any()) { activationParameters = new FileHandlerActivationParameters(request.Form); return(true); } else { var persistedRequestData = CookieStorage.Load(request); if (null != persistedRequestData) { activationParameters = new FileHandlerActivationParameters(persistedRequestData); return(true); } } return(false); }
public static bool IsFileHandlerActivationRequest(HttpRequestBase request, out FileHandlerActivationParameters activationParameters) { activationParameters = null; if (request.Form != null && request.Form.AllKeys.Any()) { // Get from current request's form data activationParameters = new FileHandlerActivationParameters(request.Form); return(true); } else { // If form data does not exist, it must be because of the sign in redirection. // Read the cookie we saved before the redirection in RedirectToIdentityProvider callback in Startup.Auth.cs var persistedRequestData = CookieStorage.Load(request); if (null != persistedRequestData) { activationParameters = new FileHandlerActivationParameters(persistedRequestData); return(true); } } return(false); }