Skip to content
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

Something wrong with streaming auth #210

Closed
IMgoRt opened this issue Nov 6, 2020 · 15 comments
Closed

Something wrong with streaming auth #210

IMgoRt opened this issue Nov 6, 2020 · 15 comments
Assignees
Labels

Comments

@IMgoRt
Copy link

IMgoRt commented Nov 6, 2020

Having been using startStreating for 6 months without issue, 2 days ago it started returning the error "Error: Basic Auth Disabled"
I was using my username: email and password: options.tokens[0]
I get the same error using simply authToken: CurrentToken (which works in vehicles

Library version
4.7.0,
updated to 4.9.3

Additional context
called within NodeRed

@mseminatore
Copy link
Owner

Have you enabled MFA on your account?

@IMgoRt
Copy link
Author

IMgoRt commented Nov 9, 2020

Have you enabled MFA on your account?

No sir,
This just randomly started happening when I was out driving, so no code changes, no 2FA enabled.

I have just enabled 2FA and then disabled 2FA, at all times vechiles/vehicle continues with valid responses, but startstreaming continues to return "Error: Basic Auth Disabled", which is passed directly by your code from the Tesla servers.
I've re-authorise with new tokens and still exactly the same

@mseminatore
Copy link
Owner

Hmm. The TJS streaming code has not changed recently so something may have changed on the Tesla side. Have you taken a recent FW update? Is your car an M3? I vaguely remember hearing that streaming stopped working on some car models with some FW versions. Since I do not have those combinations I cannot reproduce.

@IMgoRt
Copy link
Author

IMgoRt commented Nov 9, 2020

Hmm. The TJS streaming code has not changed recently so something may have changed on the Tesla side. Have you taken a recent FW update? Is your car an M3? I vaguely remember hearing that streaming stopped working on some car models with some FW versions. Since I do not have those combinations I cannot reproduce.

Hi Mark,
I regularly get software updates but not while driving.
I've got an MS from 2016, had the HW3- and MCU2 upgrade at the start of October, I refresh my authtoken on the first of the month (and other times if for some reason a problem gets returned)

Hopefully others will start noticing this issue and then we can get to the bottom of it.
I've tried moving my server from behind my VPN in case that was the issue, but there was no difference so I'm back behind the VPN again.

Thanks
David

@cyu
Copy link

cyu commented Nov 11, 2020

I'm seeing this as well. I originally saw this issue with the Ruby API, and saw the same behavior with TeslaJS.

@ktoonsez
Copy link

ktoonsez commented Nov 11, 2020

I am also getting this on my android app I wrote, I thought it was something I was doing wrong in WebSockets() but guess it is everybody.
Any luck @IMgoRt finding a wrok around?

@IMgoRt
Copy link
Author

IMgoRt commented Nov 12, 2020

Hmm. The TJS streaming code has not changed recently so something may have changed on the Tesla side. Have you taken a recent FW update? Is your car an M3? I vaguely remember hearing that streaming stopped working on some car models with some FW versions. Since I do not have those combinations I cannot reproduce.

This is reputed to be the issue
timdorr/tesla-api#97 (comment)
so line 1841 of teslajs, but also the correct token needs passing

@ktoonsez
Copy link

@IMgoRt, I do have an M3. I have just started doing this in the last 3 days so not sure if it ever worked before. I have tried the "data:subscribe_oauth" and it does the same thing for me.

@IMgoRt
Copy link
Author

IMgoRt commented Nov 12, 2020

@IMgoRt, I do have an M3. I have just started doing this in the last 3 days so not sure if it ever worked before. I have tried the "data:subscribe_oauth" and it does the same thing for me.

Have you been driving at the time as the timeout seems to be 10s if no draw on the battery

@ktoonsez
Copy link

Not driving, at my desk working on the code. I will try the "data:subscribe_oauth" way again, maybe I am missing something on what is passed, what are people referring to when they say use your oauth string instead of oauth token, not sure I have seena way to make an oauth string?

@IMgoRt
Copy link
Author

IMgoRt commented Nov 12, 2020 via email

@ktoonsez
Copy link

I used the normal "https://owner-api.teslamotors.com/oauth/token" to get token and refresh token, but not aware of any path called "https://owner-api.teslamotors.com/login" that you are referring to. I will keep poking around to see if I can find that login path. Please post up if you find what you are talking about when home, thanks.

mseminatore added a commit that referenced this issue Nov 12, 2020
@mseminatore mseminatore self-assigned this Nov 12, 2020
@mseminatore
Copy link
Owner

@ktoonsez @IMgoRt @cyu I believe I have just pushed the fix for this issue. The streaming API now takes the OAuth token. The sample now works again. LMK if you see some issues. If anyone wants to update the simpleStreaming sample to display more friendly output that would probably be a good PR.

@ktoonsez
Copy link

Awesome!

@IMgoRt
Copy link
Author

IMgoRt commented Nov 13, 2020

@ktoonsez @IMgoRt @cyu I believe I have just pushed the fix for this issue. The streaming API now takes the OAuth token. The sample now works again. LMK if you see some issues. If anyone wants to update the simpleStreaming sample to display more friendly output that would probably be a good PR.

Thank you Mark for your prompt attention, working fine in the UK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants