Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code: 281658 #33

Closed
nyko513 opened this issue Mar 9, 2017 · 48 comments
Closed

Error code: 281658 #33

nyko513 opened this issue Mar 9, 2017 · 48 comments
Assignees
Labels
Milestone

Comments

@nyko513
Copy link

nyko513 commented Mar 9, 2017

ERROR:
Fatal error: Uncaught JKetelaar\fut\api\errors\login\MainLogin: Unable to login with unknown response With the following message: Page not matching login form page () With error code: 281658 in C:\xampp\htdocs\rangos\src\JKetelaar\fut\api\user\Login.php:352 Stack trace: #0 C:\xampp\htdocs\rangos\src\JKetelaar\fut\api\user\Login.php(96): JKetelaar\fut\api\user\Login->postLoginForm('https://signin....') #1 C:\xampp\htdocs\rangos\src\JKetelaar\fut\api\API.php(123): JKetelaar\fut\api\user\Login->login() #2 C:\xampp\htdocs\rangos\prueba2.php(8): JKetelaar\fut\api\API->login() #3 {main} thrown in C:\xampp\htdocs\rangos\src\JKetelaar\fut\api\user\Login.php on line 352

CODE:

$api = new \JKetelaar\fut\api\API('XXX@gmail.com', 'XXX', 'XXX', 'email_callback', 'ps4', true);

if($api->login() === true) {
    echo('We\'re logged in!');
}

function email_callback() {
    return '84505842';
}

I'm running this code on localhost/Xampp. Installed this plugin with composer.
Thanks in advance :)

@nyko513 nyko513 changed the title Problem login Error code: 281658 Mar 9, 2017
@JKetelaar
Copy link
Owner

Thanks for the report, I'm having the same issue.

I'll investigate this and solve this ASAP.

@JKetelaar JKetelaar added the bug label Mar 10, 2017
@JKetelaar JKetelaar self-assigned this Mar 10, 2017
@baselbers
Copy link

baselbers commented Mar 11, 2017

Hi @JKetelaar,

Great work!
Any news on this issue?

Does login with App Authenticator work? What about SMS? Can anybody confirm this?

If I can help you out let me know!

Edit:
Did some digging..
https://github.com/baselbers/PHP-FUT-API/commit/2186094acfa15204043b6ec5afe9dde5d73abcd2

Then I got this error.
Fatal error: Uncaught JKetelaar\fut\api\errors\login\MainLogin: Unable to login with unknown response With the following message: HTTP/1.1 500 Internal Server Error With error code: 500 in C:\xampp-2\htdocs\fut\vendor\jketelaar\php-fut-api\src\JKetelaar\fut\api\user\Login.php on line 210

It seems that LOGIN_ACCOUNTS url is not correct (anymore).
https://github.com/JKetelaar/PHP-FUT-API/blob/master/src/JKetelaar/fut/api/config/URL.php#L16

How do we get the new one? 😄

@JKetelaar
Copy link
Owner

I'm using App Authenticator personally, so that used to work back when I made this.

When I'm back, I'll fix this issue!

@suckedjs
Copy link

Any news?

@baselbers
Copy link

Unfortunately App Authenticator is also not working. Can you tell me how we find out the new LOGIN_ACCOUNTS url?

@suckedjs
Copy link

the LOGIN_ACCOUNTS url is the same for me, I just fired up Live HTTP Headers (firefox addon) while I was logging in. Something else has changed but not sure what.

@baselbers
Copy link

baselbers commented Mar 12, 2017

It seems that the request for getting the account information needs to have a Easw-Session-Data-Nucleus-Id header with the EASW_ID. Unfortunately EASW_ID is always zero when requesting getFUTPage().

https://github.com/baselbers/PHP-FUT-API/commit/1517acb464a4a1dea82e901d798afe8b5065e73e

I've tested with Advanced Rest Client extension for Chrome. When I use the cookie from real fut web app, the extension gives me a non-zero EASW_ID. How do we go from here?

@baselbers
Copy link

The request needs to have a cookie with EASFC-WEB-SESSION and XSRF-TOKEN to get the nucleas id.

@suckedjs
Copy link

I believe the problem is before getFUTPage() gets called. Now after you submit your details via curl->post, the response is a javascript redirect which redirects to the same page, over and over again.

@JKetelaar
Copy link
Owner

I found a solution to the problem, it's a bit sketchy now, so I'll clean the code and push it to a new release.
Stay tuned!

Thanks for all the investigations btw 😄

@baselbers
Copy link

You're welcome. 😸
Let me know if you have resolved the issue.

@baselbers
Copy link

Did you got the time to look into it? Eager to use it! 😄

@suckedjs
Copy link

same here, I have so many non-rare golds to sell and I want to use the script to do it.

@baselbers
Copy link

baselbers commented Mar 14, 2017

Which platform do you play @suckedjs and what division?

@suckedjs
Copy link

xbox one. div 1. you?

@baselbers
Copy link

PC with Xbox One controller. Division 3, but just started playing a month ago.

@JKetelaar
Copy link
Owner

Sorry for the delay, I'll try pushing the update today!

@suckedjs
Copy link

that's great news!

@JKetelaar JKetelaar added this to the 0.0.6 milestone Mar 16, 2017
@JKetelaar
Copy link
Owner

Please try the latest release (0.0.6)

@suckedjs
Copy link

how do I download the latest version?

@baselbers
Copy link

Just use composer. 😄

@suckedjs
Copy link

right! got it to work but how do you get the verification code?

@suckedjs
Copy link

I just used the email verification but now I get this error:
Fatal error: Uncaught exception 'JKetelaar\fut\api\errors\login\MainLogin' with message 'Unable to login with unknown response With the following message: HTTP/1.1 500 Internal Server Error With error code: 500' in C:\xampp\htdocs\PHP-FUT-API-master\PHP-FUT-API-master\src\JKetelaar\fut\api\user\Login.php:211 Stack trace: #0 C:\xampp\htdocs\PHP-FUT-API-master\PHP-FUT-API-master\src\JKetelaar\fut\api\user\Login.php(186): JKetelaar\fut\api\user\Login->getAccountInformation() #1 C:\xampp\htdocs\PHP-FUT-API-master\PHP-FUT-API-master\src\JKetelaar\fut\api\user\Login.php(146): JKetelaar\fut\api\user\Login->getShards('0') #2 C:\xampp\htdocs\PHP-FUT-API-master\PHP-FUT-API-master\src\JKetelaar\fut\api\user\Login.php(408): JKetelaar\fut\api\user\Login->getFUTPage() #3 C:\xampp\htdocs\PHP-FUT-API-master\PHP-FUT-API-master\src\JKetelaar\fut\api\user\Login.php(98): JKetelaar\fut\api\user\Login->postTwoFactorForm('https://signin....') #4 C:\xampp\htdocs\PHP-FUT-API-master\PHP-FUT-API-master\src\JKetelaar\fut\api\API.php(123): JKetelaar\ in C:\xampp\htdocs\PHP-FUT-API-master\PHP-FUT-API-master\src\JKetelaar\fut\api\user\Login.php on line 211

@baselbers
Copy link

That's because getFUTPage() always returns EASW_ID with value 0.

The request $this->curl->get(URL::LOGIN_NUCLEUS); needs to have a cookie with futweb id and web session id to actually get a non-zero EASW_ID.

If you have the correct nucleasid (EASW_ID) you have to add it as a header with key Easw-Session-Data-Nucleus-Id to getAccountInformation() request.

@JKetelaar You did not resolve the issue. 😞

@baselbers
Copy link

http://pydoc.net/Python/fut/0.1.3/fut.core/
This is how it should be.

@JKetelaar
Copy link
Owner

Latest version seems to be working for me.

Could you try clearing your cache?

@baselbers
Copy link

Of course I've tried clearing cache.

@suckedjs
Copy link

same error here, EASW_ID always 0, maybe it has something to do with the fact that my account has two fut accounts? pc and xbox one? what platform are you on, @JKetelaar ?

@baselbers
Copy link

I've tested this before with Advanced Rest Client and it was working with the modifications mentioned earlier.

@suckedjs
Copy link

I found the problem, in order to get a non 0 EASW_ID you have to add the following headers to the curl->get request:

private function getFUTPage() {
	$this->curl->setOpt(CURLOPT_FOLLOWLOCATION, true);
    $this->curl->setOpt(CURLOPT_ENCODING, Configuration::HEADER_ACCEPT_ENCODING);
    $this->curl->setHeader('Accept-Language', Configuration::HEADER_ACCEPT_LANGUAGE);
    $this->curl->setHeader('Cache-Control', Configuration::HEADER_CACHE_CONTROL);
    $this->curl->setHeader('Accept', Configuration::HEADER_ACCEPT);
    $this->curl->setHeader('DNT', Configuration::HEADER_DNT);
    $this->curl->get(URL::LOGIN_NUCLEUS);

@baselbers
Copy link

So you fixed it? Or still 500?

@suckedjs
Copy link

works for me. Add the headers and let me know. Nice to see "We're logged in!" on my screen. Btw all those functions need a proper tutorial. I'm still figuring out how to use the trading functions.

@baselbers
Copy link

Does not work for me. It does not make any sense to me to add those headers because they are already added when setting up curl. Does pc platform work for you? Can you send me your code to authenticate?

@suckedjs
Copy link

Not sure how to test on pc as I only had an fut account in 2013 (fut 13). I can send you my Login.php file as this is the only file I changed.

@baselbers
Copy link

Please share a link to the file.

@suckedjs
Copy link

@suckedjs
Copy link

for example in the readme file there is an example that gets the tradepile items, how do I loop all of them and get only the players? I know that I have to compare the itemType of each item and the ones that are "player", should do something with them but how do I achive this with the functions provided in the API?

@baselbers
Copy link

I ment your index.php file. What method do you use? Email, SMS or App authenticator?

@suckedjs
Copy link

I am using the index.php file provided in the readme. I just added my account details, email, pass, secret and console. Passed true as the last argument.

@suckedjs
Copy link

Your problem could be at selecting the persona. What error do you get now?

@baselbers
Copy link

Still 500. No EASW_ID. 😞
I'm testing with App Authenticator, but tried to many times so have to wait a couple of minutes.
So you use the App Authenticator right? You change the 'SECRET' in function everytime you login right?

@suckedjs
Copy link

suckedjs commented Mar 18, 2017 via email

@JKetelaar
Copy link
Owner

Quick questions to debug this further:

What platform?
What authentication method?
What version of PHP?

@baselbers
Copy link

@suckedjs you need to reconfigure App Authenticator on your ea account and use the secret key below QR-code. Put the secret key into the totp() function and login will work just fine.

@JKetelaar Please add this to your README.MD, because this has taken us hours to find out. 😞

I am trying to simply relist my tradepile items.

$handler->sendRequest( \JKetelaar\fut\api\config\URL::API_RELIST, JKetelaar\fut\api\market\handler\Method::POST() )

Fatal error: Uncaught JKetelaar\fut\api\errors\market\MarketError: Unknown error occurred in the Market. If this error is unknown to you too, please report this error. Error with code: 404 With response message:HTTP/1.1 404 Not Found in C:\xampp-2\htdocs\fut\vendor\jketelaar\php-fut-api\src\JKetelaar\fut\api\market\Handler.php on line 133

This is getting to annoying. No documentation means to much work with trial and error.

@JKetelaar
Copy link
Owner

So is login working or what?

@baselbers
Copy link

@suckedjs you need to reconfigure App Authenticator on your ea account and use the secret key below QR-code. Put the secret key into the totp() function and login will work just fine.

@suckedjs
Copy link

@baselbers can you add me on skype? same username as here.

@baselbers
Copy link

baaaaas89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants