Results 1 to 1 of 1

Thread: Web authentication

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Web authentication

    I am trying to login to a web site using Winsock but i am not able to get any response from the site
    this is the code i am using to login

    Code:
    Private Sub cmdLogin_Click()
    Call DisableAll
    lblStatus.Caption = "Logging In..."
    Winsock1.RemoteHost = "test.authorize.net"
    Winsock1.RemotePort = 443
    Winsock1.Connect
    End Sub
    Private Sub Form_Initialize()
       InitCommonControls
    End Sub
    Private Sub Winsock1_Connect()
    PostData = "MerchantLogin=Test&Password=Test"
       Winsock1.SendData "POST" & " /ui/themes/anet/Logon.aspx?sub=signin HTTP/1.1" & vbCrLf & _
           "Host: test.authorize.net" & vbCrLf & _
           "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13" & vbCrLf & _
           "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" & vbCrLf & _
           "Accept-Language: en-us,en;q=0.5" & vbCrLf & _
           "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" & vbCrLf & _
           "Accept - Encoding: gzip , deflate" & vbCrLf & _
           "Keep-Alive: 300" & vbCrLf & _
           "Connection: keep-alive" & vbCrLf & _
           "Referer: https://test.authorize.net/ui/themes/anet/Logon.aspx?sub=signinMerchantLogin=Test&Password=Test" & vbCrLf & _
           "Content-type: application/x-www-form-urlencoded" & vbCrLf & _
           "Content-Type: application/x-www-form-urlencoded" & vbCrLf & _
           "Content-Length: " & Len(PostData)
    PageSource = vbNullString
    End Sub
    but i don't get anything in Winsock1_DataArrival it just do nothing after successfully login to site

    i have also tested on other login site it work fine

    this is the info i get from Firefox Addon

    Code:
    https://test.authorize.net/ui/themes/anet/Logon.aspx?sub=signin
    
    POST /ui/themes/anet/Logon.aspx?sub=signin HTTP/1.1
    Host: test.authorize.net
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Referer: https://test.authorize.net/ui/themes/anet/logon.aspx
    Cookie: stoken=_QoCnESBalNW6cHDwUT%24BB8bcTmvtOcHMY%24b9%24aAcGQA; rwizard=6
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 32
    MerchantLogin=Test&Password=Test
    HTTP/1.x 200 OK
    Server: Microsoft-IIS/5.0
    Date: Wed, 02 Apr 2008 13:54:17 GMT
    X-Powered-By: ASP.NET
    X-AspNet-Version: 1.1.4322
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 8813
    can anybody tell me how can i login using this info?
    Last edited by xor83; Apr 2nd, 2008 at 01:19 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width