python-ring-doorbell
python-ring-doorbell copied to clipboard
MissingTokenError
Yo. Getting the following today when refreshing the token - even from a pull of the latest branch. Anyone else?
Traceback (most recent call last): File "E:\homestead_projects\python-ring-doorbell-0.6.2\test.py", line 29, in main auth.fetch_token(username, password) File "E:\homestead_projects\python-ring-doorbell-0.6.2\ring_doorbell\auth.py", line 41, in fetch_token token = self.oauth.fetch_token( File "C:\Users_\AppData\Local\Programs\Python\Python39\lib\site-packages\requests_oauthlib-1.3.0-py3.9.egg\requests_oauthlib\oauth2_session.py", line 360, in fetch_token self.client.parse_request_body_response(r.text, scope=self.scope) File "C:\Users_\AppData\Local\Programs\Python\Python39\lib\site-packages\oauthlib-3.1.0-py3.9.egg\oauthlib\oauth2\rfc6749\clients\base.py", line 421, in parse_request_body_response self.token = parse_token_response(body, scope=scope) File "C:\Users_\AppData\Local\Programs\Python\Python39\lib\site-packages\oauthlib-3.1.0-py3.9.egg\oauthlib\oauth2\rfc6749\parameters.py", line 431, in parse_token_response validate_token_parameters(params) File "C:\Users_\AppData\Local\Programs\Python\Python39\lib\site-packages\oauthlib-3.1.0-py3.9.egg\oauthlib\oauth2\rfc6749\parameters.py", line 441, in validate_token_parameters raise MissingTokenError(description="Missing access token parameter.") oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\homestead_projects\python-ring-doorbell-0.6.2\test.py", line 49, in
Same here...
Traceback (most recent call last):
File "./test.py", line 63, in
Getting the same error as well:
File "ring_floodlight.py", line 46, in main auth.fetch_token(username, password) File "/srv/dev/lib/python/ring_doorbell/auth.py", line 35, in fetch_token token = self._oauth.fetch_token( File "/usr/local/lib/python3.8/dist-packages/requests_oauthlib/oauth2_session.py", line 360, in fetch_token self._client.parse_request_body_response(r.text, scope=self.scope) File "/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 421, in parse_request_body_response self.token = parse_token_response(body, scope=scope) File "/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/parameters.py", line 431, in parse_token_response validate_token_parameters(params) File "/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in validate_token_parameters raise MissingTokenError(description="Missing access token parameter.") oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "ring_floodlight.py", line 67, in
Same, last success was July 1st. Moved the old token out of the way, am prompted for 2FA code, but never get one delivered to my email. Do get the code when signing in with browser, but that code does not work, as expected. Looks like Ring changed their 2FA methods. I have no idea how any of that oauth2 stuff works though.
Same here.
Interesting.... ringcli.py works. Trying to see what is different between its authentication and my script.
Solved: The ID in Auth cannot be the default "MyProject/1.0" Ring seems to be flagging this.
auth = Auth("**CHANGE_THIS**", json.loads(cache_file.read_text()), token_updated)
I also had to comment out line 58 of init.py
# self.update_groups()
Perhaps because I don't have groups set up? It was returning: AttributeError: 'NoneType' object has no attribute 'get'
That did it, But I think I did alter it to "MyProject/1.0d" which apparently isn't enough anymore. Should use "PleaseForTheLoveOfferAnOfficialAPI/1.234e" or some such.
Solved: The ID in Auth cannot be the default "MyProject/1.0" Ring seems to be flagging this.
auth = Auth("**CHANGE_THIS**", json.loads(cache_file.read_text()), token_updated)
@dlemmink That solved the issue, thanks!
ID name change in Auth fixed it for me too. Thanks.
I also had to comment out line 58 of init.py
# self.update_groups()
Perhaps because I don't have groups set up? It was returning: AttributeError: 'NoneType' object has no attribute 'get'
You might modify as mentioned here https://github.com/alexlatchford/python-ring-doorbell/commit/07171a5d11da0bcdafe1878b06599f0bcfa1b249 instead of comment out...
Thanks @dlemmink
Getting this same error. I did change the ID in the Auth and it didn't work.
Changing the project id worked for me 2
I changed the Project ID to all different names/codes but always " MissingTokenError: (missing_token) Missing access token parameter."
Please help!
Thanks
Closing this as stale and I think fixed in the latest master