Skip to content

Server returns 403 Forbidden error on auth step #8

@shafeey

Description

@shafeey

I was receiving this error during login:

PHP Fatal error:  Uncaught JsonException: Syntax error in /home/shafeey/fut-api/src/Api/AbstractCore.php:339
Stack trace:
#0 /home/shafeey/fut-api/src/Api/AbstractCore.php(339): json_decode('', true, 512, 4194304)
#1 /home/shafeey/fut-api/test.php(37): Shapecode\FUT\Client\Api\AbstractCore->login('881689')

As I looked deeper, I found that the POST request to "https://utas.external.s2.fut.ea.com:443/ut/auth?client=webcomp" is returning 403 FORBIDDEN with an empty body, which in turn results in the json_decode() exception.

$call = $this->simpleRequest('POST', $this->getFutAuthUrl(), [

I'm using the following script for login and putting the code from verification email. Any idea what I am doing wrong? Thank you.

<?php

// Autoload files using the Composer autoloader.
require_once __DIR__ . '/vendor/autoload.php'; 

use Shapecode\FUT\Client\Api\Core;
use Shapecode\FUT\Client\Exception\FutError;
use Shapecode\FUT\Client\Authentication\Account;
use Shapecode\FUT\Client\Authentication\Credentials;
use Shapecode\FUT\Client\Authentication\Session;


$email = "email@email.com";
$password = "PASSWD";
$platform = "ps4";
$code = "999999";

$credentials = new Credentials($email, $password, $platform);

$session = null;

$account = new Account($credentials, $session);
$fut = new Core($account);

try {
    $login = $fut->login($code);
    $session = $account->getSession();
} catch(FutError $e) {
    $reason = $e->getReason();
    die("We have an error logging in: ".$reason);
}
echo "Login complete...\n";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions