teslajson icon indicating copy to clipboard operation
teslajson copied to clipboard

recent auth issues?

Open 88gts opened this issue 3 years ago • 17 comments

code and pw have not changed but i have not been able to auth for two days or so. anyone else experiencing this?

87, in fetch_sso_token m = re.search('code=([^&]*)',r.headers['location']) File "/usr/local/lib/python3.6/site-packages/requests/structures.py", line 52, in getitem return self._store[key.lower()][1] KeyError: 'location'

88gts avatar May 30 '21 21:05 88gts

I too have had this problem for the last couple of days. I'm still using Python 2.7 and I the account only uses the basic authentication - email & password. The last data collected via Teslajson was 2021-05-28 19:05:03 GMT. I was recording data every 60 seconds at that point.

Response contains the following keys: Server Content-Type X-DNS-Prefetch-Control X-Frame-Options Strict-Transport-Security X-Download-Options X-Content-Type-Options X-XSS-Protection X-Request-ID X-Correlation-ID Content-Security-Policy X-Content-Security-Policy X-WebKit-CSP ETag X-Response-Time X-EdgeConnect-MidMile-RTT X-EdgeConnect-Origin-MEX-Latency OriginIP X-Akamai-Transformed Vary Content-Encoding Date Content-Length Connection Set-Cookie Origin_hostname

Les-A avatar May 30 '21 22:05 Les-A

Same here. I was actually about to create an issue myself, but you beat me to it :) My list of headers in the response is identical. The last datapoint I have received through Tesla-JSON was on 2021-05-28, 12:04 PST.

AlexanderSidorenko avatar May 30 '21 22:05 AlexanderSidorenko

Remember folks, this library uses an undocumented API. Looks like Tesla changed the API again, and it will take some time to reverse engineer it.

gglockner avatar May 30 '21 23:05 gglockner

It looks like Tesla now requires you to complete a CAPTCHA. This isn't going to have a quick fix. Again, such is life with an undocumented API.

gglockner avatar May 31 '21 05:05 gglockner

Thanks Greg, I saw that in the data and did wonder. Best of luck and thanks for all the work you've done so far.

On Mon, 31 May 2021, 06:47 Greg Glockner, @.***> wrote:

It looks like Tesla now requires you to complete a CAPTCHA https://github.com/timdorr/tesla-api/discussions/390. This isn't going to have a quick fix. Again, such is life with an undocumented API.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gglockner/teslajson/issues/30#issuecomment-851197084, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4CGTB5ZITTWOUJS5JKFJDTQMPFZANCNFSM45ZYU7RA .

Les-A avatar May 31 '21 10:05 Les-A

Same exact problem here.

For reference/testing i also test with tdorssers / TeslaPy (github)

It still works, the one I have was downloaded in Februari.

Would it be possible to snarf the login and wake_up code from TeslaPy ?

In another project they speculated it was the old/wrong USER_AGENT, when updated their code magically started to work again ...

OldGrumpyFart avatar Jun 01 '21 17:06 OldGrumpyFart

Started working normally for me again at 2021-06-02 09:15:05 BST. Haven't made any changes. Maybe Tesla has backed out the change (temporarily?).

Les-A avatar Jun 02 '21 12:06 Les-A

Ditto, suddenly works as before, no changes required.

OldGrumpyFart avatar Jun 02 '21 13:06 OldGrumpyFart

Auth issues started appearing again yesterday. Working for anyone else?

88gts avatar Jul 08 '21 16:07 88gts

Problem started yesterday evening for me again (error references 'location'). It still isn't working now. I then tried TeslaPy and it appears to be working fine so presumably TeslaPy was fixed for the problem even though Tesla appeared to back the change out.

Les-A avatar Jul 08 '21 19:07 Les-A

Auth issues here too. Worked until a 2 or 3 days ago.

spinkb avatar Jul 10 '21 11:07 spinkb

Same problem 'KeyError: location' started for me on 2021-07-08.

ivomans avatar Jul 15 '21 13:07 ivomans

I'm getting the same, anything that can be done? I miss this thing!

root@masterbot:/config# /config/unlock_car.sh Traceback (most recent call last): File "/config/unlock_car.py", line 4, in <module> c = teslajson.Connection('[email protected]', 'andapassword') File "/usr/local/lib/python3.9/site-packages/teslajson/teslajson.py", line 66, in __init__ self.fetch_token(**kwargs) File "/usr/local/lib/python3.9/site-packages/teslajson/teslajson.py", line 150, in fetch_token self.fetch_sso_token(**kwargs) File "/usr/local/lib/python3.9/site-packages/teslajson/teslajson.py", line 123, in fetch_sso_token m = re.search('code=([^&]*)',r.headers['location']) File "/usr/local/lib/python3.9/site-packages/requests/structures.py", line 54, in __getitem__ return self._store[key.lower()][1] KeyError: 'location'

tux43 avatar Jul 24 '21 04:07 tux43

I changed over to TeslaPy...it handles the captcha and can give you the image to solve manually. One time action needed as it keeps using a refresh token after that. Worked for me. Maybe teslajson can implement the equivalent...

spinkb avatar Jul 24 '21 04:07 spinkb

Thanks, I’ve just moved over to TeslaPy too, all good.

tux43 avatar Jul 24 '21 07:07 tux43

I too am trying TeslaPy - the 2 suggested code snippets and cli.py and menu.py But in every case I'm geting an error on line 210 of init.py Credentials rejected Captcha is required Catcha does not match Any suggestions most welcome How do you get an image to solve manually? for example

johnbanks1 avatar Aug 18 '21 23:08 johnbanks1

Ask your questions over on that project, not here. There is a snippet of source on the main page for TeslaPy showing how to do an alternate captcha solver where you can get the real file.

spinkb avatar Aug 19 '21 06:08 spinkb