TeslaJS: Error: Login credentials rejected in production

Hi Mark,

First of all, thank you for this awesome library. Recently, suddenly in production I have started getting this error while logging in using loginAsync and this doesn’t happen in dev at all. This also didn’t happen in production before. Can you please help me look into this?

My service is at teslame.net

Thanks a lot!


2021-07-21T01:43:43.353-07:00 | Jul 21 08:43:43 ip-172-31-24-216 web: Error: Login credentials rejected
-- | --
  | 2021-07-21T01:43:43.353-07:00 | Jul 21 08:43:43 ip-172-31-24-216 web: at /var/app/current/node_modules/teslajs/src/auth.js:95:19
  | 2021-07-21T01:43:43.353-07:00 | Jul 21 08:43:43 ip-172-31-24-216 web: at tryCallOne (/var/app/current/node_modules/promise/lib/core.js:37:12)
  | 2021-07-21T01:43:43.353-07:00 | Jul 21 08:43:43 ip-172-31-24-216 web: at /var/app/current/node_modules/promise/lib/core.js:123:15
  | 2021-07-21T01:43:43.353-07:00 | Jul 21 08:43:43 ip-172-31-24-216 web: at flush (/var/app/current/node_modules/asap/raw.js:50:29)
  | 2021-07-21T01:43:43.353-07:00CopyJul 21 08:43:43 ip-172-31-24-216 web: at processTicksAndRejections (internal/process/task_queues.js:77:11) | Jul 21 08:43:43 ip-172-31-24-216 web: at processTicksAndRejections (internal/process/task_queues.js:77:11)


About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 34 (12 by maintainers)

Most upvoted comments

It looks like Tesla broken login again. I’m searching for whether any solutions have been devised.

Thanks! The tesla-info.com/teslatoken.php worked like a charm. I used a small nodejs program to write the token to my store file and now my apps are working. Thank you! Hope the teslajs api can be fixed soon.

Is there any more information about this? @tonybroadbent Is your fix a workaround or something? Could you explain more? Thanks!

There is a free IOS app called ‘AuthAppForTesla’. I have this setup on my phone, and it allows me to copy to the clipboard an Access Token. I copied this to my pi, and created a .token file containing the long string, as shown above. Then, the sample code started working again for me. I think there are other ways to get an access token, this is just what I used. The app states they are only valid for 22 days, so it’s really just a workaround rather than any sort of fix. Hope this helps; shout if it makes no sense. Obviously the access token would potentially allow someone to steal your car, so don’t go pasting it on here!!!