python-ring-doorbell icon indicating copy to clipboard operation
python-ring-doorbell copied to clipboard

getting error when attempting to authenticate

Open moinahmed001 opened this issue 2 years ago • 5 comments

When running the test.py file, i get this error. Any idea how to proceed?

➜  python-ring-doorbell git:(master) python3 test.py
Username: [email protected]
Password:
2FA code: 111111
Traceback (most recent call last):
  File "test.py", line 29, in main
    auth.fetch_token(username, password)
  File "/home/pi/ring/python-ring-doorbell/ring_doorbell/auth.py", line 46, in fetch_token
    headers=headers,
  File "/home/pi/.local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 366, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/home/pi/.local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 448, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/home/pi/.local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in parse_token_response
    validate_token_parameters(params)
  File "/home/pi/.local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 451, 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 "test.py", line 49, in <module>
    main()
  File "test.py", line 31, in main
    auth.fetch_token(username, password, otp_callback())
  File "/home/pi/ring/python-ring-doorbell/ring_doorbell/auth.py", line 46, in fetch_token
    headers=headers,
  File "/home/pi/.local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 366, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/home/pi/.local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 448, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/home/pi/.local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in parse_token_response
    validate_token_parameters(params)
  File "/home/pi/.local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 451, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

moinahmed001 avatar Apr 05 '22 11:04 moinahmed001

Looking through other issues on this repo. This seems to be related to the default project id. Changing the project id on the authentication methods should work. auth = Auth("NEW_PROJECT/1.0", None, token_updated)

OldStarFox avatar Apr 18 '22 18:04 OldStarFox

Just found this repo. Nice.

The workaround works for me. Thanks @OldStarFox

Thanks
-paul

paulwarwicker avatar Apr 24 '22 12:04 paulwarwicker

also worked on my side

Skyblade14 avatar Mar 21 '23 17:03 Skyblade14

For me auth = Auth("YourProject/1.0", None, token_updated) works, but "MyProject" doesn't. Maybe any change works.

lolliffe avatar Sep 18 '23 22:09 lolliffe

Changing from the default auth project also worked for me!

nathankrueger avatar Nov 12 '23 21:11 nathankrueger

I'm having this issue as well and the reported fix here doesn't seem to work. After you enter your username and password, should a prompt appear to enter your 2FA code? That's not happening for me, I just get an error. Seems like the folks on this thread are getting the same thing too https://github.com/tchellomello/python-ring-doorbell/issues/315

MackHartley avatar Mar 20 '24 02:03 MackHartley

This is now updated and working in master from PR https://github.com/tchellomello/python-ring-doorbell/pull/358

sdb9696 avatar Mar 21 '24 09:03 sdb9696