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

Failed to log in #171

Open
brokenhero000 opened this issue Feb 25, 2021 · 18 comments
Open

Failed to log in #171

brokenhero000 opened this issue Feb 25, 2021 · 18 comments

Comments

@brokenhero000
Copy link

brokenhero000 commented Feb 25, 2021

I have installed messer and it seems to work fine, but, whenever I type in my credentials, an error is returned, stating "Failed to login: Wrong username/password." Even though I have copy-pasted my credentials and then double-checked several times whether they are correct or not, my credentials are 100% correct. And yet, I get an error stating that my username/password is wrong.
I don't know if this is going to help, but I'll place my versions here

  • npm -v 7.5.2
  • node -v v12.20.2
  • messer -v 0.7.3

Oh also, my OS is Kali Linux
Any ideas what I could be doing wrong?

Error:
Failed to login: Wrong username/password.

@isene
Copy link

isene commented Feb 25, 2021

Just installed messer, get the same. I have verified in several ways that my credentials are correct, but still get "Failed to login: Wrong username/password".

  • npm -v 7.5.6
  • node -v 10.19.0
  • messer -v 0.7.3

@jimrs
Copy link

jimrs commented Feb 25, 2021

Same, just installed on macOS Mojave 10.14.6.

  • npm -v 7.0.10
  • node -v 15.2.1
  • messer -v 0.7.3

@MarouenTouati
Copy link

