0

I'm trying to have users login on from my website to a third party platform that we use. I'm using the code below, however, when submitted, it's taking me to the .aspx page with no data pre-filled or anything. I want it to post the credentials and log the user in. Is it because I'm posting to an .aspx page?

<form method="POST" action="othersite.aspx">
      <fieldset>
        <dl>
          <dt>
            <label for="txtUserName">Email:</label>
          </dt>
          <dd>
            <input name="email" type="text" id="email" class="fieldSignin"/>
          </dd>
          <dt>
            <label for="txtPassword">Password:</label>
          </dt>
          <dd>
            <input name="password" type="password" id="password" class="fieldSignin"/>
          </dd>
        </dl>
      </fieldset>
      <div class="formButtons">
        <input type="submit" name="login" value="Sign in" id="login" class="buttonPrimary" />
      </div>

Any assistance is appreciated.

DRK
  • 3
  • 5
  • It is possible that the other site is set to receive form data from it's own domain only. – Maximus2012 Apr 06 '16 at 21:44
  • Is there a way I can tell? I've called the company and their tech support is useless. – DRK Apr 06 '16 at 21:53
  • Honestly, I am not even sure if this is a secure practice to do something like this. Is there a reason you have to do it this way ? – Maximus2012 Apr 06 '16 at 21:59
  • You may try using curl: http://stackoverflow.com/questions/2594880/using-curl-with-a-username-and-password – Maximus2012 Apr 06 '16 at 22:01
  • I would use something like like HTTPHeaders or Fiddler to see how the data is submitted on this third party login form. Might be a GET rather than a POST (you never know), or they use a hidden form field or something low tech like that to prevent cross site form submissions. You could 'replay' and see if subsequent calls fail - that will tell you they are obfuscating your attempt. – ficuscr Apr 06 '16 at 22:07
  • Thanks for the tips. My reason is to make the user experience more streamlined. Instead of clicking a link away from our page to a page that has none of our branding. – DRK Apr 06 '16 at 22:31

1 Answers1

0

Found a solution to post data in asp.net web form.

My aspx.page

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PostData.aspx.cs" Inherits="StackOverflow_Solve.POST.PostData" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>

    <form method="POST" action="othersite.aspx" id="form1" runat="server">
      <fieldset>
        <dl>
          <dt>
            <label for="txtUserName">Email:</label>
          </dt>
          <dd>
            <input name="email" type="text" id="email" class="fieldSignin"/>
          </dd>
          <dt>
            <label for="txtPassword">Password:</label>
          </dt>
          <dd>
            <input name="password" type="password" id="password" class="fieldSignin"/>
          </dd>
        </dl>
      </fieldset>
      <div class="formButtons">
        <input type="submit" name="login" value="Sign in" id="login" class="buttonPrimary" />
      </div>
      </form>
</body>
</html>

To receive posted data on the othersite.aspx

 protected void Page_Load(object sender, EventArgs e)
        {

            String email = Request["email"];
            String password = Request["password"];

        } 

I will work on other domain also.just change the action to that URL and it will good to go.

Syed Mhamudul Hasan
  • 1,341
  • 2
  • 17
  • 45