UniversalDevicesInc / tesla-nodeserver

The Tesla NodeServer allows to get information and control your Tesla Vehicle
MIT License
4 stars 4 forks source link

Authentication Update #24

Open shesmer opened 3 years ago

shesmer commented 3 years ago

Looks like the existing oauth authentication doesn't work anymore. See here for more details: https://github.com/timdorr/tesla-api/issues/260

https://tesla-api.timdorr.com/api-basics/authentication

This needs to be updated.

I stumbled over this while trying to add Powerwall support...

blakevh commented 3 years ago

You are exactly correct. Working on getting a working solution for the new authentication methods.

psmith3 commented 3 years ago

Is this the same error? Is there any work around to this? 2021-03-26 02:18:29 error: NS: Tesla API /api/1/vehicles returned: 400 - {"response":null,"error":"Endpoint deprecated: Please update your App.","error_description":""} 2021-03-26 02:18:29 error: NS: Error discovering vehicles: StatusCodeError: 400 - {"response":null,"error":"Endpoint deprecated: Please update your App.","error_description":""} at new StatusCodeError (/root/.polyglot/nodeservers/Tesla/node_modules/request-promise-core/lib/errors.js:32:15) at Request.plumbing.callback (/root/.polyglot/nodeservers/Tesla/node_modules/request-promise-core/lib/plumbing.js:104:33) at Request.RP$callback [as _callback] (/root/.polyglot/nodeservers/Tesla/node_modules/request-promise-core/lib/plumbing.js:46:31) at Request.self.callback (/root/.polyglot/nodeservers/Tesla/node_modules/request/request.js:185:22) at Request.emit (events.js:198:13) at Request.<anonymous> (/root/.polyglot/nodeservers/Tesla/node_modules/request/request.js:1154:10) at Request.emit (events.js:198:13) at IncomingMessage.<anonymous> (/root/.polyglot/nodeservers/Tesla/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:286:20) at IncomingMessage.emit (events.js:203:15)

blakevh commented 3 years ago

This is due to the Tesla update to their authentication protocol. And sorry, there is no workaround that I know of. I just about have the nodeserver code switched over to a new authentication library which supports the new authentication process. It is a major adaptation of the code and it has been slow going. The new code will probably be ready in a week or so.

On Thu, Mar 25, 2021 at 9:21 PM Parker Smith @.***> wrote:

Is this the same error? Is there any work around to this? 2021-03-26 02:18:29 error: NS: Tesla API /api/1/vehicles returned: 400 - {"response":null,"error":"Endpoint deprecated: Please update your App.","error_description":""} 2021-03-26 02:18:29 error: NS: Error discovering vehicles: StatusCodeError: 400 - {"response":null,"error":"Endpoint deprecated: Please update your App.","error_description":""} at new StatusCodeError (/root/.polyglot/nodeservers/Tesla/node_modules/request-promise-core/lib/errors.js:32:15) at Request.plumbing.callback (/root/.polyglot/nodeservers/Tesla/node_modules/request-promise-core/lib/plumbing.js:104:33) at Request.RP$callback [as _callback] (/root/.polyglot/nodeservers/Tesla/node_modules/request-promise-core/lib/plumbing.js:46:31) at Request.self.callback (/root/.polyglot/nodeservers/Tesla/node_modules/request/request.js:185:22) at Request.emit (events.js:198:13) at Request. (/root/.polyglot/nodeservers/Tesla/node_modules/request/request.js:1154:10) at Request.emit (events.js:198:13) at IncomingMessage. (/root/.polyglot/nodeservers/Tesla/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:286:20) at IncomingMessage.emit (events.js:203:15)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UniversalDevicesInc/tesla-nodeserver/issues/24#issuecomment-807884258, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUD7NCMHOQTYVXKNOWA2CTTFPVR5ANCNFSM4XXRS4AQ .

cayeldo commented 3 years ago

I see a new update was pushed out for the Tesla Node Server recently, however, it still doesn't seem to be working for me. Is anyone having success with it? Just trying to figure out if it's me or the authentication issues...

psmith3 commented 3 years ago

It is working for me now. I completely uninstalled and reinstalled the Tesla NS and all is good after putting in my credentials.

cayeldo commented 3 years ago

Ah yes! It's working for me now as well. I just needed to uninstall the old one and fresh install the new one. Well done!

sedgington commented 3 years ago

Apparently this issue has returned for those attempting to make a fresh install from the cloud. My polyglot cloud installs to my local ISY devices one node and then freezes when attempting to login to Tesla. I have tried it both with and without MFA and with the MFA I have tried using the numbers on my authenticator on my iphone and the list of passcodes Tesla gives me on the website when 'managing' the MFA. In my log in polyglot it says:

2021-05-31 18:01:30 error: NS: oauth is invalid: { error: true, errorMsg: 'Login credentials rejected' } 2021-05-31 18:01:30 error: NS: Could not save new tokens: There are missing keys 2021-05-31 18:01:33 debug: NS: ControllerNode.displayCredentialsError() 'Unauthorized' 2021-05-31 18:01:33 error: NS: Error discovering vehicles: Unauthorized 2021-05-31 18:01:33 info: NS: Config received has 1 nodes

Any ideas about how to fix this? Thanks in advance.

pgattu commented 2 years ago

Is there an update/fix for this? I reinstalled the Tesla nodeserver and I am getting the below error:

2022-02-05 08:23:15 info: NS: Config received has 1 nodes 2022-02-05 08:23:16 error: NS: undefined 2022-02-05 08:23:16 error: NS: oauth is invalid: { error: true, errorMsg: 'Login credentials rejected' } 2022-02-05 08:23:16 error: NS: Could not save new tokens: There are missing keys 2022-02-05 08:23:18 debug: NS: ControllerNode.displayCredentialsError() 'Unauthorized' 2022-02-05 08:23:18 error: NS: Error discovering vehicles: Unauthorized