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

ERROR for site owner: Invalid domain for site key #20

Closed
ybizeul opened this issue Sep 4, 2021 · 40 comments
Closed

ERROR for site owner: Invalid domain for site key #20

ybizeul opened this issue Sep 4, 2021 · 40 comments

Comments

@ybizeul
Copy link

ybizeul commented Sep 4, 2021

Version of the custom_component

0.2.1

Configuration

n/a

Describe the bug

In the tesla login page that is proxied, the Captcha doesn't load

image

Page URL in browser is :

https://myhomeassistantdomain/auth/tesla/proxy?config_flow_id=57a927ee399f4c178b1a6cc476ee35c1&callback_url=https://myhomeassistantdomain/auth/tesla/callback?flow_id%3D57a927ee399f4c178b1a6cc476ee35c1

Debug log

2021-09-04 19:48:24 DEBUG (MainThread) [custom_components.tesla_custom.config_flow] Found flow_id; adding 10.1.0.42 to known_ips for 300 seconds
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Received get: https://myhomeassistant.mydomain/auth/tesla/proxy?config_flow_id=e5e4f5a18c31464cae282cb57b0dc019&callback_url=https://myhomeassistant.mydomain/auth/tesla/callback?flow_id%3De5e4f5a18c31464cae282cb57b0dc019 for https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Starting auth capture proxy for https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Final headers {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Connection': 'keep-alive', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15', 'Accept-Language': 'en-us', 'Referer': 'https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA', 'Accept-Encoding': 'gzip, deflate, br', 'x-tesla-user-agent': 'TeslaApp/3.10.9-433/adff2e065/android/10', 'X-Requested-With': 'com.teslamotors.tesla'}
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Attempting get to https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA
headers: {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Connection': 'keep-alive', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15', 'Accept-Language': 'en-us', 'Referer': 'https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA', 'Accept-Encoding': 'gzip, deflate, br', 'x-tesla-user-agent': 'TeslaApp/3.10.9-433/adff2e065/android/10', 'X-Requested-With': 'com.teslamotors.tesla'}
cookies: <CookieJar[]>
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] GET:
https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA with
{"host": "auth.tesla.com", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "accept-encoding": "gzip, deflate, br", "connection": "keep-alive", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15", "accept-language": "en-us", "referer": "https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA", "x-tesla-user-agent": "TeslaApp/3.10.9-433/adff2e065/android/10", "x-requested-with": "com.teslamotors.tesla"}
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', 'c98fd737-9f8d-49cf-a808-879d99dbb2bd'), ('x-correlation-id', 'c98fd737-9f8d-49cf-a808-879d99dbb2bd'), ('cache-control', 'no-store'), ('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-bb5c161230a3934f834a'; style-src 'unsafe-inline' 'self'"), ('etag', 'W/"709a-rs8SRDKsYNnmvSHcERim/Rvo/TU"'), ('x-response-time', '20.291ms'), ('content-encoding', 'gzip'), ('x-edgeconnect-midmile-rtt', '16'), ('x-edgeconnect-origin-mex-latency', '175'), ('originip', '209.133.79.56'), ('x-akamai-transformed', '9 6251 0 pmb=mTOE,1'), ('date', 'Sat, 04 Sep 2021 17:48:24 GMT'), ('content-length', '6090'), ('connection', 'keep-alive'), ('vary', 'Accept-Encoding'), ('set-cookie', 'tesla-auth.sid=s%3AarDrMEgjr9U7ajsldIHGSyrfT1VYPhOM.EbBQKQy24%2BbtqnGFhGA9um2eDDR%2F9Ooux3loRDg0of4; Path=/; Expires=Tue, 07 Sep 2021 17:48:24 GMT; HttpOnly; Secure; SameSite=Lax'), ('origin_hostname', 'auth.tesla.com'), ('permissions-policy', 'interest-cohort=()'), ('set-cookie', '_abck=F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaIFRyZ17AQAApv/ssQax2rEvAoEVSCm+LrA0f4gPT6HUiTcheIG34/CSLRAX4nL7KKQovkSKPCIMTooj9kn0ymZcak3ASIZ0/oc9+WYGz5zCo4xH02NNn4lgkZOysy6Q4SU0M2R32lpABG96FWOXbWL/iApmiD7QDRqynv4CcS6lY8UMylB0Ee1/gbTQ3wofptmzM/UxE5oAgB6rw1VKKii8uuo8e+HhJkstLS+QoFu8qdc4VFB5nOoZxx0S9zrkPTwXVvvA6xytlF4RYmFvWkDZl44lqM3faNF8nW6AdsawHeeUqycR8F+Am8ZI6z/aOSA7jInl2kEIafUVEZKNqvBx5eiPt+wo+3/jE3ETgafUkI2elvg=~-1~-1~-1; Domain=.tesla.com; Path=/; Expires=Sun, 04 Sep 2022 17:48:24 GMT; Max-Age=31536000; Secure'), ('set-cookie', 'ak_bmsc=86D6AA52AA22E3528A4E7BFCFDAE87F5~000000000000000000000000000000~YAAQ0nRZaIJRyZ17AQAApv/ssQ2fQnUh5UB7b03KViDtLWMNQbTZ6CJrHGX0R6Q0DDYVQM3mUyzBw9tQVlrnubgKXskheZZnMZ8/wXVgEO4XDswHTloX6KXWvpKyHtWG7Pypp4rhZZM4I05xJR2/swDU8NnjfD/15pFoNjs7epWNK3jadYhslcorUH1VqPhXFTJBT5XSMazYx53SIEmtLOnoDXWO4baA4dP8522B/SAY3VfLuLuVnVDSevV7q8V4ATNcRT4iqBArQPPtNDCc0ycTQBjbhkvcHaDxkCq2hgKt1tk4N+wV/xhReTGxMV0WjKkSwmx7kevNNDnEsOr1j8DQr2fE3uJiqVeEdGJQ6L4tIm5cE39sqH7t; Domain=.tesla.com; Path=/; Expires=Sat, 04 Sep 2021 19:48:24 GMT; Max-Age=7200; HttpOnly'), ('set-cookie', 'bm_sz=C034275AB655FEF9C8B9502642C0B967~YAAQ0nRZaINRyZ17AQAApv/ssQ20xVaSdef2MBbK/UZzR3Jy+VwkejzO/wXc6ZM4C2W7qIW2woUNL6ki96UJNBl0iVqGj09qenAxyiEI2t2u1g7blIPzAgxEmhryeBU//eJROqu1+AM5055Tv4sqyxuI41nNgRcq1M+wXrfKUJt8211vrD4Km0alZG9uzqeu5kNv4AuykI9p8dbVrLjwdUB60CqOOdV6T+/SqUjfpHNpPLgua4zeVN/c9gktnEqeUbjhtuB2yjwYv/UfEJouJSEnchMKYpwTQXAe4Xixa6neXQ==~3486773~4405060; Domain=.tesla.com; Path=/; Expires=Sat, 04 Sep 2021 21:48:24 GMT; Max-Age=14400')])
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Refreshed 1 tests: ['test_url']
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine test_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Refreshed 5 modifiers: ['prepend_relative_urls', 'change_host_to_proxy', 'change_empty_to_proxy', 'prepend_url_ajax', 'prepend_url_i18n']
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine prepend_relative_urls
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for script:src /static/js/i18next.bundle.min.js -> https://myhomeassistant.mydomain/auth/tesla/proxy/static/js/i18next.bundle.min.js
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for script:src /static/js/tds4-i18n.js -> https://myhomeassistant.mydomain/auth/tesla/proxy/static/js/tds4-i18n.js
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for script:src /static/js/minimal.bundle.js -> https://myhomeassistant.mydomain/auth/tesla/proxy/static/js/minimal.bundle.js
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for script:src /static/scripts/utils.js -> https://myhomeassistant.mydomain/auth/tesla/proxy/static/scripts/utils.js
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for script:src /static/js/tds4-site.js -> https://myhomeassistant.mydomain/auth/tesla/proxy/static/js/tds4-site.js
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for script:src /static/js/tds-text-inputs--password.js -> https://myhomeassistant.mydomain/auth/tesla/proxy/static/js/tds-text-inputs--password.js
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for script:src /VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms -> https://myhomeassistant.mydomain/auth/tesla/proxy/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for link:href /static/css/tds4-minimal.bundle.css -> https://myhomeassistant.mydomain/auth/tesla/proxy/static/css/tds4-minimal.bundle.css
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for link:href /static/css/tds4-shims.min.css -> https://myhomeassistant.mydomain/auth/tesla/proxy/static/css/tds4-shims.min.css
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for a:href /user/password/forgot -> https://myhomeassistant.mydomain/auth/tesla/proxy/user/password/forgot
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function prepend_url
[...]
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine change_host_to_proxy
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function swap_url
[...]
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Modified url for a:href https://www.tesla.com/support/tesla-app?redirect=no#privacy -> https://www.tesla.com/support/tesla-app?redirect=no
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function swap_url
[...]
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running function swap_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine change_empty_to_proxy
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine prepend_url_ajax
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Found 0 patterns for method_func
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Received get: https://myhomeassistant.mydomain/auth/tesla/proxy/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms for https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Final headers {'Accept': '*/*', 'Connection': 'keep-alive', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15', 'Accept-Language': 'en-us', 'Referer': 'https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA', 'Accept-Encoding': 'gzip, deflate, br', 'x-tesla-user-agent': 'TeslaApp/3.10.9-433/adff2e065/android/10', 'X-Requested-With': 'com.teslamotors.tesla'}
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Attempting get to https://auth.tesla.com/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms
headers: {'Accept': '*/*', 'Connection': 'keep-alive', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15', 'Accept-Language': 'en-us', 'Referer': 'https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA', 'Accept-Encoding': 'gzip, deflate, br', 'x-tesla-user-agent': 'TeslaApp/3.10.9-433/adff2e065/android/10', 'X-Requested-With': 'com.teslamotors.tesla'}
cookies: <CookieJar[<Cookie _abck=F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaIFRyZ17AQAApv/ssQax2rEvAoEVSCm+LrA0f4gPT6HUiTcheIG34/CSLRAX4nL7KKQovkSKPCIMTooj9kn0ymZcak3ASIZ0/oc9+WYGz5zCo4xH02NNn4lgkZOysy6Q4SU0M2R32lpABG96FWOXbWL/iApmiD7QDRqynv4CcS6lY8UMylB0Ee1/gbTQ3wofptmzM/UxE5oAgB6rw1VKKii8uuo8e+HhJkstLS+QoFu8qdc4VFB5nOoZxx0S9zrkPTwXVvvA6xytlF4RYmFvWkDZl44lqM3faNF8nW6AdsawHeeUqycR8F+Am8ZI6z/aOSA7jInl2kEIafUVEZKNqvBx5eiPt+wo+3/jE3ETgafUkI2elvg=~-1~-1~-1 for .tesla.com/>, <Cookie ak_bmsc=86D6AA52AA22E3528A4E7BFCFDAE87F5~000000000000000000000000000000~YAAQ0nRZaIJRyZ17AQAApv/ssQ2fQnUh5UB7b03KViDtLWMNQbTZ6CJrHGX0R6Q0DDYVQM3mUyzBw9tQVlrnubgKXskheZZnMZ8/wXVgEO4XDswHTloX6KXWvpKyHtWG7Pypp4rhZZM4I05xJR2/swDU8NnjfD/15pFoNjs7epWNK3jadYhslcorUH1VqPhXFTJBT5XSMazYx53SIEmtLOnoDXWO4baA4dP8522B/SAY3VfLuLuVnVDSevV7q8V4ATNcRT4iqBArQPPtNDCc0ycTQBjbhkvcHaDxkCq2hgKt1tk4N+wV/xhReTGxMV0WjKkSwmx7kevNNDnEsOr1j8DQr2fE3uJiqVeEdGJQ6L4tIm5cE39sqH7t for .tesla.com/>, <Cookie bm_sz=C034275AB655FEF9C8B9502642C0B967~YAAQ0nRZaINRyZ17AQAApv/ssQ20xVaSdef2MBbK/UZzR3Jy+VwkejzO/wXc6ZM4C2W7qIW2woUNL6ki96UJNBl0iVqGj09qenAxyiEI2t2u1g7blIPzAgxEmhryeBU//eJROqu1+AM5055Tv4sqyxuI41nNgRcq1M+wXrfKUJt8211vrD4Km0alZG9uzqeu5kNv4AuykI9p8dbVrLjwdUB60CqOOdV6T+/SqUjfpHNpPLgua4zeVN/c9gktnEqeUbjhtuB2yjwYv/UfEJouJSEnchMKYpwTQXAe4Xixa6neXQ==~3486773~4405060 for .tesla.com/>, <Cookie tesla-auth.sid=s%3AarDrMEgjr9U7ajsldIHGSyrfT1VYPhOM.EbBQKQy24%2BbtqnGFhGA9um2eDDR%2F9Ooux3loRDg0of4 for auth.tesla.com/>]>
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] GET:
https://auth.tesla.com/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms with
{"host": "auth.tesla.com", "accept": "*/*", "accept-encoding": "gzip, deflate, br", "connection": "keep-alive", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15", "accept-language": "en-us", "referer": "https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA", "x-tesla-user-agent": "TeslaApp/3.10.9-433/adff2e065/android/10", "x-requested-with": "com.teslamotors.tesla", "cookie": {"_abck": "F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaIFRyZ17AQAApv/ssQax2rEvAoEVSCm+LrA0f4gPT6HUiTcheIG34/CSLRAX4nL7KKQovkSKPCIMTooj9kn0ymZcak3ASIZ0/oc9+WYGz5zCo4xH02NNn4lgkZOysy6Q4SU0M2R32lpABG96FWOXbWL/iApmiD7QDRqynv4CcS6lY8UMylB0Ee1/gbTQ3wofptmzM/UxE5oAgB6rw1VKKii8uuo8e+HhJkstLS+QoFu8qdc4VFB5nOoZxx0S9zrkPTwXVvvA6xytlF4RYmFvWkDZl44lqM3faNF8nW6AdsawHeeUqycR8F+Am8ZI6z/aOSA7jInl2kEIafUVEZKNqvBx5eiPt+wo+3/jE3ETgafUkI2elvg=~-1~-1~-1", "ak_bmsc": "86D6AA52AA22E3528A4E7BFCFDAE87F5~000000000000000000000000000000~YAAQ0nRZaIJRyZ17AQAApv/ssQ2fQnUh5UB7b03KViDtLWMNQbTZ6CJrHGX0R6Q0DDYVQM3mUyzBw9tQVlrnubgKXskheZZnMZ8/wXVgEO4XDswHTloX6KXWvpKyHtWG7Pypp4rhZZM4I05xJR2/swDU8NnjfD/15pFoNjs7epWNK3jadYhslcorUH1VqPhXFTJBT5XSMazYx53SIEmtLOnoDXWO4baA4dP8522B/SAY3VfLuLuVnVDSevV7q8V4ATNcRT4iqBArQPPtNDCc0ycTQBjbhkvcHaDxkCq2hgKt1tk4N+wV/xhReTGxMV0WjKkSwmx7kevNNDnEsOr1j8DQr2fE3uJiqVeEdGJQ6L4tIm5cE39sqH7t", "bm_sz": "C034275AB655FEF9C8B9502642C0B967~YAAQ0nRZaINRyZ17AQAApv/ssQ20xVaSdef2MBbK/UZzR3Jy+VwkejzO/wXc6ZM4C2W7qIW2woUNL6ki96UJNBl0iVqGj09qenAxyiEI2t2u1g7blIPzAgxEmhryeBU//eJROqu1+AM5055Tv4sqyxuI41nNgRcq1M+wXrfKUJt8211vrD4Km0alZG9uzqeu5kNv4AuykI9p8dbVrLjwdUB60CqOOdV6T+/SqUjfpHNpPLgua4zeVN/c9gktnEqeUbjhtuB2yjwYv/UfEJouJSEnchMKYpwTQXAe4Xixa6neXQ==~3486773~4405060", "tesla-auth.sid": "s%3AarDrMEgjr9U7ajsldIHGSyrfT1VYPhOM.EbBQKQy24%2BbtqnGFhGA9um2eDDR%2F9Ooux3loRDg0of4"}}
returned 200:OK with response Headers({'last-modified': 'Mon, 26 Apr 2021 16:10:06 GMT', 'etag': '"d1dbb955755ca44a0b872a64f97c471a45b14e941f69d082c19f792576ae34fb"', 'content-type': 'application/javascript', 'content-encoding': 'gzip', 'content-length': '19642', 'expires': 'Wed, 08 Sep 2021 10:32:21 GMT', 'date': 'Sat, 04 Sep 2021 17:48:24 GMT', 'connection': 'keep-alive', 'vary': 'Accept-Encoding', 'cache-control': 'max-age=21600', 'origin_hostname': 'auth.tesla.com', 'permissions-policy': 'interest-cohort=()', 'set-cookie': '_abck=F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaJ1RyZ17AQAAkwHtsQaSxPpvlS4ZvXB0GcmrdCdPk6z6KcnQyaI8/CT08szpvUEa/pGvWIY4VGXz2A0ee4I62HUxco+TJytvEHUY769dgP8vfrP0icrZXjQQA4YeY9xOv5Pblh2rL0QRJRhxx5nhKSGfMi2jWjaKBPCQ0WaG6JVlUOqMPdelZRrENZLheWM3eHZedTKfmEsR2vIw5+EN37YMs2ySFGKoWJiEL3ynhsuvJ7DLIvHX4cxaw0y83aI1t5yXvvO1igrBni7t+oN2R/jFG+Zvdymgj/Av09X+fAPJY3K3zEx2O8COG2dgumy6ZI97m/G/kkDIqQ95IJxRB/UBdQoWUcBZUTi6ufAz+emrPHx5WkiVp3Wiz9r+9nWoeW8GJg==~-1~-1~-1; Domain=.tesla.com; Path=/; Expires=Sun, 04 Sep 2022 17:48:24 GMT; Max-Age=31536000; Secure'})
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Refreshed 1 tests: ['test_url']
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine test_url
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine prepend_url_i18n
2021-09-04 19:48:24 DEBUG (MainThread) [authcaptureproxy.examples.modifiers] Found 0 patterns for method_func
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Received post: https://myhomeassistant.mydomain/auth/tesla/proxy/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms for https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Storing json {'sensor_data': '7a74G7m23Vrp0o5c9271081.7-1,2,-94,-100,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15,uaend,11011,20030107,en-gb,Gecko,1,0,0,0,401248,7705038,2560,1342,2560,1440,1616,1182,1616,,cpen:0,i1:0,dm:0,cwen:0,non:1,opc:0,fc:0,sc:0,wrc:1,isc:0,vib:0,bat:0,x11:0,x12:1,8923,0.218032634109,815388852519,0,loc:-1,2,-94,-101,do_dis,dm_dis,t_dis-1,2,-94,-105,0,0,0,1,1960,874,0;1,0,0,1,2137,1051,0;-1,2,-94,-102,0,0,0,1,1960,874,0;1,0,0,1,2137,1051,0;-1,2,-94,-108,-1,2,-94,-110,-1,2,-94,-117,-1,2,-94,-111,-1,2,-94,-109,-1,2,-94,-114,-1,2,-94,-103,-1,2,-94,-112,https://myhomeassistant.mydomain/auth/tesla/proxy?config_flow_id=e5e4f5a18c31464cae282cb57b0dc019&callback_url=https://myhomeassistant.mydomain/auth/tesla/callback?flow_id%3De5e4f5a18c31464cae282cb57b0dc019-1,2,-94,-115,1,32,32,0,0,0,0,2,0,1630777705038,-999999,17445,0,0,2907,0,0,4,0,1,2,50,-1,-1,26018161,PiZtE,14672,77,0,-1-1,2,-94,-106,0,0-1,2,-94,-119,-1-1,2,-94,-122,0,0,0,0,1,0,0-1,2,-94,-123,-1,2,-94,-124,-1,2,-94,-126,-1,2,-94,-127,6-1,2,-94,-70,-1-1,2,-94,-80,94-1,2,-94,-116,208036032-1,2,-94,-118,66469-1,2,-94,-129,-1,2,-94,-121,;3;-1;0'}
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Final headers {'Content-Type': 'text/plain;charset=UTF-8', 'Origin': 'https://auth.tesla.com', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Accept': '*/*', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15', 'Referer': 'https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA', 'Accept-Language': 'en-us', 'x-tesla-user-agent': 'TeslaApp/3.10.9-433/adff2e065/android/10', 'X-Requested-With': 'com.teslamotors.tesla'}
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Attempting post to https://auth.tesla.com/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms
headers: {'Content-Type': 'text/plain;charset=UTF-8', 'Origin': 'https://auth.tesla.com', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Accept': '*/*', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15', 'Referer': 'https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA', 'Accept-Language': 'en-us', 'x-tesla-user-agent': 'TeslaApp/3.10.9-433/adff2e065/android/10', 'X-Requested-With': 'com.teslamotors.tesla'}
cookies: <CookieJar[<Cookie _abck=F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaJ1RyZ17AQAAkwHtsQaSxPpvlS4ZvXB0GcmrdCdPk6z6KcnQyaI8/CT08szpvUEa/pGvWIY4VGXz2A0ee4I62HUxco+TJytvEHUY769dgP8vfrP0icrZXjQQA4YeY9xOv5Pblh2rL0QRJRhxx5nhKSGfMi2jWjaKBPCQ0WaG6JVlUOqMPdelZRrENZLheWM3eHZedTKfmEsR2vIw5+EN37YMs2ySFGKoWJiEL3ynhsuvJ7DLIvHX4cxaw0y83aI1t5yXvvO1igrBni7t+oN2R/jFG+Zvdymgj/Av09X+fAPJY3K3zEx2O8COG2dgumy6ZI97m/G/kkDIqQ95IJxRB/UBdQoWUcBZUTi6ufAz+emrPHx5WkiVp3Wiz9r+9nWoeW8GJg==~-1~-1~-1 for .tesla.com/>, <Cookie ak_bmsc=86D6AA52AA22E3528A4E7BFCFDAE87F5~000000000000000000000000000000~YAAQ0nRZaIJRyZ17AQAApv/ssQ2fQnUh5UB7b03KViDtLWMNQbTZ6CJrHGX0R6Q0DDYVQM3mUyzBw9tQVlrnubgKXskheZZnMZ8/wXVgEO4XDswHTloX6KXWvpKyHtWG7Pypp4rhZZM4I05xJR2/swDU8NnjfD/15pFoNjs7epWNK3jadYhslcorUH1VqPhXFTJBT5XSMazYx53SIEmtLOnoDXWO4baA4dP8522B/SAY3VfLuLuVnVDSevV7q8V4ATNcRT4iqBArQPPtNDCc0ycTQBjbhkvcHaDxkCq2hgKt1tk4N+wV/xhReTGxMV0WjKkSwmx7kevNNDnEsOr1j8DQr2fE3uJiqVeEdGJQ6L4tIm5cE39sqH7t for .tesla.com/>, <Cookie bm_sz=C034275AB655FEF9C8B9502642C0B967~YAAQ0nRZaINRyZ17AQAApv/ssQ20xVaSdef2MBbK/UZzR3Jy+VwkejzO/wXc6ZM4C2W7qIW2woUNL6ki96UJNBl0iVqGj09qenAxyiEI2t2u1g7blIPzAgxEmhryeBU//eJROqu1+AM5055Tv4sqyxuI41nNgRcq1M+wXrfKUJt8211vrD4Km0alZG9uzqeu5kNv4AuykI9p8dbVrLjwdUB60CqOOdV6T+/SqUjfpHNpPLgua4zeVN/c9gktnEqeUbjhtuB2yjwYv/UfEJouJSEnchMKYpwTQXAe4Xixa6neXQ==~3486773~4405060 for .tesla.com/>, <Cookie tesla-auth.sid=s%3AarDrMEgjr9U7ajsldIHGSyrfT1VYPhOM.EbBQKQy24%2BbtqnGFhGA9um2eDDR%2F9Ooux3loRDg0of4 for auth.tesla.com/>]>
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.helper] POST:
https://auth.tesla.com/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms with
{"host": "auth.tesla.com", "accept": "*/*", "accept-encoding": "gzip, deflate, br", "connection": "keep-alive", "user-agent": "python-httpx/0.19.0", "content-type": "text/plain;charset=UTF-8", "referer": "https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA", "accept-language": "en-us", "x-tesla-user-agent": "TeslaApp/3.10.9-433/adff2e065/android/10", "x-requested-with": "com.teslamotors.tesla", "cookie": {"_abck": "F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaJ1RyZ17AQAAkwHtsQaSxPpvlS4ZvXB0GcmrdCdPk6z6KcnQyaI8/CT08szpvUEa/pGvWIY4VGXz2A0ee4I62HUxco+TJytvEHUY769dgP8vfrP0icrZXjQQA4YeY9xOv5Pblh2rL0QRJRhxx5nhKSGfMi2jWjaKBPCQ0WaG6JVlUOqMPdelZRrENZLheWM3eHZedTKfmEsR2vIw5+EN37YMs2ySFGKoWJiEL3ynhsuvJ7DLIvHX4cxaw0y83aI1t5yXvvO1igrBni7t+oN2R/jFG+Zvdymgj/Av09X+fAPJY3K3zEx2O8COG2dgumy6ZI97m/G/kkDIqQ95IJxRB/UBdQoWUcBZUTi6ufAz+emrPHx5WkiVp3Wiz9r+9nWoeW8GJg==~-1~-1~-1", "ak_bmsc": "86D6AA52AA22E3528A4E7BFCFDAE87F5~000000000000000000000000000000~YAAQ0nRZaIJRyZ17AQAApv/ssQ2fQnUh5UB7b03KViDtLWMNQbTZ6CJrHGX0R6Q0DDYVQM3mUyzBw9tQVlrnubgKXskheZZnMZ8/wXVgEO4XDswHTloX6KXWvpKyHtWG7Pypp4rhZZM4I05xJR2/swDU8NnjfD/15pFoNjs7epWNK3jadYhslcorUH1VqPhXFTJBT5XSMazYx53SIEmtLOnoDXWO4baA4dP8522B/SAY3VfLuLuVnVDSevV7q8V4ATNcRT4iqBArQPPtNDCc0ycTQBjbhkvcHaDxkCq2hgKt1tk4N+wV/xhReTGxMV0WjKkSwmx7kevNNDnEsOr1j8DQr2fE3uJiqVeEdGJQ6L4tIm5cE39sqH7t", "bm_sz": "C034275AB655FEF9C8B9502642C0B967~YAAQ0nRZaINRyZ17AQAApv/ssQ20xVaSdef2MBbK/UZzR3Jy+VwkejzO/wXc6ZM4C2W7qIW2woUNL6ki96UJNBl0iVqGj09qenAxyiEI2t2u1g7blIPzAgxEmhryeBU//eJROqu1+AM5055Tv4sqyxuI41nNgRcq1M+wXrfKUJt8211vrD4Km0alZG9uzqeu5kNv4AuykI9p8dbVrLjwdUB60CqOOdV6T+/SqUjfpHNpPLgua4zeVN/c9gktnEqeUbjhtuB2yjwYv/UfEJouJSEnchMKYpwTQXAe4Xixa6neXQ==~3486773~4405060", "tesla-auth.sid": "s%3AarDrMEgjr9U7ajsldIHGSyrfT1VYPhOM.EbBQKQy24%2BbtqnGFhGA9um2eDDR%2F9Ooux3loRDg0of4"}, "content-length": "1192"}
returned 201:Created with response Headers({'content-length': '22', 'access-control-allow-headers': 'Content-Type,Authorization', 'access-control-allow-origin': '*', 'date': 'Sat, 04 Sep 2021 17:48:25 GMT', 'connection': 'keep-alive', 'content-type': 'application/json', 'origin_hostname': 'auth.tesla.com', 'originip': '127.0.0.1', 'permissions-policy': 'interest-cohort=()', 'set-cookie': '_abck=F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaKhRyZ17AQAA9gLtsQZLGr2VdHT3nHrFAZe9tOn1pHmXYuPOAsSYaMN+bKN8UvXy4HjDTdNp/iQXva4Tq0aL8HUT93Q4Aw4pFr48YS/HvOaMB74iPJdl6qkOa8wPMxM25Ul/T0/9GX6GqWgsCUSSoUYztPOsberIj58Cj5eGMKAxKZAZXTUcWKNFHyOzNgkR6bzQxn63T2a2UtElAOGm+bcIy3r5f53I5bpmjeb9qbj1MnMuQwfqwQCQ4SSBMGE1BbSVnFjr7tgIp+ymyNb4SRC09U4jfya8BBLoOThH7+ANARnbXd3gNSy9J3Jjn4DMxGrGP74x86tXtH/PK0AatRnc+QaeoNXi9go9UWxkPY3xyge0W//fD0b+6ET/QZ8ErbxWlg==~-1~-1~-1; Domain=.tesla.com; Path=/; Expires=Sun, 04 Sep 2022 17:48:25 GMT; Max-Age=31536000; Secure'})
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Refreshed 1 tests: ['test_url']
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine test_url
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Passing through ZyEms as application/json
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Received post: https://myhomeassistant.mydomain/auth/tesla/proxy/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms for https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Storing json {'sensor_data': '7a74G7m23Vrp0o5c9271081.7-1,2,-94,-100,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15,uaend,11011,20030107,en-gb,Gecko,1,0,0,0,401248,7705038,2560,1342,2560,1440,1616,1182,1616,,cpen:0,i1:0,dm:0,cwen:0,non:1,opc:0,fc:0,sc:0,wrc:1,isc:0,vib:0,bat:0,x11:0,x12:1,8923,0.553902510276,815388852519,0,loc:-1,2,-94,-101,do_dis,dm_dis,t_dis-1,2,-94,-105,0,0,0,1,1960,874,0;1,0,0,1,2137,1051,0;-1,2,-94,-102,0,0,0,1,1960,874,0;1,0,0,1,2137,1051,0;-1,2,-94,-108,-1,2,-94,-110,-1,2,-94,-117,-1,2,-94,-111,-1,2,-94,-109,-1,2,-94,-114,-1,2,-94,-103,-1,2,-94,-112,https://myhomeassistant.mydomain/auth/tesla/proxy?config_flow_id=e5e4f5a18c31464cae282cb57b0dc019&callback_url=https://myhomeassistant.mydomain/auth/tesla/callback?flow_id%3De5e4f5a18c31464cae282cb57b0dc019-1,2,-94,-115,1,32,32,0,0,0,0,588,0,1630777705038,12,17445,0,0,2907,0,0,588,0,1,2,50,437,1490478648,26018161,PiZtE,83930,107,0,-1-1,2,-94,-106,9,1-1,2,-94,-119,200,0,0,0,0,0,0,0,0,0,0,0,0,200,-1,2,-94,-122,0,0,0,0,1,0,0-1,2,-94,-123,-1,2,-94,-124,-1,2,-94,-126,-1,2,-94,-127,6-1,2,-94,-70,-356158881;-894418032;dis;;true;true;true;-120;true;24;24;true;false;-1-1,2,-94,-80,5378-1,2,-94,-116,208036032-1,2,-94,-118,68409-1,2,-94,-129,4d624c99ce55b315c4f2eddf110ab32c60f386cf5ccf175f66d4b8ecaf332b09,1,46b78825e671e79042d6477c5e50fbb644ee6aa0247817cc2b5ee5d1b9058939,Apple Inc.,Apple GPU,847f317542226f5fc40f6864287d658e1815d8fcb65bfffd759afb7588dd4529,26-1,2,-94,-121,;151;6;0'}
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Final headers {'Content-Type': 'text/plain;charset=UTF-8', 'Origin': 'https://auth.tesla.com', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Accept': '*/*', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15', 'Referer': 'https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA', 'Accept-Language': 'en-us', 'x-tesla-user-agent': 'TeslaApp/3.10.9-433/adff2e065/android/10', 'X-Requested-With': 'com.teslamotors.tesla'}
2021-09-04 19:48:25 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Attempting post to https://auth.tesla.com/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms
headers: {'Content-Type': 'text/plain;charset=UTF-8', 'Origin': 'https://auth.tesla.com', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Accept': '*/*', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15', 'Referer': 'https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA', 'Accept-Language': 'en-us', 'x-tesla-user-agent': 'TeslaApp/3.10.9-433/adff2e065/android/10', 'X-Requested-With': 'com.teslamotors.tesla'}
cookies: <CookieJar[<Cookie _abck=F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaKhRyZ17AQAA9gLtsQZLGr2VdHT3nHrFAZe9tOn1pHmXYuPOAsSYaMN+bKN8UvXy4HjDTdNp/iQXva4Tq0aL8HUT93Q4Aw4pFr48YS/HvOaMB74iPJdl6qkOa8wPMxM25Ul/T0/9GX6GqWgsCUSSoUYztPOsberIj58Cj5eGMKAxKZAZXTUcWKNFHyOzNgkR6bzQxn63T2a2UtElAOGm+bcIy3r5f53I5bpmjeb9qbj1MnMuQwfqwQCQ4SSBMGE1BbSVnFjr7tgIp+ymyNb4SRC09U4jfya8BBLoOThH7+ANARnbXd3gNSy9J3Jjn4DMxGrGP74x86tXtH/PK0AatRnc+QaeoNXi9go9UWxkPY3xyge0W//fD0b+6ET/QZ8ErbxWlg==~-1~-1~-1 for .tesla.com/>, <Cookie ak_bmsc=86D6AA52AA22E3528A4E7BFCFDAE87F5~000000000000000000000000000000~YAAQ0nRZaIJRyZ17AQAApv/ssQ2fQnUh5UB7b03KViDtLWMNQbTZ6CJrHGX0R6Q0DDYVQM3mUyzBw9tQVlrnubgKXskheZZnMZ8/wXVgEO4XDswHTloX6KXWvpKyHtWG7Pypp4rhZZM4I05xJR2/swDU8NnjfD/15pFoNjs7epWNK3jadYhslcorUH1VqPhXFTJBT5XSMazYx53SIEmtLOnoDXWO4baA4dP8522B/SAY3VfLuLuVnVDSevV7q8V4ATNcRT4iqBArQPPtNDCc0ycTQBjbhkvcHaDxkCq2hgKt1tk4N+wV/xhReTGxMV0WjKkSwmx7kevNNDnEsOr1j8DQr2fE3uJiqVeEdGJQ6L4tIm5cE39sqH7t for .tesla.com/>, <Cookie bm_sz=C034275AB655FEF9C8B9502642C0B967~YAAQ0nRZaINRyZ17AQAApv/ssQ20xVaSdef2MBbK/UZzR3Jy+VwkejzO/wXc6ZM4C2W7qIW2woUNL6ki96UJNBl0iVqGj09qenAxyiEI2t2u1g7blIPzAgxEmhryeBU//eJROqu1+AM5055Tv4sqyxuI41nNgRcq1M+wXrfKUJt8211vrD4Km0alZG9uzqeu5kNv4AuykI9p8dbVrLjwdUB60CqOOdV6T+/SqUjfpHNpPLgua4zeVN/c9gktnEqeUbjhtuB2yjwYv/UfEJouJSEnchMKYpwTQXAe4Xixa6neXQ==~3486773~4405060 for .tesla.com/>, <Cookie tesla-auth.sid=s%3AarDrMEgjr9U7ajsldIHGSyrfT1VYPhOM.EbBQKQy24%2BbtqnGFhGA9um2eDDR%2F9Ooux3loRDg0of4 for auth.tesla.com/>]>
2021-09-04 19:48:26 DEBUG (MainThread) [authcaptureproxy.helper] POST:
https://auth.tesla.com/VWl_M/DC/RL/vaO3/5yqzowz/ti5uk00p3r/SFwXZkc/QUELIm/ZyEms with
{"host": "auth.tesla.com", "accept": "*/*", "accept-encoding": "gzip, deflate, br", "connection": "keep-alive", "user-agent": "python-httpx/0.19.0", "content-type": "text/plain;charset=UTF-8", "referer": "https://auth.tesla.com/oauth2/v3/authorize?client_id=ownerapi&code_challenge=NDdjYzY1ZTVkYTQyMDJkODljOWJjMjMyMmMwNmI0OGFkYWVjNDkxM2E1OTQxYzliNDQ2YjQzYTY1ZWU5NzA2OQ%3D%3D&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback&response_type=code&scope=openid+email+offline_access&state=F5VXP2OgN4Ez4CqNEsZ16FMTtL7BYnMaJifZEZdBpVE_XsW_aQjtzyWCl3XLY-igxJ2xwzISIcrjCgV7P9iGrA", "accept-language": "en-us", "x-tesla-user-agent": "TeslaApp/3.10.9-433/adff2e065/android/10", "x-requested-with": "com.teslamotors.tesla", "cookie": {"_abck": "F7596CF8A824099CB6D526AC660394D2~-1~YAAQ0nRZaKhRyZ17AQAA9gLtsQZLGr2VdHT3nHrFAZe9tOn1pHmXYuPOAsSYaMN+bKN8UvXy4HjDTdNp/iQXva4Tq0aL8HUT93Q4Aw4pFr48YS/HvOaMB74iPJdl6qkOa8wPMxM25Ul/T0/9GX6GqWgsCUSSoUYztPOsberIj58Cj5eGMKAxKZAZXTUcWKNFHyOzNgkR6bzQxn63T2a2UtElAOGm+bcIy3r5f53I5bpmjeb9qbj1MnMuQwfqwQCQ4SSBMGE1BbSVnFjr7tgIp+ymyNb4SRC09U4jfya8BBLoOThH7+ANARnbXd3gNSy9J3Jjn4DMxGrGP74x86tXtH/PK0AatRnc+QaeoNXi9go9UWxkPY3xyge0W//fD0b+6ET/QZ8ErbxWlg==~-1~-1~-1", "ak_bmsc": "86D6AA52AA22E3528A4E7BFCFDAE87F5~000000000000000000000000000000~YAAQ0nRZaIJRyZ17AQAApv/ssQ2fQnUh5UB7b03KViDtLWMNQbTZ6CJrHGX0R6Q0DDYVQM3mUyzBw9tQVlrnubgKXskheZZnMZ8/wXVgEO4XDswHTloX6KXWvpKyHtWG7Pypp4rhZZM4I05xJR2/swDU8NnjfD/15pFoNjs7epWNK3jadYhslcorUH1VqPhXFTJBT5XSMazYx53SIEmtLOnoDXWO4baA4dP8522B/SAY3VfLuLuVnVDSevV7q8V4ATNcRT4iqBArQPPtNDCc0ycTQBjbhkvcHaDxkCq2hgKt1tk4N+wV/xhReTGxMV0WjKkSwmx7kevNNDnEsOr1j8DQr2fE3uJiqVeEdGJQ6L4tIm5cE39sqH7t", "bm_sz": "C034275AB655FEF9C8B9502642C0B967~YAAQ0nRZaINRyZ17AQAApv/ssQ20xVaSdef2MBbK/UZzR3Jy+VwkejzO/wXc6ZM4C2W7qIW2woUNL6ki96UJNBl0iVqGj09qenAxyiEI2t2u1g7blIPzAgxEmhryeBU//eJROqu1+AM5055Tv4sqyxuI41nNgRcq1M+wXrfKUJt8211vrD4Km0alZG9uzqeu5kNv4AuykI9p8dbVrLjwdUB60CqOOdV6T+/SqUjfpHNpPLgua4zeVN/c9gktnEqeUbjhtuB2yjwYv/UfEJouJSEnchMKYpwTQXAe4Xixa6neXQ==~3486773~4405060", "tesla-auth.sid": "s%3AarDrMEgjr9U7ajsldIHGSyrfT1VYPhOM.EbBQKQy24%2BbtqnGFhGA9um2eDDR%2F9Ooux3loRDg0of4"}, "content-length": "1523"}
returned 201:Created with response Headers({'content-length': '22', 'access-control-allow-headers': 'Content-Type,Authorization', 'access-control-allow-origin': '*', 'date': 'Sat, 04 Sep 2021 17:48:26 GMT', 'connection': 'keep-alive', 'content-type': 'application/json', 'origin_hostname': 'auth.tesla.com', 'originip': '127.0.0.1', 'permissions-policy': 'interest-cohort=()'})
2021-09-04 19:48:26 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Refreshed 1 tests: ['test_url']
2021-09-04 19:48:26 DEBUG (MainThread) [authcaptureproxy.helper] Running coroutine test_url
2021-09-04 19:48:26 DEBUG (MainThread) [authcaptureproxy.auth_capture_proxy] Passing through ZyEms as application/json

I have a reverse proxy for Home Assistant, it seems to whitelist its IP correctly

EDIT BY ADMIN:
WORKAROUND:
#20 (comment). All credits to sillyfrog.

@torvenkat

This comment has been minimized.

@tbtgspence

This comment has been minimized.

@alandtse
Copy link
Owner

alandtse commented Sep 4, 2021

Please +1 instead of posting a me too post.

The proxy doesn't touch the recaptcha traffic. Please check your browser to see what recaptcha urls you are hitting. Then please compare with the regular auth.tesla.com page.

@tbtgspence

This comment has been minimized.

@alandtse

This comment has been minimized.

@rberger

This comment has been minimized.

@alandtse
Copy link
Owner

alandtse commented Sep 5, 2021

So I investigated this. It looks like Tesla has tightened the captcha security so it compares the captcha page against the page in the browser. This obviously fails the proxy.

This happens due to JavaScript. Because we're using python, there's not really much more we can do to get around it. Python will not process JavaScript and passing it to a browser that isn't looking at auth.tesla.com fails the JavaScript test. While JavaScript could be intercepted and overridden, it's frail and likely to be a problem in the future. There are some discussions here: timdorr/tesla-api#390. The main issue is approaching the api and not getting the initial captcha.

I'll continue to think about how to get around this but we may be done.

@ybizeul

This comment has been minimized.

@sillyfrog
Copy link

My current solution is... involved... Using this code and some network trickery:

I'm running HA in a docker container, and I have the SSH server enabled on my computer (a MacOS). From within the docker container I run the command:

ssh <computer username>@<computer IP> -R 8123:localhost:8123

Then, I have updated my /etc/hosts file, and added the line:

127.0.0.1	auth.tesla.com

I then go to my browser on my computer, and navigate to http://auth.tesla.com:8123/ - if everything is working, it'll give you your HA login screen, login, and start the process to add this custom integration. I found on the the popup page that it used my default URL, update just the protocol/domain/port portion (ie: change the start to http://auth.tesla.com:8123 ), then you can login to the Tesla page as you would normally.

When things start working in HA, remove the line you added to your /etc/hosts and log out of the docker container.

There maybe better solutions - but this is the only one I can think of without hacking / running JavaScript in Python (or something similar).

@ybizeul
Copy link
Author

ybizeul commented Sep 6, 2021

Genius. I wanted to test a similar trick, but thought they would compare the whole URL and not just the web site.
I tried something simpler : add on my computer host file auth.tesla.com to my HA LAN address and it doesn't seem to work. Your way through 127.0.0.1 worked though !

@alandtse
Copy link
Owner

alandtse commented Sep 6, 2021

Thanks. I've confirmed the workaround works from @sillyfrog . Here's how you do it with less steps but potentially two browsers. You only need to use the auth.tesla.com redirect to get past the first step. It's possible that if you get prompted by MFA or some other secondary page, the login will break but luckily the component remembers the state it's in.

  1. On the computer accessing HA, modify the hosts file so auth.tesla.com points to your HA server. For example, if it's at 192.168.1.3
192.168.1.3	auth.tesla.com
  1. Use that computer and access HA normally with your browser (BROWSER A). Add the custom integration. See the Recaptcha error.
  2. In a new browser window (BROWSER B), copy the url to the new browser window. Chrome may give security warnings and not allow you to change to http. If that happens, use something besides chrome.
  3. Edit the url so it starts with http://auth.tesla.com:8123 instead of your HA domain. https://hadomain.local/auth/tesla/proxy?config_flow_id=8e739ab41fdd4e76a380f173e5c02435&callback_url=https://hadomain.local/auth/tesla/callback?flow_id%3D8e739ab41fdd4e76a380f173e5c02435
    ->
    http://auth.tesla.com:8123/auth/tesla/proxy?config_flow_id=8e739ab41fdd4e76a380f173e5c02435&callback_url=https://hadomain.local/auth/tesla/callback?flow_id%3D8e739ab41fdd4e76a380f173e5c02435
  4. With Browser B, complete the recaptcha and login.
  5. The component will either complete successfully, or it will timeout with the error below.
    image
  6. If you see this error, switch back to BROWSER A, which should still have the original login url, and refresh the page. It should take you to the next page in the login. Complete like normal.
  7. Revert your hosts file.

@alandtse alandtse pinned this issue Sep 6, 2021
@ragaimeena
Copy link

GENIUS... WORKED.....

@hbar98

This comment has been minimized.

@alandtse

This comment has been minimized.

@hbar98

This comment has been minimized.

@alandtse
Copy link
Owner

alandtse commented Sep 8, 2021

The 500 error is a different error and we'll need logs to help. Please open a new issue and post the requested logs.

It's not clear to me from your description but the HA system must have access to auth.tesla.com so if it's picking up the hosts changes that will break things. The instructions assume your HA and browser machine use different hosts files.

@hbar98

This comment has been minimized.

@ybizeul
Copy link
Author

ybizeul commented Sep 8, 2021

That's expected. Only your local browser should be fooled to go to HA, your HA should be able to reach the actual auth.tesla.com

@alandtse
Copy link
Owner

alandtse commented Sep 8, 2021

So, we're removing Tesla from core and will need to consider what to do with the custom component moving forward . I am looking for input on whether we continue with this workaround using the proxy or switch to requiring a 3rd party application to provide the refresh token. If you have an opinion, please answer here.

@zephyrus9MA

This comment has been minimized.

@juchong
Copy link

juchong commented Sep 9, 2021

I can also confirm that the workaround documented above by @alandtse doesn't work when HA is configured to only communicate via HTTPS.

@awisur

This comment has been minimized.

@fernandeusto

This comment has been minimized.

@zephyrus9MA

This comment has been minimized.

@heyitsmikey128

This comment has been minimized.

@zephyrus9MA

This comment has been minimized.

@rubin110
Copy link

I've created a new bug regarding the 500 error. If you're also hitting this bug, either reply with some logs if they differ from mine, or just +1/star/subscribe to it. Please do not reply back with a "me too" comment as it's not helpful.

Also the editing of the hosts file work around is dirty as hell and I applaud @sillyfrog for such a good hack.

bitmoji

@zephyrus9MA
Copy link

zephyrus9MA commented Sep 11, 2021

Tried latest version (with token) after generating a token and testing it using curl commands. The login failed:

2021-09-11 07:06:51 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration tesla_custom which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-11 07:06:51 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-11 07:06:51 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tesla_cc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-11 07:06:51 ERROR (SyncWorker_0) [homeassistant.loader] The custom integration 'tesla_cc' does not have a valid version key (None) in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details
2021-09-11 07:06:51 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tesla_custom which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-11 07:12:52 ERROR (MainThread) [custom_components.tesla_custom.config_flow] Authentication error: Need oauth credentials 
2021-09-11 07:14:12 ERROR (MainThread) [custom_components.tesla_custom.config_flow] Authentication error: Need oauth credentials 

EDIT: Used wrong token (access instead of refresh)

@zephyrus9MA
Copy link

Seems to work. Thanks for your efforts!

@qJake
Copy link

qJake commented Sep 12, 2021

If this custom integration is already configured, will the authentication fail at some point? (i.e. after 45 days when the token expires) - or since it's already configured and has valid tokens, will it just continue to renew them in the background without going through the setup process again?

@alandtse
Copy link
Owner

That's really a question for Tesla. So long as they accept your refresh token, then it will keep getting new access tokens. If they invalidate your refresh token, then you have to get a new one.

@alandtse alandtse unpinned this issue Oct 18, 2021
@zephyrus9MA
Copy link

zephyrus9MA commented Oct 27, 2021

If this custom integration is already configured, will the authentication fail at some point? (i.e. after 45 days when the token expires) - or since it's already configured and has valid tokens, will it just continue to renew them in the background without going through the setup process again?

Answer appears to be "yes". It failed.
EDIT. Maybe not. I got a new token for another app, so maybe that invalidated the original.

@mbrevda
Copy link

mbrevda commented Oct 28, 2021

Same here, my token expired. I didn't request a token for anything else

@magnussand
Copy link

magnussand commented Nov 13, 2021

This trick with updating the hosts file worked for me in September but now my token was invalidated again and this time when I use Broswer B I get:

Access Denied
You don't have permission to access "http://auth.tesla.com/oauth2/v3/authorize?" on this server.

Reference #18........

From http://auth.tesla.com:8123/auth/tesla/proxy?config_flow_id=....

Any ideas?

Edit:
I get the following in the log

2021-11-13 21:19:34 ERROR (MainThread) [aiohttp.server] Error handling request                                                                                                                                     
Traceback (most recent call last):                                                                                                                                                                                 
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 61, in map_httpcore_exceptions                                                                                                 
    yield                                                                                                                                                                                                          
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 281, in handle_async_request                                                                                                    
    ) = await self._pool.handle_async_request(                                                                                                                                                             
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 234, in handle_async_request                                                                                      
    response = await connection.handle_async_request(                                                                                                                                         
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 136, in handle_async_request                                                              
    self.socket = await self._open_socket(timeout)                                                                      
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 163, in _open_socket                
    return await self._backend.open_tcp_stream(                                                                         
  File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/auto.py", line 44, in open_tcp_stream                 
    return await self.backend.open_tcp_stream(                                                                          
  File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/anyio.py", line 154, in open_tcp_stream               
    stream = await TLSStream.wrap(                                                                                      
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__                                                  
    self.gen.throw(typ, value, traceback)                                                                               
  File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions                     
    raise to_exc(exc) from None                                                                                                                                                                                    
httpcore.ConnectTimeout                                                                                                                                                       
                                                                                                                        
The above exception was the direct cause of the following exception:                                                                                                                                               
                                                                                                                                                                                                                
Traceback (most recent call last):                                                                                                                                                                                
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request                                                                                                              
    resp = await self._request_handler(request)                                                                                                                                                                    
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle                                                                                                                   
    resp = await handler(request)                                                                                                                                                                          
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl                                                                                                 
    return await handler(request)                                                                                                                                             
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware            
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware                        
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 138, in auth_middleware                     
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle                                                                                                                         
    result = await result                                                                                                                                                     
  File "/config/custom_components/tesla/config_flow.py", line 325, in wrapped                                           
    return await cls.handler(request, **kwargs)                                                                                                                                                                    
  File "/usr/local/lib/python3.9/site-packages/authcaptureproxy/auth_capture_proxy.py", line 382, in all_handler                                                                                                   
    resp = await getattr(self.session, method)(site, headers=headers)                                                   
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1740, in get                                     
    return await self.request(                                                                                          
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1494, in request                                 
    response = await self.send(                                                                                         
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1586, in send                                    
    response = await self._send_handling_auth(                                                                          
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1616, in _send_handling_auth                                                                                                                
    response = await self._send_handling_redirects(                                                                                                                           
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1655, in _send_handling_redirects                
    response = await self._send_single_request(request, timeout)                                                        
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1699, in _send_single_request                    
    ) = await transport.handle_async_request(                                                                           
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 276, in handle_async_request         
    (                                                                                                                   
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__                                                  
    self.gen.throw(typ, value, traceback)                                                                               
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 78, in map_httpcore_exceptions       
    raise mapped_exc(message) from exc                                                                                  
httpx.ConnectTimeout

@zephyrus9MA
Copy link

This trick with updating the hosts file worked for me in September but now my token was invalidated again and this time when I use Broswer B I get:

Access Denied
You don't have permission to access "http://auth.tesla.com/oauth2/v3/authorize?" on this server.

Reference #18........

From http://auth.tesla.com:8123/auth/tesla/proxy?config_flow_id=....

Any ideas?

Edit: I get the following in the log

2021-11-13 21:19:34 ERROR (MainThread) [aiohttp.server] Error handling request                                                                                                                                     
Traceback (most recent call last):                                                                                                                                                                                 
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 61, in map_httpcore_exceptions                                                                                                 
    yield                                                                                                                                                                                                          
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 281, in handle_async_request                                                                                                    
    ) = await self._pool.handle_async_request(                                                                                                                                                             
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 234, in handle_async_request                                                                                      
    response = await connection.handle_async_request(                                                                                                                                         
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 136, in handle_async_request                                                              
    self.socket = await self._open_socket(timeout)                                                                      
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 163, in _open_socket                
    return await self._backend.open_tcp_stream(                                                                         
  File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/auto.py", line 44, in open_tcp_stream                 
    return await self.backend.open_tcp_stream(                                                                          
  File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/anyio.py", line 154, in open_tcp_stream               
    stream = await TLSStream.wrap(                                                                                      
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__                                                  
    self.gen.throw(typ, value, traceback)                                                                               
  File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions                     
    raise to_exc(exc) from None                                                                                                                                                                                    
httpcore.ConnectTimeout                                                                                                                                                       
                                                                                                                        
The above exception was the direct cause of the following exception:                                                                                                                                               
                                                                                                                                                                                                                
Traceback (most recent call last):                                                                                                                                                                                
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request                                                                                                              
    resp = await self._request_handler(request)                                                                                                                                                                    
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle                                                                                                                   
    resp = await handler(request)                                                                                                                                                                          
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl                                                                                                 
    return await handler(request)                                                                                                                                             
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware            
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware                        
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 138, in auth_middleware                     
    return await handler(request)                                                                                       
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle                                                                                                                         
    result = await result                                                                                                                                                     
  File "/config/custom_components/tesla/config_flow.py", line 325, in wrapped                                           
    return await cls.handler(request, **kwargs)                                                                                                                                                                    
  File "/usr/local/lib/python3.9/site-packages/authcaptureproxy/auth_capture_proxy.py", line 382, in all_handler                                                                                                   
    resp = await getattr(self.session, method)(site, headers=headers)                                                   
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1740, in get                                     
    return await self.request(                                                                                          
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1494, in request                                 
    response = await self.send(                                                                                         
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1586, in send                                    
    response = await self._send_handling_auth(                                                                          
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1616, in _send_handling_auth                                                                                                                
    response = await self._send_handling_redirects(                                                                                                                           
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1655, in _send_handling_redirects                
    response = await self._send_single_request(request, timeout)                                                        
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1699, in _send_single_request                    
    ) = await transport.handle_async_request(                                                                           
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 276, in handle_async_request         
    (                                                                                                                   
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__                                                  
    self.gen.throw(typ, value, traceback)                                                                               
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 78, in map_httpcore_exceptions       
    raise mapped_exc(message) from exc                                                                                  
httpx.ConnectTimeout

Why not just use the refresh token? Has been working well for me for a month or 2.

@magnussand
Copy link

Why not just use the refresh token? Has been working well for me for a month or 2.

This I have missed... But...

I have installed the Auth Token app for Android and cleared the cache in my browser and also reinstalled the Tesla Custom Component version 1.3.1.

But when searching it seems like I get the wrong version when trying to configure the integration?
According to this comment it looks like I should get a page that ask for email and refresh token, but I get the old proxy which ask for username and password
image

What have I missed?

@zephyrus9MA
Copy link

Did you try all the items in the thread you reference? Looks like several of us had success uninstalling/reinstalling HACS.

@EvTheFuture
Copy link

Did you try all the items in the thread you reference? Looks like several of us had success uninstalling/reinstalling HACS.

  • I uninstalled the integration.
  • Restarted Home Assistant.
  • Cleared the cache in the browser.
  • Reinstalled the Tesla component
  • Restarted Home Assistant
  • Added the integration.

I can try to uninstall hacks, but that will be Tomorow.

But just to confirm, this should work with version 1.3.1 right?

@zephyrus9MA
Copy link

Right

@EvTheFuture
Copy link

I got it to work.

It seems like there was two Tesla directories inside /config/custom_components

One named tesla_custom and one tesla. I uninstalled the Tesla custom integration which also removed tesla_custom however the Tesla directory didn't seem to belong to an installed custom component.

  • I deleted the Tesla directory with rm -rf /config/custom_component/tesla
  • I restarted Home Assistant
  • Then I added version 1.3.1 of the Tesla Custom Integration
  • Restarted Home Assistant

Then I got the proper UI in the browser when I added the integration in Configuration -> Integrations -> + Add Integration

Thank you for pointing me in the right direction and I hope this helps if someone else have the same problem in the future.

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