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
Issues with credentials : Credentials rejected #24
Comments
It looks like Tesla has enabled captcha again, but not for every user-agent it seems. The captcha image is displayed in the systems default web browser. You can override this by specifying your own captcha_solver function. |
I'm looking for help with understanding an error I'm getting:
I was previously using teslajson until the problem with captcha occured a little while ago. I then experimented with teslapy and set up a test program which was just your example code but in a while loop to log data to a file. As Tesla backed out the change I just left my original teslajson code running until captcha was reinstated a few days ago. The thing is, that teslapy test program is still working fine. I rewrote my original program to replace teslajson with teslapy and even though I cannot see anything in it that differs from my working test program (it just does a lot more with the data) it always fails. The system I'm using is a Raspberry Pi 4 with:
I tried installing everything on an alternative system running::
On this system I get a CAPTCHA prompt from my main program, the interactive python session and my test teslapy code. Is it possible that the token generated for my test program when CAPTCHA was not active is still in effect? Any help will be gratefully received. |
ps: cache.json shows (I think) the bearer token was created 2021-06-19 13:23:52 and will expire 2021-08-03 13:23:52. |
Yes the captcha is only required when there is no bearer token in cache.json present for your email. Once the bearer token is there, the module will refresh the token automatically. So on the 3rd of August the token will be refreshed and you do not need to enter the captcha again. |
I am on 1.3.0 but
What exactly do I have to do to make it work again? |
The most likely cause is that the captcha verification code is missing. So either you use a cache.json file with valid token, or you need to pass the authentication phase including captcha verification. Now, the captcha image will be shown in the systems default web browser. If you don't have a graphical interface, then you can use the solution presented in issue #25. |
the cli and menu scripts are no longer asking for a Captcha, but I think im blocked for some other reason now... Max retries exceeded with url: /oauth2/v3/authorize?response_type=code&client_id=ownerapi&redirect_uri=https%3A%2F%2Fauth.tesla.com%2Fvoid%2Fcallback&scope=openid+email+offline_access&state= (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb5c92830>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)) |
It is not working automatically. As far as I understand I have to enter the captcha manually. But it isn't even downloaded. How do other Apps solve this issue? Ask the user for the captcha?
|
Hi, thanks for that. Once I realised that cache.json had to be in the working directory everything fell into place and works just fine. Also, thanks for the pointer to the code for handling CAPTCHA in a non-GUI scenario. |
@dawiinci any luck? I am not being returned a Captcha, and not using a GUI so kinda lost here. Is there a standalone script that creates the token? |
Unfortunately not. I hope there will be an integrated way at some time. Even better would be an API without captcha. Doesn't make sense to me, because you have to refresh the token every few weeks. I think we all somehow rely on the system to just work "forever". I am wondering how commercial apps are doing this. |
It appears that Tesla requires captcha only for certain User-Agents. The wrong User-Agent was sent during authentication and this is fixed in 6c0fda4. I no longer get a captcha presented with this code fix. |
Thanks, that sounds good. By just replacing the files I get this:
After installing pip install websocket-client it works. The change is not available with "pip install teslapy" yet. I guess the websocket is a new thing? |
Yes this version supports the streaming API as well. I will package this version shortly and make it available on pypi. |
The issue came back:
|
yep, i have this issue too... :( |
Please give the fix in ebcef52 a try! |
Unfortunately it still asks for a Captcha and opens the browser.
I just replaced the three files in teslapy folder. It should work without captchas, right? |
No the captcha is required at this time. The auth server 'rejects' the first login attempt and asks for a captcha, teslapy now handles this and allows successful login. |
hey all, wanted to give this a shot, got everything installed but i'm having issues with logging in. i didnt have MFA enabled, using cli.py was still requesting a captcha. i logged into tesla, configured MFA anyhow and verified the captcha works using an authenticator app. no matter what i try, the cli.py script is returning invalid credentials. i've waited multiple iterations of credentials to verify too. thanks!
The text was updated successfully, but these errors were encountered: