futapi / fut

fut is a simple library for managing Fifa 19 Ultimate Team.
GNU General Public License v3.0
317 stars 138 forks source link

New login verification system #116

Open oczkers opened 9 years ago

oczkers commented 9 years ago

The reason of creating new issue is to collect all info about new verification system (code, secreat answer, captcha etc.) in one place.

  1. Secret answer is no used anymore since we got code validation?
  2. Captcha pops out in login process or just when you are logged in and make to fast requests?

PS. I've pushed new commit (33f7192f55fc89820fe301cf8dcbf2e3490210fd) that enables two step verification (email/sms code), it's not yet tested and probably doesn't work ;-).

TODO:

Innursery commented 9 years ago
  1. All my test not asking the secret answer after code
  2. captcha only on to fast requests

update

  1. after changing computer the secret answer is aked after code
mvillarejo commented 9 years ago

emulate requires pin also.

LUFCMOT commented 9 years ago

I have made a script that dips into the email inbox and gets the code - but i cannot for the life of me find out what URL to send the request too. The params are...

"twoFactorCode" => $thecode, "_trustThisDevice" => "on", "trustThisDevice" => "on", "_eventId" => "submit"

Yifei022 commented 9 years ago

Why not just use the backup codes?

LUFCMOT commented 9 years ago

they can only be used once.

Yifei022 commented 9 years ago

if you run out of the backup codes you can always regenerate more

LUFCMOT commented 9 years ago

I dont need too I have a script that grabs the code from the email account.

Noxdzine commented 9 years ago

Same discussion here if it can help you: https://github.com/trydis/FIFA-Ultimate-Team-2015-Toolkit/issues/93

LUFCMOT commented 9 years ago

We need the URL where the security data is sent

oczkers commented 9 years ago

@LUFCMOT url is not the problem https://github.com/oczkers/fut/blob/33f7192f55fc89820fe301cf8dcbf2e3490210fd/fut/core.py#L180

anyone tested my commit?

LUFCMOT commented 9 years ago

@oczkers but where is "twoFactorCode" => $thecode, "_trustThisDevice" => "on", "trustThisDevice" => "on", "_eventId" => "submit"

POST too?

oczkers commented 9 years ago

I have just tested it and it's working fine, anyone confirms?

Innursery commented 9 years ago

How do you use it?

oczkers commented 9 years ago
fut.Core('login', 'password', 'secret_password', code=123456)

code is needed only on first launch (and every 90 days) if you use cookies.txt

Innursery commented 9 years ago

my test

import fut

EmailAdd='email@test.com'
PassWord='password'
SecretAnswer='secret'
PlatF='xbox'
CodeOR=123456
Emu=''

Fifa = fut.Core(EmailAdd, PassWord, SecretAnswer, platform=PlatF, code=CodeOR ,emulate=Emu, cookies= EmailAdd)

result Traceback (most recent call last): File "J:\FUT\22-test connexion.py", line 16, in Fifa = fut.Core(EmailAdd, PassWord, SecretAnswer, platform=PlatF, code=CodeOR ,emulate=Emu, cookies= EmailAdd) File "J:\FUT\fut\core.py", line 106, in init self.login(email, passwd, secret_answer, platform, code, emulate) File "J:\FUT\fut\core.py", line 184, in login raise FutError('Error during login process (probably invalid email, password or code).') fut.exceptions.FutError: Error during login process (probably invalid email, password or code).

and I receive a new code by email

christrato commented 9 years ago

@oczkers what url do you use for send the code? my step are:

Login -> send in POST the username / password -> RESPONSE: html page of "Two factor code" form -> i get URL of this page -> send in POST correctly the code -> RESPONSE: html page of "Two factor code" form.

the url of twofactorcode need of some extra cookie or extra header field?

I use a JAVA tool that i made for me.

LUFCMOT commented 9 years ago

^ Ditto but php.

rjansen commented 9 years ago

Hi people. The new login with code verification works fine. Thanks a lot

oczkers commented 9 years ago

@Innursery Post full logs (last response from server at least).

@christrato At the beggining of login process there is redirect to something like this:

https://signin.ea.com/p/web/login?execution=e279030983s1&initref=https://accounts.ea.com:443/connect/auth?scope=basic.identity+basic.persona+signin+offline+security.challenge&redirect_uri=http%3A%2F%2Fwww.easports.com%2Ffifa%2Flogin_check&locale=en_US&state=ii6eMmZdi2IxVeGx8jKEPOLFql0mEVioU-hvDviXjvw&response_type=code&client_id=EASFC-web

e279030983s1

s1 = post login data (username, password) s2 = request and post code s3 = dunno

There is no difference in headers between s1,s2,s3 besides referer.

EDIT: i'll release new stable version when we get more confirmations that it works (and logs from @Innursery) EDIT2: updated s1,s2,s3

Innursery commented 9 years ago

@oczkers

