nfarina / homebridge-tesla

Tesla plugin for homebridge: https://github.com/nfarina/homebridge
154 stars 38 forks source link

Support for refresh token #66

Closed GodOSpoons closed 2 years ago

GodOSpoons commented 3 years ago

User utilizes 2FA, so must use API token for authentication, but current Tesla access token only lasts for 40 days.

Requesting support for the Tesla refresh token and ongoing maintenance of an active access token through refresh via plug-in.

nfarina commented 2 years ago

This should be fixed by the latest version (3.0.1) - check the README for details!

GodOSpoons commented 2 years ago

Updated plug-in and inserted refresh token from Tesla Token into slot. Seems to be using the refresh token to get an access token, but then that access token is unauthorized. B92AC4C6-997C-4EF4-A9DB-88A39DCCE4E2

GodOSpoons commented 2 years ago

I have refreshed the refresh token, logged out/in of the tool (Tesla Token) to get a new session.

nfarina commented 2 years ago

OK - so during my research on their new auth system, I encountered some suggestions that not all refresh tokens are created equal - I think they can be tied to different roles with difference access levels. I've only used the "Auth App for Tesla" which is in the macOS and iOS stores. Is Tesla Token the android one?