Same problem for me, It doesn't seem to work anymore :'(

@samueldy
Copy link

Same for me; just reinstalled Messer with these versions:

  • npm -v 6.14.11
  • node -v v15.10.0
  • npx messer -v 0.7.3

@ghost
Copy link

ghost commented Mar 3, 2021

For those wondering, it is an issue with the facebook-chat-api that this app uses. They have not made a new login function, but i think they have found a workaround at the original issue on that repo.

@jimrs
Copy link

jimrs commented Mar 10, 2021

For those wondering, it is an issue with the facebook-chat-api that this app uses. They have not made a new login function, but i think they have found a workaround at the original issue on that repo.

Thank you for the info, but in the link you provided I see a lot of text and maybe underneath all that a very complicated solution.

Will someone be able to write up a detailed guide for those of us less technically able? I'm sure I wouldn't be the only one who would be very grateful.

@voidfemme
Copy link

I'm having the exact same issue.
npm -v 7.8.0
node -v v15.13.0
npx messer -v 0.7.3

@Timbological
Copy link

Timbological commented Apr 4, 2021

I managed to get it work by getting the appstate.json with a different user Agent like in this issue.

The steps were:

  1. Save this as getappstate.js:
const fs = require("fs");
const login = require("facebook-chat-api");

var credentials = {email: "[EMAIL]", password: "[PASSWORD]"};

login(credentials, { forceLogin: true, logLevel: /^win/.test(process.platform) ? 'verbose' : 'warn', listenEvents: true, selfListen: true, updatePresence: true, autoMarkDelivery: true, autoMarkRead: true, userAgent: 'Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Mobile Safari/537.36' }, (err, api) => {
    if(err) return console.error(err);

    fs.writeFileSync('appstate.json', JSON.stringify(api.getAppState()));
});

replacing [EMAIL] and [PASSWORD] with your facebook email and password

  1. run node getappstate.js (you may have to npm install facebook-chat-api as well)
  2. appstate.json should appear in same directory as getappstate.js, copy appstate.json to .messer/tmp/
  3. You should be able to start messer successfully

Unfortunately I have been locked out of facebook twice since using this workaround and had to change my password, not sure if there is a way around that.

Hope this helps.

@samueldy
Copy link

Can also confirm that this workaround allows Messer to start (I get the "Successfully logged in as <my_name>" message), but cannot actually user Messer. I was able to run the recent command and see my five most recent threads, but could not list any history with the history command. I was then locked out of my account and had to do account recovery.

@Nemesis77swe
Copy link

.. still the same issue, is this now an abandonware?

@tomquirk
Copy link
Collaborator

I'll look into this today.

Keep in mind that this is an open source project. @Timbological looks like they came up with a fix (#171 (comment)) - anyone is able to create a PR that implements this 🤷

@tomquirk
Copy link
Collaborator

It turns out that this probably isn't fixable. There appears to be a bunch of upstream issues with https://github.com/Schmavery/facebook-chat-api which I don't have the time/energy to investigate further.

If anyone is willing and able to provide fixes, I'll happily review and merge them 👋

@ghost
Copy link

ghost commented May 26, 2021

Schmavery/facebook-chat-api#870 (comment)

This comment here provids a script that should help some of you get around the issue.

Also, there is another repo that is less featurerich, that is being maintained that was mentioned in one of the threads of the upstream API: https://github.com/makiprogrammer/ts-messenger-api

@0anubis0
Copy link

The following have worked for me:

  1. download https://github.com/shellmage/AAAAAAAAAAAAA/blob/main/getAppstate.js
  2. modify email and password parameter
  3. instert the highlighted code into there: (a new popup to accept privacy what wasnt handled)
    const navigationPromise = page.waitForNavigation({waitUntil: 'networkidle0'});
    await page.click('button[data-testid="cookie-policy-dialog-accept-button"]');
    await page.goto('https://www.facebook.com/');
  4. node getAppstate.js
    (probably you have to "npm install puppeteer"
  5. appstate.json should appear in same directory as getappstate.js, copy appstate.json to .messer/tmp/
    (if the directory doesn't exist, create it)
  6. run messer, have fun

Thank you for the comments, helped a lot to solve the problem.

@isene
Copy link

isene commented Dec 1, 2021

The following have worked for me:

  1. download https://github.com/shellmage/AAAAAAAAAAAAA/blob/main/getAppstate.js
  2. modify email and password parameter
  3. instert the highlighted code into there: (a new popup to accept privacy what wasnt handled)
    const navigationPromise = page.waitForNavigation({waitUntil: 'networkidle0'});
    await page.click('button[data-testid="cookie-policy-dialog-accept-button"]');
    await page.goto('https://www.facebook.com/');
  4. node getAppstate.js
    (probably you have to "npm install puppeteer"
  5. appstate.json should appear in same directory as getappstate.js, copy appstate.json to .messer/tmp/
    (if the directory doesn't exist, create it)
  6. run messer, have fun

Thank you for the comments, helped a lot to solve the problem.

With this procedure I get this:

(node:1622313) UnhandledPromiseRejectionWarning: Error: No node found for selector: button[data-testid="cookie-policy-dialog-accept-button"]
at assert (/home/geir/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:26:15)
at DOMWorld.click (/home/geir/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:285:32)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1622313) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1622313) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@junreyvi69
Copy link

The following have worked for me:

  1. download https://github.com/shellmage/AAAAAAAAAAAAA/blob/main/getAppstate.js
  2. modify email and password parameter
  3. instert the highlighted code into there: (a new popup to accept privacy what wasnt handled)
    const navigationPromise = page.waitForNavigation({waitUntil: 'networkidle0'});
    await page.click('button[data-testid="cookie-policy-dialog-accept-button"]');
    await page.goto('https://www.facebook.com/');
  4. node getAppstate.js
    (probably you have to "npm install puppeteer"
  5. appstate.json should appear in same directory as getappstate.js, copy appstate.json to .messer/tmp/
    (if the directory doesn't exist, create it)
  6. run messer, have fun

Thank you for the comments, helped a lot to solve the problem.

Worked for me, except I didn't insert
await page.click('button[data-testid="cookie-policy-dialog-accept-button"]');
and I had to login first via browser to verify the new browser.

NOTE: You need run node getAppstate.js multiple times until you get a notification on facebook for verification/authentication of the new browser.

@jimrs
Copy link

jimrs commented Dec 1, 2022

how can i unsubscribe from this blog?

@0xAl3xH
Copy link

0xAl3xH commented Sep 20, 2023

Following up on the legacy discussion I've been able to get this to work with the following:

  1. copy the code below and name it getAppstate.js
const fs = require("fs");
const puppeteer = require("puppeteer");

const email = '';
const password = '';

(async () => {
  const browser = await puppeteer.launch({headless:false});
  const page = await browser.newPage()
  const navigationPromise = page.waitForNavigation({waitUntil: 'networkidle0'});

  await page.goto('https://www.facebook.com/');

  await page.waitForSelector('#email');
  await page.type('#email', email);
  await page.type('#pass', password);
  await page.click('button[name="login"]');

  await new Promise(r => setTimeout(r, 10000));

  cookies = await page.cookies();
  cookies = cookies.map(({name: key, ...rest}) => ({key, ...rest}));
  fs.writeFileSync('appstate.json', JSON.stringify(cookies));

  await browser.close();
})();

This differs from similar scripts others have posted in that it opens up the sign in page in your browser and you manually click login. Some of the CSS selectors from the scripts before are out of date so this should be a more future-proof way to run this script. Make sure to click login within 10 seconds of the page opening up, if you need more time, feel free to modify setTimeout(r, 10000). You probably don't need a majority of the script above since puppeteer is not running headless but I'm too lazy to experiment.
2. mkdir -p ~/.messer/tmp
3. cp appstate.json ~/.messer/tmp
4. good to run messer

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

No branches or pull requests