Note that there are some explanatory texts on larger screens.

plurals
  1. PORedirect using Javascript not the same from ASP.NET as local file?
    text
    copied!<p>The following code in a TEXT file on local disk works fine as an autologin for the skwirk website if you double click on the file..</p> <pre><code>&lt;html&gt; &lt;title&gt;Skwirk&lt;/title&gt; &lt;body onload='document.forms["Skwirk"].submit()'&gt; &lt;form name="Skwirk" action="http://www.skwirk.com/homepageV2/login_process.asp" method="POST"&gt; &lt;input type="hidden" name="query_string" value=""&gt; &lt;input type="hidden" name="username" value="usernamegoeshere"&gt; &lt;input type="hidden" name="password" value="mypasswordhere"&gt; &lt;input type="hidden" name="login_submitbutton.x" value="29"&gt; &lt;input type="hidden" name="login_submitbutton.y" value="10"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I tried to make this an asp.net page being pushed on Page_load, but it doesn't appear to work correctly. See code below:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; namespace Skwirk { public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string Url = "http://www.skwirk.com/homepageV2/login_process.asp"; string formId = "Skwirk"; string stage = "username"; string pass = "password"; StringBuilder htmlForm = new StringBuilder(); htmlForm.AppendLine("&lt;html&gt;"); htmlForm.AppendLine("&lt;title&gt;Skwirk&lt;/title&gt;"); htmlForm.AppendLine("&lt;body&gt;"); htmlForm.AppendLine(String.Format("&lt;body onload='document.forms[\"{0}\"].submit()'&gt;", formId)); htmlForm.AppendLine(String.Format("&lt;form name='{0}' method='POST' action='{1}'&gt;", formId, Url)); htmlForm.AppendLine(string.Format("&lt;input type='hidden' name='username' value='{0}'&gt;",stage )); htmlForm.AppendLine(string.Format("&lt;input type='hidden' name='password' value='{0}'&gt;",pass )); htmlForm.AppendLine("&lt;input type='hidden' name='login_submitbutton' value=''&gt;"); htmlForm.AppendLine("&lt;/form&gt;"); htmlForm.AppendLine("&lt;/body&gt;"); htmlForm.AppendLine("&lt;/html&gt;"); HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Write(htmlForm.ToString()); HttpContext.Current.Response.End(); } } } </code></pre> <p>It doesn't quiet work.. It redirect and posts/passes the values.. But isn't fully logged in ????</p> <p>Have I missed something ?????</p> <p>Thanks</p> <p>UPDATE: The above code appears to work correctly. (ie. Hidden fields are loaded), the form onload automatically redirects to the website etc...</p> <p>It would appear that the following is stoppping it working:</p> <p>Same HTML/Javascript in a local file = WORKING (Note... REFERER is BLANK) Same but from IIS = FAIL (The only difference I can see if REFERER is mywebsite, not www.skwirk.com or BLANK).</p> <p>I believe I could fix it by doing the following:</p> <pre><code>Override what IIS/ASP.NET sends as the REFERER string.. Either Force it to be BLANK or force it to be www.skwirk.com </code></pre> <p>Any ideas ? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload