Title: Server returns 403 Forbidden error on auth step · Issue #8 · shapecode/fut-api · GitHub
Open Graph Title: Server returns 403 Forbidden error on auth step · Issue #8 · shapecode/fut-api
X Title: Server returns 403 Forbidden error on auth step · Issue #8 · shapecode/fut-api
Description: 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('', tru...
Open Graph Description: 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/Ab...
X Description: 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/Ab...
Opengraph URL: https://github.com/shapecode/fut-api/issues/8
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Server returns 403 Forbidden error on auth step","articleBody":"I was receiving this error during login:\r\n\r\n```\r\nPHP Fatal error: Uncaught JsonException: Syntax error in /home/shafeey/fut-api/src/Api/AbstractCore.php:339\r\nStack trace:\r\n#0 /home/shafeey/fut-api/src/Api/AbstractCore.php(339): json_decode('', true, 512, 4194304)\r\n#1 /home/shafeey/fut-api/test.php(37): Shapecode\\FUT\\Client\\Api\\AbstractCore-\u003elogin('881689')\r\n```\r\n\r\nAs 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.\r\nhttps://github.com/shapecode/fut-api/blob/4df924ca96e4f33ae6811f576c0e8c3fa599d6f5/src/Api/AbstractCore.php#L313\r\n\r\nI'm using the following script for login and putting the code from verification email. Any idea what I am doing wrong? Thank you.\r\n```\r\n\u003c?php\r\n\r\n// Autoload files using the Composer autoloader.\r\nrequire_once __DIR__ . '/vendor/autoload.php'; \r\n\r\nuse Shapecode\\FUT\\Client\\Api\\Core;\r\nuse Shapecode\\FUT\\Client\\Exception\\FutError;\r\nuse Shapecode\\FUT\\Client\\Authentication\\Account;\r\nuse Shapecode\\FUT\\Client\\Authentication\\Credentials;\r\nuse Shapecode\\FUT\\Client\\Authentication\\Session;\r\n\r\n\r\n$email = \"email@email.com\";\r\n$password = \"PASSWD\";\r\n$platform = \"ps4\";\r\n$code = \"999999\";\r\n\r\n$credentials = new Credentials($email, $password, $platform);\r\n\r\n$session = null;\r\n\r\n$account = new Account($credentials, $session);\r\n$fut = new Core($account);\r\n\r\ntry {\r\n $login = $fut-\u003elogin($code);\r\n $session = $account-\u003egetSession();\r\n} catch(FutError $e) {\r\n $reason = $e-\u003egetReason();\r\n die(\"We have an error logging in: \".$reason);\r\n}\r\necho \"Login complete...\\n\";\r\n```\r\n","author":{"url":"https://github.com/shafeey","@type":"Person","name":"shafeey"},"datePublished":"2020-01-15T09:16:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/8/fut-api/issues/8"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:43a111bf-8b1a-38c8-0b74-028566c33dd1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E298:776B8:4F5275:73A5CD:6A4E0BFC |
| html-safe-nonce | fdbc1c39819b88dcffd627f83467cd26f87955f1d41a1a2720939bf9024af34b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjk4Ojc3NkI4OjRGNTI3NTo3M0E1Q0Q6NkE0RTBCRkMiLCJ2aXNpdG9yX2lkIjoiNzUxODYyNTMwMTgyMTAwMDcwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 893dc2b9a251a459e82695d9b0bfebd19fa335f12447b468d3708c0e902ad42f |
| hovercard-subject-tag | issue:550059196 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/shapecode/fut-api/8/issue_layout |
| twitter:image | https://opengraph.githubassets.com/60921fef1a675b91b5bc5c53d4c8f4efd6c39e4393f92cf20346b86c5b7446bb/shapecode/fut-api/issues/8 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/60921fef1a675b91b5bc5c53d4c8f4efd6c39e4393f92cf20346b86c5b7446bb/shapecode/fut-api/issues/8 |
| og:image:alt | 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/Ab... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shafeey |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| turbo-cache-control | no-preview |
| go-import | github.com/shapecode/fut-api git https://github.com/shapecode/fut-api.git |
| octolytics-dimension-user_id | 19488206 |
| octolytics-dimension-user_login | shapecode |
| octolytics-dimension-repository_id | 158721571 |
| octolytics-dimension-repository_nwo | shapecode/fut-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 158721571 |
| octolytics-dimension-repository_network_root_nwo | shapecode/fut-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 51470c353b8a1f52a88d3e3cc2014b17ab8cc1ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width