2014-12-12 09:49:28,562 [INFO] [requests.packages.urllib3.connectionpool] _new_conn: Starting new HTTP connection (1): www.easports.com (line 171)
2014-12-12 09:49:28,768 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /uk/fifa/football-club/ultimate-team HTTP/1.1" 301 262 (line 344)
2014-12-12 09:49:28,770 [INFO] [requests.packages.urllib3.connectionpool] _new_conn: Starting new HTTPS connection (1): www.easports.com (line 635)
2014-12-12 09:49:29,471 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /uk/fifa/ultimate-team/web-app HTTP/1.1" 302 406 (line 344)
2014-12-12 09:49:29,475 [INFO] [requests.packages.urllib3.connectionpool] _new_conn: Starting new HTTPS connection (1): accounts.ea.com (line 635)
2014-12-12 09:49:29,666 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /connect/auth?response_type=code&client_id=EASFC-web&state=cyMOpPM8xPVCQ0aRC2VRtHN6G8eXkFnWMF2FL4sWC-4&redirect_uri=http%3A%2F%2Fwww.easports.com%2Ffifa%2Flogin_check&locale=en_GB&scope=basic.identity+basic.persona+signin+offline+security.challenge HTTP/1.1" 302 0 (line 344)
2014-12-12 09:49:29,668 [INFO] [requests.packages.urllib3.connectionpool] _new_conn: Starting new HTTPS connection (1): signin.ea.com (line 635)
2014-12-12 09:49:29,899 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /p/web/login?fid=F6i9vhuygGDc3rPSLK7ZY7YYluYYKwS HTTP/1.1" 302 0 (line 344)
2014-12-12 09:49:29,967 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /p/web/login?execution=e1332693757s1&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DcyMOpPM8xPVCQ0aRC2VRtHN6G8eXkFnWMF2FL4sWC-4%26response_type%3Dcode%26client_id%3DEASFC-web HTTP/1.1" 200 None (line 344)
2014-12-12 09:49:30,104 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "POST /p/web/login?execution=e1332693757s1&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DcyMOpPM8xPVCQ0aRC2VRtHN6G8eXkFnWMF2FL4sWC-4%26response_type%3Dcode%26client_id%3DEASFC-web HTTP/1.1" 302 0 (line 344)
2014-12-12 09:49:30,172 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /p/web/login?execution=e1332693757s2&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DcyMOpPM8xPVCQ0aRC2VRtHN6G8eXkFnWMF2FL4sWC-4%26response_type%3Dcode%26client_id%3DEASFC-web HTTP/1.1" 200 None (line 344)
2014-12-12 09:49:30,174 [DEBUG] [root] __login__: b'\n<!DOCTYPE html>\n<html lang="en">\n<head>\n    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\n\n    <title>Login Verification</title>\n    <meta name="title" content="Login Verification"/>\n    <meta name="description" content="Input your Two Factor Authentication Code"/>\n    <link rel="shortcut icon" href="/p/favicon.ico"/>\n    <meta name="lc" content="en_GB"/>\n    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>\n    <meta http-equiv="X-UA-Compatible" content="IE=Edge">\n\n<script type="text/javascript">window.EA = {};</script>\n<script type="text/javascript" src="//fonts.ea.com/fbl8bgs.js"></script>\n<script type="text/javascript">(function () {\n    try {\n        Typekit.load();\n    } catch (ex) {\n        var html = document.getElementsByTagName(\'html\')[0];\n        html.className = (html.className || \'\') + \' wf-inactive\'\n    }\n})();</script>\n\n\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery-1.8.3.min.v_1418060428.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery.origin-ux-elements.v_1418060428-min.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery.origin-layout.v_1418060428-min.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/js/jquery.origin-challenge-tfa.v_1418060428-min.js"></script>\n\n<script type="text/javascript">\n    if (!window.challenge_cancel) {\n        window.challenge_cancel = function() {\n            if ($("#btnCancel").length > 0) {\n                $("#btnCancel").trigger("click");\n                return true;\n            } else {\n                return false;\n            }\n        }\n    }\n</script>\n\n<script type="text/javascript">\n    $(document).ready(function() {\n        $.fn.tfa({\n        });\n        $("#twoFactorCode").focus();\n    });\n</script>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/css/origin-ux-elements.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/css/origin-layout.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/css/origin-challenge-tfa.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/css/origin-challenge-tfa.v_1418060428-min.css"/>\n\n<!--  GA -->\n<script type="text/javascript">\n    var _gaq = _gaq || [];\n    _gaq.push([\'_setAccount\', \'UA-38277543-1\']);\n    _gaq.push([\'_setDomainName\', \'.ea.com\']);\n    _gaq.push([\'_trackPageview\']);\n    (function () {\n        var ga = document.createElement(\'script\');\n        ga.type = \'text/javascript\';\n        ga.async = true;\n        ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';\n        var s = document.getElementsByTagName(\'script\')[0];\n        s.parentNode.insertBefore(ga, s);\n    })();\n</script>\n<!-- End of GA -->\n    <!-- Tealium -->\n    <script type="text/javascript">\n        var utag_data = {\n            region: "EMEA",\n            locale: "en_GB",\n            country: "GB",\n            language: "en",\n            userid: "",\n            user_status: "",\n            referring_site: "https://signin.ea.com/p/web/login?execution=e1332693757s1&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DcyMOpPM8xPVCQ0aRC2VRtHN6G8eXkFnWMF2FL4sWC-4%26response_type%3Dcode%26client_id%3DEASFC-web",\n            page_name: "https://signin.ea.com/p/web/login"\n        }\n    </script>\n    <script type="text/javascript">\n        (function (a, b, c, d) {\n            a = \'//tags.tiqcdn.com/utag/ea/eadp-web-identity/prod/utag.js\';\n            b = document;\n            c = \'script\';\n            d = b.createElement(c);\n            d.src = a;\n            d.type = \'text/java\' + c;\n            d.async = true;\n            a = b.getElementsByTagName(c)[0];\n            a.parentNode.insertBefore(d, a);\n        })();\n    </script>\n    <!-- End of tealium -->\n\n<script type="text/javascript">\n    $(document).ready(function () {\n        var skin = \'origin\';\n        var bodySelector = $("body");\n        switch (skin) {\n            case "origin":\n                bodySelector.addClass("origin-com");\n                break;\n            case "franchisedark":\n                bodySelector.addClass("ea-franchise").addClass("ea-franchise-dark");\n                break;\n            case "franchiselight":\n                bodySelector.addClass("ea-franchise").addClass("ea-franchise-light");\n                break;\n            case "ea":\n            default:\n                bodySelector.addClass("ea-com");\n                break;\n        }\n    })\n</script>\n\n\n\n</head>\n<body>\n\n\n<div class="loading-container"></div>\n\n<div class="tfa-container">\n    <form method="post" id="challengeForm">\n        <div class="dialog-info">\n            <div id="resend-error-code">\n                <div></div>\n            </div>\n        </div>\n\n<a class="logo-origin" title=""\n   href="https://www.origin.com/store/?no-takeover=true">\n</a>\n\n        <div class="panel" id="panel-tfa">\n            <div class="tfa-form-container">\n                <div class="panel-contents">\n                    <div class="panel-content">\n                        <h1 class="twoStepHeader">Login Verification</h1>\n\n                            <p class="check-your-type-text"><strong>Check your email.</strong></p>\n                            <p class="tfa-codeSent-text"><strong>Your security code was sent to: </strong>yannick.xboxone@outlook.com</p>\n\n                        <ul>\n                            <li id="origin-tfa-container" class="origin-control-tip-container">\n<div class="origin-ux-element origin-ux-textbox origin-ux-textbox-web">\n        <label class="origin-ux-textbox-label">\n        Enter code:\n        </label>\n    <span class="origin-ux-textbox-control origin-ux-control">\n        <span>\n            <input type="text" id="twofactorCode"\n                   name="twofactorCode"\n                   value=""\n                   description="" data-description="" placeholder="Enter security code here"  autocorrect="off" autocapitalize="off" autocomplete="off"/>\n        </span>\n    </span>\n    <span class="origin-ux-textbox-status-icon"></span>\n    <span class="origin-ux-textbox-status-message origin-ux-status-message">\n        &nbsp;\n    </span>\n</div>\n    \n                             </li>\n                        </ul>\n\n                        <div style="clear: both">\n                            <a id="resend_code_link" href="/p/web/login?execution=e1332693757s2&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DcyMOpPM8xPVCQ0aRC2VRtHN6G8eXkFnWMF2FL4sWC-4%26response_type%3Dcode%26client_id%3DEASFC-web&_eventId=resend" class="tfa-login-link">Resend security code</a><br>\n                        </div>\n\n                        <div class="panel-action-area">\n<a class=\'origin-ux-element origin-ux-button\n               origin-ux-button-primary \' href="#" id="btnTFAVerify">\n<span><span>Submit Security Code</span></span>\n</a>\n<a class=\'origin-ux-element origin-ux-button origin-ux-button-secondary btn-cancel\' href="#" id="btnCancel">\n<span><span>Cancel</span></span>\n</a>\n    <input type="hidden" name="_eventId" value="submit" id="_eventId"/>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n<div class="footer">\n    <span class="copyright-notice">\xc2\xa9 2014 Electronic Arts Inc. Trademarks belong to their respective owners. All rights reserved.</span>\n    <ul class="footer-navigation">\n            <li class="item-2 even"><a\n                    href="https://www.origin.com/store"\n                    target="_blank"\n                    class="link link-origin "><span>Shop at Origin</span></a>\n            </li><li class="item-3 odd">\n            <a href="https://www.origin.com/legal"\n               target="_blank"\n               class="link link-origin"><span>Legal Notices</span></a>\n        </li><li class="item-4 even">\n            <a href="https://www.origin.com/termsofservice"\n               target="_blank"\n               class="link link-origin"><span>Terms of Services</span></a>\n        </li><li class="item-5 odd">\n            <a href="https://www.origin.com/privacypolicy"\n               target="_blank"\n               class="link link-origin"><span>Privacy Policy</span></a>\n        </li><li class="item-6 even">\n            <a href="http://aboutus.ea.com/" target="_blank"\n               class="link link-origin"><span>Corporate Info</span></a>\n        </li><li class="item-7 odd">\n            <a href="https://www.origin.com/termsofsale"\n               target="_blank"\n               class="link link-origin"><span>EA Terms of Sale</span></a>\n        </li><li class="item-8 even last">\n            <a href="https://help.ea.com/uk" target="_blank"\n               class="link link-origin"><span>Contact Us</span></a>\n        </li>    </ul>\n</div>\n    </form>\n</div>\n\n<div id="form-errors">\n    <span id="form-error-invalid-code">Incorrect code entered</span>\n</div>\n\n\n<!-- ### eanshprdaccounts10.eao.abn-iad.ea.com ### -->\n\n</body>\n</html>\n' (line 165)
2014-12-12 09:49:30,479 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /fifa/api/isUserLoggedIn HTTP/1.1" 200 40 (line 344)
oczkers commented 9 years ago

@Innursery Try now :-) a8eadda59f00f32ba2ea49d96dcb28d1d93bc021

