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

Unable to authenticate, even with brand new refresh token #473

Open
Lenbok opened this issue Jun 23, 2024 · 2 comments
Open

Unable to authenticate, even with brand new refresh token #473

Lenbok opened this issue Jun 23, 2024 · 2 comments

Comments

@Lenbok
Copy link

Lenbok commented Jun 23, 2024

I am having the same issue as is desscribed over at alandtse/tesla#941 (comment)

You can see in the logs posted there an excerpt like:

2024-04-12 16:41:57.647 DEBUG (MainThread) [teslajsonpy.controller] 552 endpoints loaded
2024-04-12 16:41:57.648 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -19826 days, 7:18:03
2024-04-12 16:41:57.648 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected
2024-04-12 16:41:57.649 DEBUG (MainThread) [teslajsonpy.connection] Refreshing access token with refresh_token
2024-04-12 16:41:57.982 DEBUG (MainThread) [teslajsonpy.connection] Unable to refresh sso oauth token
2024-04-12 16:41:57.983 DEBUG (MainThread) [teslajsonpy.connection] Auth returned {'error': 'login_required', 'error_description': 'Login required', 'referenceID': '4f3b29e2-f57b-4adb-8372-3bb683d235e6-1712932917851'}
2024-04-12 16:41:59.636 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -19826 days, 7:18:01
2024-04-12 16:41:59.636 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected

From what I can see, these messages are coming from https://github.com/zabuldon/teslajsonpy/blob/dev/teslajsonpy/connection.py#L101 and to get a listed token expiration of -19826 days ago, it seems that self.expiration is probably 0.

My own log messages look just like this, even with a freshly minted refresh token, so something is going wrong during the authentication steps.

@Peke140
Copy link

Peke140 commented Jun 24, 2024

Same problem and same logs

2024-06-24 14:04:23.735 DEBUG (MainThread) [teslajsonpy.controller] 552 endpoints loaded
2024-06-24 14:04:23.735 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -19899 days, 9:55:37
2024-06-24 14:04:23.735 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected
2024-06-24 14:04:23.735 DEBUG (MainThread) [teslajsonpy.connection] Refreshing access token with refresh_token
2024-06-24 14:04:26.125 DEBUG (MainThread) [teslajsonpy.connection] Unable to refresh sso oauth token
2024-06-24 14:04:26.125 DEBUG (MainThread) [teslajsonpy.connection] Auth returned {'error': 'server_error', 'error_description': 'Internal server error', 'error_uri': '82eff671-8bf6-4b5c-8b83-d79155c73eff-1719230666013. For more information, visit: https://developer.tesla.com/docs/fleet-api#help-and-support'}
2024-06-24 14:04:27.537 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -19899 days, 9:55:33
2024-06-24 14:04:27.537 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected
2024-06-24 14:04:27.537 DEBUG (MainThread) [teslajsonpy.connection] Refreshing access token with refresh_token
2024-06-24 14:04:27.851 DEBUG (MainThread) [teslajsonpy.connection] Unable to refresh sso oauth token
2024-06-24 14:04:27.852 DEBUG (MainThread) [teslajsonpy.connection] Auth returned {'error': 'server_error', 'error_description': 'Internal server error', 'error_uri': '311dec07-c59e-446a-89c1-dd022fa123d3-1719230667740. For more information, visit: https://developer.tesla.com/docs/fleet-api#help-and-support'}
2024-06-24 14:04:30.555 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in -19899 days, 9:55:30
2024-06-24 14:04:30.555 DEBUG (MainThread) [teslajsonpy.connection] Oauth expiration detected
2024-06-24 14:04:30.555 DEBUG (MainThread) [teslajsonpy.connection] Refreshing access token with refresh_token
2024-06-24 14:04:30.873 DEBUG (MainThread) [teslajsonpy.connection] Unable to refresh sso oauth token
2024-06-24 14:04:30.874 DEBUG (MainThread) [teslajsonpy.connection] Auth returned {'error': 'server_error', 'error_description': 'Internal server error', 'error_uri': '6162b1a9-3901-47f0-abb2-d3b4f8b3b94c-1719230670747. For more information, visit: https://developer.tesla.com/docs/fleet-api#help-and-support'}

@bvlaicu
Copy link

bvlaicu commented Jun 28, 2024

I had the same problem and the solution here worked for me (if using Home Assistant):
llamafilm/tesla-http-proxy-addon#111 (comment)
TLDR; You should use the token generated via the http proxy plugin UI.

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

3 participants