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

(missing_token) Missing access token parameter. #128

Open
behconsci opened this issue May 21, 2023 · 14 comments
Open

(missing_token) Missing access token parameter. #128

behconsci opened this issue May 21, 2023 · 14 comments

Comments

@behconsci
Copy link

hey Tim, thanks for this great library!!!
I am getting this issue below. It works well in my localhost, but on server (Debian) it is failing with this error:

(missing_token) Missing access token parameter.

image image image image
@tdorssers
Copy link
Owner

This error means that oauthlib doesn't get an access token back from the Tesla server. The body is actually HTML with an access denied error instead of a JSON response.

@behconsci
Copy link
Author

behconsci commented May 21, 2023 via email

@buehlerfabian
Copy link

Hi. I have the same issue. Everything worked fine until today I set up a new virtual environment, in which I installed teslapy with all necessary dependencies.
Now I keep getting the "Missing access token parameter".
Maybe something goes wrong with the current version of one of the packages teslapy depends on?

@behconsci
Copy link
Author

I deployed on different servers (debian, ubuntu..) and still no luck. I have TeslaPy==2.7.0 both in my localhost and on server. localhost works fine, but server doesn't. what are we missing here?

@buehlerfabian
Copy link

I tried different versions for TeslaPy and also for the dependent packages, no change.
Providing a refresh token obtained from a third party app didn't work either. Always the same error: MissingTokenError raised from oauthlib/oauth2/rfc6749/parameters.py", line 451, in validate_token_parameters.

@behconsci
Copy link
Author

what we are doing is a pure "man in the middle attack"? :D but then localhost is still working. I suspect, the scope is the issue, maybe? instead of offline_access maybe online_access .. but just a guess

@buehlerfabian
Copy link

but then localhost is still working.

Lucky for you. Here nothing is working, neither server nor localhost.

@behconsci
Copy link
Author

damn it. time for tesla sso auth for third parties.

@buehlerfabian
Copy link

I think I may have found a solution that works for me: using the following (older) package versions I can log in again without the "Missing token error"

certifi = "2022.9.24"
charset-normalizer = "2.1.1"
requests = "2.28.1"
urllib3 = "1.26.12"
websocket-client = "1.4.1"

With one or more of these packages the newer (current) versions seem to cause the trouble.

@behconsci
Copy link
Author

Aaah thanks man. I will try out tomorrow morning.

@HansKappert
Copy link

This saved my day.
Week
Month

@Refhi
Copy link

Refhi commented Aug 25, 2023

Hey @fbphysik

thank you so much for the tip !

had the same problem, but it was solved only by downgrading charset-nromalize and requests to the aforementioned versions, I did not have to touch the others

if that's important : I"m working in an up-to-date dockerised Domoticz where I had :

  • requests 2.31.0 (downgraded to 2.28.1)
  • certifi-2023.7.22
  • charset_normalizer-3.2.0 (downgraded to 2.1.1)
  • urllib3 2.0.4
  • websocket-client 1.6.2
    On my other computer it works with :
  • requests 2.25.1
  • certifi 2020.6.20
  • urllib3 1.26.5
  • websocket-client 1.5.1
    (charset_normalize is nowhere to be found)

If I had a guess that would be to blame a recent requests update

(thank you so much for teslapy btw :) )

tdorssers added a commit that referenced this issue Aug 26, 2023
@tdorssers
Copy link
Owner

I believe the combination of urllib3 2.0 and Python <3.10 is causing issues. Either upgrade Python to 3.10+ or downgrade urllib3 to 1.26.x. Please let me now if this works for you.

@Refhi
Copy link

Refhi commented Aug 27, 2023

I'm sorry it will be difficult for me to do more testing, though in my dockerized environment it works properly with python 3.9 and urlib 2.0.4
It broke with requests 2.31/charset_normalize 3.2, but worked again with downgrading to requests 2.28.1/charset_normalize 2.1.1 if that helps
here's my pip list (where TeslaPy is working properly) :

Python 3.9.2 (default, Feb 28 2021, 17:03:44)
Package Version
certifi 2023.7.22
charset-normalizer 2.1.1
idna 3.4
oauthlib 3.2.2
pip 20.3.4
requests 2.28.1
requests-oauthlib 1.3.1
setuptools 52.0.0
TeslaPy 2.8.0
urllib3 2.0.4
websocket-client 1.6.2
wheel 0.34.2

Hope that'll help a bit

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

5 participants