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

Auth disabled when streaming? #65

Open
mortimern opened this issue Jan 6, 2021 · 6 comments
Open

Auth disabled when streaming? #65

mortimern opened this issue Jan 6, 2021 · 6 comments

Comments

@mortimern
Copy link

Hi, just started updating my app with the version 7.0.0 of TeslaSwift. I have sorted out the other differences, but the streaming is complaining about not being authorized?

Opening Stream to: wss://streaming.vn.teslamotors.com/streaming/
Stream viabilityChanged: true
Stream open headers: ["Sec-WebSocket-Accept": "FKS+dFuLRSWpWI3am6ZNoh+h7l8=", "X-Content-Type-Options": "nosniff", "Date": "Wed, 06 Jan 2021 10:01:07 GMT", "Strict-Transport-Security": "max-age=15724800; includeSubDomains, max-age=31536000; includeSubDomains", "Connection": "upgrade", "Cache-Control": "no-cache, no-store, private, s-max-age=0", "X-Frame-Options": "DENY", "Upgrade": "websocket"]
Stream data: {"msg_type":"control:hello","connection_timeout":0}
Stream got hello
Stream data: {"msg_type":"data:error","tag":"1422335915","value":"Basic Auth Disabled","error_type":"client_error"}
Stream got data error: Basic Auth Disabled, client_error
Stream closed
Stream cancelled

How can I add oAuth to the streaming code? Do I have to use oAuth login for the app, or is it separate for streaming?

@jonasman
Copy link
Owner

jonasman commented Jan 6, 2021 via email

@mortimern
Copy link
Author

Ok, I will check and try that.
Thank you.

@mortimern
Copy link
Author

I dont have MFA activated, but used weblogin instead for the app and it got data on the stream, but the stream closed pretty fast. probably because the car is parked. I will try with the car driving too.

Stream got data: 1609933224961,,1973.1,74,58,276,xx.xxxxxx,xx.xxxxxx,,237,132,280
Stream data: {"msg_type":"data:error","tag":"1422335915","value":"disconnected","error_type":"vehicle_disconnected"}
Stream got data error: disconnected, vehicle_disconnected
Stream closed
Stream cancelled

@jonasman
Copy link
Owner

jonasman commented Jan 6, 2021 via email

@mortimern
Copy link
Author

Something must be done I guess. I activated MFA too now, but the same result that it disconnects after a couple of minutes. I did a small trip now to pick up some kids from school and it disconnected after 3km. It worked great up until then with frequent updates. Maybe put in some kind of auto reconnect if it drops without me telling it to.

@jonasman
Copy link
Owner

jonasman commented Jan 6, 2021 via email

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

No branches or pull requests

2 participants