Innursery commented 9 years ago

@oczkers not better for me

2014-12-12 10:14:30,423 [INFO] [requests.packages.urllib3.connectionpool] _new_conn: Starting new HTTP connection (1): www.easports.com (line 171)
2014-12-12 10:14:30,642 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /uk/fifa/football-club/ultimate-team HTTP/1.1" 301 262 (line 344)
2014-12-12 10:14:30,642 [INFO] [requests.packages.urllib3.connectionpool] _new_conn: Starting new HTTPS connection (1): www.easports.com (line 635)
2014-12-12 10:14:31,392 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /uk/fifa/ultimate-team/web-app HTTP/1.1" 302 406 (line 344)
2014-12-12 10:14:31,408 [INFO] [requests.packages.urllib3.connectionpool] _new_conn: Starting new HTTPS connection (1): accounts.ea.com (line 635)
2014-12-12 10:14:31,611 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /connect/auth?response_type=code&client_id=EASFC-web&state=Lh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc&redirect_uri=http%3A%2F%2Fwww.easports.com%2Ffifa%2Flogin_check&locale=en_GB&scope=basic.identity+basic.persona+signin+offline+security.challenge HTTP/1.1" 302 0 (line 344)
2014-12-12 10:14:31,611 [INFO] [requests.packages.urllib3.connectionpool] _new_conn: Starting new HTTPS connection (1): signin.ea.com (line 635)
2014-12-12 10:14:31,845 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /p/web/login?fid=FqvIw2wv25hj85BVaXuxNMTFwz2j7hL HTTP/1.1" 302 0 (line 344)
2014-12-12 10:14:31,908 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /p/web/login?execution=e144050996s1&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web HTTP/1.1" 200 None (line 344)
2014-12-12 10:14:32,048 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "POST /p/web/login?execution=e144050996s1&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web HTTP/1.1" 302 0 (line 344)
2014-12-12 10:14:32,111 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /p/web/login?execution=e144050996s2&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web HTTP/1.1" 200 None (line 344)
2014-12-12 10:14:32,111 [DEBUG] [root] __login__: b'\n<!DOCTYPE html>\n<html lang="en">\n<head>\n    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\n\n    <title>Login Verification</title>\n    <meta name="title" content="Login Verification"/>\n    <meta name="description" content="Input your Two Factor Authentication Code"/>\n    <link rel="shortcut icon" href="/p/favicon.ico"/>\n    <meta name="lc" content="en_GB"/>\n    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>\n    <meta http-equiv="X-UA-Compatible" content="IE=Edge">\n\n<script type="text/javascript">window.EA = {};</script>\n<script type="text/javascript" src="//fonts.ea.com/fbl8bgs.js"></script>\n<script type="text/javascript">(function () {\n    try {\n        Typekit.load();\n    } catch (ex) {\n        var html = document.getElementsByTagName(\'html\')[0];\n        html.className = (html.className || \'\') + \' wf-inactive\'\n    }\n})();</script>\n\n\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery-1.8.3.min.v_1418060428.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery.origin-ux-elements.v_1418060428-min.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery.origin-layout.v_1418060428-min.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/js/jquery.origin-challenge-tfa.v_1418060428-min.js"></script>\n\n<script type="text/javascript">\n    if (!window.challenge_cancel) {\n        window.challenge_cancel = function() {\n            if ($("#btnCancel").length > 0) {\n                $("#btnCancel").trigger("click");\n                return true;\n            } else {\n                return false;\n            }\n        }\n    }\n</script>\n\n<script type="text/javascript">\n    $(document).ready(function() {\n        $.fn.tfa({\n        });\n        $("#twoFactorCode").focus();\n    });\n</script>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/css/origin-ux-elements.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/css/origin-layout.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/css/origin-challenge-tfa.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/css/origin-challenge-tfa.v_1418060428-min.css"/>\n\n<!--  GA -->\n<script type="text/javascript">\n    var _gaq = _gaq || [];\n    _gaq.push([\'_setAccount\', \'UA-38277543-1\']);\n    _gaq.push([\'_setDomainName\', \'.ea.com\']);\n    _gaq.push([\'_trackPageview\']);\n    (function () {\n        var ga = document.createElement(\'script\');\n        ga.type = \'text/javascript\';\n        ga.async = true;\n        ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';\n        var s = document.getElementsByTagName(\'script\')[0];\n        s.parentNode.insertBefore(ga, s);\n    })();\n</script>\n<!-- End of GA -->\n    <!-- Tealium -->\n    <script type="text/javascript">\n        var utag_data = {\n            region: "EMEA",\n            locale: "en_GB",\n            country: "GB",\n            language: "en",\n            userid: "",\n            user_status: "",\n            referring_site: "https://signin.ea.com/p/web/login?execution=e144050996s1&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web",\n            page_name: "https://signin.ea.com/p/web/login"\n        }\n    </script>\n    <script type="text/javascript">\n        (function (a, b, c, d) {\n            a = \'//tags.tiqcdn.com/utag/ea/eadp-web-identity/prod/utag.js\';\n            b = document;\n            c = \'script\';\n            d = b.createElement(c);\n            d.src = a;\n            d.type = \'text/java\' + c;\n            d.async = true;\n            a = b.getElementsByTagName(c)[0];\n            a.parentNode.insertBefore(d, a);\n        })();\n    </script>\n    <!-- End of tealium -->\n\n<script type="text/javascript">\n    $(document).ready(function () {\n        var skin = \'origin\';\n        var bodySelector = $("body");\n        switch (skin) {\n            case "origin":\n                bodySelector.addClass("origin-com");\n                break;\n            case "franchisedark":\n                bodySelector.addClass("ea-franchise").addClass("ea-franchise-dark");\n                break;\n            case "franchiselight":\n                bodySelector.addClass("ea-franchise").addClass("ea-franchise-light");\n                break;\n            case "ea":\n            default:\n                bodySelector.addClass("ea-com");\n                break;\n        }\n    })\n</script>\n\n\n\n</head>\n<body>\n\n\n<div class="loading-container"></div>\n\n<div class="tfa-container">\n    <form method="post" id="challengeForm">\n        <div class="dialog-info">\n            <div id="resend-error-code">\n                <div></div>\n            </div>\n        </div>\n\n<a class="logo-origin" title=""\n   href="https://www.origin.com/store/?no-takeover=true">\n</a>\n\n        <div class="panel" id="panel-tfa">\n            <div class="tfa-form-container">\n                <div class="panel-contents">\n                    <div class="panel-content">\n                        <h1 class="twoStepHeader">Login Verification</h1>\n\n                            <p class="check-your-type-text"><strong>Check your email.</strong></p>\n                            <p class="tfa-codeSent-text"><strong>Your security code was sent to: </strong>yannick.xboxone@outlook.com</p>\n\n                        <ul>\n                            <li id="origin-tfa-container" class="origin-control-tip-container">\n<div class="origin-ux-element origin-ux-textbox origin-ux-textbox-web">\n        <label class="origin-ux-textbox-label">\n        Enter code:\n        </label>\n    <span class="origin-ux-textbox-control origin-ux-control">\n        <span>\n            <input type="text" id="twofactorCode"\n                   name="twofactorCode"\n                   value=""\n                   description="" data-description="" placeholder="Enter security code here"  autocorrect="off" autocapitalize="off" autocomplete="off"/>\n        </span>\n    </span>\n    <span class="origin-ux-textbox-status-icon"></span>\n    <span class="origin-ux-textbox-status-message origin-ux-status-message">\n        &nbsp;\n    </span>\n</div>\n    \n                             </li>\n                        </ul>\n\n                        <div style="clear: both">\n                            <a id="resend_code_link" href="/p/web/login?execution=e144050996s2&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web&_eventId=resend" class="tfa-login-link">Resend security code</a><br>\n                        </div>\n\n                        <div class="panel-action-area">\n<a class=\'origin-ux-element origin-ux-button\n               origin-ux-button-primary \' href="#" id="btnTFAVerify">\n<span><span>Submit Security Code</span></span>\n</a>\n<a class=\'origin-ux-element origin-ux-button origin-ux-button-secondary btn-cancel\' href="#" id="btnCancel">\n<span><span>Cancel</span></span>\n</a>\n    <input type="hidden" name="_eventId" value="submit" id="_eventId"/>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n<div class="footer">\n    <span class="copyright-notice">\xc2\xa9 2014 Electronic Arts Inc. Trademarks belong to their respective owners. All rights reserved.</span>\n    <ul class="footer-navigation">\n            <li class="item-2 even"><a\n                    href="https://www.origin.com/store"\n                    target="_blank"\n                    class="link link-origin "><span>Shop at Origin</span></a>\n            </li><li class="item-3 odd">\n            <a href="https://www.origin.com/legal"\n               target="_blank"\n               class="link link-origin"><span>Legal Notices</span></a>\n        </li><li class="item-4 even">\n            <a href="https://www.origin.com/termsofservice"\n               target="_blank"\n               class="link link-origin"><span>Terms of Services</span></a>\n        </li><li class="item-5 odd">\n            <a href="https://www.origin.com/privacypolicy"\n               target="_blank"\n               class="link link-origin"><span>Privacy Policy</span></a>\n        </li><li class="item-6 even">\n            <a href="http://aboutus.ea.com/" target="_blank"\n               class="link link-origin"><span>Corporate Info</span></a>\n        </li><li class="item-7 odd">\n            <a href="https://www.origin.com/termsofsale"\n               target="_blank"\n               class="link link-origin"><span>EA Terms of Sale</span></a>\n        </li><li class="item-8 even last">\n            <a href="https://help.ea.com/uk" target="_blank"\n               class="link link-origin"><span>Contact Us</span></a>\n        </li>    </ul>\n</div>\n    </form>\n</div>\n\n<div id="form-errors">\n    <span id="form-error-invalid-code">Incorrect code entered</span>\n</div>\n\n\n<!-- ### eanshprdaccounts11.eao.abn-iad.ea.com ### -->\n\n</body>\n</html>\n' (line 165)
2014-12-12 10:14:32,174 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "POST /p/web/login?execution=e144050996s2&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web HTTP/1.1" 302 0 (line 344)
2014-12-12 10:14:32,236 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /p/web/login?execution=e144050996s2&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web HTTP/1.1" 200 None (line 344)
2014-12-12 10:14:32,236 [DEBUG] [root] __login__: b'\n<!DOCTYPE html>\n<html lang="en">\n<head>\n    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\n\n    <title>Login Verification</title>\n    <meta name="title" content="Login Verification"/>\n    <meta name="description" content="Input your Two Factor Authentication Code"/>\n    <link rel="shortcut icon" href="/p/favicon.ico"/>\n    <meta name="lc" content="en_GB"/>\n    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>\n    <meta http-equiv="X-UA-Compatible" content="IE=Edge">\n\n<script type="text/javascript">window.EA = {};</script>\n<script type="text/javascript" src="//fonts.ea.com/fbl8bgs.js"></script>\n<script type="text/javascript">(function () {\n    try {\n        Typekit.load();\n    } catch (ex) {\n        var html = document.getElementsByTagName(\'html\')[0];\n        html.className = (html.className || \'\') + \' wf-inactive\'\n    }\n})();</script>\n\n\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery-1.8.3.min.v_1418060428.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery.origin-ux-elements.v_1418060428-min.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/js/jquery.origin-layout.v_1418060428-min.js"></script>\n    <script type="text/javascript" src="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/js/jquery.origin-challenge-tfa.v_1418060428-min.js"></script>\n\n<script type="text/javascript">\n    if (!window.challenge_cancel) {\n        window.challenge_cancel = function() {\n            if ($("#btnCancel").length > 0) {\n                $("#btnCancel").trigger("click");\n                return true;\n            } else {\n                return false;\n            }\n        }\n    }\n</script>\n\n<script type="text/javascript">\n    $(document).ready(function() {\n        $.fn.tfa({\n        });\n        $("#twoFactorCode").focus();\n    });\n</script>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/css/origin-ux-elements.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/ui/core/css/origin-layout.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/css/origin-challenge-tfa.v_1418060428-min.css"/>\n        <link rel="stylesheet" type="text/css" href="https://eaassets-a.akamaihd.net/signin_ea_com/p/statics/challenge/css/origin-challenge-tfa.v_1418060428-min.css"/>\n\n<!--  GA -->\n<script type="text/javascript">\n    var _gaq = _gaq || [];\n    _gaq.push([\'_setAccount\', \'UA-38277543-1\']);\n    _gaq.push([\'_setDomainName\', \'.ea.com\']);\n    _gaq.push([\'_trackPageview\']);\n    (function () {\n        var ga = document.createElement(\'script\');\n        ga.type = \'text/javascript\';\n        ga.async = true;\n        ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';\n        var s = document.getElementsByTagName(\'script\')[0];\n        s.parentNode.insertBefore(ga, s);\n    })();\n</script>\n<!-- End of GA -->\n    <!-- Tealium -->\n    <script type="text/javascript">\n        var utag_data = {\n            region: "EMEA",\n            locale: "en_GB",\n            country: "GB",\n            language: "en",\n            userid: "",\n            user_status: "",\n            referring_site: "https://signin.ea.com/p/web/login?execution=e144050996s2&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web",\n            page_name: "https://signin.ea.com/p/web/login"\n        }\n    </script>\n    <script type="text/javascript">\n        (function (a, b, c, d) {\n            a = \'//tags.tiqcdn.com/utag/ea/eadp-web-identity/prod/utag.js\';\n            b = document;\n            c = \'script\';\n            d = b.createElement(c);\n            d.src = a;\n            d.type = \'text/java\' + c;\n            d.async = true;\n            a = b.getElementsByTagName(c)[0];\n            a.parentNode.insertBefore(d, a);\n        })();\n    </script>\n    <!-- End of tealium -->\n\n<script type="text/javascript">\n    $(document).ready(function () {\n        var skin = \'origin\';\n        var bodySelector = $("body");\n        switch (skin) {\n            case "origin":\n                bodySelector.addClass("origin-com");\n                break;\n            case "franchisedark":\n                bodySelector.addClass("ea-franchise").addClass("ea-franchise-dark");\n                break;\n            case "franchiselight":\n                bodySelector.addClass("ea-franchise").addClass("ea-franchise-light");\n                break;\n            case "ea":\n            default:\n                bodySelector.addClass("ea-com");\n                break;\n        }\n    })\n</script>\n\n\n\n</head>\n<body>\n\n\n<div class="loading-container"></div>\n\n<div class="tfa-container">\n    <form method="post" id="challengeForm">\n        <div class="dialog-info">\n            <div id="resend-error-code">\n                <div></div>\n            </div>\n        </div>\n\n<a class="logo-origin" title=""\n   href="https://www.origin.com/store/?no-takeover=true">\n</a>\n\n        <div class="panel" id="panel-tfa">\n            <div class="tfa-form-container">\n                <div class="panel-contents">\n                    <div class="panel-content">\n                        <h1 class="twoStepHeader">Login Verification</h1>\n\n                            <p class="check-your-type-text"><strong>Check your email.</strong></p>\n                            <p class="tfa-codeSent-text"><strong>Your security code was sent to: </strong>yannick.xboxone@outlook.com</p>\n\n                        <ul>\n                            <li id="origin-tfa-container" class="origin-control-tip-container">\n<div class="origin-ux-element origin-ux-textbox origin-ux-textbox-web field-error">\n        <label class="origin-ux-textbox-label">\n        Enter code:\n        </label>\n    <span class="origin-ux-textbox-control origin-ux-control">\n        <span>\n            <input type="text" id="twofactorCode"\n                   name="twofactorCode"\n                   value=""\n                   description="" data-description="" placeholder="Enter security code here"  autocorrect="off" autocapitalize="off" autocomplete="off"/>\n        </span>\n    </span>\n    <span class="origin-ux-textbox-status-icon"></span>\n    <span class="origin-ux-textbox-status-message origin-ux-status-message">\n        Incorrect code entered\n    </span>\n</div>\n    \n                             </li>\n                        </ul>\n\n                        <div style="clear: both">\n                            <a id="resend_code_link" href="/p/web/login?execution=e144050996s2&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%2Bsecurity.challenge%26redirect_uri%3Dhttp%253A%252F%252Fwww.easports.com%252Ffifa%252Flogin_check%26locale%3Den_GB%26state%3DLh1HAOPpS_YOuU4iVNb3R6PsEGO3KnOXtG__9BoL8zc%26response_type%3Dcode%26client_id%3DEASFC-web&_eventId=resend" class="tfa-login-link">Resend security code</a><br>\n                        </div>\n\n                        <div class="panel-action-area">\n<a class=\'origin-ux-element origin-ux-button\n               origin-ux-button-primary \' href="#" id="btnTFAVerify">\n<span><span>Submit Security Code</span></span>\n</a>\n<a class=\'origin-ux-element origin-ux-button origin-ux-button-secondary btn-cancel\' href="#" id="btnCancel">\n<span><span>Cancel</span></span>\n</a>\n    <input type="hidden" name="_eventId" value="submit" id="_eventId"/>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n<div class="footer">\n    <span class="copyright-notice">\xc2\xa9 2014 Electronic Arts Inc. Trademarks belong to their respective owners. All rights reserved.</span>\n    <ul class="footer-navigation">\n            <li class="item-2 even"><a\n                    href="https://www.origin.com/store"\n                    target="_blank"\n                    class="link link-origin "><span>Shop at Origin</span></a>\n            </li><li class="item-3 odd">\n            <a href="https://www.origin.com/legal"\n               target="_blank"\n               class="link link-origin"><span>Legal Notices</span></a>\n        </li><li class="item-4 even">\n            <a href="https://www.origin.com/termsofservice"\n               target="_blank"\n               class="link link-origin"><span>Terms of Services</span></a>\n        </li><li class="item-5 odd">\n            <a href="https://www.origin.com/privacypolicy"\n               target="_blank"\n               class="link link-origin"><span>Privacy Policy</span></a>\n        </li><li class="item-6 even">\n            <a href="http://aboutus.ea.com/" target="_blank"\n               class="link link-origin"><span>Corporate Info</span></a>\n        </li><li class="item-7 odd">\n            <a href="https://www.origin.com/termsofsale"\n               target="_blank"\n               class="link link-origin"><span>EA Terms of Sale</span></a>\n        </li><li class="item-8 even last">\n            <a href="https://help.ea.com/uk" target="_blank"\n               class="link link-origin"><span>Contact Us</span></a>\n        </li>    </ul>\n</div>\n    </form>\n</div>\n\n<div id="form-errors">\n    <span id="form-error-invalid-code">Incorrect code entered</span>\n</div>\n\n\n<!-- ### eanshprdaccounts11.eao.abn-iad.ea.com ### -->\n\n</body>\n</html>\n' (line 181)
2014-12-12 10:14:32,767 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "GET /fifa/api/isUserLoggedIn HTTP/1.1" 200 40 (line 344)
oczkers commented 9 years ago

@Innursery It's worked correct now but "Incorrect code entered" appeared.

LUFCMOT commented 9 years ago

@oczkers I am sending the code to (s3)

https://signin.ea.com/p/web/login?execution=e279030983s3&initref=https://accounts.ea.com:443/connect/auth?scope=basic.identity+basic.persona+signin+offline+security.challenge&redirect_uri=http%3A%2F%2Fwww.easports.com%2Ffifa%2Flogin_check&locale=en_US&state=ii6eMmZdi2IxVeGx8jKEPOLFql0mEVioU-hvDviXjvw&response_type=code&client_id=EASFC-web

but I just get a 400 error Bad request.

oczkers commented 9 years ago

@LUFCMOT I might be wrong and it's s2 but hard to say whats wrong with your request if you don't attach headers etc. How about referer?

EDIT: it's dynamic url, for example e279030983 is changing on every login

LUFCMOT commented 9 years ago

$url = "https://signin.ea.com/p/web/login?execution=e279030983s3&initref=https://accounts.ea.com:443/connect/auth?scope=basic.identity+basic.persona+signin+offline+security.challenge&redirect_uri=http%3A%2F%2Fwww.easports.com%2Ffifa%2Flogin_check&locale=en_US&state=ii6eMmZdi2IxVeGx8jKEPOLFql0mEVioU-hvDviXjvw&response_type=code&client_id=EASFC-web";

private function Verify($url) { $request = $this->_client->post($url, array(), array( "twoFactorCode" => "84725048", "_trustThisDevice" => "on", "trustThisDevice" => "on", "_eventId" => "submit"
)); $response = $request->send(); }

Innursery commented 9 years ago

@oczkers

Yes I see but all try I put the right code

I use python 3.x

DiCoco commented 9 years ago

Same here

ricklhp7 commented 9 years ago

I was getting this problem, but now I believe I found out what was happening.

Only in the first time I needed to log in the webapp. I believe is was necessary to activate something in the account.

Next time I asked for another code and the script worked like a charm. I'm using cookies and restarted the script, its still working with a random code.

If someone is getting this invalid code error, try it. I used an anonymous google chrome tab to login in the first time and to ask for a new code in the second time, but in the second time we don't log in the browser again.

Innursery commented 9 years ago

@ricklhp7 not working for me

ricklhp7 commented 9 years ago

Maybe I wasn't clear in last post, so I'll try to explain (sorry for my english):

First of all, part of my code:

fut = fut.Core(username, passw, answer_question, platform='xbox', code = code_ea, cookies=cokkies_username)

where: username is my email passw is my password question is the answer of the secret question code_ea is the pin we ask.

1) Open an anonymous google chrome tab and goes to webapp (http://www.ea.com/soccer/fifa-ultimate-team)

2) login, ask the code by email... Them unmark "Remember this computer/device" and use the code there. Actually we don't need to unmark that, but its easy to logou and login again, because we want them asking the code again.

3) Answer the Security Question and wait to login in your account.

4) Sign Out.

5) Go again to (http://www.ea.com/soccer/fifa-ultimate-team .

6) Just enter your email and password and click and login. Them will send a new code in your email. Don't login in the browser again, if you do this, you will need a new code. Just use this pin in your python file, it should work.

I had this problem and after I did that it worked. It worked in all my 5 accounts.

ricklhp7 commented 9 years ago

I forgot to say I'm using the code as string, because often the code starts with 0.

oczkers commented 9 years ago

@Innursery This html page was send to you after posting email code https://gist.github.com/oczkers/a575c21a0c15514a32f3 (use http://htmledit.squarefree.com/ to read to easly)

What code did you used and where did you get it?

@ricklhp7 You're talking about first login per ip or browserid? Could you upload logs (like Innursery)?

EDIT: code starting with 0 might be a reason, try using string instead

@tmontana3x Yes, i was testing and it works for me and at least one other guy. If your code is starting with 0, try using passing it as a string:

fut.Core("login", "password", "secret_password", code="0123")
tmontana3x commented 9 years ago

@oczkers I use Python 3.4.2 now with the newest commits code (i just followed the link to the newest commit and downloaded the whole ZIP again...?)

I am doing import fut fut = fut.Core('email', 'pw', 'secretanswer', platform='pc', debug=True) and getting fut.exceptions.FutError: Error during login process - code is required.

