Android Question Reading a web page that neeed user and pass

Discussion in 'Android Questions' started by Alberto Michelis, Jun 7, 2015.

  1. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    I´m trying to read
    http://200.68.94.241/log.aspx?ReturnUrl=/cons.aspx?tipo=22&tipo=22

    see image

    This is the source code of the page where it ask for user and pass

    <input name="txus" type="text" id="txus" class="txt" style="width:150px;" />
    <input name="txpa" type="password" id="txpa" class="txt" style="width:150px;" />

    I´m using a Webview control and:

    Sub WebView1_UserAndPasswordRequired (Host As String, Realm As String) As String()
    Return Array As String("1205", "partagas#1205")
    End Sub

    But it does not work

    How can I do it?

    PD I´m trying to see it just to test but I need to parse it once readed.

    Thanks
     

    Attached Files:

  2. sorex

    sorex Expert Licensed User

    you need to post that data and the hidden parameters to that url.
     
  3. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    Sory dont understand you, may you please be more specific?
    Form where can I copy the hidden params?
    Thanks for your time!
     
  4. sorex

    sorex Expert Licensed User

    in the form you need to look for <input type=hidden that are the parameters that need to be passed aswell as it might check for those.
     
  5. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    This is what I found...

    <div>
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="btin" />
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTIxNDY5ODU5NTcPZBYCAgEPZBYCAgkPDxYCHgdWaXNpYmxlaGRkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQRidGlu9+TYw0sfl63jhQaG3vvV1MBXVWIJc+Kd0I+JN/gHnng=" />
    </div>

    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['form2'];
    if (!theForm) {
    theForm = document.form2;
    }
    function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;
    theForm.submit();
    }
    }
    //]]>
    </script>

    <div>
    <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="881C1645" />
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAXP2rylwL5U3oJ9bDnttCYzoiuHG1JM7SRvG7QXShBtUkHzh8XRDl787XQs/G4KtMFFNAdTqhzzY4gUBKAQB/9ZsbvItzGNuOxxNBTFmN4z7vd61t4TsFk7w6TQQ6ljIgyk/d8tg8q7AhxCLskGhhmZ" />
    </div>
     
  6. Alberto Michelis

    Alberto Michelis Active Member Licensed User

  7. Erel

    Erel Administrator Staff Member Licensed User

    Use a tool such as FireBug to monitor the http request that is sent when you submit the form. You will then need to create a similar request with HttpUtils2
     
Loading...