home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.73k stars 29.98k forks source link

tesla integration not logging in since 2021.5.5 #51243

Closed Mbobko closed 3 years ago

Mbobko commented 3 years ago

The problem

Logger: homeassistant.components.tesla.config_flow Source: components/tesla/config_flow.py:169 Integration: Tesla (documentation, issues) First occurred: 12:48:32 AM (2 occurrences) Last logged: 1:15:13 AM

Authentication error: Unable to login with credentials

errors and tesla integration shows not loaded

What is version of Home Assistant Core has the issue?

2021.5.5

What was the last working version of Home Assistant Core?

2021.5.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tesla

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tesla

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

Hey there @zabuldon, @alandtse, mind taking a look at this issue as its been labeled with an integration (tesla) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

alandtse commented 3 years ago

Please provide logs. Otherwise the error is saying your authentication is incorrect which we can't help you with.

linuxkidd commented 3 years ago

I just experienced this as well. I found that I still had the integration configured in my 'configuration.yaml' file. Once I removed that, the next restart allowed the authentication to occur successfully.

It may ultimately have been unrelated ( could have just be a temporary tesla glitch ), but I could connect with both the mobile app and via the tesla.com site, while HA was saying the credentials were incorrect.

All working now though... Hope this helps!

Mbobko commented 3 years ago

That did it! I had tesla in the configuration yaml. As well I commented it out and rebooted now it connects. Bizarre


From: Michael J. Kidd @.> Sent: Sunday, May 30, 2021 12:59:42 AM To: home-assistant/core @.> Cc: Mbobko @.>; Author @.> Subject: Re: [home-assistant/core] tesla integration not logging in since 2021.5.5 (#51243)

I just experienced this as well. I found that I still had the integration configured in my 'configuration.yaml' file. Once I removed that, the next restart allowed the authentication to occur successfully.

It may ultimately have been unrelated ( could have just be a temporary tesla glitch ), but I could connect with both the mobile app and via the tesla.com site, while HA was saying the credentials were incorrect.

All working now though... Hope this helps!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/51243#issuecomment-850940155, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AR6SACWWRWGB43X64BV6NQDTQHA35ANCNFSM45YKBLBA.

victormylle commented 3 years ago

I'm not able to add the integration via the UI. It says invalid authentication but my email and password are correct (It has worked a few days ago). Does it have something to do with the new captcha tesla added to the login?

dermotduffy commented 3 years ago

Very same behavior here:

2021-05-31 08:44:48 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -18779 days, 15:15:12
2021-05-31 08:44:48 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected
2021-05-31 08:44:48 DEBUG (MainThread) [teslajsonpy.connection] Getting sso auth code using credentials
2021-05-31 08:44:48 DEBUG (MainThread) [teslajsonpy.connection] Attempt #0
2021-05-31 08:44:49 DEBUG (MainThread) [teslajsonpy.connection] POST: 
https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=REDACTED&code_challenge_method=S256&redirect_uri=https://au
th.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=REDACTED with
Headers({'host': 'auth.tesla.com', 'accept': '*/*', 'accept-encoding': 'gzip, deflate, br', 'connection': 'kee
p-alive', 'user-agent': 'HomeAssistant/2021.7.0.dev20210530 httpx/0.18.0 Python/3.8', 'cookie': '_abck=REDACTED==~-1~-1~-1; bm_sz=REDACTED; tesla-auth.
sid=REDACTED, 'content-length': '176'
, 'content-type': 'application/x-www-form-urlencoded'})
 returned 200:OK with response Headers({'content-type': 'text/html; charset=utf-8', 'x-dns-prefetch-control': 
'off', 'x-frame-options': 'DENY', 'strict-transport-security': 'max-age=15552000; includeSubDomains', 'x-downl
oad-options': 'noopen', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-request-i
d': '20c25b56-b842-4037-9db8-a8129a60282b', 'x-correlation-id': '20c25b56-b842-4037-9db8-a8129a60282b', 'conte
nt-security-policy': "connect-src 'self'; default-src 'none'; font-src 'self' data: fonts.gstatic.com; frame-s
rc 'self' www.google.com www.recaptcha.net; img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-d
f8a7b22eeaf53e4e4b5'; style-src 'unsafe-inline' 'self'", 'x-content-security-policy': "connect-src 'self'; def
ault-src 'none'; font-src 'self' data: fonts.gstatic.com; frame-src 'self' www.google.com www.recaptcha.net; i
mg-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-df8a7b22eeaf53e4e4b5'; style-src 'unsafe-inlin
e' 'self'", 'x-webkit-csp': "connect-src 'self'; default-src 'none'; font-src 'self' data: fonts.gstatic.com; 
frame-src 'self' www.google.com www.recaptcha.net; img-src 'self' data:; script-src www.recaptcha.net 'self' '
nonce-df8a7b22eeaf53e4e4b5'; style-src 'unsafe-inline' 'self'", 'etag': 'W/"6c49-k69rqItXDFmJ7qhMrhBo16nWOLg"'
, 'x-response-time': '36.277ms', 'content-encoding': 'gzip', 'x-edgeconnect-midmile-rtt': '53', 'x-edgeconnect
-origin-mex-latency': '92', 'originip': '209.133.79.56', 'x-akamai-transformed': '9 5820 0 pmb=mTOE,1', 'date'
: 'Mon, 31 May 2021 15:44:49 GMT', 'content-length': '5714', 'connection': 'keep-alive', 'vary': 'Accept-Encod
ing', 'set-cookie': 'REDACTED; Path=/; Expires=Thu, 03 Jun 2021 15:44:49 GMT; HttpOnly; Secure; SameSite=Lax', 'origin_hostname': 'au
th.tesla.com'})
2021-05-31 08:44:52 DEBUG (MainThread) [teslajsonpy.connection] Attempt #1
2021-05-31 08:44:52 DEBUG (MainThread) [teslajsonpy.connection] POST: 
https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=REDACTED&code_challenge_method=S256&redirect_uri=https://au
th.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=REDACTED with
Headers({'host': 'auth.tesla.com', 'accept': '*/*', 'accept-encoding': 'gzip, deflate, br', 'connection': 'keep-alive', 'user-agent': 'HomeAssistant/2021.7.0.dev20210530 httpx/0.18.0 Python/3.8', 'cookie': '_abck=REDACTED~-1~-1~-1; bm_sz=REDACTED; tesla-auth.sid=sREDACTED', 'content-length': '176', 'content-type': 'application/x-www-form-urlencoded'})
 returned 200:OK with response Headers({'server': 'nginx', 'content-type': 'text/html; charset=utf-8', 'x-dns-prefetch-control': 'off', 'x-frame-options': 'DENY', 'strict-transport-security': 'max-age=15552000; includeSubDomains', 'x-download-options': 'noopen', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-request-id': '110e7452-a20c-40b9-b830-378df58ab802', 'x-correlation-id': '110e7452-a20c-40b9-b830-378df58ab802', 'content-security-policy': "connect-src 'self'; default-src 'none'; font-src 'self' data: fonts.gstatic.com; frame-src 'self' www.google.com www.recaptcha.net; img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-ce4871c6c03d7e3afd50'; style-src 'unsafe-inline' 'self'", 'x-content-security-policy': "connect-src 'self'; default-src 'none'; font-src 'self' data: fonts.gstatic.com; frame-src 'self' www.google.com www.recaptcha.net; img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-ce4871c6c03d7e3afd50'; style-src 'unsafe-inline' 'self'", 'x-webkit-csp': "connect-src 'self'; default-src 'none'; font-src 'self' data: fonts.gstatic.com; frame-src 'self' www.google.com www.recaptcha.net; img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-ce4871c6c03d7e3afd50'; style-src 'unsafe-inline' 'self'", 'etag': 'W/"6c49-k6eH4BgbI1pglQ6z5Zm+Eq+ZjYg"', 'x-response-time': '45.269ms', 'x-edgeconnect-midmile-rtt': '54', 'x-edgeconnect-origin-mex-latency': '101', 'originip': '209.133.79.56', 'x-akamai-transformed': '9 27721 0 pmb=mTOE,1', 'vary': 'Accept-Encoding', 'content-encoding': 'gzip', 'date': 'Mon, 31 May 2021 15:44:52 GMT', 'content-length': '5714', 'connection': 'keep-alive', 'set-cookie': 'tesla-auth.sid=s%3ANe1O21lK51XSyKOYfAM1Cup17PdzR9Cu.7TTX8RhdKXb6KIrmuaXXuVorBTbgqsW4qOlr7XhUeZA; Path=/; Expires=Thu, 03 Jun 2021 15:44:52 GMT; HttpOnly; Secure; SameSite=Lax', 'origin_hostname': 'auth.tesla.com'})
2021-05-31 08:44:55 DEBUG (MainThread) [teslajsonpy.connection] Attempt #2
2021-05-31 08:44:55 DEBUG (MainThread) [teslajsonpy.connection] POST: 
https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=REDACTED&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=REDACTED with
Headers({'host': 'auth.tesla.com', 'accept': '*/*', 'accept-encoding': 'gzip, deflate, br', 'connection': 'keep-alive', 'user-agent': 'HomeAssistant/2021.7.0.dev20210530 httpx/0.18.0 Python/3.8', 'cookie': '_abck=REDACTED==~-1~-1~-1; bm_sz=REDACTED=; tesla-auth.sid=REDACTED', 'content-length': '176', 'content-type': 'application/x-www-form-urlencoded'})
 returned 200:OK with response Headers({'content-type': 'text/html; charset=utf-8', 'x-dns-prefetch-control': 'off', 'x-frame-options': 'DENY', 'strict-transport-security': 'max-age=15552000; includeSubDomains', 'x-download-options': 'noopen', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-request-id': 'c5c23b06-86f1-4903-83ac-b91c70a4b5be', 'x-correlation-id': 'c5c23b06-86f1-4903-83ac-b91c70a4b5be', 'content-security-policy': "connect-src 'self'; default-src 'none'; font-src 'self' data: fonts.gstatic.com; frame-src 'self' www.google.com www.recaptcha.net; img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-a09924fd8a28e580d47d'; style-src 'unsafe-inline' 'self'", 'x-content-security-policy': "connect-src 'self'; default-src 'none'; font-src 'self' data: fonts.gstatic.com; frame-src 'self' www.google.com www.recaptcha.net; img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-a09924fd8a28e580d47d'; style-src 'unsafe-inline' 'self'", 'x-webkit-csp': "connect-src 'self'; default-src 'none'; font-src 'self' data: fonts.gstatic.com; frame-src 'self' www.google.com www.recaptcha.net; img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-a09924fd8a28e580d47d'; style-src 'unsafe-inline' 'self'", 'etag': 'W/"6c49-+hU7bv4b8GUW9cVVfcb4DjT4QaE"', 'x-response-time': '43.188ms', 'content-encoding': 'gzip', 'x-edgeconnect-midmile-rtt': '51', 'x-edgeconnect-origin-mex-latency': '105', 'originip': '209.133.79.56', 'x-akamai-transformed': '9 5821 0 pmb=mTOE,1', 'date': 'Mon, 31 May 2021 15:44:55 GMT', 'content-length': '5713', 'connection': 'keep-alive', 'vary': 'Accept-Encoding', 'set-cookie': 'tesla-auth.sid=s%3ANe1O21lK51XSyKOYfAM1Cup17PdzR9Cu.7TTX8RhdKXb6KIrmuaXXuVorBTbgqsW4qOlr7XhUeZA; Path=/; Expires=Thu, 03 Jun 2021 15:44:55 GMT; HttpOnly; Secure; SameSite=Lax', 'origin_hostname': 'auth.tesla.com'})
2021-05-31 08:44:56 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.opensky is taking over 10 seconds
2021-05-31 08:44:58 DEBUG (MainThread) [teslajsonpy.connection] Failed to authenticate
2021-05-31 08:44:58 ERROR (MainThread) [homeassistant.components.tesla.config_flow] Authentication error: Unable to login with credentials 
alandtse commented 3 years ago

If Tesla added a captcha then that is the cause. I won't be fixing that here so someone else will have to.

Edit: Your options are to wait for someone to fix it here or use my custom component on HACS which handles captchas and MFA already.

mlachman commented 3 years ago

I have the same problem. Ever since the captcha went live on the tesla api, the authentication (through UI or configuration.yaml) is not working anymore. This happend three days ago. It seems that the signing in method hasn't changed much, and that the captcha has just been added. As long as your token is still valid, the api will remain working, but if you've changed your password (like i did), then this integration will not work anymore.

victormylle commented 3 years ago

Wouldn't a quick fix be to manually enter the access and refresh token? The tokens can easily be retrieved via the app Auth for Tesla

alandtse commented 3 years ago

Wouldn't a quick fix be to manually enter the access and refresh token? The tokens can easily be retrieved via the app Auth for Tesla

Yes, but editing your .storage files is not supported and can break your HA if you do it wrong.

victormylle commented 3 years ago

I mean like an extra configuration field for the tokens. Instead of only asking for the email and password. But I'm not sure how the token refresh would be handled.

mabahj commented 3 years ago

Adding my logs after a restart, in case they can help. I have not done any HA upgrades, I just restarted HA now and got these errors.

Home Assistant 2021.5.5

2021-06-01 20:04:26 INFO (MainThread) [homeassistant.setup] Setting up tesla
2021-06-01 20:04:26 INFO (MainThread) [homeassistant.setup] Setup of domain tesla took 0.0 seconds
2021-06-01 20:04:26 DEBUG (MainThread) [teslajsonpy.connection] Connecting with existing access token
2021-06-01 20:04:26 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 0:00:30
2021-06-01 20:04:26 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles None
2021-06-01 20:04:34 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"id":xxx,"vehicle_id":xxx,"vin":"xxx","display_name":"Black","option_codes":"nnnn","color":null,"access_type":"OWNER","tokens":["xxx","xxx"],"state":"asleep","in_service":false,"id_s":"xxx","calendar_enabled":true,"api_version":15,"backseat_token":null,"backseat_token_updated_at":null,"command_signing":"off"}],"count":1}
2021-06-01 20:04:34 DEBUG (MainThread) [teslajsonpy.controller] tasks [<coroutine object Controller.update at 0x6d7024a8>] True
2021-06-01 20:04:34 DEBUG (MainThread) [teslajsonpy.controller] 01274 resetting last_parked_timestamp: shift_state None
2021-06-01 20:04:35 DEBUG (MainThread) [teslajsonpy.controller] Updating 01274
2021-06-01 20:04:35 DEBUG (MainThread) [teslajsonpy.controller] wake_up needed for get -> None 
2021-06-01 20:04:35 DEBUG (MainThread) [teslajsonpy.controller] Attempting to wake up
2021-06-01 20:04:35 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 0:00:21
2021-06-01 20:04:35 DEBUG (MainThread) [teslajsonpy.connection] post: https://owner-api.teslamotors.com/api/1/vehicles/xxx/wake_up {}
2021-06-01 20:04:37 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":xxx,"user_id":xxx,"vehicle_id":xxx,"vin":"xxx","display_name":"Black","option_codes":"nnn","color":null,"access_type":"OWNER","tokens":["xxx","xxx"],"state":"asleep","in_service":false,"id_s":"xxx","calendar_enabled":true,"api_version":15,"backseat_token":null,"backseat_token_updated_at":null,"command_signing":"off"}}
2021-06-01 20:04:37 DEBUG (MainThread) [teslajsonpy.controller] Wakeup 01274: asleep
2021-06-01 20:04:37 DEBUG (MainThread) [teslajsonpy.controller] get(01274): Wake Attempt(0): False
2021-06-01 20:04:43 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: tesla, sensor.airthings_wave
2021-06-01 20:04:56 DEBUG (MainThread) [teslajsonpy.controller] Attempting to wake up
2021-06-01 20:04:56 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 0:00:00
2021-06-01 20:04:56 DEBUG (MainThread) [teslajsonpy.connection] post: https://owner-api.teslamotors.com/api/1/vehicles/xxx/wake_up {}
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":xxx,"user_id":xxx,"vehicle_id":xxx,"vin":"xxx","display_name":"Black","option_codes":"nnn","color":null,"access_type":"OWNER","tokens":["xxx","xxx"],"state":"online","in_service":false,"id_s":"x","calendar_enabled":true,"api_version":15,"backseat_token":null,"backseat_token_updated_at":null,"command_signing":"off"}}
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.controller] Wakeup 01274: online
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.controller] get(01274): Wake Attempt(1): True
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.controller] Retrying get((xxxx, 'vehicle_data') {'wake_if_asleep': True})
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -1 day, 23:59:58
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.connection] Getting sso auth code using credentials
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.connection] Attempt #0
2021-06-01 20:04:58 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:01 DEBUG (MainThread) [teslajsonpy.connection] Attempt #1
2021-06-01 20:05:02 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:05 DEBUG (MainThread) [teslajsonpy.connection] Attempt #2
2021-06-01 20:05:05 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:08 DEBUG (MainThread) [teslajsonpy.connection] Failed to authenticate
2021-06-01 20:05:08 DEBUG (MainThread) [teslajsonpy.controller] Exception: 
2021-06-01 20:05:08 DEBUG (MainThread) [homeassistant.components.tesla] Connected to the Tesla API
2021-06-01 20:05:08 DEBUG (MainThread) [teslajsonpy.controller] Updating 01274
2021-06-01 20:05:08 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -1 day, 23:59:48
2021-06-01 20:05:08 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected
2021-06-01 20:05:08 DEBUG (MainThread) [teslajsonpy.connection] Getting sso auth code using credentials
2021-06-01 20:05:08 DEBUG (MainThread) [teslajsonpy.connection] Attempt #0
2021-06-01 20:05:09 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:12 DEBUG (MainThread) [teslajsonpy.connection] Attempt #1
2021-06-01 20:05:12 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:15 DEBUG (MainThread) [teslajsonpy.connection] Attempt #2
2021-06-01 20:05:15 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:18 DEBUG (MainThread) [teslajsonpy.connection] Failed to authenticate
2021-06-01 20:05:18 DEBUG (MainThread) [teslajsonpy.controller] Exception: 
2021-06-01 20:05:18 DEBUG (MainThread) [homeassistant.components.tesla] Finished fetching tesla data in 10.200 seconds
2021-06-01 20:05:18 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tesla
2021-06-01 20:05:18 INFO (MainThread) [homeassistant.components.lock] Setting up lock.tesla
2021-06-01 20:05:18 INFO (MainThread) [homeassistant.components.climate] Setting up climate.tesla
2021-06-01 20:05:18 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.tesla
2021-06-01 20:05:18 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.tesla
2021-06-01 20:05:18 INFO (MainThread) [homeassistant.components.switch] Setting up switch.tesla
2021-06-01 20:05:18 DEBUG (MainThread) [teslajsonpy.controller] Updating 01274
2021-06-01 20:05:18 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -1 day, 23:59:38
2021-06-01 20:05:18 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected
2021-06-01 20:05:18 DEBUG (MainThread) [teslajsonpy.connection] Getting sso auth code using credentials
2021-06-01 20:05:19 DEBUG (MainThread) [teslajsonpy.connection] Attempt #0
2021-06-01 20:05:19 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:22 DEBUG (MainThread) [teslajsonpy.connection] Attempt #1
2021-06-01 20:05:23 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:26 DEBUG (MainThread) [teslajsonpy.connection] Attempt #2
2021-06-01 20:05:26 DEBUG (MainThread) [teslajsonpy.connection] POST: 
2021-06-01 20:05:28 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform tesla is taking over 10 seconds.
2021-06-01 20:05:29 DEBUG (MainThread) [teslajsonpy.connection] Failed to authenticate
2021-06-01 20:05:29 DEBUG (MainThread) [teslajsonpy.controller] Exception: 
2021-06-01 20:05:29 DEBUG (MainThread) [homeassistant.components.tesla] Finished fetching tesla data in 11.034 seconds
drlauridsen commented 3 years ago

This is definitely due to the new captcha on Tesla login page, as alandtse wrote... His custom integration works with the captcha, since login process is via webpage, and I suppose it would also work with 2fa ?? @alandtse

alandtse commented 3 years ago

This is definitely due to the new captcha on Tesla login page, as alandtse wrote... His custom integration works with the captcha, since login process is via webpage, and I suppose it would also work with 2fa ?? @alandtse

Yes. MFA is multi factor authentication also known as 2FA.

victormylle commented 3 years ago

Tesla removed the captcha?? Everything works again now

kocsenc commented 3 years ago

image I'm getting the same issue when trying to add the Integration using the UI. It seems that it is the CAPTCHA issue and probably sporadic. I'll try again tomorrow and see if it fixes itself. I tried removing the Integration (had previously set it up) but that made it worse.

kocsenc commented 3 years ago

From the unofficial API site:

Tesla's SSO service has a WAF (web application firewall) that may temporarily block you if you make repeated, execessive requests. This is to prevent bots from attacking the service, either as a brute force or denial-of-service attack. This normally presents as a "challenge" page, which requires running some non-trivial JavaScript code to validate that you have a full browser engine available. While you can potentially fully evaluate this page to remove the block, the best practice for now is to reduce your calls to the SSO service to a minimum and avoid things like automatic request retries.