so i go to my email get the code and doing:

fut = fut.Core('email', 'pw', 'secretanswer', platform='pc', debug=True, code='123456')

unfortunately the result is:

Traceback (most recent call last): File "<pyshell#3>", line 1, in fut = fut.Core('myemail', 'mypw', 'mysecretanswer', platform='pc', debug=True, code='123456') File "D:\Python34\lib\site-packages\fut-0.0.20-py3.4.egg\fut\core.py", line 106, in init self.login(email, passwd, secret_answer, platform, code, emulate) File "D:\Python34\lib\site-packages\fut-0.0.20-py3.4.egg\fut\core.py", line 181, in login if 'Incorrect code entered' in rc: TypeError: Type str doesn't support the buffer API

then i get a new email with same code

Innursery commented 9 years ago

@oczkers I use the code from origin in my email when I use the same code on the web it works.

I have the same setup as @tmontana3x (same python version) but i don't use string for the code. but I get the same result, put my code, get the response I send before, and get a new emailed code.

@ricklhp7 I retry your method but no change

christrato commented 9 years ago

@oczkers if i post the CODE in the "s3" url like this: https://signin.ea.com/p/web/login?execution=e279030983s3&initref=https://accounts.ea.com:443/connect/auth?scope=basic.identity+basic.persona+signin+offline+security.challenge&redirect_uri=http%3A%2F%2Fwww.easports.com%2Ffifa%2Flogin_check&locale=en_US&state=ii6eMmZdi2IxVeGx8jKEPOLFql0mEVioU-hvDviXjvw&response_type=code&client_id=EASFC-web

the server return error 505: java.io.IOException: Server returned HTTP response code: 505 for URL: https://accounts.ea.com:443/connect/auth?scope=basic.identity basic.persona signin offline security.challenge

with Firebug i see that the webapp POST the code at the "s2" url.

christrato commented 9 years ago

ok... sorry... i was using this parameter: "twofactorCode" but the right one is "twoFactorCode".

now the login and the security code request works correctly.

ps: i post the code to the "s2" url.

oczkers commented 9 years ago

@tmontana3x python3 fixed 936eefbe3a2422c36e12c14645fc2699190d1290

@christrato You'r right, it's s2.

@Innursery Ok guys, i know the reason now - you're posting wrong code, it was generated for specific browser id (session, instance) and every time you make clean start (without cookies.txt) new code is generated.

In short you have to use backup codes (for first launch only).

Innursery commented 9 years ago

@oczkers yes you right, it works thanks again for your great support

tmontana3x commented 9 years ago

@oczkers Thanks it works...Great work !!! debugger brings a lot of red text but in the end i seem to be logged in.

Would your recommend using the cookies.txt?

Bidding works now without permission denied :) Thanks again ! Great Job!

oczkers commented 9 years ago

@tmontana3x What red text are you talking about?

tmontana3x commented 9 years ago

@oczkers i dont have it anymore. i can now login without code.... for whatever reason...

oczkers commented 9 years ago

I don't know what red text are you talking about but if you use cookies.txt code is required on first login and once every 90 days

ricklhp7 commented 9 years ago

My scripts are going down all the time. I have made one account today and its working fine for about 2 hours, I need more time to know if its really fine.

Maybe my old accounts are flagged, but they were working fine before this validation. Anyone with problems?

Other thing: I see there is no validation code for mobile app, I'm thinking about testing it if my bots don't get to work fine again.

oczkers commented 9 years ago

Writing that it's "going down" is pointless you should post logs or at least error message because it could be for example just connection problem

ricklhp7 commented 9 years ago

I know, I just want to know if its happening to everybody.

I turned debug on and restarted my bots, I'll post the logs soon.

ricklhp7 commented 9 years ago

Seeing my logs, its just a expired session, but it was ok before this validation thing.

I put 3 accounts to work together in the same vps I was using before, they don't go down in the same time. I can login in the account again, but sometimes EA asks for the pin again, even if I'm using cookies. But if I wait about one hours, I can login again without the pin. I believe they are changing something in the page that we need to request the pin. I will post logs of this soon, I'm looking for them in my archieve.

So I'll just post the log of my expired session, there is 3 logs of this problem here. My bot closes after this, but its my option, I tell my script to close for general exceptions, like that. Idk if they would work after this, I believe not, I'll try again later.

1st

2014-12-15 15:02:41,836 [DEBUG] [root] request: request: https://utas.fut.ea.com:443/ut/game/fifa/transfermarket args=(); kwargs={'params': {'maxb': 60000, 'start': 0, 'num': 1, 'type': 'player', 'maskedDefId': yyyyyy}} (line 310)

2014-12-15 15:02:41,841 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "POST /ut/game/fifa/transfermarket?maxb=600&start=0&num=1&type=player&maskedDefId=184431 HTTP/1.1" 200 70 (line 362)

2014-12-15 15:02:41,841 [DEBUG] [root] request: response: {"message":null,"reason":"expired session","code":401} (line 312)

2nd

2014-12-15 15:07:43,499 [DEBUG] [root] request: request: https://utas.fut.ea.com:443/ut/game/fifa/transfermarket args=(); kwargs={'params': {'maxb': 55000, 'start': 0, 'num': 1, 'type': 'player', 'maskedDefId': zzzzzz}} (line 310)

2014-12-15 15:07:43,512 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "POST /ut/game/fifa/transfermarket?maxb=550&start=0&num=1&type=player&maskedDefId=184575 HTTP/1.1" 200 70 (line 362)

2014-12-15 15:07:43,513 [DEBUG] [root] request: response: {"message":null,"reason":"expired session","code":401}

3rd - This one is a little different, because I got an Internal Server Error before, but I have an exception for it, so the bot won't close for this reason. It just will try to do the same thing he was trying before the Internal Server Error. And yes, I care about rpm, thats not the problem for sure. The gap between these two requests was short because I had some auction close to the end, I didn't change my bot, only upgraded the toolkit to use cookies and to use this new security code. Everything was 100% fine until last week. 2014-12-15 18:27:57,157 [DEBUG] [root] request: request: https://utas.fut.ea.com:443/ut/game/fifa/watchlist args=(); kwargs={} (line 310)

2014-12-15 18:27:57,172 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "POST /ut/game/fifa/watchlist HTTP/1.1" 200 86 (line 362)

2014-12-15 18:27:57,172 [DEBUG] [root] request: response: {"debug":"","string":"Internal Server Error (ut)","reason":"","code":"500"} (line 312)

2014-12-15 18:27:57,172 [DEBUG] [root] request: request: https://utas.fut.ea.com:443/ut/game/fifa/watchlist args=(); kwargs={} (line 310)

2014-12-15 18:27:57,177 [DEBUG] [requests.packages.urllib3.connectionpool] _make_request: "POST /ut/game/fifa/watchlist HTTP/1.1" 200 70 (line 362)

2014-12-15 18:27:57,177 [DEBUG] [root] request: response: {"message":null,"reason":"expired session","code":401} (line 312)

ricklhp7 commented 9 years ago

I realize that I cannot login again in some accounts, even if I wait hours, like a said before. I didn't know, but my scripts were running doing nothing! I will delete all cookies and use new pins. Sorryfor this mistake, I don't know why it happened.

So I believe my only problem is that I'm just getting disconnected too much...

Dinana, thanks for the reference. I'm going to check.

oczkers commented 9 years ago

It's always good idea to look at one request/response before you got expired session - there could be something "weird" that makes your session expired.

ricklhp7 commented 9 years ago

I have an account that only check prices of a list of players, and this account has the same problem. This account doesn't buy, doesn't sell, just check prices like some sites does.

I'm seeing there are normal users with temporaries bans, like my accounts.

Now I'm trying to run the script for 20 minutes only, they are restarting after 15 minutes. I'll see if it helps.