User account name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #1

    User account name

    When a user logs in, it is common practice to display their username together with account balance, exposure, etc.

    Whilst I can see how to retrieve the account balance, exposure, etc is there a call that actually returns the username that a person logged in with?

    If you are using the interactive login (to allow two factor authentication), the username is NOT set in the cookies, so how exactly do you get this information?
  • AlgoTrader
    Junior Member
    • Mar 2012
    • 243

    #2
    Is it you who starts the login? Just save the user name at the interactive login start.
    Betfair Bots Made Easy

    Comment

    • AlgoTrader
      Junior Member
      • Mar 2012
      • 243

      #3
      It seems I have to explain. The interactive login can be used in many ways, some of them are absolutly non-interactive. The example is:

      Code:
      curl -v -c cookies.txt -d "username=Username&password=password&login=true&redirectMethod=POST&product=home.betfair.int&url=https://www.betfair.com/" https://identitysso.betfair.com/api/login
      In response, there will be cookies set like this
      Code:
      Added cookie ssoid="Hs7V5Ls+s/qaU9/mGf7So63je53m145F12rnspB9nZo=" for domain betfair.com, path /, expire 0
      ssoid is modified, will not work

      You seem to use another way where you load HTML from server first. In this case, you can add additional JavaScript handler on button with id="login" or form id="loginForm" and read the element with id="username". That's the two step way.

      I just send the post with form data, the first step of getting form HTML and displaying it is optional.
      Betfair Bots Made Easy

      Comment

      • betdynamics
        Junior Member
        • Sep 2010
        • 534

        #4
        I'm trying to use the interactive method as outlined in the C# example that has been provided by BDP.

        In this, a standalone desktop program with a webbrowser control navigates to the login page and the user logs in. If two factor authentication is enabled, then another web page is displayed for the user to enter the authentication code, then the user is actually logged in.

        Once logged in, the session code is extracted from the cookies and the webbrowser control is closed.

        Although I don't like this, I would prefer not to change this as then the user can see that the standard Betfair mechanism is being used.

        So two questions:

        1. Do I have to inject another routine to capture the log in information before it is sent to Betfair (and if so, how do I do this)?

        2. Wouldn't it be easier if the account functions actually contained a field with the account name in it?

        Comment

        • AlgoTrader
          Junior Member
          • Mar 2012
          • 243

          #5
          1) you have webbrowser control. untill data is submitted, you can read it's DOM and extract anything you need from there.

          2) sure, it will be great if Betfair will put login name into cookies. I don't like cookies much as they can be stolen though.
          Betfair Bots Made Easy

          Comment

          • betdynamics
            Junior Member
            • Sep 2010
            • 534

            #6
            1) I'm off to look at the OnNavigating event - which hopefully should be raised when the login button is clicked.

            2) I would prefer the account routines to return the username, not for it to be put into the cookies.

            Comment

            • AlgoTrader
              Junior Member
              • Mar 2012
              • 243

              #7
              I completly agree. It would be great if some API call returned login name. Then no cookie-magic required.

              Try to write bdp@... and suggest the change
              Betfair Bots Made Easy

              Comment

              Working...
              X