Alex-Rose / fb-messenger-cli

fb-messenger-cli, console Facebook messenger
759 stars 99 forks source link

Unable to login with Facebook 2FA enabled. #119

Open dawoodjee opened 6 years ago

dawoodjee commented 6 years ago
Facebook credentials:
Email: *****@gmail.com
Password: *********
Attempting login...
ErrorUtils caught an error: "<![EX[["JS loading error [%s] at %s | time: %s | retries: %s | concurrency: %...". Subsequent errors won't be logged; see https://fburl.com/debugjs.

  https://static.xx.fbcdn.net/rsrc.php/v3/yz/r/3nDx_KsvH0H.js:46 in J
Warning: Errors caught in return data
Login verification failed: Error: Invalid phantomJS data
Facebook credentials:
Email: ****@gmail.com
Password: **********
Attempting login...
ErrorUtils caught an error: "<![EX[["JS loading error [%s] at %s | time: %s | retries: %s | concurrency: %...". Subsequent errors won't be logged; see https://fburl.com/debugjs.

  https://static.xx.fbcdn.net/rsrc.php/v3/yz/r/3nDx_KsvH0H.js:46 in J
gcordalis commented 6 years ago

Looks the same as what I get - To get around this I've had to disable 2FA, login, then re-enable 2FA. I rinse and repeat each time I'm logged out.

snwfog commented 6 years ago

My fb account was hacked trying out this cli, strange coincidence...

SamBergeron commented 6 years ago

@snwfog Feel free to look at the code and realise that we don't actually do anything with your credentials besides login you in and encrypting them to disk. There are no external APIs called. But I'm sure you already knew that.

AlmostNever commented 6 years ago

I am getting an identical error when putting in correct credentials, and I don't have 2FA enabled so I can't disable it.

gcordalis commented 6 years ago

I get that error every time. When 2FA is disabled it prints the same error and then after a bit it will return a response and load my conversations.

I usually quit the tool and relaunch after this to have a smooth experience. The downside I'm facing at the moment is the saved credentials only last 24 hours - at which point my conversations don't automatically refresh.

ghost commented 6 years ago
ErrorUtils caught an error: "<![EX[["JS loading error [%s] at %s | time: %s | retries: %s | concurrency: %...". Subsequent errors won't be logged; see https://fburl.com/debugjs.

  https://static.xx.fbcdn.net/rsrc.php/v3/y2/r/tzllnL-BMiZ.js:46 in J
{"fb_dtsg":"AQGREFAn4tH9:AQHbvUiaRkfu","c_user":"100006820051151","cookie":"presence=EDvF3EtimeF1509449664EuserFA21B06820051151A2EstateFDutF1509449664535CEchFDp_5f1B06820051151F3CC; wd=400x300; xs=5%3ABzjEfXh-6MIsbQ%3A2%3A1509449656%3A2820%3A6164; c_user=100006820051151; sb=uF_4Wf0A1pEUPcOfpLTg9aPu; datr=t1_4WcHUtEond6XiveNN4Ad_"}
Warning: Errors caught in return data
fs.js:642
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/fb-messenger-cli/.kryptonite'
    at Error (native)
    at Object.fs.openSync (fs.js:642:18)
    at Object.fs.writeFileSync (fs.js:1348:33)
    at Crypt.save (/usr/local/lib/node_modules/fb-messenger-cli/scripts/crypt.js:38:8)
    at Socket.login.run_cmd.err2 (/usr/local/lib/node_modules/fb-messenger-cli/scripts/login.js:46:13)
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

I have been facing them same problem. I don't have 2FA enabled. Do you have any solution?

SamBergeron commented 6 years ago

@danhvophuong You're problem is different, you're getting access denied on your first run. Run it as root (sudo) for the first time and then you should be fine.

SamBergeron commented 6 years ago

@gcordalis You can change the time that your login is saved in the ".settings" file. It defaults to 12hrs actually.

Were currently working on a way to make this work with 2FA. But the errors returned by phantomJS are pretty illegible, so there's no reason to keep posting them. I've updated the name of the issue accordingly.

gcordalis commented 6 years ago

@SamBergeron Fantastic! This solves my main complaint 👍

ghost commented 6 years ago

@SamBergeron I still cannot login. I faced another problem

ErrorUtils caught an error: "<![EX[["JS loading error [%s] at %s | time: %s | retries: %s | concurrency: %...". Subsequent errors won't be logged; see https://fburl.com/debugjs.

https://static.xx.fbcdn.net/rsrc.php/v3/yz/r/G_RBWp7Tw3h.js:46 in J
Warning: Errors caught in return data
Login verification failed: Error: Invalid phantomJS data
claritise commented 6 years ago

Getting the same error as @danhvophuong :( run as sudo and no 2fa

EDIT: Also downgraded to npm@4 nothing works.

jmbeach commented 6 years ago

I can get this Pidgin facebook messenger extension to work by using an app password. App passwords aren't working for fb-messenger-cli though.

2E0PGS commented 6 years ago

Yes @jmbeach app passwords are a good idea for this usage case. I suspect Facebook API has a separate call for using app password over normal password.

CrowderSoup commented 6 years ago

Just wanted to chime in that I'm seeing the error with 2FA as well. Thanks for all your work @SamBergeron! I'll keep checking back.

OvaisAli commented 6 years ago

The first error my console is showing is: ErrorUtils caught an error: "<![EX[["Tried to listen to element of type %s from %s: %s","click","Error","C...". Subsequent errors won't be logged; see https://fburl.com/debugjs.

And two more are: Refused to display 'https://web.facebook.com/xti.php?xt=AZUzGSt1jJurSLcpLVc-HLz62jAuQ6yUBV1x2HPi7WvaeaYMUUDRhxsO_sJ0d1MXOPks7sDYgfHHZmFS2csRptujieEUlwgF_0Qh4MZIBgXDPJ4KglgOUnKxZoeiBFgBGRyvmNVa5AYNm-EDvt62x9fUDswuB37doyeMiLaZbL4r04nw7wWN5BL8Mxsu8Z8YkkqB1NhM80-IZEwHX6cJwgu9SFXEqhc0-wgMXxJag6S9vCMaHTsWbPBWac0o-5SWcwuVVRelAqHgw3zxKXd2MJeb_ak1S4EmvQledTCqKYrXtARcKzl4xlZ7qIJ6SRhEweZZXVMj6XseeQwadq_oRA8znunczL9Xu1YA3r1E7zCPc3W2uUq1ZpgCG54dVLQ7j2meh3VIcTaThXpAsK3-9dqjvvmQfXpvMdki_iIYggcpe4njJJE8WkOSo930OWpVw5licRTDUyyvOboLBhazmrj71sQbAfgZCXo-XXlco4CVo3EkByNf4rHfDYsdzixGGy84VDf9U53byKr4htcELMoYQUoV2qZMhgMGxxbIWRyNZ4kmC-Cb1X5fk3zB-jz2vA0Kl2D4YdajCUxXwDeEAh3f7LhkbBcXyBTDkij7ytdzj5ZfHQaAtkgiDlnb3SKZiGw_Fc19epJNr77hVlrkcTT3ZIHxdGjQhyFoTyBPAGgE7GWeYjYp2Q1N_nteSwvvtqrTzQ4agu7tIfzLOOeB1GuyQTWcO5kzGekeiFqBeR6cktG-3lkqDoR-RWU0cYG346AXqFZ7JXSJCWj4fNRpZuaey2AoHBsJ5FwNJBTX3YEVLUv5aInJfUZ4xEEgCZw7WV3_H5ozXG9nhzUUuG5ESJ1V7TCKmiTl64KtttlkoQdeoQ&isv=1&cts=1532351568&csp&hba=false&etid=1532351568436_853102754' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Refused to display 'https://web.facebook.com/xti.php?xt=AZUzGSt1jJurSLcpLVc-HLz62jAuQ6yUBV1x2HPi7WvaeaYMUUDRhxsO_sJ0d1MXOPks7sDYgfHHZmFS2csRptujieEUlwgF_0Qh4MZIBgXDPJ4KglgOUnKxZoeiBFgBGRyvmNVa5AYNm-EDvt62x9fUDswuB37doyeMiLaZbL4r04nw7wWN5BL8Mxsu8Z8YkkqB1NhM80-IZEwHX6cJwgu9SFXEqhc0-wgMXxJag6S9vCMaHTsWbPBWac0o-5SWcwuVVRelAqHgw3zxKXd2MJeb_ak1S4EmvQledTCqKYrXtARcKzl4xlZ7qIJ6SRhEweZZXVMj6XseeQwadq_oRA8znunczL9Xu1YA3r1E7zCPc3W2uUq1ZpgCG54dVLQ7j2meh3VIcTaThXpAsK3-9dqjvvmQfXpvMdki_iIYggcpe4njJJE8WkOSo930OWpVw5licRTDUyyvOboLBhazmrj71sQbAfgZCXo-XXlco4CVo3EkByNf4rHfDYsdzixGGy84VDf9U53byKr4htcELMoYQUoV2qZMhgMGxxbIWRyNZ4kmC-Cb1X5fk3zB-jz2vA0Kl2D4YdajCUxXwDeEAh3f7LhkbBcXyBTDkij7ytdzj5ZfHQaAtkgiDlnb3SKZiGw_Fc19epJNr77hVlrkcTT3ZIHxdGjQhyFoTyBPAGgE7GWeYjYp2Q1N_nteSwvvtqrTzQ4agu7tIfzLOOeB1GuyQTWcO5kzGekeiFqBeR6cktG-3lkqDoR-RWU0cYG346AXqFZ7JXSJCWj4fNRpZuaey2AoHBsJ5FwNJBTX3YEVLUv5aInJfUZ4xEEgCZw7WV3_H5ozXG9nhzUUuG5ESJ1V7TCKmiTl64KtttlkoQdeoQ&isv=1&cts=1532351568&csp&hba=false&etid=1532351568436_853102754' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

What will be the solution @SamBergeron ?

rovinbhandari commented 6 years ago

Were currently working on a way to make this work with 2FA.

@SamBergeron any update?

people-can-fly commented 5 years ago

just coping @rovinbhandari +1 for the request

Were currently working on a way to make this work with 2FA.

@SamBergeron any update?

kubukoz commented 5 years ago

I looked at the sources and it looked like 2FA is (at least kind of) supported. Last commit was 4 months ago, but there hasn't been a release for 8 months. If that functionality is now working, can we have a release? Thanks.

SamBergeron commented 5 years ago

Hi! I've been away for a while but I published a new version on npm (version 2.1.0) which addresses a couple login issues. This thread is a bit of a shit show of different issues, but as far as 2FA goes, we don't fully support it yet the core of it is there, but it requires a bit of work because there are multiples different types of 2FA with fb. Currently the only solution is to set a really high timeout for the application to wait for the user to complete 2FA (this works if you receive a text message for example). If you have any of the other 2FA method, we try to open a browser window where you can manually complete it, before the app finishes the process... this doesn't quite work right now, mainly because if you use a machine with no visual, we can't physically open the browser. As you can see this isn't my main priority, but anyone that wants to help out can take a look at the code, it's all in lib/login.js :pray: Sorry for the inconvenience

nagylilla96 commented 4 years ago

Hey! What browser does 2FA work with automatically? First, I changed the field twoFactorAuth to true, but then it doesn't open the browser. Should I install a browser specifically? I am using cmd.exe in Admin mode on a Windows 10.