Wonder if this is related.

purcell-lab commented 3 years ago

Upgrading to core-2021.8.1 has forced me back to authentication.

image

Receiving authentication error when logging in.

image

alandtse commented 3 years ago

Wonder if this is related.

Could be the captcha or the WAF. This is actually an old issue you've revived and it probably makes sense to open a new one based on the new implementation.

Unfortunately, I do not support Tesla login issues on the core component because of the inherent complexity of the fix, but you can use my custom component on HACS or wait till someone fixes it here. @BreakingBread0 did the MFA fix for 2021.8.x so may be willing to fix it.

iancg commented 3 years ago

I've also had the same issue upgrading to 2021.8.2. Initially when I upgraded, tesla authentication failed (no MFA). I've added MFA to my account and tried again. Still get the same error as @purcell-lab

@BreakingBread0 is there anything we can do to help debug?

nnoally commented 3 years ago

Same for me. Upgrading from 2021.8.1 to 2021.8.2. Forced to login again but i can't (no MFA).

mlachman commented 3 years ago

Wouldn't a quick fix be to manually enter the access and refresh token? The tokens can easily be retrieved via the app Auth for Tesla

Well this worked for me. It’s not a recommended or supported to change your .storage file, but I got it working again.

iMartien commented 3 years ago

Wouldn't a quick fix be to manually enter the access and refresh token? The tokens can easily be retrieved via the app Auth for Tesla

Well this worked for me. It’s not a recommended or supported to change your .storage file, but I got it working again.

Can you tell me where exactly the token is stored? I'm trying to replace it because I have this issue since updating to 2021.8

Edit: nevermind, I've found the workaround here: https://community.home-assistant.io/t/tesla-integration-not-working-since-1-30-21/275149/66

paracetamol32 commented 3 years ago

Wouldn't a quick fix be to manually enter the access and refresh token? The tokens can easily be retrieved via the app Auth for Tesla

Well this worked for me. It’s not a recommended or supported to change your .storage file, but I got it working again.

Can you tell me where exactly the token is stored? I'm trying to replace it because I have this issue since updating to 2021.8

in .storage/core.config_entries

alandtse commented 3 years ago

This old issue should be closed in favor of #54177. Please refer to the new issue instead.