Getting token results in INVALID_AUTH_CODE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BetBro
    Junior Member
    • Feb 2019
    • 4

    #1

    Getting token results in INVALID_AUTH_CODE

    Hi,

    I'm getting users to link their Betfair account with our web app, but I seem to be getting INVALID_AUTH_CODE, despite the code looking as expected.

    I log the code right before posting it back to the /token endpoint, along with the grant_type, etc, but just get this back. It seem fine yesterday, with the mobile app, but not today with the web app. Both using same node.js API.

    Has anyone had the same issue or know what it could be? Do I have to encode the auth code or anything?

    Thanks.

    Code:
    const http = context.services.get("http");
    
    
          return http.post({
            headers: {
              "X-Application": [<APPID>],
              "X-Authentication": [token],
              "Content-Type": ["application/json"],
              "Accept": ["application/json"],
            },
            url:'https://api.betfair.com/exchange/account/json-rpc/v1',
            body: '{"jsonrpc": "2.0", "method": "AccountAPING/v1.0/token", "params": {"client_id":"' + client_id + '","grant_type":"AUTHORIZATION_CODE","code": "' + code + '","client_secret": "' + client_secret + '"}, "id": 1 }'
          })
          .then(result => {
            const ejson_body = EJSON.parse(result.body.text());
            return ejson_body;
          });
    I'm in a MongoDB function here, so some syntax is a little different. All working as expected, just the authorisation code not working.
    Last edited by BetBro; 15-02-2019, 09:09 AM.
  • darlorob
    Junior Member
    • Feb 2019
    • 5

    #2
    Exactly the same here, started yesterday with no code changes.

    Odds Monkey is also down when linking, so it is a universal bug that has been introduced.

    Comment

    • BetBro
      Junior Member
      • Feb 2019
      • 4

      #3
      Ah, okay, I'm not insane then. Thanks for letting me know.

      Comment

      • darlorob
        Junior Member
        • Feb 2019
        • 5

        #4
        Do Betfair monitor this forum? They need to know about this issue, I sent an email but I have no idea what the SLA is. This is a critical bug really as it prevents new user registrations

        Comment

        • BetBro
          Junior Member
          • Feb 2019
          • 4

          #5
          Not sure but I seem to be getting the desired response from the token endpoint now.

          Comment

          • darlorob
            Junior Member
            • Feb 2019
            • 5

            #6
            Yeah its fixed :+1:

            Comment

            Working...
            X