Getting STRONG_AUTH_CODE_REQUIRED when trying to create a login

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jake
    Junior Member
    • Aug 2019
    • 5

    #1

    Getting STRONG_AUTH_CODE_REQUIRED when trying to create a login

    Trying to login to create a session token, but I'm getting this error back:
    Code:
    "status":"LOGIN_RESTRICTED","error":"STRONG_AUTH_CODE_REQUIRED"
    It might be due to me having a two factor authentication - would this affect the login via the API?

    This is the PHP cURL function I'm using:
    PHP Code:
    public function initiate_login()
        {

            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_URL'https://identitysso.betfair.com/api/login');
            
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
            
    curl_setopt($chCURLOPT_POSTFIELDS"username={$username}&password={$password}");
            
    curl_setopt($chCURLOPT_POST1);

            
    $headers = array();
            
    $headers[] = 'Accept: application/json';
            
    $headers[] = 'X-Application: '.$app_id;
            
    $headers[] = 'Content-Type: application/x-www-form-urlencoded';
            
    curl_setopt($chCURLOPT_HTTPHEADER$headers);

            
    $result curl_exec($ch);
            if (
    curl_errno($ch)) {
                echo 
    'Error:' curl_error($ch);
            } else {
                
    print_r$result );
            }
            
    curl_close($ch);
        } 
    Any help from previous experiences with this error would be awesome!
    TIA - Jake
  • Generalizing
    Junior Member
    • Oct 2019
    • 2

    #2
    Hey Jake,

    Don't know if you managed to fix it from your end, cause I can see its been quite a while.

    Issue is actually explained here: https://docs.developer.betfair.com/d...op+Application

    In a nutshell, all you need to do is put the 2-step code at the end of your password in code and should work.

    Igor

    Comment

    • RogerMoore
      Junior Member
      • Mar 2020
      • 4

      #3
      The above comment is good for user interaction. I found this post via trying non-user interaction, cert based auth is the answer for this. API-NG API

      Comment

      Working...
      X