Rettiwt-API: Failed to authenticate using the given account Credentials

facing this issue when creating an api key. I had a working API key before but it suddenly stopped working, when I checked the account it was suspended so I created a new fresh account but I still got the same issue, the account itself still works on twitter with no errors, but I can’t generate an API key with it. I used www.moakt.com to get the disposable email I used to create the account.

othman@othmans-13-mbp ~ % rettiwt auth login my-burner-email account-id password
/usr/local/lib/node_modules/rettiwt-api/node_modules/rettiwt-auth/dist/Auth.js:235
                                                throw new Error(_this.parseAuthError(err, _this.subtasks[i]));
                                                      ^

Error: Failed to authenticate using the given account Credentials
    at /usr/local/lib/node_modules/rettiwt-api/node_modules/rettiwt-auth/dist/Auth.js:235:55
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v21.6.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

Okay I have a temporary workaround:

  1. Open your browser and go to twitter/X.
  2. Open browser developer tools.
  3. Navigate to Applications->Cookies (for Chrome) or Storage->Cookies (for Firefox).
  4. Copy the values of the 4 fields: auth_token, ct0, kdt, twid. Store them temporarily somewhere.
  5. Open NodeJS in a terminal and execute the command: btoa("auth_token=<auth_token_value>;ct0=<ct0_value>;kdt=<kdt_value>;twid=<twid_value>")
  6. The output string is your API_KEY.

Thanks! Do let me know if you need any help, you’ve done an awesome job on this package!