-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
TeslaJS error: Unauthorized #218
Comments
I notice there's a pull request with code to handle the new login flow and that you're working on it with the submitter. Just leaving this issue open until that's implemented. |
@focher I've merged the PR from @DoctorMcKay which migrates to the new auth. |
@focher @DoctorMcKay today the new auth flow is failing. It appears that the hidden form fields are missing. Anyone else seeing the same? |
Yes, I've experience the same. I was about to work up a PR to retry the first HTML GET request a couple of times as that mostly mitigates the issue for now. |
I just updated my own app to use the new auth flow via the latest version of TeslaJS and it worked fine for me, so it does seem like there's some intermittent issue there and that retries are probably the best way to deal with it. |
I have an automated script, and retries are not ideal. I suppose I could put a loop in the code, to retry 10 times or something... |
I've found, as others have said, that the WAF throttles you and returns another page if you call too frequently. As I am testing my Tesla Control app, which unfortunately cannot use TeslaJS, I've encountered these issues. Waiting a few hours seems to correct. I sure wish the delay were shorter while I am still debugging. @wga22 I would not recommend frequent retries. I've heard that Tesla servers will freeze your account if they believe you may be a DDoS attack. That requires a password reset to correct. |
As mentioned above, I think you are missing the code for getting the actual refresh token. It’s described here https://tesla-api.timdorr.com/. |
@benthehorn Yes, refresh token is not yet supported but the new auth flow is in place. |
Tesla is placing a shell game with their WAF. Auth was broken but with the latest PR is now working again. I am closing this issue. A user has contributed a PR for refresh tokens. I'll look at that and merge if it looks good. If refresh is not fixed we can open a new issue to track that work. |
I am seeing this in the Homebridge plugin that utilizes TeslaJS (where I also created a bug report), but I believe the underlying problem is related to the changes Tesla has been making to the authentication process to properly support MFA and OAUTH2. As the Homebridge plugin uses TeslaJS, it appears that the error is coming from within this library.
According to https://tesla-api.timdorr.com/api-basics/authentication, Tesla has deprecated the /oauth/token endpoint.
The text was updated successfully, but these errors were encountered: